passagemath-combinat 10.6.1__cp312-cp312-musllinux_1_2_aarch64.whl → 10.8.1a1__cp312-cp312-musllinux_1_2_aarch64.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.
Files changed (221) hide show
  1. passagemath_combinat/__init__.py +3 -0
  2. {passagemath_combinat-10.6.1.dist-info → passagemath_combinat-10.8.1a1.dist-info}/METADATA +17 -20
  3. {passagemath_combinat-10.6.1.dist-info → passagemath_combinat-10.8.1a1.dist-info}/RECORD +220 -218
  4. {passagemath_combinat-10.6.1.dist-info → passagemath_combinat-10.8.1a1.dist-info}/WHEEL +1 -1
  5. passagemath_combinat-10.8.1a1.dist-info/top_level.txt +3 -0
  6. sage/algebras/affine_nil_temperley_lieb.py +3 -3
  7. sage/algebras/all.py +0 -1
  8. sage/algebras/askey_wilson.py +1 -1
  9. sage/algebras/associated_graded.py +2 -2
  10. sage/algebras/cellular_basis.py +3 -6
  11. sage/algebras/cluster_algebra.py +2 -3
  12. sage/algebras/down_up_algebra.py +6 -6
  13. sage/algebras/free_algebra.py +3 -32
  14. sage/algebras/free_algebra_element.py +21 -25
  15. sage/algebras/free_algebra_quotient_element.py +9 -38
  16. sage/algebras/free_zinbiel_algebra.py +4 -3
  17. sage/algebras/hall_algebra.py +2 -2
  18. sage/algebras/hecke_algebras/ariki_koike_algebra.py +8 -8
  19. sage/algebras/hecke_algebras/ariki_koike_specht_modules.py +2 -2
  20. sage/algebras/hecke_algebras/cubic_hecke_algebra.py +11 -14
  21. sage/algebras/hecke_algebras/cubic_hecke_base_ring.py +1 -1
  22. sage/algebras/hecke_algebras/cubic_hecke_matrix_rep.py +5 -5
  23. sage/algebras/iwahori_hecke_algebra.py +59 -57
  24. sage/algebras/jordan_algebra.py +97 -89
  25. sage/algebras/lie_conformal_algebras/abelian_lie_conformal_algebra.py +6 -6
  26. sage/algebras/lie_conformal_algebras/affine_lie_conformal_algebra.py +14 -12
  27. sage/algebras/lie_conformal_algebras/bosonic_ghosts_lie_conformal_algebra.py +6 -6
  28. sage/algebras/lie_conformal_algebras/fermionic_ghosts_lie_conformal_algebra.py +4 -4
  29. sage/algebras/lie_conformal_algebras/finitely_freely_generated_lca.py +13 -13
  30. sage/algebras/lie_conformal_algebras/free_bosons_lie_conformal_algebra.py +8 -6
  31. sage/algebras/lie_conformal_algebras/free_fermions_lie_conformal_algebra.py +7 -5
  32. sage/algebras/lie_conformal_algebras/freely_generated_lie_conformal_algebra.py +7 -7
  33. sage/algebras/lie_conformal_algebras/graded_lie_conformal_algebra.py +6 -5
  34. sage/algebras/lie_conformal_algebras/lie_conformal_algebra.py +12 -11
  35. sage/algebras/lie_conformal_algebras/lie_conformal_algebra_element.py +3 -3
  36. sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_basis.py +3 -3
  37. sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py +11 -11
  38. sage/algebras/lie_conformal_algebras/n2_lie_conformal_algebra.py +3 -3
  39. sage/algebras/lie_conformal_algebras/neveu_schwarz_lie_conformal_algebra.py +8 -7
  40. sage/algebras/lie_conformal_algebras/virasoro_lie_conformal_algebra.py +9 -8
  41. sage/algebras/lie_conformal_algebras/weyl_lie_conformal_algebra.py +6 -5
  42. sage/algebras/nil_coxeter_algebra.py +4 -4
  43. sage/algebras/q_commuting_polynomials.py +6 -6
  44. sage/algebras/q_system.py +3 -3
  45. sage/algebras/quantum_clifford.py +8 -8
  46. sage/algebras/quantum_groups/fock_space.py +48 -8
  47. sage/algebras/quantum_groups/quantum_group_gap.py +5 -7
  48. sage/algebras/quantum_matrix_coordinate_algebra.py +7 -7
  49. sage/algebras/quantum_oscillator.py +3 -3
  50. sage/algebras/quaternion_algebra_element.py +5 -3
  51. sage/algebras/schur_algebra.py +3 -3
  52. sage/algebras/shuffle_algebra.py +5 -8
  53. sage/algebras/splitting_algebra.py +129 -85
  54. sage/algebras/tensor_algebra.py +7 -7
  55. sage/algebras/yangian.py +16 -15
  56. sage/algebras/yokonuma_hecke_algebra.py +13 -11
  57. sage/combinat/all.py +9 -0
  58. sage/combinat/all__sagemath_combinat.py +1 -0
  59. sage/combinat/alternating_sign_matrix.py +36 -29
  60. sage/combinat/baxter_permutations.py +32 -12
  61. sage/combinat/bijectionist.py +13 -17
  62. sage/combinat/chas/fsym.py +6 -6
  63. sage/combinat/chas/wqsym.py +23 -29
  64. sage/combinat/colored_permutations.py +9 -11
  65. sage/combinat/colored_permutations_representations.py +13 -12
  66. sage/combinat/composition_tableau.py +2 -2
  67. sage/combinat/constellation.py +57 -30
  68. sage/combinat/crystals/affine_factorization.py +5 -4
  69. sage/combinat/crystals/alcove_path.py +2 -2
  70. sage/combinat/crystals/fully_commutative_stable_grothendieck.py +3 -2
  71. sage/combinat/crystals/infinity_crystals.py +18 -18
  72. sage/combinat/crystals/kac_modules.py +1 -1
  73. sage/combinat/crystals/kirillov_reshetikhin.py +2 -2
  74. sage/combinat/crystals/letters.cpython-312-aarch64-linux-musl.so +0 -0
  75. sage/combinat/crystals/littelmann_path.py +1 -1
  76. sage/combinat/crystals/pbw_datum.cpython-312-aarch64-linux-musl.so +0 -0
  77. sage/combinat/crystals/pbw_datum.pyx +3 -2
  78. sage/combinat/crystals/spins.cpython-312-aarch64-linux-musl.so +0 -0
  79. sage/combinat/crystals/tensor_product.py +7 -5
  80. sage/combinat/crystals/tensor_product_element.cpython-312-aarch64-linux-musl.so +0 -0
  81. sage/combinat/debruijn_sequence.cpython-312-aarch64-linux-musl.so +0 -0
  82. sage/combinat/debruijn_sequence.pyx +1 -2
  83. sage/combinat/degree_sequences.cpython-312-aarch64-linux-musl.so +0 -0
  84. sage/combinat/degree_sequences.pyx +241 -188
  85. sage/combinat/derangements.py +28 -22
  86. sage/combinat/diagram_algebras.py +12 -14
  87. sage/combinat/dyck_word.py +15 -14
  88. sage/combinat/e_one_star.py +1 -1
  89. sage/combinat/expnums.cpython-312-aarch64-linux-musl.so +0 -0
  90. sage/combinat/fast_vector_partitions.cpython-312-aarch64-linux-musl.so +0 -0
  91. sage/combinat/fqsym.py +13 -19
  92. sage/combinat/free_dendriform_algebra.py +2 -2
  93. sage/combinat/free_prelie_algebra.py +2 -2
  94. sage/combinat/fully_commutative_elements.py +8 -8
  95. sage/combinat/fully_packed_loop.py +9 -9
  96. sage/combinat/gelfand_tsetlin_patterns.py +4 -5
  97. sage/combinat/gray_codes.py +3 -4
  98. sage/combinat/grossman_larson_algebras.py +2 -2
  99. sage/combinat/growth.py +13 -13
  100. sage/combinat/hall_polynomial.py +1 -1
  101. sage/combinat/hillman_grassl.py +1 -1
  102. sage/combinat/integer_matrices.py +5 -7
  103. sage/combinat/k_tableau.py +8 -7
  104. sage/combinat/kazhdan_lusztig.py +3 -3
  105. sage/combinat/key_polynomial.py +845 -298
  106. sage/combinat/knutson_tao_puzzles.py +11 -13
  107. sage/combinat/matrices/hadamard_matrix.py +1 -1
  108. sage/combinat/matrices/latin.py +75 -92
  109. sage/combinat/misc.py +3 -3
  110. sage/combinat/multiset_partition_into_sets_ordered.py +27 -10
  111. sage/combinat/ncsf_qsym/generic_basis_code.py +5 -5
  112. sage/combinat/ncsf_qsym/ncsf.py +6 -5
  113. sage/combinat/ncsf_qsym/qsym.py +9 -17
  114. sage/combinat/ncsym/ncsym.py +8 -12
  115. sage/combinat/nu_dyck_word.py +1 -1
  116. sage/combinat/parallelogram_polyomino.py +3 -5
  117. sage/combinat/parking_functions.py +6 -5
  118. sage/combinat/partition_algebra.py +22 -57
  119. sage/combinat/partition_kleshchev.py +4 -4
  120. sage/combinat/partition_tuple.py +12 -10
  121. sage/combinat/plane_partition.py +10 -13
  122. sage/combinat/positive_integer_semigroup_test.py +17 -0
  123. sage/combinat/q_bernoulli.cpython-312-aarch64-linux-musl.so +0 -0
  124. sage/combinat/quickref.py +2 -2
  125. sage/combinat/recognizable_series.py +2 -2
  126. sage/combinat/regular_sequence.py +7 -7
  127. sage/combinat/regular_sequence_bounded.py +15 -21
  128. sage/combinat/restricted_growth.py +3 -3
  129. sage/combinat/ribbon.py +3 -3
  130. sage/combinat/rigged_configurations/bijection.py +3 -3
  131. sage/combinat/rigged_configurations/rigged_partition.cpython-312-aarch64-linux-musl.so +0 -0
  132. sage/combinat/rsk.py +2 -0
  133. sage/combinat/schubert_polynomial.py +11 -2
  134. sage/combinat/set_partition.py +3 -7
  135. sage/combinat/set_partition_iterator.cpython-312-aarch64-linux-musl.so +0 -0
  136. sage/combinat/set_partition_iterator.pyx +0 -1
  137. sage/combinat/set_partition_ordered.py +2 -2
  138. sage/combinat/sf/classical.py +1 -1
  139. sage/combinat/sf/dual.py +4 -8
  140. sage/combinat/sf/elementary.py +13 -7
  141. sage/combinat/sf/hall_littlewood.py +10 -8
  142. sage/combinat/sf/homogeneous.py +6 -3
  143. sage/combinat/sf/jack.py +11 -9
  144. sage/combinat/sf/llt.py +4 -5
  145. sage/combinat/sf/macdonald.py +10 -11
  146. sage/combinat/sf/monomial.py +6 -0
  147. sage/combinat/sf/ns_macdonald.py +92 -51
  148. sage/combinat/sf/powersum.py +9 -14
  149. sage/combinat/sf/schur.py +6 -0
  150. sage/combinat/sf/sf.py +21 -19
  151. sage/combinat/sf/sfa.py +13 -64
  152. sage/combinat/shifted_primed_tableau.py +5 -7
  153. sage/combinat/shuffle.py +1 -1
  154. sage/combinat/sine_gordon.py +18 -38
  155. sage/combinat/skew_partition.py +9 -12
  156. sage/combinat/skew_tableau.py +2 -7
  157. sage/combinat/sloane_functions.py +1 -1
  158. sage/combinat/species/all.py +67 -2
  159. sage/combinat/species/characteristic_species.py +3 -0
  160. sage/combinat/species/composition_species.py +3 -0
  161. sage/combinat/species/cycle_species.py +4 -0
  162. sage/combinat/species/empty_species.py +3 -0
  163. sage/combinat/species/functorial_composition_species.py +3 -0
  164. sage/combinat/species/generating_series.py +3 -0
  165. sage/combinat/species/library.py +3 -0
  166. sage/combinat/species/linear_order_species.py +3 -0
  167. sage/combinat/species/partition_species.py +3 -0
  168. sage/combinat/species/permutation_species.py +4 -0
  169. sage/combinat/species/product_species.py +3 -0
  170. sage/combinat/species/recursive_species.py +3 -0
  171. sage/combinat/species/set_species.py +3 -0
  172. sage/combinat/species/species.py +13 -7
  173. sage/combinat/species/structure.py +8 -9
  174. sage/combinat/species/subset_species.py +3 -0
  175. sage/combinat/species/sum_species.py +3 -0
  176. sage/combinat/subword.py +4 -1
  177. sage/combinat/subword_complex.py +7 -7
  178. sage/combinat/subword_complex_c.cpython-312-aarch64-linux-musl.so +0 -0
  179. sage/combinat/superpartition.py +1 -1
  180. sage/combinat/symmetric_group_algebra.py +9 -9
  181. sage/combinat/symmetric_group_representations.py +5 -5
  182. sage/combinat/t_sequences.py +4 -4
  183. sage/combinat/tableau.py +3 -4
  184. sage/combinat/tableau_tuple.py +2 -2
  185. sage/combinat/tiling.py +39 -42
  186. sage/combinat/triangles_FHM.py +38 -15
  187. sage/combinat/tutorial.py +2 -2
  188. sage/combinat/vector_partition.py +43 -31
  189. sage/combinat/words/abstract_word.py +4 -4
  190. sage/combinat/words/alphabet.py +12 -12
  191. sage/combinat/words/finite_word.py +25 -229
  192. sage/combinat/words/infinite_word.py +1 -1
  193. sage/combinat/words/morphic.py +13 -13
  194. sage/combinat/words/morphism.py +3 -12
  195. sage/combinat/words/paths.py +16 -17
  196. sage/combinat/words/word.py +60 -35
  197. sage/combinat/words/word_char.cpython-312-aarch64-linux-musl.so +0 -0
  198. sage/combinat/words/word_char.pyx +46 -7
  199. sage/combinat/words/word_datatypes.cpython-312-aarch64-linux-musl.so +0 -0
  200. sage/combinat/words/word_generators.py +39 -38
  201. sage/databases/findstat.py +72 -31
  202. sage/databases/oeis.py +125 -25
  203. sage/databases/sloane.py +14 -8
  204. sage/games/sudoku_backtrack.cpython-312-aarch64-linux-musl.so +0 -0
  205. sage/groups/indexed_free_group.py +3 -4
  206. sage/libs/symmetrica/symmetrica.cpython-312-aarch64-linux-musl.so +0 -0
  207. sage/libs/symmetrica/symmetrica.pxi +1 -0
  208. sage/monoids/automatic_semigroup.py +1 -3
  209. sage/monoids/free_abelian_monoid.py +7 -33
  210. sage/monoids/free_abelian_monoid_element.cpython-312-aarch64-linux-musl.so +0 -0
  211. sage/monoids/free_monoid.py +8 -40
  212. sage/monoids/free_monoid_element.py +1 -9
  213. sage/monoids/string_monoid.py +5 -2
  214. sage/monoids/string_monoid_element.py +12 -66
  215. sage/rings/all__sagemath_combinat.py +7 -0
  216. sage/sat/solvers/__init__.py +3 -4
  217. sage/sat/solvers/cryptominisat.py +2 -3
  218. sage/sat/solvers/picosat.py +2 -3
  219. sage/sat/solvers/sat_lp.py +2 -2
  220. sage/sat/solvers/satsolver.cpython-312-aarch64-linux-musl.so +0 -0
  221. passagemath_combinat-10.6.1.dist-info/top_level.txt +0 -2
