passagemath-modules 10.5.46__cp310-cp310-macosx_14_0_arm64.whl → 10.6.20__cp310-cp310-macosx_14_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of passagemath-modules might be problematic. Click here for more details.

Files changed (320) hide show
  1. {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/METADATA +49 -44
  2. {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/RECORD +320 -314
  3. passagemath_modules.dylibs/libmpc.3.dylib +0 -0
  4. passagemath_modules.dylibs/libopenblasp-r0.3.29.dylib +0 -0
  5. sage/algebras/clifford_algebra.py +2 -2
  6. sage/algebras/clifford_algebra_element.cpython-310-darwin.so +0 -0
  7. sage/algebras/clifford_algebra_element.pyx +4 -2
  8. sage/algebras/exterior_algebra_groebner.cpython-310-darwin.so +0 -0
  9. sage/algebras/exterior_algebra_groebner.pyx +2 -0
  10. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra.py +83 -5
  11. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.cpython-310-darwin.so +0 -0
  12. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pxd +2 -0
  13. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pyx +28 -3
  14. sage/algebras/finite_gca.py +1 -1
  15. sage/algebras/lie_algebras/bgg_dual_module.py +18 -11
  16. sage/algebras/lie_algebras/classical_lie_algebra.py +3 -3
  17. sage/algebras/lie_algebras/examples.py +2 -2
  18. sage/algebras/lie_algebras/free_lie_algebra.py +1 -1
  19. sage/algebras/lie_algebras/heisenberg.py +4 -4
  20. sage/algebras/lie_algebras/lie_algebra.py +1 -1
  21. sage/algebras/lie_algebras/lie_algebra_element.cpython-310-darwin.so +0 -0
  22. sage/algebras/lie_algebras/lie_algebra_element.pyx +63 -27
  23. sage/algebras/lie_algebras/quotient.py +40 -29
  24. sage/algebras/lie_algebras/subalgebra.py +76 -53
  25. sage/algebras/lie_algebras/verma_module.py +1 -3
  26. sage/algebras/octonion_algebra.cpython-310-darwin.so +0 -0
  27. sage/algebras/octonion_algebra.pyx +1 -1
  28. sage/algebras/orlik_solomon.py +4 -4
  29. sage/algebras/orlik_terao.py +4 -4
  30. sage/algebras/steenrod/steenrod_algebra.py +37 -30
  31. sage/algebras/steenrod/steenrod_algebra_bases.py +2 -2
  32. sage/algebras/steenrod/steenrod_algebra_misc.py +4 -4
  33. sage/algebras/steenrod/steenrod_algebra_mult.py +2 -2
  34. sage/all__sagemath_modules.py +1 -0
  35. sage/calculus/integration.cpython-310-darwin.so +0 -0
  36. sage/calculus/integration.pyx +6 -5
  37. sage/calculus/interpolation.cpython-310-darwin.so +0 -0
  38. sage/calculus/interpolators.cpython-310-darwin.so +0 -0
  39. sage/calculus/ode.cpython-310-darwin.so +0 -0
  40. sage/calculus/ode.pxd +2 -2
  41. sage/calculus/ode.pyx +6 -4
  42. sage/calculus/riemann.cpython-310-darwin.so +0 -0
  43. sage/calculus/riemann.pyx +68 -48
  44. sage/calculus/transforms/dwt.cpython-310-darwin.so +0 -0
  45. sage/calculus/transforms/fft.cpython-310-darwin.so +0 -0
  46. sage/coding/ag_code_decoders.cpython-310-darwin.so +0 -0
  47. sage/coding/ag_code_decoders.pyx +31 -31
  48. sage/coding/binary_code.cpython-310-darwin.so +0 -0
  49. sage/coding/binary_code.pxd +6 -6
  50. sage/coding/binary_code.pyx +212 -173
  51. sage/coding/guruswami_sudan/utils.py +3 -5
  52. sage/coding/kasami_codes.cpython-310-darwin.so +0 -0
  53. sage/coding/kasami_codes.pyx +20 -24
  54. sage/coding/linear_code.py +2 -2
  55. sage/coding/linear_code_no_metric.py +5 -5
  56. sage/coding/linear_rank_metric.py +81 -19
  57. sage/combinat/free_module.py +22 -2
  58. sage/combinat/root_system/ambient_space.py +1 -1
  59. sage/combinat/root_system/associahedron.py +4 -4
  60. sage/combinat/root_system/braid_move_calculator.py +1 -1
  61. sage/combinat/root_system/braid_orbit.cpython-310-darwin.so +0 -0
  62. sage/combinat/root_system/branching_rules.py +2 -2
  63. sage/combinat/root_system/cartan_type.py +14 -14
  64. sage/combinat/root_system/coxeter_group.py +2 -2
  65. sage/combinat/root_system/coxeter_type.py +11 -0
  66. sage/combinat/root_system/extended_affine_weyl_group.py +8 -8
  67. sage/combinat/root_system/fundamental_group.py +2 -4
  68. sage/combinat/root_system/hecke_algebra_representation.py +1 -1
  69. sage/combinat/root_system/pieri_factors.py +2 -2
  70. sage/combinat/root_system/root_lattice_realization_algebras.py +1 -1
  71. sage/combinat/root_system/root_lattice_realizations.py +1 -1
  72. sage/combinat/root_system/type_folded.py +3 -3
  73. sage/combinat/root_system/type_reducible.py +8 -7
  74. sage/combinat/root_system/type_super_A.py +2 -2
  75. sage/combinat/root_system/weight_lattice_realizations.py +9 -8
  76. sage/combinat/root_system/weyl_characters.py +1 -1
  77. sage/crypto/__init__.py +1 -0
  78. sage/crypto/block_cipher/des.py +1 -1
  79. sage/crypto/block_cipher/miniaes.py +3 -3
  80. sage/crypto/block_cipher/present.py +3 -3
  81. sage/crypto/block_cipher/sdes.py +3 -3
  82. sage/crypto/boolean_function.cpython-310-darwin.so +0 -0
  83. sage/crypto/boolean_function.pyx +22 -23
  84. sage/crypto/key_exchange/diffie_hellman.py +4 -9
  85. sage/crypto/mq/sr.py +1 -1
  86. sage/crypto/public_key/blum_goldwasser.py +3 -3
  87. sage/crypto/sbox.cpython-310-darwin.so +0 -0
  88. sage/crypto/sbox.pyx +1 -1
  89. sage/crypto/sboxes.py +22 -0
  90. sage/crypto/util.py +4 -6
  91. sage/ext/interpreters/__init__.py +1 -1
  92. sage/ext/interpreters/all__sagemath_modules.py +1 -1
  93. sage/ext/interpreters/wrapper_cc.cpython-310-darwin.so +0 -0
  94. sage/ext/interpreters/wrapper_cc.pxd +5 -5
  95. sage/ext/interpreters/wrapper_cc.pyx +1 -1
  96. sage/ext/interpreters/wrapper_cdf.cpython-310-darwin.so +0 -0
  97. sage/ext/interpreters/wrapper_cdf.pxd +5 -7
  98. sage/ext/interpreters/wrapper_cdf.pyx +4 -10
  99. sage/ext/interpreters/wrapper_rdf.cpython-310-darwin.so +0 -0
  100. sage/ext/interpreters/wrapper_rdf.pxd +1 -1
  101. sage/ext/interpreters/wrapper_rdf.pyx +1 -1
  102. sage/ext/interpreters/wrapper_rr.cpython-310-darwin.so +0 -0
  103. sage/ext/interpreters/wrapper_rr.pxd +5 -5
  104. sage/ext/interpreters/wrapper_rr.pyx +1 -2
  105. sage/geometry/toric_lattice.py +3 -3
  106. sage/geometry/toric_lattice_element.cpython-310-darwin.so +0 -0
  107. sage/groups/additive_abelian/additive_abelian_group.py +1 -1
  108. sage/groups/additive_abelian/qmodnz.py +4 -4
  109. sage/groups/matrix_gps/coxeter_group.py +17 -4
  110. sage/groups/matrix_gps/group_element.cpython-310-darwin.so +0 -0
  111. sage/groups/misc_gps/argument_groups.py +2 -2
  112. sage/groups/misc_gps/imaginary_groups.py +4 -4
  113. sage/groups/perm_gps/partn_ref/refinement_binary.cpython-310-darwin.so +0 -0
  114. sage/groups/perm_gps/partn_ref/refinement_matrices.cpython-310-darwin.so +0 -0
  115. sage/homology/chain_complex.py +0 -2
  116. sage/homology/hochschild_complex.py +3 -3
  117. sage/homology/homology_morphism.py +6 -6
  118. sage/homology/homology_vector_space_with_basis.py +1 -1
  119. sage/libs/gsl/array.cpython-310-darwin.so +0 -0
  120. sage/libs/mpmath/utils.cpython-310-darwin.so +0 -0
  121. sage/matrix/action.cpython-310-darwin.so +0 -0
  122. sage/matrix/args.cpython-310-darwin.so +0 -0
  123. sage/matrix/args.pyx +25 -10
  124. sage/matrix/benchmark.py +8 -4
  125. sage/matrix/compute_J_ideal.py +2 -2
  126. sage/matrix/constructor.cpython-310-darwin.so +0 -0
  127. sage/matrix/echelon_matrix.cpython-310-darwin.so +0 -0
  128. sage/matrix/echelon_matrix.pyx +1 -1
  129. sage/matrix/matrix0.cpython-310-darwin.so +0 -0
  130. sage/matrix/matrix0.pxd +3 -3
  131. sage/matrix/matrix0.pyx +7 -5
  132. sage/matrix/matrix1.cpython-310-darwin.so +0 -0
  133. sage/matrix/matrix1.pyx +87 -48
  134. sage/matrix/matrix2.cpython-310-darwin.so +0 -0
  135. sage/matrix/matrix2.pxd +3 -3
  136. sage/matrix/matrix2.pyx +758 -75
  137. sage/matrix/matrix_cdv.cpython-310-darwin.so +0 -0
  138. sage/matrix/matrix_complex_double_dense.cpython-310-darwin.so +0 -0
  139. sage/matrix/matrix_complex_double_dense.pyx +1 -1
  140. sage/matrix/matrix_dense.cpython-310-darwin.so +0 -0
  141. sage/matrix/matrix_dense.pyx +2 -3
  142. sage/matrix/matrix_double_dense.cpython-310-darwin.so +0 -0
  143. sage/matrix/matrix_double_dense.pyx +11 -5
  144. sage/matrix/matrix_double_sparse.cpython-310-darwin.so +0 -0
  145. sage/matrix/matrix_generic_dense.cpython-310-darwin.so +0 -0
  146. sage/matrix/matrix_generic_sparse.cpython-310-darwin.so +0 -0
  147. sage/matrix/matrix_generic_sparse.pyx +1 -1
  148. sage/matrix/matrix_laurent_mpolynomial_dense.cpython-310-darwin.so +0 -0
  149. sage/matrix/matrix_numpy_dense.cpython-310-darwin.so +0 -0
  150. sage/matrix/matrix_numpy_integer_dense.cpython-310-darwin.so +0 -0
  151. sage/matrix/matrix_polynomial_dense.cpython-310-darwin.so +0 -0
  152. sage/matrix/matrix_polynomial_dense.pyx +952 -261
  153. sage/matrix/matrix_real_double_dense.cpython-310-darwin.so +0 -0
  154. sage/matrix/matrix_sparse.cpython-310-darwin.so +0 -0
  155. sage/matrix/matrix_sparse.pyx +2 -3
  156. sage/matrix/matrix_window.cpython-310-darwin.so +0 -0
  157. sage/matrix/matrix_window.pyx +2 -2
  158. sage/matrix/misc_mpfr.cpython-310-darwin.so +0 -0
  159. sage/matrix/operation_table.py +0 -2
  160. sage/matrix/special.py +4 -0
  161. sage/matrix/strassen.cpython-310-darwin.so +0 -0
  162. sage/matrix/strassen.pyx +1 -1
  163. sage/matroids/basis_exchange_matroid.cpython-310-darwin.so +0 -0
  164. sage/matroids/basis_matroid.cpython-310-darwin.so +0 -0
  165. sage/matroids/chow_ring.py +68 -65
  166. sage/matroids/chow_ring_ideal.py +41 -38
  167. sage/matroids/circuit_closures_matroid.cpython-310-darwin.so +0 -0
  168. sage/matroids/circuits_matroid.cpython-310-darwin.so +0 -0
  169. sage/matroids/database_matroids.py +16 -5
  170. sage/matroids/dual_matroid.py +2 -2
  171. sage/matroids/extension.cpython-310-darwin.so +0 -0
  172. sage/matroids/flats_matroid.cpython-310-darwin.so +0 -0
  173. sage/matroids/gammoid.py +1 -1
  174. sage/matroids/graphic_matroid.cpython-310-darwin.so +0 -0
  175. sage/matroids/graphic_matroid.pyx +3 -3
  176. sage/matroids/lean_matrix.cpython-310-darwin.so +0 -0
  177. sage/matroids/lean_matrix.pyx +22 -22
  178. sage/matroids/linear_matroid.cpython-310-darwin.so +0 -0
  179. sage/matroids/linear_matroid.pyx +13 -13
  180. sage/matroids/matroid.cpython-310-darwin.so +0 -0
  181. sage/matroids/matroid.pyx +15 -15
  182. sage/matroids/matroids_plot_helpers.py +48 -46
  183. sage/matroids/minor_matroid.py +2 -2
  184. sage/matroids/set_system.cpython-310-darwin.so +0 -0
  185. sage/matroids/transversal_matroid.cpython-310-darwin.so +0 -0
  186. sage/matroids/transversal_matroid.pyx +3 -3
  187. sage/matroids/union_matroid.cpython-310-darwin.so +0 -0
  188. sage/matroids/union_matroid.pyx +3 -0
  189. sage/matroids/unpickling.cpython-310-darwin.so +0 -0
  190. sage/matroids/utilities.py +2 -2
  191. sage/misc/c3.cpython-310-darwin.so +0 -0
  192. sage/misc/compat.py +1 -2
  193. sage/misc/pickle_old.cpython-310-darwin.so +0 -0
  194. sage/modules/diamond_cutting.py +117 -30
  195. sage/modules/fg_pid/fgp_module.py +3 -3
  196. sage/modules/filtered_vector_space.py +4 -4
  197. sage/modules/finite_submodule_iter.cpython-310-darwin.so +0 -0
  198. sage/modules/fp_graded/free_module.py +2 -2
  199. sage/modules/fp_graded/module.py +2 -2
  200. sage/modules/fp_graded/morphism.py +4 -4
  201. sage/modules/fp_graded/steenrod/morphism.py +1 -1
  202. sage/modules/free_module.py +144 -15
  203. sage/modules/free_module_element.cpython-310-darwin.so +0 -0
  204. sage/modules/free_module_element.pyx +4 -4
  205. sage/modules/free_module_integer.py +2 -2
  206. sage/modules/free_module_morphism.py +3 -3
  207. sage/modules/free_module_pseudohomspace.py +352 -0
  208. sage/modules/free_module_pseudomorphism.py +578 -0
  209. sage/modules/free_quadratic_module_integer_symmetric.py +24 -13
  210. sage/modules/matrix_morphism.py +9 -9
  211. sage/modules/multi_filtered_vector_space.py +4 -4
  212. sage/modules/ore_module.py +2208 -0
  213. sage/modules/ore_module_element.py +178 -0
  214. sage/modules/ore_module_homspace.py +147 -0
  215. sage/modules/ore_module_morphism.py +968 -0
  216. sage/modules/quotient_module.py +11 -1
  217. sage/modules/submodule.py +1 -1
  218. sage/modules/torsion_quadratic_module.py +1 -1
  219. sage/modules/vector_complex_double_dense.cpython-310-darwin.so +0 -0
  220. sage/modules/vector_double_dense.cpython-310-darwin.so +0 -0
  221. sage/modules/vector_integer_dense.cpython-310-darwin.so +0 -0
  222. sage/modules/vector_integer_sparse.cpython-310-darwin.so +0 -0
  223. sage/modules/vector_integer_sparse.pyx +4 -4
  224. sage/modules/vector_modn_dense.cpython-310-darwin.so +0 -0
  225. sage/modules/vector_modn_sparse.cpython-310-darwin.so +0 -0
  226. sage/modules/vector_numpy_dense.cpython-310-darwin.so +0 -0
  227. sage/modules/vector_numpy_integer_dense.cpython-310-darwin.so +0 -0
  228. sage/modules/vector_rational_dense.cpython-310-darwin.so +0 -0
  229. sage/modules/vector_rational_dense.pyx +1 -1
  230. sage/modules/vector_rational_sparse.cpython-310-darwin.so +0 -0
  231. sage/modules/vector_rational_sparse.pyx +5 -5
  232. sage/modules/vector_real_double_dense.cpython-310-darwin.so +0 -0
  233. sage/modules/vector_space_morphism.py +2 -2
  234. sage/modules/with_basis/cell_module.py +17 -0
  235. sage/modules/with_basis/indexed_element.cpython-310-darwin.so +0 -0
  236. sage/modules/with_basis/indexed_element.pyx +1 -1
  237. sage/modules/with_basis/invariant.py +1 -1
  238. sage/modules/with_basis/representation.py +0 -1
  239. sage/modules/with_basis/subquotient.py +2 -2
  240. sage/numerical/gauss_legendre.cpython-310-darwin.so +0 -0
  241. sage/probability/probability_distribution.cpython-310-darwin.so +0 -0
  242. sage/quadratic_forms/binary_qf.py +7 -7
  243. sage/quadratic_forms/bqf_class_group.py +26 -92
  244. sage/quadratic_forms/count_local_2.cpython-310-darwin.so +0 -0
  245. sage/quadratic_forms/extras.py +1 -1
  246. sage/quadratic_forms/quadratic_form.py +5 -4
  247. sage/quadratic_forms/quadratic_form__equivalence_testing.py +7 -4
  248. sage/quadratic_forms/quadratic_form__evaluate.cpython-310-darwin.so +0 -0
  249. sage/quadratic_forms/quadratic_form__local_field_invariants.py +10 -10
  250. sage/quadratic_forms/quadratic_form__ternary_Tornaria.py +2 -2
  251. sage/quadratic_forms/ternary.cpython-310-darwin.so +0 -0
  252. sage/quadratic_forms/ternary_qf.py +50 -83
  253. sage/rings/complex_conversion.cpython-310-darwin.so +0 -0
  254. sage/rings/complex_double.cpython-310-darwin.so +0 -0
  255. sage/rings/complex_double.pxd +1 -0
  256. sage/rings/complex_double.pyx +37 -32
  257. sage/rings/complex_mpc.cpython-310-darwin.so +0 -0
  258. sage/rings/complex_mpc.pyx +27 -23
  259. sage/rings/complex_mpfr.cpython-310-darwin.so +0 -0
  260. sage/rings/complex_mpfr.pyx +11 -9
  261. sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py +277 -21
  262. sage/rings/function_field/drinfeld_modules/drinfeld_module.py +10 -1
  263. sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py +1 -1
  264. sage/rings/function_field/drinfeld_modules/homset.py +1 -2
  265. sage/rings/function_field/drinfeld_modules/morphism.py +2 -2
  266. sage/rings/function_field/hermite_form_polynomial.cpython-310-darwin.so +0 -0
  267. sage/rings/function_field/khuri_makdisi.cpython-310-darwin.so +0 -0
  268. sage/rings/function_field/khuri_makdisi.pyx +27 -25
  269. sage/rings/invariants/invariant_theory.py +61 -60
  270. sage/rings/invariants/reconstruction.py +8 -8
  271. sage/rings/polynomial/laurent_polynomial_mpair.cpython-310-darwin.so +0 -0
  272. sage/rings/polynomial/ore_function_element.py +1 -1
  273. sage/rings/polynomial/ore_polynomial_element.cpython-310-darwin.so +0 -0
  274. sage/rings/polynomial/ore_polynomial_element.pyx +8 -8
  275. sage/rings/polynomial/ore_polynomial_ring.py +134 -17
  276. sage/rings/polynomial/polynomial_real_mpfr_dense.cpython-310-darwin.so +0 -0
  277. sage/rings/polynomial/skew_polynomial_element.cpython-310-darwin.so +0 -0
  278. sage/rings/polynomial/skew_polynomial_finite_field.cpython-310-darwin.so +0 -0
  279. sage/rings/polynomial/skew_polynomial_finite_field.pyx +3 -4
  280. sage/rings/polynomial/skew_polynomial_finite_order.cpython-310-darwin.so +0 -0
  281. sage/rings/polynomial/skew_polynomial_finite_order.pyx +2 -5
  282. sage/rings/real_double_element_gsl.cpython-310-darwin.so +0 -0
  283. sage/rings/real_mpfr.cpython-310-darwin.so +0 -0
  284. sage/rings/real_mpfr.pyx +25 -7
  285. sage/rings/ring_extension.cpython-310-darwin.so +0 -0
  286. sage/rings/ring_extension.pyx +4 -2
  287. sage/rings/ring_extension_conversion.cpython-310-darwin.so +0 -0
  288. sage/rings/ring_extension_element.cpython-310-darwin.so +0 -0
  289. sage/rings/ring_extension_element.pyx +42 -0
  290. sage/rings/ring_extension_morphism.cpython-310-darwin.so +0 -0
  291. sage/schemes/projective/cohomology.py +2 -2
  292. sage/stats/basic_stats.py +9 -6
  293. sage/stats/distributions/dgs_misc.h +11 -4
  294. sage/stats/distributions/discrete_gaussian_integer.cpython-310-darwin.so +0 -0
  295. sage/stats/distributions/discrete_gaussian_integer.pyx +9 -7
  296. sage/stats/hmm/chmm.cpython-310-darwin.so +0 -0
  297. sage/stats/hmm/chmm.pyx +13 -13
  298. sage/stats/hmm/distributions.cpython-310-darwin.so +0 -0
  299. sage/stats/hmm/distributions.pxd +3 -3
  300. sage/stats/hmm/distributions.pyx +3 -3
  301. sage/stats/hmm/hmm.cpython-310-darwin.so +0 -0
  302. sage/stats/hmm/hmm.pxd +3 -3
  303. sage/stats/hmm/hmm.pyx +6 -6
  304. sage/stats/hmm/util.cpython-310-darwin.so +0 -0
  305. sage/stats/hmm/util.pyx +6 -6
  306. sage/stats/intlist.cpython-310-darwin.so +0 -0
  307. sage/stats/intlist.pxd +3 -3
  308. sage/stats/time_series.cpython-310-darwin.so +0 -0
  309. sage/tensor/modules/alternating_contr_tensor.py +3 -3
  310. sage/tensor/modules/comp.py +3 -3
  311. sage/tensor/modules/ext_pow_free_module.py +3 -3
  312. sage/tensor/modules/format_utilities.py +3 -3
  313. sage/tensor/modules/free_module_linear_group.py +3 -3
  314. sage/tensor/modules/free_module_morphism.py +0 -1
  315. sage/tensor/modules/tensor_free_module.py +3 -3
  316. sage/tensor/modules/tensor_free_submodule.py +1 -1
  317. sage/tensor/modules/tensor_free_submodule_basis.py +1 -1
  318. sage/tensor/modules/tensor_with_indices.py +5 -5
  319. {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/WHEEL +0 -0
  320. {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/top_level.txt +0 -0
@@ -9,7 +9,7 @@ AUTHORS:
9
9
  - David Lucas, ported the original implementation in Sage
10
10
  """
11
11
 
12
- #*****************************************************************************
12
+ # ***************************************************************************
13
13
  # Copyright (C) 2015 David Lucas <david.lucas@inria.fr>
14
14
  # 2015 Johan S. R. Nielsen <jsrn@jsrn.dk>
15
15
  #
@@ -17,12 +17,10 @@ AUTHORS:
17
17
  # it under the terms of the GNU General Public License as published by
18
18
  # the Free Software Foundation, either version 2 of the License, or
19
19
  # (at your option) any later version.
20
- # http://www.gnu.org/licenses/
21
- #*****************************************************************************
22
-
20
+ # https://www.gnu.org/licenses/
21
+ # ***************************************************************************
23
22
 
24
23
  from sage.arith.misc import integer_floor as floor
25
- from sage.misc.lazy_import import lazy_import
26
24
  from sage.misc.functional import sqrt
27
25
  from sage.rings.integer_ring import ZZ
28
26
  from sage.rings.integer import Integer
@@ -166,26 +166,25 @@ class KasamiCode(AbstractLinearCode):
166
166
  ValueError: The parameter t(=5) must be a power of 2
167
167
  """
168
168
  # Check validity of s and t
169
- (p,i) = is_prime_power(t,get_data=True)
169
+ p, i = is_prime_power(t, get_data=True)
170
170
  if p != 2:
171
171
  raise ValueError(f"The parameter t(={t}) must be a power of 2")
172
172
 
173
- if s != t*t:
173
+ if s != t * t:
174
174
  # then we must have s=q^{2j+1} and t = q^m
175
- (p,k) = is_prime_power(s,get_data=True)
175
+ p, k = is_prime_power(s, get_data=True)
176
176
  if p != 2:
177
177
  raise ValueError(f"The parameter s(={s}) must be a power of 2")
178
178
 
179
179
  # q= 2^l here l = gcd(k,i)
180
- l = gcd(i,k)
181
- q = 2**l
180
+ l = gcd(i, k)
182
181
  m = i // l
183
182
 
184
- if (k//l) % 2 == 0:
183
+ if (k // l) % 2 == 0:
185
184
  raise ValueError(
186
185
  f"The parameter s(={s}) is invalid. Check the documentation")
187
186
 
188
- j = ((k//l) - 1) // 2
187
+ j = ((k // l) - 1) // 2
189
188
 
190
189
  # gcd(m,2*j+1) = gcd( i/l, k/l) = 1
191
190
  if m > j:
@@ -220,7 +219,7 @@ class KasamiCode(AbstractLinearCode):
220
219
  sage: C.parameters()
221
220
  (8, 2)
222
221
  """
223
- return (self._s,self._t)
222
+ return (self._s, self._t)
224
223
 
225
224
  def __eq__(self, other):
226
225
  r"""
@@ -240,10 +239,10 @@ class KasamiCode(AbstractLinearCode):
240
239
  # Check that s, t, extended values of both
241
240
  # objects are the same
242
241
  return isinstance(other, KasamiCode) \
243
- and self.parameters() == other.parameters() \
244
- and self._extended == other._extended
242
+ and self.parameters() == other.parameters() \
243
+ and self._extended == other._extended
245
244
 
246
- def _repr_(self):
245
+ def _repr_(self) -> str:
247
246
  r"""
248
247
  Return a string representation of ``self``.
249
248
 
@@ -252,13 +251,12 @@ class KasamiCode(AbstractLinearCode):
252
251
  sage: codes.KasamiCode(4,2,extended=True)
253
252
  [4, 0] Extended (4, 2)-Kasami code
254
253
  """
255
- ext = ""
256
- if self._extended:
257
- ext = " Extended"
258
- return "[%s, %s]%s (%s, %s)-Kasami code"\
259
- % (self.length(),self.dimension(), ext, self._s, self._t)
254
+ ext = " Extended" if self._extended else ""
255
+ return "[%s, %s]%s (%s, %s)-Kasami code" % (self.length(),
256
+ self.dimension(), ext,
257
+ self._s, self._t)
260
258
 
261
- def _latex_(self):
259
+ def _latex_(self) -> str:
262
260
  r"""
263
261
  Return a latex representation of ``self``.
264
262
 
@@ -268,11 +266,9 @@ class KasamiCode(AbstractLinearCode):
268
266
  sage: latex(C)
269
267
  [16, 9]\textnormal{ Extended} (16, 4)\textnormal{-Kasami code}
270
268
  """
271
- ext = ""
272
- if self._extended:
273
- ext = " Extended"
269
+ ext = " Extended" if self._extended else ""
274
270
  return "[%s, %s]\\textnormal{%s} (%s, %s)\\textnormal{-Kasami code}"\
275
- % (self.length(), self.dimension(), ext, self._s, self._t)
271
+ % (self.length(), self.dimension(), ext, self._s, self._t)
276
272
 
277
273
  def generator_matrix(self):
278
274
  r"""
@@ -330,11 +326,11 @@ class KasamiCode(AbstractLinearCode):
330
326
 
331
327
  def exp(row):
332
328
  return matrix(F,
333
- [x + [0]*(m - len(x)) for x in
334
- [a.polynomial().list() for a in row]]).transpose()
329
+ [x + [0] * (m - len(x)) for x in
330
+ [a.polynomial().list() for a in row]]).transpose()
335
331
 
336
332
  # Parity check matrix over GF(s)
337
- Hs = matrix(F, [[1]*self._s,
333
+ Hs = matrix(F, [[1] * self._s,
338
334
  F.list(),
339
335
  [a**(self._t + 1) for a in F]])
340
336
 
@@ -99,10 +99,10 @@ Further references
99
99
  ------------------
100
100
 
101
101
  If you want to get started on Sage's linear codes library, see
102
- https://doc.sagemath.org/html/en/thematic_tutorials/coding_theory.html
102
+ https://passagemath.org/docs/latest/html/en/thematic_tutorials/coding_theory.html
103
103
 
104
104
  If you want to learn more on the design of this library, see
105
- https://doc.sagemath.org/html/en/thematic_tutorials/structures_in_coding_theory.html
105
+ https://passagemath.org/docs/latest/html/en/thematic_tutorials/structures_in_coding_theory.html
106
106
 
107
107
  REFERENCES:
108
108
 
@@ -375,18 +375,18 @@ class AbstractLinearCodeNoMetric(AbstractCode, Module):
375
375
  return self.dimension() / self.length()
376
376
 
377
377
  @cached_method
378
- def gens(self) -> list:
378
+ def gens(self) -> tuple:
379
379
  r"""
380
- Return the generators of this code as a list of vectors.
380
+ Return the generators of this code as a tuple of vectors.
381
381
 
382
382
  EXAMPLES::
383
383
 
384
384
  sage: C = codes.HammingCode(GF(2), 3)
385
385
  sage: C.gens()
386
- [(1, 0, 0, 0, 0, 1, 1), (0, 1, 0, 0, 1, 0, 1),
387
- (0, 0, 1, 0, 1, 1, 0), (0, 0, 0, 1, 1, 1, 1)]
386
+ ((1, 0, 0, 0, 0, 1, 1), (0, 1, 0, 0, 1, 0, 1),
387
+ (0, 0, 1, 0, 1, 1, 0), (0, 0, 0, 1, 1, 1, 1))
388
388
  """
389
- return self.generator_matrix().rows()
389
+ return tuple(self.generator_matrix().rows())
390
390
 
391
391
  def basis(self):
392
392
  r"""
@@ -92,6 +92,7 @@ Read more about
92
92
  AUTHORS:
93
93
 
94
94
  - Marketa Slukova (2019-08-16): initial version
95
+ - Camille Garnier and Rubén Muñoz-\-Bertrand (2024-02-13): added rank_support_of_vector, and corrected the documentation
95
96
 
96
97
  TESTS::
97
98
 
@@ -147,9 +148,9 @@ def to_matrix_representation(v, sub_field=None, basis=None):
147
148
  specified, it is the prime subfield `\GF{p}` of `\GF{q^m}`
148
149
 
149
150
  - ``basis`` -- (default: ``None``) a basis of `\GF{q^m}` as a vector space over
150
- ``sub_field``. If not specified, given that `q = p^s`, let
151
- `1,\beta,\ldots,\beta^{sm}` be the power basis that SageMath uses to
152
- represent `\GF{q^m}`. The default basis is then `1,\beta,\ldots,\beta^{m-1}`.
151
+ ``sub_field``. If not specified, the default basis is
152
+ `1,\beta,\ldots,\beta^{m-1}` where `\beta` is the generator of `\GF{q^m}`
153
+ given by SageMath.
153
154
 
154
155
  EXAMPLES::
155
156
 
@@ -199,9 +200,9 @@ def from_matrix_representation(w, base_field=None, basis=None):
199
200
  ``w``.
200
201
 
201
202
  - ``basis`` -- (default: ``None``) a basis of `\GF{q^m}` as a vector space over
202
- `\GF{q}`. If not specified, given that `q = p^s`, let
203
- `1,\beta,\ldots,\beta^{sm}` be the power basis that SageMath uses to
204
- represent `\GF{q^m}`. The default basis is then `1,\beta,\ldots,\beta^{m-1}`.
203
+ `\GF{q}`. If not specified, the default basis is
204
+ `1,\beta,\ldots,\beta^{m-1}` where `\beta` is the generator
205
+ of `\GF{q^m}` given by SageMath.
205
206
 
206
207
  EXAMPLES::
207
208
 
@@ -231,7 +232,7 @@ def rank_weight(c, sub_field=None, basis=None):
231
232
  Return the rank of ``c`` as a matrix over ``sub_field``.
232
233
 
233
234
  If ``c`` is a vector over some field `\GF{q^m}`, the function converts it
234
- into a matrix over `\GF{q}`.
235
+ into a matrix over ``sub_field```.
235
236
 
236
237
  INPUT:
237
238
 
@@ -241,9 +242,9 @@ def rank_weight(c, sub_field=None, basis=None):
241
242
  specified, it is the prime subfield `\GF{p}` of `\GF{q^m}`
242
243
 
243
244
  - ``basis`` -- (default: ``None``) a basis of `\GF{q^m}` as a vector space over
244
- ``sub_field``. If not specified, given that `q = p^s`, let
245
- `1,\beta,\ldots,\beta^{sm}` be the power basis that SageMath uses to
246
- represent `\GF{q^m}`. The default basis is then `1,\beta,\ldots,\beta^{m-1}`.
245
+ ``sub_field``. If not specified, the default basis is
246
+ `1,\beta,\ldots,\beta^{m-1}` where `\beta` is the generator
247
+ of `\GF{q^m}` given by SageMath.
247
248
 
248
249
  EXAMPLES::
249
250
 
@@ -279,9 +280,9 @@ def rank_distance(a, b, sub_field=None, basis=None):
279
280
  specified, it is the prime subfield `\GF{p}` of `\GF{q^m}`
280
281
 
281
282
  - ``basis`` -- (default: ``None``) a basis of `\GF{q^m}` as a vector space over
282
- ``sub_field``. If not specified, given that `q = p^s`, let
283
- `1,\beta,\ldots,\beta^{sm}` be the power basis that SageMath uses to
284
- represent `\GF{q^m}`. The default basis is then `1,\beta,\ldots,\beta^{m-1}`.
283
+ ``sub_field``. If not specified, the default basis is
284
+ `1,\beta,\ldots,\beta^{m-1}` where `\beta` is the generator
285
+ of `\GF{q^m}` given by SageMath.
285
286
 
286
287
  EXAMPLES::
287
288
 
@@ -380,9 +381,9 @@ class AbstractLinearRankMetricCode(AbstractLinearCodeNoMetric):
380
381
  - ``default_decoder_name`` -- the name of the default decoder of ``self``
381
382
 
382
383
  - ``basis`` -- (default: ``None``) a basis of `\GF{q^m}` as a vector space over
383
- ``sub_field``. If not specified, given that `q = p^s`, let
384
- `1,\beta,\ldots,\beta^{sm}` be the power basis that SageMath uses to
385
- represent `\GF{q^m}`. The default basis is then `1,\beta,\ldots,\beta^{m-1}`.
384
+ ``sub_field``. If not specified, the default basis is
385
+ `1,\beta,\ldots,\beta^{m-1}` where `\beta` is the generator
386
+ of `\GF{q^m}` given by SageMath.
386
387
 
387
388
  EXAMPLES:
388
389
 
@@ -589,6 +590,67 @@ class AbstractLinearRankMetricCode(AbstractLinearCodeNoMetric):
589
590
  """
590
591
  return rank_weight(word, self.sub_field())
591
592
 
593
+ def rank_support_of_vector(self, word, sub_field=None, basis=None):
594
+ r"""
595
+ Return the rank support of ``word`` over ``sub_field``, i.e. the vector space over
596
+ ``sub_field`` generated by its coefficients.
597
+
598
+ If ``word`` is a vector over some field `\GF{q^m}`, and ``sub_field`` is a subfield of
599
+ `\GF{q^m}`, the function converts it into a matrix over ``sub_field``, with
600
+ respect to the basis ``basis``.
601
+
602
+ INPUT:
603
+
604
+ - ``word`` -- a vector over the ``base_field`` of ``self``.
605
+
606
+ - ``sub_field`` -- (default: ``None``) a sub field of the
607
+ ``base_field`` of ``self``; if not specified, it is the prime
608
+ subfield of `\GF{p}` the ``base_field`` of ``self``.
609
+
610
+ - ``basis`` -- (default: ``None``) a basis of ``base_field`` of
611
+ ``self`` as a vector space over ``sub_field``. If not specified,
612
+ the default basis is `1,\beta,\ldots,\beta^{m-1}`, where `\beta` is
613
+ the generator of `\GF{q^m}` given by SageMath.
614
+
615
+ EXAMPLES::
616
+
617
+ sage: G = Matrix(GF(64), [[1,1,0], [0,0,1]])
618
+ sage: C = codes.LinearRankMetricCode(G, GF(4))
619
+ sage: a = GF(64).gen()
620
+ sage: c = vector([a^4 + a^3 + 1, a^4 + a^3 + 1, a^4 + a^3 + a^2 + 1])
621
+ sage: c in C
622
+ True
623
+ sage: C.rank_support_of_vector(c)
624
+ Vector space of degree 6 and dimension 2 over Finite Field of size 2
625
+ Basis matrix:
626
+ [1 0 0 1 1 0]
627
+ [0 0 1 0 0 0]
628
+
629
+ An example with a non canonical basis::
630
+
631
+ sage: K.<a> = GF(2^3)
632
+ sage: G = Matrix(K, [[1,1,0], [0,0,1]])
633
+ sage: C = codes.LinearRankMetricCode(G)
634
+ sage: c = vector([a^2, a^2, 0])
635
+ sage: basis = [a, a+1, a^2]
636
+ sage: C.rank_support_of_vector(c, basis=basis)
637
+ Vector space of degree 3 and dimension 1 over Finite Field of size 2
638
+ Basis matrix:
639
+ [0 0 1]
640
+
641
+ TESTS::
642
+
643
+ sage: C.rank_support_of_vector(c, GF(2^4))
644
+ Traceback (most recent call last):
645
+ ...
646
+ TypeError: the input subfield Finite Field in z4 of size 2^4 is not a subfield of Finite Field in a of size 2^3
647
+ """
648
+ word = self.ambient_space()(word)
649
+ if sub_field is not None:
650
+ if self.base_field().degree() % sub_field.degree() != 0:
651
+ raise TypeError(f"the input subfield {sub_field} is not a subfield of {self.base_field()}")
652
+ return to_matrix_representation(word, sub_field, basis).column_module()
653
+
592
654
  def matrix_form_of_vector(self, word):
593
655
  r"""
594
656
  Return the matrix representation of a word.
@@ -680,9 +742,9 @@ class LinearRankMetricCode(AbstractLinearRankMetricCode):
680
742
  specified, it is the prime field of ``base_field``
681
743
 
682
744
  - ``basis`` -- (default: ``None``) a basis of `\GF{q^m}` as a vector space over
683
- ``sub_field``. If not specified, given that `q = p^s`, let
684
- `1,\beta,\ldots,\beta^{sm}` be the power basis that SageMath uses to
685
- represent `\GF{q^m}`. The default basis is then `1,\beta,\ldots,\beta^{m-1}`.
745
+ ``sub_field``. If not specified, the default basis is
746
+ `1,\beta,\ldots,\beta^{m-1}` where `\beta` is the generator `\GF{q^m}`
747
+ given by SageMath.
686
748
 
687
749
  EXAMPLES::
688
750
 
@@ -1777,6 +1777,26 @@ class CombinatorialFreeModule_CartesianProduct(CombinatorialFreeModule):
1777
1777
  sage: S = cartesian_product([cartesian_product([F, G]), H]) # todo: not implemented
1778
1778
  F (+) G (+) H
1779
1779
  """
1780
+ @staticmethod
1781
+ def __classcall_private__(cls, modules, category, **options):
1782
+ """
1783
+ Dispatch to the appropriate class based on the input.
1784
+
1785
+ EXAMPLES::
1786
+
1787
+ sage: # needs sage.combinat sage.groups
1788
+ sage: Q = RootSystem(['A',3]).root_space(GF(3))
1789
+ sage: W = WeylGroup(['A',3], prefix='s')
1790
+ sage: CP = cartesian_product([Q, W])
1791
+ sage: type(CP)
1792
+ <class 'sage.sets.cartesian_product.CartesianProduct_with_category'>
1793
+ """
1794
+ R = modules[0].base_ring()
1795
+ Cat = ModulesWithBasis(R)
1796
+ if any(module not in Cat for module in modules):
1797
+ from sage.sets.cartesian_product import CartesianProduct
1798
+ return CartesianProduct(modules, category, **options)
1799
+ return super().__classcall__(cls, modules, category=category, **options)
1780
1800
 
1781
1801
  def __init__(self, modules, **options):
1782
1802
  r"""
@@ -1788,9 +1808,9 @@ class CombinatorialFreeModule_CartesianProduct(CombinatorialFreeModule):
1788
1808
  Free module generated by {2, 4, 5} over Integer Ring (+) Free module generated by {2, 4, 7} over Integer Ring
1789
1809
  sage: TestSuite(C).run()
1790
1810
  """
1791
- assert (len(modules)) # TODO: generalize to a family or tuple
1811
+ assert len(modules) # TODO: generalize to a family or tuple
1792
1812
  R = modules[0].base_ring()
1793
- assert (all(module in ModulesWithBasis(R)) for module in modules)
1813
+ assert all(module in ModulesWithBasis(R) for module in modules)
1794
1814
  # should check the base ring
1795
1815
  self._sets = modules
1796
1816
  CombinatorialFreeModule.__init__(self, R,
@@ -194,7 +194,7 @@ class AmbientSpace(CombinatorialFreeModule):
194
194
  # This adds coercion from a list
195
195
  if isinstance(v, (list, tuple)):
196
196
  K = self.base_ring()
197
- return self._from_dict(dict((i,K(c)) for i,c in enumerate(v) if c))
197
+ return self._from_dict({i: K(c) for i, c in enumerate(v) if c})
198
198
  else:
199
199
  return CombinatorialFreeModule.__call__(self, v)
200
200
 
@@ -120,8 +120,8 @@ def Associahedron(cartan_type, backend='ppl'):
120
120
 
121
121
  sage: p1 = polytopes.associahedron(['A',4], backend='normaliz') # optional - pynormaliz
122
122
  sage: TestSuite(p1).run(skip='_test_pickling') # optional - pynormaliz
123
- sage: p2 = polytopes.associahedron(['A',4], backend='cdd')
124
- sage: TestSuite(p2).run()
123
+ sage: p2 = polytopes.associahedron(['A',4], backend='cdd') # needs cddexec_gmp
124
+ sage: TestSuite(p2).run() # needs cddexec_gmp
125
125
  sage: p3 = polytopes.associahedron(['A',4], backend='field')
126
126
  sage: TestSuite(p3).run()
127
127
  """
@@ -141,7 +141,7 @@ class Associahedron_class_base:
141
141
 
142
142
  sage: Asso = polytopes.associahedron(['A',2]); Asso
143
143
  Generalized associahedron of type ['A', 2] with 5 vertices
144
- sage: TestSuite(Asso).run()
144
+ sage: TestSuite(Asso).run() # needs cddexec
145
145
  """
146
146
  def __new__(typ, parent=None, Vrep=None, Hrep=None, cartan_type=None, **kwds):
147
147
  r"""
@@ -181,7 +181,7 @@ class Associahedron_class_base:
181
181
  A 4-dimensional polyhedron in QQ^4 defined as the convex hull of 42 vertices
182
182
  sage: A.dilation(2)
183
183
  A 4-dimensional polyhedron in QQ^4 defined as the convex hull of 42 vertices
184
- sage: A.dilation(2.0)
184
+ sage: A.dilation(2.0) # needs cddexec
185
185
  A 4-dimensional polyhedron in RDF^4 defined as the convex hull of 42 vertices
186
186
  sage: A.convex_hull(A)
187
187
  A 4-dimensional polyhedron in QQ^4 defined as the convex hull of 42 vertices
@@ -1,5 +1,5 @@
1
1
  # sage_setup: distribution = sagemath-modules
2
- # sage.doctest: needs sage.libs.gap
2
+ # sage.doctest: needs sage.graphs sage.libs.gap
3
3
  """
4
4
  Braid move calculator
5
5
 
@@ -1,5 +1,5 @@
1
1
  # sage_setup: distribution = sagemath-modules
2
- # sage.doctest: needs sage.libs.gap
2
+ # sage.doctest: needs sage.graphs sage.libs.gap
3
3
  """
4
4
  Branching rules
5
5
  """
@@ -645,7 +645,7 @@ def branch_weyl_character(chi, R, S, rule='default'):
645
645
  These embeddings are described more completely (with references
646
646
  to the literature) in the thematic tutorial at:
647
647
 
648
- https://doc.sagemath.org/html/en/thematic_tutorials/lie.html
648
+ https://passagemath.org/docs/latest/html/en/thematic_tutorials/lie.html
649
649
 
650
650
  EXAMPLES::
651
651
 
@@ -1740,10 +1740,10 @@ class CartanType_crystallographic(CartanType_abstract):
1740
1740
  from sage.matrix.constructor import matrix, diagonal_matrix
1741
1741
  m = self.cartan_matrix()
1742
1742
  n = m.nrows()
1743
- M = matrix(ZZ, n, n*n, sparse=True)
1744
- for (i,j) in m.nonzero_positions():
1745
- M[i, n * i + j] = m[i,j]
1746
- M[j, n * i + j] -= m[j,i]
1743
+ M = matrix(ZZ, n, n * n, sparse=True)
1744
+ for i, j in m.nonzero_positions():
1745
+ M[i, n * i + j] = m[i, j]
1746
+ M[j, n * i + j] -= m[j, i]
1747
1747
  kern = M.integer_kernel()
1748
1748
  c = len(self.dynkin_diagram().connected_components(sort=False))
1749
1749
  if kern.dimension() < c:
@@ -1758,7 +1758,7 @@ class CartanType_crystallographic(CartanType_abstract):
1758
1758
  D = sum(kern.basis())
1759
1759
  assert diagonal_matrix(D) * m == m.transpose() * diagonal_matrix(D)
1760
1760
  I = self.index_set()
1761
- return Family( dict( (I[i], D[i]) for i in range(n) ) )
1761
+ return Family({I[i]: D[i] for i in range(n)})
1762
1762
 
1763
1763
  def index_set_bipartition(self):
1764
1764
  r"""
@@ -2132,7 +2132,7 @@ class CartanType_affine(CartanType_simple, CartanType_crystallographic):
2132
2132
  raise ValueError("the kernel is not 1 dimensional")
2133
2133
  assert (all(coef > 0 for coef in annihilator_basis[0]))
2134
2134
 
2135
- return Family(dict((i,annihilator_basis[0][i])for i in self.index_set()))
2135
+ return Family({i: annihilator_basis[0][i] for i in self.index_set()})
2136
2136
 
2137
2137
  acheck = row_annihilator
2138
2138
 
@@ -2206,8 +2206,8 @@ class CartanType_affine(CartanType_simple, CartanType_crystallographic):
2206
2206
  """
2207
2207
  a = self.a()
2208
2208
  acheck = self.acheck()
2209
- return Family(dict((i, max(ZZ(1), a[i] // acheck[i]))
2210
- for i in self.index_set()))
2209
+ return Family({i: max(ZZ.one(), a[i] // acheck[i])
2210
+ for i in self.index_set()})
2211
2211
 
2212
2212
  def translation_factors(self):
2213
2213
  r"""
@@ -2373,21 +2373,21 @@ class CartanType_affine(CartanType_simple, CartanType_crystallographic):
2373
2373
 
2374
2374
  REFERENCES:
2375
2375
 
2376
- .. [HST09] \F. Hivert, A. Schilling, and N. M. Thiery,
2376
+ .. [HST09] \F. Hivert, A. Schilling, and N. M. Thiéry,
2377
2377
  *Hecke group algebras as quotients of affine Hecke
2378
2378
  algebras at level 0*, JCT A, Vol. 116, (2009) p. 844-863
2379
2379
  :arxiv:`0804.3781`
2380
2380
  """
2381
2381
  a = self.a()
2382
2382
  acheck = self.acheck()
2383
- if set([1/ZZ(2), 2]).issubset( set(a[i]/acheck[i] for i in self.index_set()) ):
2383
+ s = set(a[i] / acheck[i] for i in self.index_set())
2384
+ if ~ZZ(2) in s and 2 in s:
2384
2385
  # The test above and the formula below are rather meaningless
2385
2386
  # But they detect properly type BC or dual and return the correct value
2386
- return Family(dict((i, min(ZZ(1), a[i] / acheck[i]))
2387
- for i in self.index_set()))
2387
+ return Family({i: min(ZZ.one(), a[i] / acheck[i])
2388
+ for i in self.index_set()})
2388
2389
 
2389
- else:
2390
- return self.c()
2390
+ return self.c()
2391
2391
 
2392
2392
  def _test_dual_classical(self, **options):
2393
2393
  r"""
@@ -105,12 +105,12 @@ def CoxeterGroup(data, implementation='reflection', base_ring=None, index_set=No
105
105
 
106
106
  We use the different options for the "reflection" implementation::
107
107
 
108
- sage: W = CoxeterGroup(["H",3], implementation='reflection', base_ring=RR); W # needs sage.libs.gap
108
+ sage: W = CoxeterGroup(["H",3], implementation='reflection', base_ring=RR); W # needs sage.libs.gap sage.symbolic
109
109
  Finite Coxeter group over Real Field with 53 bits of precision with Coxeter matrix:
110
110
  [1 3 2]
111
111
  [3 1 5]
112
112
  [2 5 1]
113
- sage: W = CoxeterGroup([[1,10],[10,1]], implementation='reflection', # needs sage.symbolics
113
+ sage: W = CoxeterGroup([[1,10],[10,1]], implementation='reflection', # needs sage.symbolic
114
114
  ....: index_set=['a','b'], base_ring=SR); W
115
115
  Finite Coxeter group over Symbolic Ring with Coxeter matrix:
116
116
  [ 1 10]
@@ -397,6 +397,17 @@ class CoxeterType(SageObject, metaclass=ClasscallMetaclass):
397
397
  return R((E(2*x) + ~E(2*x)).to_cyclotomic_field()) / R(-2)
398
398
  else:
399
399
  return R(x)
400
+ elif all(mat[i,j] in (1, 2, 3) or mat[i, j] <= -1 for i in range(n) for j in range(n)):
401
+ def val(x):
402
+ if x > -1:
403
+ if x == 1:
404
+ return R(1)
405
+ elif x == 2:
406
+ return R(0)
407
+ elif x == 3:
408
+ return R(1)/R(-2)
409
+ else:
410
+ return R(x)
400
411
  else:
401
412
  from sage.functions.trig import cos
402
413
  from sage.symbolic.constants import pi
@@ -1,5 +1,5 @@
1
1
  # sage_setup: distribution = sagemath-modules
2
- # sage.doctest: needs sage.libs.gap
2
+ # sage.doctest: needs sage.graphs sage.libs.gap
3
3
  r"""
4
4
  Extended affine Weyl groups
5
5
 
@@ -1322,7 +1322,7 @@ class ExtendedAffineWeylGroup_Class(UniqueRepresentation, Parent):
1322
1322
  class ElementMethods:
1323
1323
 
1324
1324
  @abstract_method
1325
- def has_descent(self, i, side='right', positive=False):
1325
+ def has_descent(self, i, side='right', positive=False) -> bool:
1326
1326
  r"""
1327
1327
  Return whether ``self`` * `s_i` < ``self`` where `s_i` is the `i`-th simple
1328
1328
  reflection in the realized group.
@@ -1919,7 +1919,7 @@ class ExtendedAffineWeylGroup_Class(UniqueRepresentation, Parent):
1919
1919
  The element class for the "PW0" realization.
1920
1920
  """
1921
1921
 
1922
- def has_descent(self, i, side='right', positive=False):
1922
+ def has_descent(self, i, side='right', positive=False) -> bool:
1923
1923
  r"""
1924
1924
  Return whether ``self`` has `i` as a descent.
1925
1925
 
@@ -2129,7 +2129,7 @@ class ExtendedAffineWeylGroup_Class(UniqueRepresentation, Parent):
2129
2129
  The element class for the W0P realization.
2130
2130
  """
2131
2131
 
2132
- def has_descent(self, i, side='right', positive=False):
2132
+ def has_descent(self, i, side='right', positive=False) -> bool:
2133
2133
  r"""
2134
2134
  Return whether ``self`` has `i` as a descent.
2135
2135
 
@@ -2308,7 +2308,7 @@ class ExtendedAffineWeylGroup_Class(UniqueRepresentation, Parent):
2308
2308
  Element class for the "WF" realization.
2309
2309
  """
2310
2310
 
2311
- def has_descent(self, i, side='right', positive=False):
2311
+ def has_descent(self, i, side='right', positive=False) -> bool:
2312
2312
  r"""
2313
2313
  Return whether ``self`` has `i` as a descent.
2314
2314
 
@@ -2482,7 +2482,7 @@ class ExtendedAffineWeylGroup_Class(UniqueRepresentation, Parent):
2482
2482
  The element class for the "FW" realization.
2483
2483
  """
2484
2484
 
2485
- def has_descent(self, i, side='right', positive=False):
2485
+ def has_descent(self, i, side='right', positive=False) -> bool:
2486
2486
  r"""
2487
2487
  Return whether ``self`` has descent at `i`.
2488
2488
 
@@ -2642,7 +2642,7 @@ class ExtendedAffineWeylGroup_Class(UniqueRepresentation, Parent):
2642
2642
  The element class for the "PvW0" realization.
2643
2643
  """
2644
2644
 
2645
- def has_descent(self, i, side='right', positive=False):
2645
+ def has_descent(self, i, side='right', positive=False) -> bool:
2646
2646
  r"""
2647
2647
  Return whether ``self`` has `i` as a descent.
2648
2648
 
@@ -2837,7 +2837,7 @@ class ExtendedAffineWeylGroup_Class(UniqueRepresentation, Parent):
2837
2837
  assert la in w.parent().domain()
2838
2838
  return w.action(self.cartesian_projection(1).value + la)
2839
2839
 
2840
- def has_descent(self, i, side='right', positive=False):
2840
+ def has_descent(self, i, side='right', positive=False) -> bool:
2841
2841
  r"""
2842
2842
  Return whether ``self`` has `i` as a descent.
2843
2843
 
@@ -532,8 +532,7 @@ class FundamentalGroupOfExtendedAffineWeylGroup_Class(UniqueRepresentation,
532
532
  """
533
533
  return iter(self.group_generators())
534
534
 
535
- @cached_method
536
- def an_element(self):
535
+ def _an_element_(self):
537
536
  r"""
538
537
  Return an element of ``self``.
539
538
 
@@ -708,8 +707,7 @@ class FundamentalGroupGL(FundamentalGroupOfExtendedAffineWeylGroup_Class):
708
707
  """
709
708
  return LazyFamily(ZZ, lambda i: i)
710
709
 
711
- @cached_method
712
- def an_element(self):
710
+ def _an_element_(self):
713
711
  r"""
714
712
  An element of ``self``.
715
713
 
@@ -1,5 +1,5 @@
1
1
  # sage_setup: distribution = sagemath-modules
2
- # sage.doctest: needs sage.libs.gap sage.groups
2
+ # sage.doctest: needs sage.graphs sage.libs.gap sage.groups
3
3
  r"""
4
4
  Hecke algebra representations
5
5
  """
@@ -1,5 +1,5 @@
1
1
  # sage_setup: distribution = sagemath-modules
2
- # sage.doctest: needs sage.libs.gap
2
+ # sage.doctest: needs sage.graphs sage.libs.gap
3
3
  r"""
4
4
  Pieri factors
5
5
  """
@@ -520,7 +520,7 @@ class PieriFactors_type_A_affine(PieriFactors_affine_type):
520
520
 
521
521
  @staticmethod
522
522
  def __classcall__(cls, W, min_length=0, max_length=infinity,
523
- min_support=frozenset([]), max_support=None):
523
+ min_support=frozenset(), max_support=None):
524
524
  r"""
525
525
  TESTS::
526
526