@@ -103,7 +103,7 @@ algebra as well::
103
103
  sage: s^2
104
104
  (c0*c1*c2*c3*c4)^2
105
105
  sage: t = CHA6.an_element() * c4; t
106
- (-w)*c0*c1^-1*c4 + v*c0*c2^-1*c4 + u*c2*c1*c4 + ((-v*w+u)/w)*c4
106
+ -w*c0*c1^-1*c4 + v*c0*c2^-1*c4 + u*c2*c1*c4 - ((v*w-u)/w)*c4
107
107
 
108
108
  REFERENCES:
109
109
 
@@ -579,7 +579,7 @@ class CubicHeckeElement(CombinatorialFreeModule.Element):
579
579
  mtcf = [M.from_vector(cf.to_vector()) for cf in mtcf]
580
580
 
581
581
  R = M.base_ring()
582
- return M.linear_combination((mtcf[i], R(val)) for i, val in vs.iteritems())
582
+ return M.linear_combination((mtcf[i], R(val)) for i, val in vs.items())
583
583
 
584
584
 
585
585
  class CubicHeckeAlgebra(CombinatorialFreeModule):
@@ -718,7 +718,7 @@ class CubicHeckeAlgebra(CombinatorialFreeModule):
718
718
  True
719
719
  sage: CHA4 = algebras.CubicHecke(4) # optional database_cubic_hecke
720
720
  sage: ele4 = CHA4(ele3); ele4 # optional database_cubic_hecke
721
- c0*c1*c0^-1*c1 + u*c0^-1*c1*c0 + (-v)*c0*c1^-1 + v*c1^-1*c0 + (-u)*c0*c1*c0^-1
721
+ c0*c1*c0^-1*c1 + u*c0^-1*c1*c0 - v*c0*c1^-1 + v*c1^-1*c0 - u*c0*c1*c0^-1
722
722
 
723
723
  Cubic Hecke algebra over the ring of definition using different variable
724
724
  names::
@@ -1123,7 +1123,7 @@ class CubicHeckeAlgebra(CombinatorialFreeModule):
1123
1123
  # overloaded inherited methods
1124
1124
  # --------------------------------------------------------------------------
1125
1125
  ############################################################################
1126
- def _repr_(self):
1126
+ def _repr_(self) -> str:
1127
1127
  r"""
1128
1128
  Return a string representation.
1129
1129
 
@@ -1553,8 +1553,6 @@ class CubicHeckeAlgebra(CombinatorialFreeModule):
1553
1553
  g1 = self.monomial(g1)
1554
1554
  g2 = self.monomial(g2)
1555
1555
 
1556
- result = None
1557
-
1558
1556
  g1_Tietze = g1.Tietze()
1559
1557
  g2_Tietze = g2.Tietze()
1560
1558
 
@@ -1564,9 +1562,8 @@ class CubicHeckeAlgebra(CombinatorialFreeModule):
1564
1562
  # The product is calculated from the corresponding product of the braids
1565
1563
  # ----------------------------------------------------------------------
1566
1564
  braid_group = self.braid_group()
1567
- braid_product = braid_group(g1_Tietze+g2_Tietze)
1568
- result = self._braid_image(braid_product)
1569
- return result
1565
+ braid_product = braid_group(g1_Tietze + g2_Tietze)
1566
+ return self._braid_image(braid_product)
1570
1567
 
1571
1568
  ############################################################################
1572
1569
  # --------------------------------------------------------------------------
@@ -1917,6 +1914,9 @@ class CubicHeckeAlgebra(CombinatorialFreeModule):
1917
1914
  sage: F = CHA3.base_ring().fraction_field()
1918
1915
  sage: par = tuple([F(p) for p in CHA3.cubic_equation_parameters()])
1919
1916
  sage: CHA3F = algebras.CubicHecke(3, cubic_equation_parameters=par)
1917
+ doctest:warning
1918
+ ...
1919
+ UserWarning: Assuming h^3 - u*h^2 + v*h - w to have maximal Galois group!
1920
1920
  sage: CHA3F._braid_image_from_filecache(br)
1921
1921
  1/w*c0*c1*c0^-1*c1 + v/w*c1^-1*c0 - u/w*c0*c1*c0^-1
1922
1922
  sage: section = CHA3.filecache_section().braid_images
@@ -2044,8 +2044,7 @@ class CubicHeckeAlgebra(CombinatorialFreeModule):
2044
2044
  return self.one()
2045
2045
  k = braid_tietze[0]*len_braid
2046
2046
  result_vect = self._reduce_gen_power(k)
2047
- result = self.from_vector(result_vect)
2048
- return result
2047
+ return self.from_vector(result_vect)
2049
2048
 
2050
2049
  # ----------------------------------------------------------------------
2051
2050
  # Try to use former calculations (from dynamic library) to obtain the
@@ -2095,8 +2094,7 @@ class CubicHeckeAlgebra(CombinatorialFreeModule):
2095
2094
  braid_preimage = tuple(word_result)
2096
2095
  result_vect = self._mult_by_regular_rep(vect, tuple(word_right), RepresentationType.RegularRight, braid_preimage)
2097
2096
 
2098
- result = self.from_vector(result_vect)
2099
- return result
2097
+ return self.from_vector(result_vect)
2100
2098
 
2101
2099
  # --------------------------------------------------------------------------
2102
2100
  # _braid_image_from_former_calculations
@@ -2650,7 +2648,6 @@ class CubicHeckeAlgebra(CombinatorialFreeModule):
2650
2648
  sage: CHA2.mirror_isomorphism(br) # indirect doctest
2651
2649
  c^-1
2652
2650
  """
2653
-
2654
2651
  result = self.zero()
2655
2652
  for braid in element.support():
2656
2653
  autom_braid = braid_automorphism(braid)
@@ -274,7 +274,7 @@ class CubicHeckeExtensionRing(LaurentPolynomialRing_mpair):
274
274
  sage: ER = chbr.CubicHeckeExtensionRing('a, b, c')
275
275
  sage: ER._test_category() # indirect doctest
276
276
  """
277
- return None
277
+ return
278
278
 
279
279
  def __reduce__(self):
280
280
  r"""
@@ -75,7 +75,7 @@ class RepresentationType(Enum):
75
75
  sage: chmr.RepresentationType.RegularLeft.is_regular()
76
76
  True
77
77
  """
78
- def is_split(self):
78
+ def is_split(self) -> bool:
79
79
  r"""
80
80
  Return ``True`` if this representation type is absolutely split,
81
81
  ``False`` else-wise.
@@ -89,7 +89,7 @@ class RepresentationType(Enum):
89
89
  """
90
90
  return self.value['split']
91
91
 
92
- def is_regular(self):
92
+ def is_regular(self) -> bool:
93
93
  r"""
94
94
  Return ``True`` if this representation type is regular, ``False``
95
95
  else-wise.
@@ -709,7 +709,7 @@ class CubicHeckeMatrixSpace(MatrixSpace):
709
709
  sage: MS = c1.matrix().parent()
710
710
  sage: MS._test_category() # indirect doctest
711
711
  """
712
- return None
712
+ return
713
713
 
714
714
  def __reduce__(self):
715
715
  r"""
@@ -895,8 +895,8 @@ class CubicHeckeMatrixSpace(MatrixSpace):
895
895
  matri += cf2 * matr
896
896
  matri += cf3 * matr**2
897
897
  d1, d2 = matr.dimensions()
898
- matrI = matrix(original_base_ring, d1, d2, lambda i, j: original_base_ring(matri[i, j]))
899
- return matrI
898
+ return matrix(original_base_ring, d1, d2,
899
+ lambda i, j: original_base_ring(matri[i, j]))
900
900
 
901
901
  if n == 2:
902
902
  if representation_type.is_split():
@@ -234,7 +234,7 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
234
234
 
235
235
  sage: R.<q> = LaurentPolynomialRing(ZZ)
236
236
  sage: H = IwahoriHeckeAlgebra('A3', q^2)
237
- sage: T=H.T(); Cp=H.Cp(); C=H.C()
237
+ sage: T = H.T(); Cp = H.Cp(); C = H.C()
238
238
  sage: C(T[1])
239
239
  q*C[1] + q^2
240
240
  sage: elt = Cp(T[1,2,1]); elt
@@ -246,7 +246,7 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
246
246
 
247
247
  sage: R.<q> = LaurentPolynomialRing(ZZ)
248
248
  sage: H = IwahoriHeckeAlgebra('A3', q, -q^-1)
249
- sage: T=H.T(); Cp=H.Cp(); C=H.C()
249
+ sage: T = H.T(); Cp = H.Cp(); C = H.C()
250
250
  sage: C(T[1])
251
251
  C[1] + q
252
252
  sage: elt = Cp(T[1,2,1]); elt
@@ -257,7 +257,7 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
257
257
  In the group algebra, so that `(T_r-1)(T_r+1) = 0`::
258
258
 
259
259
  sage: H = IwahoriHeckeAlgebra('A3', 1)
260
- sage: T=H.T(); Cp=H.Cp(); C=H.C()
260
+ sage: T = H.T(); Cp = H.Cp(); C = H.C()
261
261
  sage: C(T[1])
262
262
  C[1] + 1
263
263
  sage: Cp(T[1,2,1])
@@ -271,7 +271,7 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
271
271
 
272
272
  sage: R.<q>=LaurentPolynomialRing(ZZ)
273
273
  sage: H = IwahoriHeckeAlgebra('A3', q)
274
- sage: C=H.C()
274
+ sage: C = H.C()
275
275
  Traceback (most recent call last):
276
276
  ...
277
277
  ValueError: the Kazhdan-Lusztig bases are defined only when -q_1*q_2 is a square
@@ -280,7 +280,7 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
280
280
 
281
281
  sage: R.<v> = LaurentPolynomialRing(ZZ)
282
282
  sage: H = IwahoriHeckeAlgebra(['A',2,1], v^2)
283
- sage: T=H.T(); Cp=H.Cp(); C=H.C()
283
+ sage: T = H.T(); Cp = H.Cp(); C = H.C()
284
284
  sage: C(T[1,0,2])
285
285
  v^3*C[1,0,2] + v^4*C[1,0] + v^4*C[0,2] + v^4*C[1,2]
286
286
  + v^5*C[0] + v^5*C[2] + v^5*C[1] + v^6
@@ -460,6 +460,15 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
460
460
  sage: R.<q1,q2> = QQ[]
461
461
  sage: H = IwahoriHeckeAlgebra("A2", q1, q2=q2, base_ring=Frac(R))
462
462
  sage: TestSuite(H).run()
463
+
464
+ TESTS::
465
+
466
+ sage: T = IwahoriHeckeAlgebra("B2", 1).T()
467
+ sage: T.is_commutative()
468
+ False
469
+ sage: T = IwahoriHeckeAlgebra("A1", 1).T()
470
+ sage: T.is_commutative()
471
+ True
463
472
  """
464
473
  self._W = W
465
474
  self._coxeter_type = W.coxeter_type()
@@ -482,16 +491,17 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
482
491
  # Attach the generic Hecke algebra and the basis change maps
483
492
  self._root = root
484
493
  self._generic_iwahori_hecke_algebra = IwahoriHeckeAlgebra_nonstandard(W)
485
- self._shorthands = ['C', 'Cp', 'T']
494
+ self._shorthands = ('C', 'Cp', 'T')
486
495
  else:
487
496
  # Can we actually remove the bases C and Cp in this case?
488
497
  self._root = None
489
- self._shorthands = ['T']
498
+ self._shorthands = ('T',)
490
499
 
491
500
  # if 2 is a unit in the base ring then add th A and B bases
492
501
  try:
493
502
  base_ring(base_ring.one() / 2)
494
- self._shorthands.extend(['A', 'B'])
503
+ sh = self._shorthands
504
+ self._shorthands = (*sh, 'A', 'B')
495
505
  except (TypeError, ZeroDivisionError):
496
506
  pass
497
507
 
@@ -499,7 +509,12 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
499
509
  self._category = FiniteDimensionalAlgebrasWithBasis(base_ring)
500
510
  else:
501
511
  self._category = AlgebrasWithBasis(base_ring)
502
- Parent.__init__(self, base=base_ring, category=self._category.WithRealizations())
512
+
513
+ if base_ring.is_commutative() and W.is_commutative():
514
+ self._category = self._category.Commutative()
515
+
516
+ Parent.__init__(self, base=base_ring,
517
+ category=self._category.WithRealizations())
503
518
 
504
519
  self._is_generic = False # needed for initialisation of _KLHeckeBasis
505
520
 
@@ -510,7 +525,7 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
510
525
  except TypeError:
511
526
  self._inverse_base_ring_generators = {}
512
527
 
513
- def _repr_(self):
528
+ def _repr_(self) -> str:
514
529
  r"""
515
530
  EXAMPLES::
516
531
 
@@ -525,7 +540,7 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
525
540
  return "Iwahori-Hecke algebra of type {} in {},{} over {}".format(
526
541
  ct, self._q1, self._q2, self.base_ring())
527
542
 
528
- def _latex_(self):
543
+ def _latex_(self) -> str:
529
544
  r"""
530
545
  Return a latex representation of ``self``.
531
546
 
@@ -672,7 +687,7 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
672
687
  """
673
688
  return [Realizations(self.base()), self.base()._category]
674
689
 
675
- def _repr_(self):
690
+ def _repr_(self) -> str:
676
691
  r"""
677
692
  Return the representation of ``self``.
678
693
 
@@ -690,7 +705,7 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
690
705
  cases, these are just default implementations that will get
691
706
  specialized in a basis.
692
707
  """
693
- def _repr_(self):
708
+ def _repr_(self) -> str:
694
709
  """
695
710
  Text representation of this basis of Iwahori-Hecke algebra.
696
711
 
@@ -767,19 +782,6 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
767
782
  """
768
783
  return False
769
784
 
770
- def is_commutative(self) -> bool:
771
- """
772
- Return whether this Iwahori-Hecke algebra is commutative.
773
-
774
- EXAMPLES::
775
-
776
- sage: T = IwahoriHeckeAlgebra("B2", 1).T()
777
- sage: T.is_commutative()
778
- False
779
- """
780
- return self.base_ring().is_commutative() \
781
- and self.realization_of().coxeter_group().is_commutative()
782
-
783
785
  @cached_method
784
786
  def one_basis(self):
785
787
  r"""
@@ -1258,7 +1260,7 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
1258
1260
  # specialize_to() to work
1259
1261
  _basis_name = 'B'
1260
1262
 
1261
- def _repr_term(self, t):
1263
+ def _repr_term(self, t) -> str:
1262
1264
  r"""
1263
1265
  Return the string representation of the term indexed by ``t``.
1264
1266
 
@@ -1275,7 +1277,7 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
1275
1277
  return "1"
1276
1278
  return self._print_options['prefix'] + '[%s]' % ','.join('%d' % i for i in redword)
1277
1279
 
1278
- def _latex_term(self, t):
1280
+ def _latex_term(self, t) -> str:
1279
1281
  r"""
1280
1282
  Return latex for the term indexed by ``t``.
1281
1283
 
@@ -1621,8 +1623,8 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
1621
1623
 
1622
1624
  sage: R.<v> = LaurentPolynomialRing(QQ, 'v')
1623
1625
  sage: H = IwahoriHeckeAlgebra('A3', v**2)
1624
- sage: T=H.T()
1625
- sage: s=H.coxeter_group().simple_reflection(1)
1626
+ sage: T = H.T()
1627
+ sage: s = H.coxeter_group().simple_reflection(1)
1626
1628
  sage: T.hash_involution_on_basis(s)
1627
1629
  -(v^-2)*T[1]
1628
1630
  sage: T[s].hash_involution()
@@ -1661,8 +1663,8 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
1661
1663
 
1662
1664
  sage: R.<v> = LaurentPolynomialRing(QQ, 'v')
1663
1665
  sage: H = IwahoriHeckeAlgebra('A3', v**2)
1664
- sage: T=H.T()
1665
- sage: s=H.coxeter_group().simple_reflection(1)
1666
+ sage: T = H.T()
1667
+ sage: s = H.coxeter_group().simple_reflection(1)
1666
1668
  sage: T.goldman_involution_on_basis(s)
1667
1669
  -T[1] - (1-v^2)
1668
1670
  sage: T[s].goldman_involution()
@@ -1836,8 +1838,8 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
1836
1838
 
1837
1839
  EXAMPLES::
1838
1840
 
1839
- sage: H=IwahoriHeckeAlgebra("A3",1); Cp=H.Cp(); C=H.C()
1840
- sage: s=H.coxeter_group().simple_reflection(1)
1841
+ sage: H = IwahoriHeckeAlgebra("A3",1); Cp = H.Cp(); C = H.C()
1842
+ sage: s = H.coxeter_group().simple_reflection(1)
1841
1843
  sage: C.to_T_basis(s)
1842
1844
  T[1] - 1
1843
1845
  sage: Cp.to_T_basis(s)
@@ -2032,8 +2034,8 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
2032
2034
 
2033
2035
  sage: R.<v> = LaurentPolynomialRing(QQ, 'v')
2034
2036
  sage: H = IwahoriHeckeAlgebra('A3', v**2)
2035
- sage: Cp=H.Cp()
2036
- sage: s=H.coxeter_group().simple_reflection(1)
2037
+ sage: Cp = H.Cp()
2038
+ sage: s = H.coxeter_group().simple_reflection(1)
2037
2039
  sage: Cp.hash_involution_on_basis(s)
2038
2040
  -Cp[1] + (v^-1+v)
2039
2041
  sage: Cp[s].hash_involution()
@@ -2130,7 +2132,7 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
2130
2132
  sage: # optional - coxeter3
2131
2133
  sage: R.<v> = LaurentPolynomialRing(ZZ, 'v')
2132
2134
  sage: W = CoxeterGroup('A3', implementation='coxeter3')
2133
- sage: H = IwahoriHeckeAlgebra(W, v**2); Cp=H.Cp()
2135
+ sage: H = IwahoriHeckeAlgebra(W, v**2); Cp = H.Cp()
2134
2136
  sage: Cp.product_on_basis(W([1,2,1]), W([3,1]))
2135
2137
  (v^-1+v)*Cp[1,2,1,3]
2136
2138
  sage: Cp.product_on_basis(W([1,2,1]), W([3,1,2]))
@@ -2267,7 +2269,7 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
2267
2269
 
2268
2270
  sage: R.<v> = LaurentPolynomialRing(ZZ, 'v') # optional - coxeter3
2269
2271
  sage: W = CoxeterGroup('A3', implementation='coxeter3') # optional - coxeter3
2270
- sage: H = IwahoriHeckeAlgebra(W, v**2); Cp=H.Cp() # optional - coxeter3
2272
+ sage: H = IwahoriHeckeAlgebra(W, v**2); Cp = H.Cp() # optional - coxeter3
2271
2273
 
2272
2274
  When `u` is itself a generator `s`, the decomposition is trivial::
2273
2275
 
@@ -2440,8 +2442,8 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
2440
2442
 
2441
2443
  sage: R.<v> = LaurentPolynomialRing(QQ, 'v')
2442
2444
  sage: H = IwahoriHeckeAlgebra('A3', v**2)
2443
- sage: C=H.C()
2444
- sage: s=H.coxeter_group().simple_reflection(1)
2445
+ sage: C = H.C()
2446
+ sage: s = H.coxeter_group().simple_reflection(1)
2445
2447
  sage: C.hash_involution_on_basis(s)
2446
2448
  -C[1] - (v^-1+v)
2447
2449
  sage: C[s].hash_involution()
@@ -2473,7 +2475,7 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
2473
2475
 
2474
2476
  sage: R.<v> = LaurentPolynomialRing(QQ, 'v')
2475
2477
  sage: H = IwahoriHeckeAlgebra('A3', v**2)
2476
- sage: A=H.A(); T=H.T()
2478
+ sage: A = H.A(); T = H.T()
2477
2479
  sage: T(A[1])
2478
2480
  T[1] + (1/2-1/2*v^2)
2479
2481
  sage: T(A[1,2])
@@ -2526,8 +2528,8 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
2526
2528
  EXAMPLES::
2527
2529
 
2528
2530
  sage: R.<v> = LaurentPolynomialRing(QQ)
2529
- sage: H = IwahoriHeckeAlgebra('A3', v**2); A=H.A(); T=H.T()
2530
- sage: s=H.coxeter_group().simple_reflection(1)
2531
+ sage: H = IwahoriHeckeAlgebra('A3', v**2); A = H.A(); T = H.T()
2532
+ sage: s = H.coxeter_group().simple_reflection(1)
2531
2533
  sage: A.to_T_basis(s)
2532
2534
  T[1] + (1/2-1/2*v^2)
2533
2535
  sage: T(A[1,2])
@@ -2550,8 +2552,8 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
2550
2552
 
2551
2553
  sage: R.<v> = LaurentPolynomialRing(QQ, 'v')
2552
2554
  sage: H = IwahoriHeckeAlgebra('A3', v**2)
2553
- sage: A=H.A()
2554
- sage: s=H.coxeter_group().simple_reflection(1)
2555
+ sage: A = H.A()
2556
+ sage: s = H.coxeter_group().simple_reflection(1)
2555
2557
  sage: A.goldman_involution_on_basis(s)
2556
2558
  -A[1]
2557
2559
  sage: A[1,2].goldman_involution()
@@ -2593,7 +2595,7 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
2593
2595
 
2594
2596
  sage: R.<v> = LaurentPolynomialRing(QQ, 'v')
2595
2597
  sage: H = IwahoriHeckeAlgebra('A3', v**2)
2596
- sage: A=H.A(); T=H.T(); Cp=H.Cp()
2598
+ sage: A = H.A(); T = H.T(); Cp = H.Cp()
2597
2599
  sage: T(A[1])
2598
2600
  T[1] + (1/2-1/2*v^2)
2599
2601
  sage: T(A[1,2])
@@ -2659,8 +2661,8 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
2659
2661
  EXAMPLES::
2660
2662
 
2661
2663
  sage: R.<v> = LaurentPolynomialRing(QQ)
2662
- sage: H = IwahoriHeckeAlgebra('A3', v**2); B=H.B(); T=H.T()
2663
- sage: s=H.coxeter_group().simple_reflection(1)
2664
+ sage: H = IwahoriHeckeAlgebra('A3', v**2); B = H.B(); T = H.T()
2665
+ sage: s = H.coxeter_group().simple_reflection(1)
2664
2666
  sage: B.to_T_basis(s)
2665
2667
  T[1] + (1/2-1/2*v^2)
2666
2668
  sage: T(B[1,2])
@@ -2687,8 +2689,8 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
2687
2689
 
2688
2690
  sage: R.<v> = LaurentPolynomialRing(QQ, 'v')
2689
2691
  sage: H = IwahoriHeckeAlgebra('A3', v**2)
2690
- sage: B=H.B()
2691
- sage: s=H.coxeter_group().simple_reflection(1)
2692
+ sage: B = H.B()
2693
+ sage: s = H.coxeter_group().simple_reflection(1)
2692
2694
  sage: B.goldman_involution_on_basis(s)
2693
2695
  -B[1]
2694
2696
  sage: B[1,2].goldman_involution()
@@ -2786,7 +2788,7 @@ class IwahoriHeckeAlgebra_nonstandard(IwahoriHeckeAlgebra):
2786
2788
  self.u_inv = normalized_laurent_polynomial(base_ring, u**-1)
2787
2789
  self.v_inv = normalized_laurent_polynomial(base_ring, v**-1)
2788
2790
 
2789
- self._shorthands = ['C', 'Cp', 'T']
2791
+ self._shorthands = ('C', 'Cp', 'T')
2790
2792
 
2791
2793
  if W.is_finite():
2792
2794
  self._category = FiniteDimensionalAlgebrasWithBasis(base_ring)
@@ -2795,7 +2797,7 @@ class IwahoriHeckeAlgebra_nonstandard(IwahoriHeckeAlgebra):
2795
2797
  Parent.__init__(self, base=base_ring, category=self._category.WithRealizations())
2796
2798
  self._is_generic = True # needed for initialising _KLHeckeBasis
2797
2799
 
2798
- def _repr_(self):
2800
+ def _repr_(self) -> str:
2799
2801
  r"""
2800
2802
  EXAMPLES::
2801
2803
 
@@ -2808,7 +2810,7 @@ class IwahoriHeckeAlgebra_nonstandard(IwahoriHeckeAlgebra):
2808
2810
  except TypeError:
2809
2811
  ct = repr(self._coxeter_type)
2810
2812
  return "A generic Iwahori-Hecke algebra of type {} in {},{} over {}".format(
2811
- ct, self._q1, self._q2, self.base_ring())
2813
+ ct, self._q1, self._q2, self.base_ring())
2812
2814
 
2813
2815
  def _bar_on_coefficients(self, c):
2814
2816
  r"""
@@ -2822,8 +2824,8 @@ class IwahoriHeckeAlgebra_nonstandard(IwahoriHeckeAlgebra):
2822
2824
  EXAMPLES::
2823
2825
 
2824
2826
  sage: R.<q>=LaurentPolynomialRing(ZZ)
2825
- sage: H=IwahoriHeckeAlgebra("A3",q^2)
2826
- sage: GH=H._generic_iwahori_hecke_algebra
2827
+ sage: H = IwahoriHeckeAlgebra("A3",q^2)
2828
+ sage: GH = H._generic_iwahori_hecke_algebra
2827
2829
  sage: GH._bar_on_coefficients(GH.u_inv)
2828
2830
  u
2829
2831
  sage: GH._bar_on_coefficients(GH.v_inv)
@@ -2871,8 +2873,8 @@ class IwahoriHeckeAlgebra_nonstandard(IwahoriHeckeAlgebra):
2871
2873
  EXAMPLES::
2872
2874
 
2873
2875
  sage: R.<a,b>=LaurentPolynomialRing(ZZ,2)
2874
- sage: H=IwahoriHeckeAlgebra("A3",a^2,-b^2)
2875
- sage: GH=H._generic_iwahori_hecke_algebra
2876
+ sage: H = IwahoriHeckeAlgebra("A3",a^2,-b^2)
2877
+ sage: GH = H._generic_iwahori_hecke_algebra
2876
2878
  sage: GH.T()(GH.C()[1])
2877
2879
  (v^-1)*T[1] + (-u*v^-1)
2878
2880
  sage: ( GH.T()(GH.C()[1]) ).specialize_to(H)