passagemath-combinat 10.6.42__cp314-cp314-musllinux_1_2_x86_64.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 (400) hide show
  1. passagemath_combinat/__init__.py +3 -0
  2. passagemath_combinat-10.6.42.dist-info/METADATA +160 -0
  3. passagemath_combinat-10.6.42.dist-info/RECORD +400 -0
  4. passagemath_combinat-10.6.42.dist-info/WHEEL +5 -0
  5. passagemath_combinat-10.6.42.dist-info/top_level.txt +3 -0
  6. passagemath_combinat.libs/libgmp-0e7fc84e.so.10.5.0 +0 -0
  7. passagemath_combinat.libs/libsymmetrica-81fe8739.so.3.0.0 +0 -0
  8. sage/algebras/affine_nil_temperley_lieb.py +263 -0
  9. sage/algebras/all.py +24 -0
  10. sage/algebras/all__sagemath_combinat.py +35 -0
  11. sage/algebras/askey_wilson.py +935 -0
  12. sage/algebras/associated_graded.py +345 -0
  13. sage/algebras/cellular_basis.py +350 -0
  14. sage/algebras/cluster_algebra.py +2766 -0
  15. sage/algebras/down_up_algebra.py +860 -0
  16. sage/algebras/free_algebra.py +1698 -0
  17. sage/algebras/free_algebra_element.py +345 -0
  18. sage/algebras/free_algebra_quotient.py +405 -0
  19. sage/algebras/free_algebra_quotient_element.py +295 -0
  20. sage/algebras/free_zinbiel_algebra.py +885 -0
  21. sage/algebras/hall_algebra.py +783 -0
  22. sage/algebras/hecke_algebras/all.py +4 -0
  23. sage/algebras/hecke_algebras/ariki_koike_algebra.py +1796 -0
  24. sage/algebras/hecke_algebras/ariki_koike_specht_modules.py +475 -0
  25. sage/algebras/hecke_algebras/cubic_hecke_algebra.py +3520 -0
  26. sage/algebras/hecke_algebras/cubic_hecke_base_ring.py +1473 -0
  27. sage/algebras/hecke_algebras/cubic_hecke_matrix_rep.py +1079 -0
  28. sage/algebras/iwahori_hecke_algebra.py +3095 -0
  29. sage/algebras/jordan_algebra.py +1773 -0
  30. sage/algebras/lie_conformal_algebras/abelian_lie_conformal_algebra.py +113 -0
  31. sage/algebras/lie_conformal_algebras/affine_lie_conformal_algebra.py +156 -0
  32. sage/algebras/lie_conformal_algebras/all.py +18 -0
  33. sage/algebras/lie_conformal_algebras/bosonic_ghosts_lie_conformal_algebra.py +134 -0
  34. sage/algebras/lie_conformal_algebras/examples.py +43 -0
  35. sage/algebras/lie_conformal_algebras/fermionic_ghosts_lie_conformal_algebra.py +131 -0
  36. sage/algebras/lie_conformal_algebras/finitely_freely_generated_lca.py +139 -0
  37. sage/algebras/lie_conformal_algebras/free_bosons_lie_conformal_algebra.py +174 -0
  38. sage/algebras/lie_conformal_algebras/free_fermions_lie_conformal_algebra.py +167 -0
  39. sage/algebras/lie_conformal_algebras/freely_generated_lie_conformal_algebra.py +107 -0
  40. sage/algebras/lie_conformal_algebras/graded_lie_conformal_algebra.py +135 -0
  41. sage/algebras/lie_conformal_algebras/lie_conformal_algebra.py +353 -0
  42. sage/algebras/lie_conformal_algebras/lie_conformal_algebra_element.py +236 -0
  43. sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_basis.py +78 -0
  44. sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py +328 -0
  45. sage/algebras/lie_conformal_algebras/n2_lie_conformal_algebra.py +117 -0
  46. sage/algebras/lie_conformal_algebras/neveu_schwarz_lie_conformal_algebra.py +86 -0
  47. sage/algebras/lie_conformal_algebras/virasoro_lie_conformal_algebra.py +82 -0
  48. sage/algebras/lie_conformal_algebras/weyl_lie_conformal_algebra.py +205 -0
  49. sage/algebras/nil_coxeter_algebra.py +191 -0
  50. sage/algebras/q_commuting_polynomials.py +673 -0
  51. sage/algebras/q_system.py +608 -0
  52. sage/algebras/quantum_clifford.py +959 -0
  53. sage/algebras/quantum_groups/ace_quantum_onsager.py +693 -0
  54. sage/algebras/quantum_groups/all.py +9 -0
  55. sage/algebras/quantum_groups/fock_space.py +2219 -0
  56. sage/algebras/quantum_groups/q_numbers.py +207 -0
  57. sage/algebras/quantum_groups/quantum_group_gap.py +2695 -0
  58. sage/algebras/quantum_groups/representations.py +591 -0
  59. sage/algebras/quantum_matrix_coordinate_algebra.py +1006 -0
  60. sage/algebras/quantum_oscillator.py +623 -0
  61. sage/algebras/quaternion_algebra.py +20 -0
  62. sage/algebras/quaternion_algebra_element.py +55 -0
  63. sage/algebras/rational_cherednik_algebra.py +525 -0
  64. sage/algebras/schur_algebra.py +670 -0
  65. sage/algebras/shuffle_algebra.py +1011 -0
  66. sage/algebras/splitting_algebra.py +779 -0
  67. sage/algebras/tensor_algebra.py +709 -0
  68. sage/algebras/yangian.py +1082 -0
  69. sage/algebras/yokonuma_hecke_algebra.py +1018 -0
  70. sage/all__sagemath_combinat.py +35 -0
  71. sage/combinat/SJT.py +255 -0
  72. sage/combinat/affine_permutation.py +2405 -0
  73. sage/combinat/algebraic_combinatorics.py +55 -0
  74. sage/combinat/all.py +53 -0
  75. sage/combinat/all__sagemath_combinat.py +195 -0
  76. sage/combinat/alternating_sign_matrix.py +2063 -0
  77. sage/combinat/baxter_permutations.py +346 -0
  78. sage/combinat/bijectionist.py +3220 -0
  79. sage/combinat/binary_recurrence_sequences.py +1180 -0
  80. sage/combinat/blob_algebra.py +685 -0
  81. sage/combinat/catalog_partitions.py +27 -0
  82. sage/combinat/chas/all.py +23 -0
  83. sage/combinat/chas/fsym.py +1180 -0
  84. sage/combinat/chas/wqsym.py +2601 -0
  85. sage/combinat/cluster_complex.py +326 -0
  86. sage/combinat/colored_permutations.py +2039 -0
  87. sage/combinat/colored_permutations_representations.py +964 -0
  88. sage/combinat/composition_signed.py +142 -0
  89. sage/combinat/composition_tableau.py +855 -0
  90. sage/combinat/constellation.py +1729 -0
  91. sage/combinat/core.py +751 -0
  92. sage/combinat/counting.py +12 -0
  93. sage/combinat/crystals/affine.py +742 -0
  94. sage/combinat/crystals/affine_factorization.py +518 -0
  95. sage/combinat/crystals/affinization.py +331 -0
  96. sage/combinat/crystals/alcove_path.py +2013 -0
  97. sage/combinat/crystals/all.py +22 -0
  98. sage/combinat/crystals/bkk_crystals.py +141 -0
  99. sage/combinat/crystals/catalog.py +115 -0
  100. sage/combinat/crystals/catalog_elementary_crystals.py +18 -0
  101. sage/combinat/crystals/catalog_infinity_crystals.py +33 -0
  102. sage/combinat/crystals/catalog_kirillov_reshetikhin.py +18 -0
  103. sage/combinat/crystals/crystals.py +257 -0
  104. sage/combinat/crystals/direct_sum.py +260 -0
  105. sage/combinat/crystals/elementary_crystals.py +1251 -0
  106. sage/combinat/crystals/fast_crystals.py +441 -0
  107. sage/combinat/crystals/fully_commutative_stable_grothendieck.py +1205 -0
  108. sage/combinat/crystals/generalized_young_walls.py +1076 -0
  109. sage/combinat/crystals/highest_weight_crystals.py +436 -0
  110. sage/combinat/crystals/induced_structure.py +695 -0
  111. sage/combinat/crystals/infinity_crystals.py +730 -0
  112. sage/combinat/crystals/kac_modules.py +863 -0
  113. sage/combinat/crystals/kirillov_reshetikhin.py +4196 -0
  114. sage/combinat/crystals/kyoto_path_model.py +497 -0
  115. sage/combinat/crystals/letters.cpython-314-x86_64-linux-musl.so +0 -0
  116. sage/combinat/crystals/letters.pxd +79 -0
  117. sage/combinat/crystals/letters.pyx +3056 -0
  118. sage/combinat/crystals/littelmann_path.py +1518 -0
  119. sage/combinat/crystals/monomial_crystals.py +1262 -0
  120. sage/combinat/crystals/multisegments.py +462 -0
  121. sage/combinat/crystals/mv_polytopes.py +467 -0
  122. sage/combinat/crystals/pbw_crystal.py +511 -0
  123. sage/combinat/crystals/pbw_datum.cpython-314-x86_64-linux-musl.so +0 -0
  124. sage/combinat/crystals/pbw_datum.pxd +4 -0
  125. sage/combinat/crystals/pbw_datum.pyx +487 -0
  126. sage/combinat/crystals/polyhedral_realization.py +372 -0
  127. sage/combinat/crystals/spins.cpython-314-x86_64-linux-musl.so +0 -0
  128. sage/combinat/crystals/spins.pxd +21 -0
  129. sage/combinat/crystals/spins.pyx +756 -0
  130. sage/combinat/crystals/star_crystal.py +290 -0
  131. sage/combinat/crystals/subcrystal.py +464 -0
  132. sage/combinat/crystals/tensor_product.py +1177 -0
  133. sage/combinat/crystals/tensor_product_element.cpython-314-x86_64-linux-musl.so +0 -0
  134. sage/combinat/crystals/tensor_product_element.pxd +35 -0
  135. sage/combinat/crystals/tensor_product_element.pyx +1870 -0
  136. sage/combinat/crystals/virtual_crystal.py +420 -0
  137. sage/combinat/cyclic_sieving_phenomenon.py +204 -0
  138. sage/combinat/debruijn_sequence.cpython-314-x86_64-linux-musl.so +0 -0
  139. sage/combinat/debruijn_sequence.pyx +355 -0
  140. sage/combinat/decorated_permutation.py +270 -0
  141. sage/combinat/degree_sequences.cpython-314-x86_64-linux-musl.so +0 -0
  142. sage/combinat/degree_sequences.pyx +588 -0
  143. sage/combinat/derangements.py +527 -0
  144. sage/combinat/descent_algebra.py +1008 -0
  145. sage/combinat/diagram.py +1551 -0
  146. sage/combinat/diagram_algebras.py +5886 -0
  147. sage/combinat/dyck_word.py +4349 -0
  148. sage/combinat/e_one_star.py +1623 -0
  149. sage/combinat/enumerated_sets.py +123 -0
  150. sage/combinat/expnums.cpython-314-x86_64-linux-musl.so +0 -0
  151. sage/combinat/expnums.pyx +148 -0
  152. sage/combinat/fast_vector_partitions.cpython-314-x86_64-linux-musl.so +0 -0
  153. sage/combinat/fast_vector_partitions.pyx +346 -0
  154. sage/combinat/fqsym.py +1977 -0
  155. sage/combinat/free_dendriform_algebra.py +954 -0
  156. sage/combinat/free_prelie_algebra.py +1141 -0
  157. sage/combinat/fully_commutative_elements.py +1077 -0
  158. sage/combinat/fully_packed_loop.py +1523 -0
  159. sage/combinat/gelfand_tsetlin_patterns.py +1409 -0
  160. sage/combinat/gray_codes.py +311 -0
  161. sage/combinat/grossman_larson_algebras.py +667 -0
  162. sage/combinat/growth.py +4352 -0
  163. sage/combinat/hall_polynomial.py +188 -0
  164. sage/combinat/hillman_grassl.py +866 -0
  165. sage/combinat/integer_matrices.py +329 -0
  166. sage/combinat/integer_vectors_mod_permgroup.py +1238 -0
  167. sage/combinat/k_tableau.py +4564 -0
  168. sage/combinat/kazhdan_lusztig.py +215 -0
  169. sage/combinat/key_polynomial.py +885 -0
  170. sage/combinat/knutson_tao_puzzles.py +2286 -0
  171. sage/combinat/lr_tableau.py +311 -0
  172. sage/combinat/matrices/all.py +24 -0
  173. sage/combinat/matrices/hadamard_matrix.py +3790 -0
  174. sage/combinat/matrices/latin.py +2912 -0
  175. sage/combinat/misc.py +401 -0
  176. sage/combinat/multiset_partition_into_sets_ordered.py +3541 -0
  177. sage/combinat/ncsf_qsym/all.py +21 -0
  178. sage/combinat/ncsf_qsym/combinatorics.py +317 -0
  179. sage/combinat/ncsf_qsym/generic_basis_code.py +1427 -0
  180. sage/combinat/ncsf_qsym/ncsf.py +5637 -0
  181. sage/combinat/ncsf_qsym/qsym.py +4053 -0
  182. sage/combinat/ncsf_qsym/tutorial.py +447 -0
  183. sage/combinat/ncsym/all.py +21 -0
  184. sage/combinat/ncsym/bases.py +855 -0
  185. sage/combinat/ncsym/dual.py +593 -0
  186. sage/combinat/ncsym/ncsym.py +2076 -0
  187. sage/combinat/necklace.py +551 -0
  188. sage/combinat/non_decreasing_parking_function.py +634 -0
  189. sage/combinat/nu_dyck_word.py +1474 -0
  190. sage/combinat/output.py +861 -0
  191. sage/combinat/parallelogram_polyomino.py +4326 -0
  192. sage/combinat/parking_functions.py +1602 -0
  193. sage/combinat/partition_algebra.py +1998 -0
  194. sage/combinat/partition_kleshchev.py +1982 -0
  195. sage/combinat/partition_shifting_algebras.py +584 -0
  196. sage/combinat/partition_tuple.py +3114 -0
  197. sage/combinat/path_tableaux/all.py +13 -0
  198. sage/combinat/path_tableaux/catalog.py +29 -0
  199. sage/combinat/path_tableaux/dyck_path.py +380 -0
  200. sage/combinat/path_tableaux/frieze.py +476 -0
  201. sage/combinat/path_tableaux/path_tableau.py +728 -0
  202. sage/combinat/path_tableaux/semistandard.py +510 -0
  203. sage/combinat/perfect_matching.py +779 -0
  204. sage/combinat/plane_partition.py +3300 -0
  205. sage/combinat/q_bernoulli.cpython-314-x86_64-linux-musl.so +0 -0
  206. sage/combinat/q_bernoulli.pyx +128 -0
  207. sage/combinat/quickref.py +81 -0
  208. sage/combinat/recognizable_series.py +2051 -0
  209. sage/combinat/regular_sequence.py +4316 -0
  210. sage/combinat/regular_sequence_bounded.py +543 -0
  211. sage/combinat/restricted_growth.py +81 -0
  212. sage/combinat/ribbon.py +20 -0
  213. sage/combinat/ribbon_shaped_tableau.py +489 -0
  214. sage/combinat/ribbon_tableau.py +1180 -0
  215. sage/combinat/rigged_configurations/all.py +46 -0
  216. sage/combinat/rigged_configurations/bij_abstract_class.py +548 -0
  217. sage/combinat/rigged_configurations/bij_infinity.py +370 -0
  218. sage/combinat/rigged_configurations/bij_type_A.py +163 -0
  219. sage/combinat/rigged_configurations/bij_type_A2_dual.py +338 -0
  220. sage/combinat/rigged_configurations/bij_type_A2_even.py +218 -0
  221. sage/combinat/rigged_configurations/bij_type_A2_odd.py +199 -0
  222. sage/combinat/rigged_configurations/bij_type_B.py +900 -0
  223. sage/combinat/rigged_configurations/bij_type_C.py +267 -0
  224. sage/combinat/rigged_configurations/bij_type_D.py +771 -0
  225. sage/combinat/rigged_configurations/bij_type_D_tri.py +392 -0
  226. sage/combinat/rigged_configurations/bij_type_D_twisted.py +576 -0
  227. sage/combinat/rigged_configurations/bij_type_E67.py +402 -0
  228. sage/combinat/rigged_configurations/bijection.py +143 -0
  229. sage/combinat/rigged_configurations/kleber_tree.py +1475 -0
  230. sage/combinat/rigged_configurations/kr_tableaux.py +1898 -0
  231. sage/combinat/rigged_configurations/rc_crystal.py +461 -0
  232. sage/combinat/rigged_configurations/rc_infinity.py +540 -0
  233. sage/combinat/rigged_configurations/rigged_configuration_element.py +2403 -0
  234. sage/combinat/rigged_configurations/rigged_configurations.py +1918 -0
  235. sage/combinat/rigged_configurations/rigged_partition.cpython-314-x86_64-linux-musl.so +0 -0
  236. sage/combinat/rigged_configurations/rigged_partition.pxd +15 -0
  237. sage/combinat/rigged_configurations/rigged_partition.pyx +680 -0
  238. sage/combinat/rigged_configurations/tensor_product_kr_tableaux.py +499 -0
  239. sage/combinat/rigged_configurations/tensor_product_kr_tableaux_element.py +428 -0
  240. sage/combinat/rsk.py +3438 -0
  241. sage/combinat/schubert_polynomial.py +508 -0
  242. sage/combinat/set_partition.py +3318 -0
  243. sage/combinat/set_partition_iterator.cpython-314-x86_64-linux-musl.so +0 -0
  244. sage/combinat/set_partition_iterator.pyx +136 -0
  245. sage/combinat/set_partition_ordered.py +1590 -0
  246. sage/combinat/sf/abreu_nigro.py +346 -0
  247. sage/combinat/sf/all.py +52 -0
  248. sage/combinat/sf/character.py +576 -0
  249. sage/combinat/sf/classical.py +319 -0
  250. sage/combinat/sf/dual.py +996 -0
  251. sage/combinat/sf/elementary.py +549 -0
  252. sage/combinat/sf/hall_littlewood.py +1028 -0
  253. sage/combinat/sf/hecke.py +336 -0
  254. sage/combinat/sf/homogeneous.py +464 -0
  255. sage/combinat/sf/jack.py +1428 -0
  256. sage/combinat/sf/k_dual.py +1458 -0
  257. sage/combinat/sf/kfpoly.py +447 -0
  258. sage/combinat/sf/llt.py +789 -0
  259. sage/combinat/sf/macdonald.py +2019 -0
  260. sage/combinat/sf/monomial.py +525 -0
  261. sage/combinat/sf/multiplicative.py +113 -0
  262. sage/combinat/sf/new_kschur.py +1786 -0
  263. sage/combinat/sf/ns_macdonald.py +964 -0
  264. sage/combinat/sf/orthogonal.py +246 -0
  265. sage/combinat/sf/orthotriang.py +355 -0
  266. sage/combinat/sf/powersum.py +963 -0
  267. sage/combinat/sf/schur.py +880 -0
  268. sage/combinat/sf/sf.py +1653 -0
  269. sage/combinat/sf/sfa.py +7053 -0
  270. sage/combinat/sf/symplectic.py +253 -0
  271. sage/combinat/sf/witt.py +721 -0
  272. sage/combinat/shifted_primed_tableau.py +2735 -0
  273. sage/combinat/shuffle.py +830 -0
  274. sage/combinat/sidon_sets.py +146 -0
  275. sage/combinat/similarity_class_type.py +1721 -0
  276. sage/combinat/sine_gordon.py +618 -0
  277. sage/combinat/six_vertex_model.py +784 -0
  278. sage/combinat/skew_partition.py +2053 -0
  279. sage/combinat/skew_tableau.py +2989 -0
  280. sage/combinat/sloane_functions.py +8935 -0
  281. sage/combinat/specht_module.py +1403 -0
  282. sage/combinat/species/all.py +48 -0
  283. sage/combinat/species/characteristic_species.py +321 -0
  284. sage/combinat/species/composition_species.py +273 -0
  285. sage/combinat/species/cycle_species.py +284 -0
  286. sage/combinat/species/empty_species.py +155 -0
  287. sage/combinat/species/functorial_composition_species.py +148 -0
  288. sage/combinat/species/generating_series.py +673 -0
  289. sage/combinat/species/library.py +148 -0
  290. sage/combinat/species/linear_order_species.py +169 -0
  291. sage/combinat/species/misc.py +83 -0
  292. sage/combinat/species/partition_species.py +290 -0
  293. sage/combinat/species/permutation_species.py +268 -0
  294. sage/combinat/species/product_species.py +423 -0
  295. sage/combinat/species/recursive_species.py +476 -0
  296. sage/combinat/species/set_species.py +192 -0
  297. sage/combinat/species/species.py +820 -0
  298. sage/combinat/species/structure.py +539 -0
  299. sage/combinat/species/subset_species.py +243 -0
  300. sage/combinat/species/sum_species.py +225 -0
  301. sage/combinat/subword.py +564 -0
  302. sage/combinat/subword_complex.py +2122 -0
  303. sage/combinat/subword_complex_c.cpython-314-x86_64-linux-musl.so +0 -0
  304. sage/combinat/subword_complex_c.pyx +119 -0
  305. sage/combinat/super_tableau.py +821 -0
  306. sage/combinat/superpartition.py +1154 -0
  307. sage/combinat/symmetric_group_algebra.py +3774 -0
  308. sage/combinat/symmetric_group_representations.py +1830 -0
  309. sage/combinat/t_sequences.py +877 -0
  310. sage/combinat/tableau.py +9506 -0
  311. sage/combinat/tableau_residues.py +860 -0
  312. sage/combinat/tableau_tuple.py +5353 -0
  313. sage/combinat/tiling.py +2432 -0
  314. sage/combinat/triangles_FHM.py +777 -0
  315. sage/combinat/tutorial.py +1857 -0
  316. sage/combinat/vector_partition.py +337 -0
  317. sage/combinat/words/abstract_word.py +1722 -0
  318. sage/combinat/words/all.py +59 -0
  319. sage/combinat/words/alphabet.py +268 -0
  320. sage/combinat/words/finite_word.py +7201 -0
  321. sage/combinat/words/infinite_word.py +113 -0
  322. sage/combinat/words/lyndon_word.py +652 -0
  323. sage/combinat/words/morphic.py +351 -0
  324. sage/combinat/words/morphism.py +3878 -0
  325. sage/combinat/words/paths.py +2932 -0
  326. sage/combinat/words/shuffle_product.py +278 -0
  327. sage/combinat/words/suffix_trees.py +1873 -0
  328. sage/combinat/words/word.py +769 -0
  329. sage/combinat/words/word_char.cpython-314-x86_64-linux-musl.so +0 -0
  330. sage/combinat/words/word_char.pyx +847 -0
  331. sage/combinat/words/word_datatypes.cpython-314-x86_64-linux-musl.so +0 -0
  332. sage/combinat/words/word_datatypes.pxd +4 -0
  333. sage/combinat/words/word_datatypes.pyx +1067 -0
  334. sage/combinat/words/word_generators.py +2026 -0
  335. sage/combinat/words/word_infinite_datatypes.py +1218 -0
  336. sage/combinat/words/word_options.py +99 -0
  337. sage/combinat/words/words.py +2396 -0
  338. sage/data_structures/all__sagemath_combinat.py +1 -0
  339. sage/databases/all__sagemath_combinat.py +13 -0
  340. sage/databases/findstat.py +4897 -0
  341. sage/databases/oeis.py +2058 -0
  342. sage/databases/sloane.py +393 -0
  343. sage/dynamics/all__sagemath_combinat.py +14 -0
  344. sage/dynamics/cellular_automata/all.py +7 -0
  345. sage/dynamics/cellular_automata/catalog.py +34 -0
  346. sage/dynamics/cellular_automata/elementary.py +612 -0
  347. sage/dynamics/cellular_automata/glca.py +477 -0
  348. sage/dynamics/cellular_automata/solitons.py +1463 -0
  349. sage/dynamics/finite_dynamical_system.py +1249 -0
  350. sage/dynamics/finite_dynamical_system_catalog.py +382 -0
  351. sage/games/all.py +7 -0
  352. sage/games/hexad.py +704 -0
  353. sage/games/quantumino.py +591 -0
  354. sage/games/sudoku.py +889 -0
  355. sage/games/sudoku_backtrack.cpython-314-x86_64-linux-musl.so +0 -0
  356. sage/games/sudoku_backtrack.pyx +189 -0
  357. sage/groups/all__sagemath_combinat.py +1 -0
  358. sage/groups/indexed_free_group.py +489 -0
  359. sage/libs/all__sagemath_combinat.py +6 -0
  360. sage/libs/lrcalc/__init__.py +1 -0
  361. sage/libs/lrcalc/lrcalc.py +525 -0
  362. sage/libs/symmetrica/__init__.py +7 -0
  363. sage/libs/symmetrica/all.py +101 -0
  364. sage/libs/symmetrica/kostka.pxi +168 -0
  365. sage/libs/symmetrica/part.pxi +193 -0
  366. sage/libs/symmetrica/plet.pxi +42 -0
  367. sage/libs/symmetrica/sab.pxi +196 -0
  368. sage/libs/symmetrica/sb.pxi +332 -0
  369. sage/libs/symmetrica/sc.pxi +192 -0
  370. sage/libs/symmetrica/schur.pxi +956 -0
  371. sage/libs/symmetrica/symmetrica.cpython-314-x86_64-linux-musl.so +0 -0
  372. sage/libs/symmetrica/symmetrica.pxi +1172 -0
  373. sage/libs/symmetrica/symmetrica.pyx +39 -0
  374. sage/monoids/all.py +13 -0
  375. sage/monoids/automatic_semigroup.py +1054 -0
  376. sage/monoids/free_abelian_monoid.py +315 -0
  377. sage/monoids/free_abelian_monoid_element.cpython-314-x86_64-linux-musl.so +0 -0
  378. sage/monoids/free_abelian_monoid_element.pxd +16 -0
  379. sage/monoids/free_abelian_monoid_element.pyx +397 -0
  380. sage/monoids/free_monoid.py +335 -0
  381. sage/monoids/free_monoid_element.py +431 -0
  382. sage/monoids/hecke_monoid.py +65 -0
  383. sage/monoids/string_monoid.py +817 -0
  384. sage/monoids/string_monoid_element.py +547 -0
  385. sage/monoids/string_ops.py +143 -0
  386. sage/monoids/trace_monoid.py +972 -0
  387. sage/rings/all__sagemath_combinat.py +2 -0
  388. sage/sat/all.py +4 -0
  389. sage/sat/boolean_polynomials.py +405 -0
  390. sage/sat/converters/__init__.py +6 -0
  391. sage/sat/converters/anf2cnf.py +14 -0
  392. sage/sat/converters/polybori.py +611 -0
  393. sage/sat/solvers/__init__.py +5 -0
  394. sage/sat/solvers/cryptominisat.py +287 -0
  395. sage/sat/solvers/dimacs.py +783 -0
  396. sage/sat/solvers/picosat.py +228 -0
  397. sage/sat/solvers/sat_lp.py +156 -0
  398. sage/sat/solvers/satsolver.cpython-314-x86_64-linux-musl.so +0 -0
  399. sage/sat/solvers/satsolver.pxd +3 -0
  400. sage/sat/solvers/satsolver.pyx +405 -0
@@ -0,0 +1,1796 @@
1
+ # sage_setup: distribution = sagemath-combinat
2
+ # sage.doctest: needs sage.combinat sage.modules
3
+ r"""
4
+ Ariki-Koike Algebras
5
+
6
+ The *Ariki-Koike algebras* were introduced by Ariki and Koike [AK1994]_ as
7
+ a natural generalization of the Iwahori-Hecke algebras of types `A` and `B`
8
+ (see :class:`~sage.algebras.iwahori_hecke_algebra.IwahoriHeckeAlgebra`).
9
+ Soon afterwards, Broué and Malle defined analogues of the Hecke
10
+ algebras for all complex reflection groups
11
+
12
+ Fix nonnegative integers `r` an `n`. The Ariki-Koike algebras are
13
+ deformations of the group algebra of the complex reflection group
14
+ `G(r, 1, n) = \ZZ / r\ZZ \wr \mathfrak{S}_n`. If `R` is a ring containing a
15
+ *Hecke parameter* `q` and *cyclotomic parameters* `u_0, \ldots, u_{r-1}` then
16
+ the Ariki-Koike algebra `H_n(q, u_1, \ldots, u_r)` is the unital associative
17
+ `r`-algebra with generators `T_0, T_1, \ldots, T_{n-1}` an relations:
18
+
19
+ .. MATH::
20
+
21
+ \begin{aligned}
22
+ \prod_{i=0}^{r-1} (T_0 - u_i) & = 0, \\
23
+ T_i^2 & = (q - 1) T_i + q && \text{for } 1 \leq i < n, \\
24
+ T_0 T_1 T_0 T_1 & = T_1 T_0 T_1 T_0, \\
25
+ T_i T_j & = T_j T_i && \text{if } |i - j| \geq 2, \\
26
+ T_i T_{i+1} T_i & = T_{i+1} T_i T_{i+1} && \text{for } 1 \leq i < n.
27
+ \end{aligned}
28
+
29
+ AUTHORS:
30
+
31
+ - Travis Scrimshaw (2016-04): initial version
32
+ - Andrew Mathas (2016-07): improved multiplication code
33
+
34
+ REFERENCES:
35
+
36
+ - [AK1994]_
37
+ - [BM1993]_
38
+ - [MM1998]_
39
+ """
40
+
41
+ #*****************************************************************************
42
+ # Copyright (C) 2016-2018 Travis Scrimshaw <tcscrims at gmail.com>
43
+ # 2016-2018 Andrew Mathas <andrew.mathas at sydney.edu.au>
44
+ #
45
+ # This program is free software: you can redistribute it and/or modify
46
+ # it under the terms of the GNU General Public License as published by
47
+ # the Free Software Foundation, either version 2 of the License, or
48
+ # (at your option) any later version.
49
+ # http://www.gnu.org/licenses/
50
+ #*****************************************************************************
51
+
52
+
53
+ from sage.misc.cachefunc import cached_method
54
+ from sage.misc.lazy_attribute import lazy_attribute
55
+ from sage.misc.misc_c import prod
56
+ from sage.misc.bindable_class import BindableClass
57
+ from sage.structure.parent import Parent
58
+ from sage.structure.unique_representation import UniqueRepresentation
59
+ from sage.categories.algebras import Algebras
60
+ from sage.categories.rings import Rings
61
+ from sage.categories.realizations import Realizations, Category_realization_of_parent
62
+ from sage.categories.cartesian_product import cartesian_product
63
+ from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
64
+ from sage.rings.polynomial.laurent_polynomial_ring import LaurentPolynomialRing
65
+ from sage.rings.integer_ring import ZZ
66
+ from sage.combinat.free_module import CombinatorialFreeModule
67
+ from sage.combinat.permutation import Permutations
68
+ from sage.sets.family import Family
69
+ from sage.data_structures.blas_dict import iaxpy
70
+
71
+ # ABC for basis classes
72
+
73
+
74
+ class _Basis(CombinatorialFreeModule, BindableClass):
75
+ r"""
76
+ Abstract base class for bases of the Ariki-Koike algebra.
77
+ """
78
+ def __init__(self, algebra, prefix='AK'):
79
+ r"""
80
+ Initialize ``self``.
81
+
82
+ EXAMPLES::
83
+
84
+ sage: LT = algebras.ArikiKoike(2, 3).LT()
85
+ sage: TestSuite(LT).run()
86
+ """
87
+ self._r = algebra._r
88
+ self._n = algebra._n
89
+ self._q = algebra._q
90
+ self._u = algebra._u
91
+ # It seems more efficient to copy this as we need it a lot
92
+ self._zero_tuple = tuple([0] * self._n)
93
+ self._Pn = Permutations(self._n)
94
+ self._one_perm = self._Pn.one()
95
+ C = cartesian_product([range(self._r)] * self._n)
96
+ indices = cartesian_product([C, self._Pn])
97
+ CombinatorialFreeModule.__init__(self, algebra.base_ring(), indices,
98
+ prefix=prefix,
99
+ category=algebra._BasesCategory())
100
+
101
+ @cached_method
102
+ def one_basis(self):
103
+ r"""
104
+ Return the index of the basis element of `1`.
105
+
106
+ EXAMPLES::
107
+
108
+ sage: LT = algebras.ArikiKoike(5, 3).LT()
109
+ sage: LT.one_basis()
110
+ ((0, 0, 0), [1, 2, 3])
111
+
112
+ sage: T = algebras.ArikiKoike(5, 3).T()
113
+ sage: T.one_basis()
114
+ ((0, 0, 0), [1, 2, 3])
115
+ """
116
+ return (self._zero_tuple, self._one_perm)
117
+
118
+
119
+ class ArikiKoikeAlgebra(Parent, UniqueRepresentation):
120
+ r"""
121
+ The Ariki-Koike algebra `H_{r,n}(q, u)`.
122
+
123
+ Let `R` be an unital integral domain.
124
+ Let `q, u_0, \ldots, u_{r-1} \in R` such that `q^{-1} \in R`.
125
+ The *Ariki-Koike algebra* is the unital associative algebra
126
+ `H_{r,n}(q, u)` generated by `T_0, \ldots, T_{n-1}` that satisfies
127
+ the following relations:
128
+
129
+ .. MATH::
130
+
131
+ \begin{aligned}
132
+ \prod_{i=0}^{r-1} (T_0 - u_i) & = 0, \\
133
+ T_i^2 & = (q - 1) T_i + q && \text{for } 1 \leq i < n, \\
134
+ T_0 T_1 T_0 T_1 & = T_1 T_0 T_1 T_0, \\
135
+ T_i T_j & = T_j T_i && \text{if } |i - j| \geq 2, \\
136
+ T_i T_{i+1} T_i & = T_{i+1} T_i T_{i+1} && \text{for } 1 \leq i < n.
137
+ \end{aligned}
138
+
139
+ The parameter `q` is called the *Hecke parameter* and the parameters
140
+ `u_0, \ldots, u_{r-1}` are called the *cyclotomic parameters*.
141
+ Thus, the Ariki-Koike algebra is a deformation of the group algebra of the
142
+ complex reflection group `G(r, 1, n) = \ZZ / r\ZZ \wr \mathfrak{S}_n`.
143
+
144
+ Next, we define *Jucys-Murphy elements*
145
+
146
+ .. MATH::
147
+
148
+ L_i = q^{-i+1} T_{i-1} \cdots T_1 T_0 T_1 \cdots T_{i-1}
149
+
150
+ for `1 \leq i \leq n`.
151
+
152
+ .. NOTE::
153
+
154
+ These element differ by a power of `q` from the corresponding
155
+ elements in [AK1994]_. However, these elements are more commonly
156
+ used because they lead to nicer representation theoretic formulas.
157
+
158
+ Ariki and Koike [AK1994]_ showed that `H_{r,n}(q, u)` is a free
159
+ `R`-module with a basis given by
160
+
161
+ .. MATH::
162
+
163
+ \{ L_1^{c_i} \cdots L_n^{c_n} T_w \mid w \in S_n, 0 \leq c_i < r \}.
164
+
165
+ In particular, we have `\dim H_{r,n}(q,u) = r^n n! = |G(r, 1, n)|`.
166
+ Moreover, we have `L_i L_j = L_i L_j` for all `1 \leq i, j \leq n`.
167
+
168
+ The Ariki-Koike algebra `H_{r,n}(q, u)` can be considered as a quotient
169
+ of the group algebra of the braid group for `G(r, 1, n)` by the ideal
170
+ generated by `\prod_{i=0}^{r-1} (T_0 - u_i)` and `(T_i - q)(T_i + 1)`.
171
+ Furthermore, `H_{r,n}(q, u)` can be constructed as a quotient of the
172
+ extended affine Hecke algebra of type `A_{n-1}^{(1)}` by
173
+ `\prod_{i=0}^{r-1} (X_1 - u_i)`.
174
+
175
+ Since the Ariki-Koike algebra is a quotient of the group
176
+ algebra of the braid group of `G(r, 1, n)`, we can recover
177
+ the group algebra of `G(r, 1, n)` as follows. Consider
178
+ `u = (1, \zeta_r, \ldots, \zeta_r^{r-1})`, where `\zeta_r`
179
+ is a primitive `r`-th root of unity, then we have
180
+
181
+ .. MATH::
182
+
183
+ R G(r, 1, n) = H_{r,n}(1, u).
184
+
185
+ INPUT:
186
+
187
+ - ``r`` -- the maximum power of `L_i`
188
+ - ``n`` -- the rank `S_n`
189
+ - ``q`` -- (optional) an invertible element in a commutative ring;
190
+ the default is `q \in R[q,q^{-1}]`, where `R` is the ring containing
191
+ the variables ``u``
192
+ - ``u`` -- (optional) the variables `u_1, \ldots, u_r`; the
193
+ default is the generators of `\ZZ[u_1, \ldots, u_r]`
194
+ - ``R`` -- (optional) a commutative ring containing ``q`` and ``u``;
195
+ the default is the parent of `q` and `u_1, \ldots, u_r`
196
+ - ``use_fraction_field`` -- (default: ``False``) whether to use the
197
+ fraction field or not
198
+
199
+ EXAMPLES:
200
+
201
+ We start by constructing an Ariki-Koike algebra where the
202
+ values `q, u` are generic and do some computations::
203
+
204
+ sage: H = algebras.ArikiKoike(3, 4)
205
+
206
+ Next, we do some computations using the `LT` basis::
207
+
208
+ sage: LT = H.LT()
209
+ sage: LT.inject_variables()
210
+ Defining L1, L2, L3, L4, T1, T2, T3
211
+ sage: T1 * T2 * T1 * T2
212
+ q*T[2,1] - (1-q)*T[2,1,2]
213
+ sage: T1 * L1 * T2 * L3 * T1 * T2
214
+ -(q-q^2)*L2*L3*T[2] + q*L1*L2*T[2,1] - (1-q)*L1*L2*T[2,1,2]
215
+ sage: L1^3
216
+ u0*u1*u2 - ((u0*u1+u0*u2+u1*u2))*L1 + ((u0+u1+u2))*L1^2
217
+ sage: L3 * L2 * L1
218
+ L1*L2*L3
219
+ sage: u = LT.u()
220
+ sage: q = LT.q()
221
+ sage: (q + 2*u[0]) * (T1 * T2) * L3
222
+ -(2*u0+(-2*u0+1)*q-q^2)*L3*T[1] - (2*u0+(-2*u0+1)*q-q^2)*L2*T[2]
223
+ + (2*u0+q)*L1*T[1,2]
224
+
225
+ We check the defining relations::
226
+
227
+ sage: prod(L1 - val for val in u) == H.zero()
228
+ True
229
+ sage: L1 * T1 * L1 * T1 == T1 * L1 * T1 * L1
230
+ True
231
+ sage: T1 * T2 * T1 == T2 * T1 * T2
232
+ True
233
+ sage: T2 * T3 * T2 == T3 * T2 * T3
234
+ True
235
+ sage: L2 == q^-1 * T1 * L1 * T1
236
+ True
237
+ sage: L3 == q^-2 * T2 * T1 * L1 * T1 * T2
238
+ True
239
+
240
+ We construct an Ariki-Koike algebra with `u = (1, \zeta_3, \zeta_3^2)`,
241
+ where `\zeta_3` is a primitive third root of unity::
242
+
243
+ sage: # needs sage.rings.number_field
244
+ sage: F = CyclotomicField(3)
245
+ sage: zeta3 = F.gen()
246
+ sage: R.<q> = LaurentPolynomialRing(F)
247
+ sage: H = algebras.ArikiKoike(3, 4, q=q, u=[1, zeta3, zeta3^2], R=R)
248
+ sage: H.LT().inject_variables()
249
+ Defining L1, L2, L3, L4, T1, T2, T3
250
+ sage: L1^3
251
+ 1
252
+ sage: L2^3
253
+ 1 - (q^-1-1)*T[1] - (q^-1-1)*L1*L2^2*T[1] - (q^-1-1)*L1^2*L2*T[1]
254
+
255
+ Next, we additionally take `q = 1` to obtain the group algebra
256
+ of `G(r, 1, n)`::
257
+
258
+ sage: # needs sage.rings.number_field
259
+ sage: F = CyclotomicField(3)
260
+ sage: zeta3 = F.gen()
261
+ sage: H = algebras.ArikiKoike(3, 4, q=1, u=[1, zeta3, zeta3^2], R=F)
262
+ sage: LT = H.LT()
263
+ sage: LT.inject_variables()
264
+ Defining L1, L2, L3, L4, T1, T2, T3
265
+ sage: A = ColoredPermutations(3, 4).algebra(F)
266
+ sage: s1, s2, s3, s0 = list(A.algebra_generators())
267
+ sage: all(L^3 == LT.one() for L in LT.L())
268
+ True
269
+ sage: J = [s0, s3*s0*s3, s2*s3*s0*s3*s2, s1*s2*s3*s0*s3*s2*s1]
270
+ sage: all(Ji^3 == A.one() for Ji in J)
271
+ True
272
+ """
273
+ @staticmethod
274
+ def __classcall_private__(cls, r, n, q=None, u=None, R=None, use_fraction_field=False):
275
+ r"""
276
+ Standardize input to ensure a unique representation.
277
+
278
+ TESTS::
279
+
280
+ sage: H1 = algebras.ArikiKoike(4, 3)
281
+ sage: S = PolynomialRing(ZZ, 'u', 4)
282
+ sage: R.<q> = LaurentPolynomialRing(S)
283
+ sage: H2 = algebras.ArikiKoike(4, 3, q=q)
284
+ sage: H3 = algebras.ArikiKoike(4, 3, q, S.gens(), R)
285
+ sage: H1 is H2
286
+ True
287
+ sage: H2 is H3
288
+ True
289
+ """
290
+ if u is None:
291
+ if q is not None:
292
+ R = q.parent()
293
+ if R is None:
294
+ R = PolynomialRing(ZZ, 'u', r)
295
+ u = R.gens()
296
+ if q is None:
297
+ R = LaurentPolynomialRing(R, 'q')
298
+ q = R.gen()
299
+ else:
300
+ u = PolynomialRing(ZZ, 'u', r).gens()
301
+ if q is None:
302
+ q = 'q'
303
+ else:
304
+ if not isinstance(u, (list,tuple)):
305
+ u = [u]*r
306
+ if R is None:
307
+ from sage.structure.element import get_coercion_model
308
+ cm = get_coercion_model()
309
+ if q is None:
310
+ R = cm.common_parent(*[val.parent() for val in u])
311
+ R = LaurentPolynomialRing(R, 'q')
312
+ q = R.gen()
313
+ else:
314
+ R = cm.common_parent(q.parent(), *[val.parent() for val in u])
315
+ elif q is None:
316
+ q = 'q'
317
+ if R not in Rings().Commutative():
318
+ raise TypeError("base ring must be a commutative ring")
319
+ if use_fraction_field:
320
+ R = R.fraction_field()
321
+ q = R(q)
322
+ u = tuple([R(val) for val in u])
323
+ return super().__classcall__(cls, r, n, q, u, R)
324
+
325
+ def __init__(self, r, n, q, u, R):
326
+ r"""
327
+ Initialize ``self``.
328
+
329
+ EXAMPLES::
330
+
331
+ sage: H = algebras.ArikiKoike(5, 3)
332
+ sage: TestSuite(H).run()
333
+ sage: H = algebras.ArikiKoike(1, 4)
334
+ sage: TestSuite(H).run()
335
+ sage: H = algebras.ArikiKoike(2, 3)
336
+ sage: TestSuite(H).run()
337
+ sage: H = algebras.ArikiKoike(3, 4)
338
+ sage: TestSuite(H).run() # long time
339
+ """
340
+ self._r = r
341
+ self._n = n
342
+ self._q = q
343
+ self._u = u
344
+ self._category = Algebras(R).FiniteDimensional().WithBasis()
345
+ Parent.__init__(self, base=R, category=self._category.WithRealizations())
346
+
347
+ T = self.T()
348
+ LT = self.LT()
349
+ T.module_morphism(LT._from_T_basis, codomain=LT).register_as_coercion()
350
+ LT.module_morphism(T._from_LT_basis, codomain=T).register_as_coercion()
351
+
352
+ def _repr_(self):
353
+ r"""
354
+ Return a string representation of ``self``.
355
+
356
+ EXAMPLES::
357
+
358
+ sage: algebras.ArikiKoike(5, 2)
359
+ Ariki-Koike algebra of rank 5 and order 2
360
+ with q=q and u=(u0, u1, u2, u3, u4)
361
+ over Univariate Laurent Polynomial Ring in q
362
+ over Multivariate Polynomial Ring in u0, u1, u2, u3, u4
363
+ over Integer Ring
364
+ """
365
+ return "Ariki-Koike algebra of rank {} and order {} with q={} and u={} over {}".format(
366
+ self._r, self._n, self._q, self._u, self.base_ring())
367
+
368
+ def _latex_(self):
369
+ r"""
370
+ Return a latex representation of ``self``.
371
+
372
+ EXAMPLES::
373
+
374
+ sage: H = algebras.ArikiKoike(5, 2)
375
+ sage: latex(H)
376
+ \mathcal{H}_{5,2}(q)
377
+ """
378
+ return "\\mathcal{H}_{%s,%s}(%s)" % (self._r, self._n, self._q)
379
+
380
+ def hecke_parameter(self):
381
+ r"""
382
+ Return the Hecke parameter `q` of ``self``.
383
+
384
+ EXAMPLES::
385
+
386
+ sage: H = algebras.ArikiKoike(5, 3)
387
+ sage: H.hecke_parameter()
388
+ q
389
+ """
390
+ return self._q
391
+
392
+ q = hecke_parameter
393
+
394
+ def cyclotomic_parameters(self):
395
+ r"""
396
+ Return the cyclotomic parameters `u` of ``self``.
397
+
398
+ EXAMPLES::
399
+
400
+ sage: H = algebras.ArikiKoike(5, 3)
401
+ sage: H.cyclotomic_parameters()
402
+ (u0, u1, u2, u3, u4)
403
+ """
404
+ return self._u
405
+
406
+ u = cyclotomic_parameters
407
+
408
+ def a_realization(self):
409
+ r"""
410
+ Return a realization of ``self``.
411
+
412
+ EXAMPLES::
413
+
414
+ sage: H = algebras.ArikiKoike(5, 2)
415
+ sage: H.a_realization()
416
+ Ariki-Koike algebra of rank 5 and order 2
417
+ with q=q and u=(u0, u1, u2, u3, u4) ... in the LT-basis
418
+ """
419
+ return self.LT()
420
+
421
+ def specht_module(self, la):
422
+ r"""
423
+ Return the Specht module of ``self`` corresponding to the shape ``la``.
424
+
425
+ EXAMPLES::
426
+
427
+ sage: AK = algebras.ArikiKoike(4, 6)
428
+ sage: AK.specht_module([[2], [], [1,1,1], [1]])
429
+ Specht module of shape ([2], [], [1, 1, 1], [1]) for
430
+ Ariki-Koike algebra of rank 4 and order 6 with q=q and u=(u0, u1, u2, u3)
431
+ over ... over Integer Ring
432
+ """
433
+ from sage.algebras.hecke_algebras.ariki_koike_specht_modules import SpechtModule
434
+ return SpechtModule(self, la)
435
+
436
+ class _BasesCategory(Category_realization_of_parent):
437
+ r"""
438
+ The category of bases of a Ariki-Koike algebra.
439
+ """
440
+ def __init__(self, base):
441
+ r"""
442
+ Initialize ``self``.
443
+
444
+ INPUT:
445
+
446
+ - ``base`` -- a Ariki-Koike algebra
447
+
448
+ TESTS::
449
+
450
+ sage: H = algebras.ArikiKoike(5, 2)
451
+ sage: bases = H._BasesCategory()
452
+ sage: H.T() in bases
453
+ True
454
+ """
455
+ Category_realization_of_parent.__init__(self, base)
456
+
457
+ def super_categories(self):
458
+ r"""
459
+ The super categories of ``self``.
460
+
461
+ EXAMPLES::
462
+
463
+ sage: H = algebras.ArikiKoike(5, 2)
464
+ sage: bases = H._BasesCategory()
465
+ sage: bases.super_categories()
466
+ [Category of realizations of Ariki-Koike algebra of rank 5 and order 2
467
+ with q=q and u=(u0, u1, u2, u3, u4) over ...,
468
+ Category of finite dimensional algebras with basis over ...]
469
+ """
470
+ return [Realizations(self.base()), self.base()._category]
471
+
472
+ def _repr_(self):
473
+ r"""
474
+ Return the representation of ``self``.
475
+
476
+ EXAMPLES::
477
+
478
+ sage: H = algebras.ArikiKoike(5, 2)
479
+ sage: H._BasesCategory()
480
+ Category of bases of Ariki-Koike algebra of rank 5 and order 2
481
+ with q=q and u=(u0, u1, u2, u3, u4) over ...
482
+ """
483
+ return "Category of bases of %s" % self.base()
484
+
485
+ class ParentMethods:
486
+ r"""
487
+ This class collects code common to all the various bases. In most
488
+ cases, these are just default implementations that will get
489
+ specialized in a basis.
490
+ """
491
+ def _repr_(self):
492
+ r"""
493
+ Text representation of this basis of Iwahori-Hecke algebra.
494
+
495
+ EXAMPLES::
496
+
497
+ sage: H = algebras.ArikiKoike(5, 2)
498
+ sage: H.T()
499
+ Ariki-Koike algebra of rank 5 and order 2
500
+ with q=q and u=(u0, u1, u2, u3, u4) ... in the T-basis
501
+ sage: H.LT()
502
+ Ariki-Koike algebra of rank 5 and order 2
503
+ with q=q and u=(u0, u1, u2, u3, u4) ... in the LT-basis
504
+ """
505
+ return "%s in the %s-basis" % (self.realization_of(), self._realization_name())
506
+
507
+ def hecke_parameter(self):
508
+ r"""
509
+ Return the Hecke parameter `q` of ``self``.
510
+
511
+ EXAMPLES::
512
+
513
+ sage: LT = algebras.ArikiKoike(5, 3).LT()
514
+ sage: LT.hecke_parameter()
515
+ q
516
+ """
517
+ return self._q
518
+
519
+ q = hecke_parameter
520
+
521
+ def cyclotomic_parameters(self):
522
+ r"""
523
+ Return the cyclotomic parameters `u` of ``self``.
524
+
525
+ EXAMPLES::
526
+
527
+ sage: LT = algebras.ArikiKoike(5, 3).LT()
528
+ sage: LT.cyclotomic_parameters()
529
+ (u0, u1, u2, u3, u4)
530
+ """
531
+ return self._u
532
+
533
+ u = cyclotomic_parameters
534
+
535
+ @cached_method
536
+ def gens(self) -> tuple:
537
+ r"""
538
+ Return the generators of ``self``.
539
+
540
+ EXAMPLES::
541
+
542
+ sage: LT = algebras.ArikiKoike(5, 3).LT()
543
+ sage: LT.gens()
544
+ (L1, L2, L3, T[1], T[2])
545
+ """
546
+ return tuple(self.algebra_generators())
547
+
548
+ def dimension(self):
549
+ r"""
550
+ Return the dimension of ``self``.
551
+
552
+ The dimension of `H_{r,n}(q, u)` is `r^n n!`.
553
+
554
+ EXAMPLES::
555
+
556
+ sage: LT = algebras.ArikiKoike(8, 3).LT()
557
+ sage: LT.dimension()
558
+ 3072
559
+ sage: LT = algebras.ArikiKoike(6, 3).LT()
560
+ sage: LT.dimension()
561
+ 1296
562
+ sage: LT = algebras.ArikiKoike(3, 5).LT()
563
+ sage: LT.dimension()
564
+ 29160
565
+ """
566
+ from sage.arith.misc import factorial
567
+ return self._r**self._n * factorial(self._n)
568
+
569
+ def some_elements(self):
570
+ r"""
571
+ Return a list of elements of ``self``.
572
+
573
+ EXAMPLES::
574
+
575
+ sage: LT = algebras.ArikiKoike(4, 3).LT()
576
+ sage: LT.some_elements()
577
+ [1 + 2*T[2] + 3*T[1] + T[2,1],
578
+ L1, L2, L3, T[1], T[2], L1^2, L2^2]
579
+ """
580
+ G = self.algebra_generators()
581
+ elts = [self.an_element()] + list(G)
582
+ elts += [self.L(1)**2]
583
+ if self._n > 1:
584
+ elts += [self.L(2)**(self._r//2)]
585
+ return elts
586
+
587
+ def specht_module(self, la):
588
+ r"""
589
+ Return the Specht module of ``self`` corresponding
590
+ to the shape ``la``.
591
+
592
+ EXAMPLES::
593
+
594
+ sage: AK = algebras.ArikiKoike(4, 3)
595
+ sage: LT = AK.LT()
596
+ sage: S1 = LT.specht_module([[1], [], [1,1], []])
597
+ sage: T = AK.T()
598
+ sage: S2 = T.specht_module([[1], [], [1,1], []])
599
+ sage: S1 is S2
600
+ True
601
+ """
602
+ from sage.algebras.hecke_algebras.ariki_koike_specht_modules import SpechtModule
603
+ return SpechtModule(self.realization_of(), la)
604
+
605
+ # -----------------------------------------------------
606
+ # Basis classes
607
+ # -----------------------------------------------------
608
+
609
+ class LT(_Basis):
610
+ r"""
611
+ The basis of the Ariki-Koike algebra given by monomials of the
612
+ form `L T`, where `L` is product of Jucys-Murphy elements and
613
+ `T` is a product of `\{ T_i | 0 < i < n \}`.
614
+
615
+ This was the basis defined in [AK1994]_ except using the
616
+ renormalized Jucys-Murphy elements.
617
+ """
618
+ def __init__(self, algebra):
619
+ r"""
620
+ Initialize ``self``.
621
+
622
+ EXAMPLES::
623
+
624
+ sage: LT = algebras.ArikiKoike(5, 3).LT()
625
+ sage: TestSuite(LT).run()
626
+ sage: LT = algebras.ArikiKoike(1, 4).LT()
627
+ sage: TestSuite(LT).run()
628
+ sage: LT = algebras.ArikiKoike(2, 3).LT()
629
+ sage: TestSuite(LT).run()
630
+ sage: LT = algebras.ArikiKoike(3, 4).LT()
631
+ sage: TestSuite(LT).run() # long time
632
+ """
633
+ _Basis.__init__(self, algebra, prefix='LT')
634
+ self._assign_names(self.algebra_generators().keys())
635
+
636
+ def _repr_term(self, m):
637
+ r"""
638
+ Return a string representation of the basis element indexed by ``m``.
639
+
640
+ EXAMPLES::
641
+
642
+ sage: LT = algebras.ArikiKoike(4, 3).LT()
643
+ sage: LT._repr_term( ((1, 0, 2), Permutation([3,2,1])) )
644
+ 'L1*L3^2*T[2,1,2]'
645
+ """
646
+ gen_str = lambda e: '' if e == 1 else '^%s' % e
647
+ lhs = '*'.join('L%s' % (j+1) + gen_str(i)
648
+ for j,i in enumerate(m[0]) if i > 0)
649
+ redword = m[1].reduced_word()
650
+ if not redword:
651
+ if not lhs:
652
+ return '1'
653
+ return lhs
654
+ rhs = 'T[{}]'.format(','.join(str(i) for i in redword))
655
+ if not lhs:
656
+ return rhs
657
+ return lhs + '*' + rhs
658
+
659
+ def _latex_term(self, m):
660
+ r"""
661
+ Return a latex representation for the basis element indexed by ``m``.
662
+
663
+ EXAMPLES::
664
+
665
+ sage: LT = algebras.ArikiKoike(4, 3).LT()
666
+ sage: LT._latex_term( ((1, 0, 2), Permutation([3,2,1])) )
667
+ 'L_{1} L_{3}^{2} T_{2} T_{1} T_{2}'
668
+ """
669
+ gen_str = lambda e: '' if e == 1 else '^{%s}' % e
670
+ lhs = ' '.join('L_{%s}' % (j+1) + gen_str(i)
671
+ for j,i in enumerate(m[0]) if i > 0)
672
+ redword = m[1].reduced_word()
673
+ if not redword:
674
+ if not lhs:
675
+ return '1'
676
+ return lhs
677
+ return lhs + ' ' + ' '.join("T_{%d}" % i for i in redword)
678
+
679
+ def _from_T_basis(self, t):
680
+ r"""
681
+ Return the image of the `T` basis element indexed
682
+ by ``t`` in ``self``.
683
+
684
+ EXAMPLES::
685
+
686
+ sage: H = algebras.ArikiKoike(3, 3)
687
+ sage: LT = H.LT()
688
+ sage: T = H.T()
689
+ sage: all(LT(Li) == LT.L(i+1) for i,Li in enumerate(T.L()))
690
+ True
691
+ sage: all(LT(Ti) == LT.T(i) for i,Ti in enumerate(T.T()))
692
+ True
693
+ sage: all(LT(T(b)) == b for b in LT.basis()) # long time
694
+ True
695
+
696
+ sage: H = algebras.ArikiKoike(1, 3)
697
+ sage: LT = H.LT()
698
+ sage: T = H.T()
699
+ sage: all(LT(Li) == LT.L(i+1) for i,Li in enumerate(T.L()))
700
+ True
701
+ sage: all(LT(T(b)) == b for b in LT.basis()) # indirect doctest
702
+ True
703
+ """
704
+ # Compute the corresponding reduced word for the first part
705
+ ret = self.one()
706
+ T = list(self._zero_tuple)
707
+ one = self.base_ring().one()
708
+ for i,k in enumerate(t[0]):
709
+ if k == 0:
710
+ continue
711
+ perm = self._Pn.prod(self._Pn.simple_reflection(j)
712
+ for j in range(1,i+1))
713
+ ret = ret * self._from_dict({(self._zero_tuple, perm): one},
714
+ remove_zeros=False, coerce=False)
715
+ T[0] = k
716
+ ret = ret * self._from_dict({(tuple(T), self._one_perm): one},
717
+ remove_zeros=False, coerce=False)
718
+
719
+ return ret * self._from_dict({(self._zero_tuple, t[1]): one},
720
+ remove_zeros=False, coerce=False)
721
+
722
+ @cached_method
723
+ def algebra_generators(self):
724
+ r"""
725
+ Return the algebra generators of ``self``.
726
+
727
+ EXAMPLES::
728
+
729
+ sage: LT = algebras.ArikiKoike(5, 3).LT()
730
+ sage: dict(LT.algebra_generators())
731
+ {'L1': L1, 'L2': L2, 'L3': L3, 'T1': T[1], 'T2': T[2]}
732
+
733
+ sage: LT = algebras.ArikiKoike(1, 4).LT()
734
+ sage: dict(LT.algebra_generators())
735
+ {'T1': T[1], 'T2': T[2], 'T3': T[3]}
736
+ """
737
+ d = {}
738
+ if self._r != 1:
739
+ for i in range(self._n):
740
+ r = list(self._zero_tuple) # Make a copy
741
+ r[i] = 1
742
+ d['L%s' % (i+1)] = self.monomial((tuple(r), self._one_perm))
743
+ G = self._Pn.group_generators()
744
+ for i in range(1, self._n):
745
+ d['T%s' % i] = self.monomial((self._zero_tuple, G[i]))
746
+ return Family(sorted(d), lambda i: d[i])
747
+
748
+ def T(self, i=None):
749
+ r"""
750
+ Return the generator(s) `T_i` of ``self``.
751
+
752
+ INPUT:
753
+
754
+ - ``i`` -- (default: ``None``) the generator `T_i` or
755
+ if ``None``, then the list of all generators `T_i`
756
+
757
+ EXAMPLES::
758
+
759
+ sage: LT = algebras.ArikiKoike(8, 3).LT()
760
+ sage: LT.T(1)
761
+ T[1]
762
+ sage: LT.T()
763
+ [L1, T[1], T[2]]
764
+ sage: LT.T(0)
765
+ L1
766
+ """
767
+ G = self.algebra_generators()
768
+ if i is None:
769
+ return [G['L1']] + [G['T%s' % j] for j in range(1, self._n)]
770
+ if i == 0:
771
+ return G['L1']
772
+ return G['T%s' % i]
773
+
774
+ def L(self, i=None):
775
+ r"""
776
+ Return the generator(s) `L_i`.
777
+
778
+ INPUT:
779
+
780
+ - ``i`` -- (default: ``None``) the generator `L_i` or
781
+ if ``None``, then the list of all generators `L_i`
782
+
783
+ EXAMPLES::
784
+
785
+ sage: LT = algebras.ArikiKoike(8, 3).LT()
786
+ sage: LT.L(2)
787
+ L2
788
+ sage: LT.L()
789
+ [L1, L2, L3]
790
+
791
+ sage: LT = algebras.ArikiKoike(1, 3).LT()
792
+ sage: LT.L(2)
793
+ u - (u*q^-1-u)*T[1]
794
+ sage: LT.L()
795
+ [u,
796
+ u - (u*q^-1-u)*T[1],
797
+ u - (u*q^-1-u)*T[2] - (u*q^-2-u*q^-1)*T[2,1,2]]
798
+ """
799
+ G = self.algebra_generators()
800
+ if i is None:
801
+ if self._r == 1:
802
+ return [self._Li_power(j, 1) for j in range(1, self._n+1)]
803
+ return [G['L%s' % j] for j in range(1, self._n+1)]
804
+ if self._r == 1:
805
+ return self._Li_power(i, 1)
806
+ return G['L%s' % i]
807
+
808
+ @cached_method
809
+ def product_on_basis(self, m1, m2):
810
+ r"""
811
+ Return the product of the basis elements indexed
812
+ by ``m1`` and ``m2``.
813
+
814
+ EXAMPLES::
815
+
816
+ sage: LT = algebras.ArikiKoike(6, 3).LT()
817
+ sage: m = ((1, 0, 2), Permutations(3)([2,1,3]))
818
+ sage: LT.product_on_basis(m, m)
819
+ q*L1*L2*L3^4
820
+
821
+ sage: LT = algebras.ArikiKoike(4, 3).LT()
822
+ sage: L1,L2,L3,T1,T2 = LT.algebra_generators()
823
+ sage: L1 * T1 * L1^2 * T1
824
+ q*L1*L2^2 + (1-q)*L1^2*L2*T[1]
825
+ sage: L1^2 * T1 * L1^2 * T1
826
+ q*L1^2*L2^2 + (1-q)*L1^3*L2*T[1]
827
+ sage: L1^3 * T1 * L1^2 * T1
828
+ -(u0*u1*u2*u3-u0*u1*u2*u3*q)*L2*T[1]
829
+ + ((u0*u1*u2+u0*u1*u3+u0*u2*u3+u1*u2*u3)+(-u0*u1*u2-u0*u1*u3-u0*u2*u3-u1*u2*u3)*q)*L1*L2*T[1]
830
+ - ((u0*u1+u0*u2+u1*u2+u0*u3+u1*u3+u2*u3)+(-u0*u1-u0*u2-u1*u2-u0*u3-u1*u3-u2*u3)*q)*L1^2*L2*T[1]
831
+ + ((u0+u1+u2+u3)+(-u0-u1-u2-u3)*q)*L1^3*L2*T[1] + q*L1^3*L2^2
832
+
833
+ sage: L1^2 * T1 * L1^3 * T1
834
+ -(u0*u1*u2*u3-u0*u1*u2*u3*q)*L2*T[1]
835
+ + ((u0*u1*u2+u0*u1*u3+u0*u2*u3+u1*u2*u3)+(-u0*u1*u2-u0*u1*u3-u0*u2*u3-u1*u2*u3)*q)*L1*L2*T[1]
836
+ - ((u0*u1+u0*u2+u1*u2+u0*u3+u1*u3+u2*u3)+(-u0*u1-u0*u2-u1*u2-u0*u3-u1*u3-u2*u3)*q)*L1^2*L2*T[1]
837
+ + q*L1^2*L2^3
838
+ + ((u0+u1+u2+u3)+(-u0-u1-u2-u3)*q)*L1^3*L2*T[1]
839
+ + (1-q)*L1^3*L2^2*T[1]
840
+
841
+ sage: L1^2 * T1*T2*T1 * L2 * L3 * T2
842
+ (q-2*q^2+q^3)*L1^2*L2*L3 - (1-2*q+2*q^2-q^3)*L1^2*L2*L3*T[2]
843
+ - (q-q^2)*L1^3*L3*T[1] + (1-2*q+q^2)*L1^3*L3*T[1,2]
844
+ + q*L1^3*L2*T[2,1] - (1-q)*L1^3*L2*T[2,1,2]
845
+
846
+ sage: LT = algebras.ArikiKoike(2, 3).LT()
847
+ sage: L3 = LT.L(3)
848
+ sage: x = LT.an_element()
849
+ sage: (x * L3) * L3 == x * (L3 * L3)
850
+ True
851
+ """
852
+ # Although it is tempting to make this recursive, some care must be
853
+ # taken here to ensure that the various "helper" methods return
854
+ # linear combinations of "standard" basis elements of the form
855
+ # (L,w), where L is an n-tuple and w is a permutation because
856
+ # otherwise we may end up in an infinite loop...
857
+
858
+ # Product is of the form L1*T1*L2*T2: separate the L's and permutations
859
+ L1,T1 = m1
860
+ L2,T2 = m2
861
+
862
+ if sum(L2) == 0:
863
+ # Compute and return the product of T1 and T2, whilst fixing L
864
+ return self._from_dict(self._product_LTwTv(L1, T1, T2),
865
+ remove_zeros=False, coerce=False)
866
+
867
+ # If T1 is trivial then we just have L1*L2*T2 we only need to rewrite
868
+ # all of the "large" powers that appear in L1*L2. Unfortunately, this
869
+ # will almost certainly introduce more T_w's and it will be recursive
870
+ # because L_n^r, for example, will introduce many powers of L_k for k<n.
871
+ if T1 == self._one_perm:
872
+ Lbig = list(self._zero_tuple) # separate the "big" and small
873
+ Lsmall = list(self._zero_tuple) # powers of the Lk's
874
+ for i in range(self._n):
875
+ s = L1[i] + L2[i]
876
+ if s < self._r:
877
+ Lsmall[i] = s
878
+ else:
879
+ Lbig[i] = s
880
+ if tuple(Lbig) == self._zero_tuple:
881
+ # if no big powers we only need to combine Lsmall and T2
882
+ return self.monomial((tuple(Lsmall), T2))
883
+
884
+ # The l variables all commute, so we can multiply them in any order
885
+ # that we like. For improved efficiency, however, we move the Ls to
886
+ # the left as soon as we can. For efficiency, we multiply the
887
+ # "big" powers in the order L_n^N L_{n-1}^N...L_1^N as this
888
+ # way we have to expand few powers the of the Lk's later.
889
+ return (self.monomial((tuple(Lsmall), self._one_perm))
890
+ * prod(self._Li_power(i+1, Lbig[i])
891
+ for i in reversed(range(self._n)) if Lbig[i] > 0)
892
+ * self.monomial((self._zero_tuple, T2))
893
+ )
894
+
895
+ # If we are still here then both T1 and L2 are non-trivial. Using the
896
+ # method _product_Tw_L we expand the product T1*L2 as a linear
897
+ # combination of standard basis elements using the method and then,
898
+ # recursively, multiply on the left and right by L1 and T2,
899
+ # respectively. In other words, we multiply as L1*(T1*L2)*T2.
900
+ return (self.monomial((L1, self._one_perm))
901
+ * self._product_Tw_L(T1, L2)
902
+ * self.monomial((self._zero_tuple, T2)))
903
+
904
+ def _product_LTwTv(self, L, w, v):
905
+ r"""
906
+ Return the product `L * T_w * Tv` as a linear combinations of
907
+ terms of the form `L*T_x`.
908
+
909
+ The main point of this method is that it computes the product
910
+ `L T_w T_v` and returns it as a linear combination of standard
911
+ basis elements. That is, terms of the form `L T_x`. The monomial
912
+ ``L`` does not play a role in this calculation and, instead, it
913
+ is kept as a place holder for this "L-component" of the product.
914
+
915
+ For this calculation the most important point is that
916
+
917
+ .. MATH::
918
+
919
+ T_i T_v = \begin{cases}
920
+ T_{s_i v}, & \text{if } \ell(s_iv) > \ell(v),\\
921
+ q T_{s_i v} + (q-1)T_v, & \text{if } \ell(s_iv) < \ell(v).
922
+ \end{cases}
923
+
924
+ This observation is used to rewrite the product `L T_w T_v`
925
+ as a linear combination of standard basis elements.
926
+
927
+ .. WARNING::
928
+
929
+ This method is not intended to be called directly and, instead,
930
+ is used by :meth:`product_on_basis`.
931
+
932
+ INPUT:
933
+
934
+ - ``L`` -- an `n`-tuple
935
+ - ``w`` -- the permutation ``w``
936
+ - ``v`` -- the permutation ``v``
937
+
938
+ OUTPUT: the corresponding element represented as a ``dict``
939
+
940
+ EXAMPLES::
941
+
942
+ sage: H = algebras.ArikiKoike(5, 4).LT()
943
+ sage: P4 = Permutations(4)
944
+ sage: H._from_dict( H._product_LTwTv((0, 3, 2, 4), P4([1,3,2,4]), P4([1,3,2,4])) )
945
+ q*L2^3*L3^2*L4^4 - (1-q)*L2^3*L3^2*L4^4*T[2]
946
+ sage: H._from_dict( H._product_LTwTv((0, 3, 2, 4), P4([1,3,2,4]), P4([1,3,4,2])) )
947
+ q*L2^3*L3^2*L4^4*T[3] - (1-q)*L2^3*L3^2*L4^4*T[2,3]
948
+ sage: H._from_dict( H._product_LTwTv((0, 3, 2, 4), P4([1,4,3,2]), P4([1,4,3,2])) )
949
+ q^3*L2^3*L3^2*L4^4 - (q^2-q^3)*L2^3*L3^2*L4^4*T[3]
950
+ - (q^2-q^3)*L2^3*L3^2*L4^4*T[2]
951
+ + (q-2*q^2+q^3)*L2^3*L3^2*L4^4*T[2,3]
952
+ + (q-2*q^2+q^3)*L2^3*L3^2*L4^4*T[3,2]
953
+ - (1-2*q+2*q^2-q^3)*L2^3*L3^2*L4^4*T[3,2,3]
954
+ """
955
+ ret = {v: self.base_ring().one()}
956
+ qm1 = self._q - self.base_ring().one()
957
+ for i in reversed(w.reduced_word()):
958
+ temp = {} # start from 0
959
+ for p, c in ret.items():
960
+ # We have to flip the side due to Sage's
961
+ # convention for multiplying permutations
962
+ pi = p.apply_simple_reflection(i, side='left')
963
+ if p.has_descent(i, side='left'):
964
+ iaxpy(1, {p: c * qm1, pi: c * self._q}, temp)
965
+ else:
966
+ iaxpy(1, {pi: c}, temp)
967
+ ret = temp
968
+ return {(L, p): c for p, c in ret.items()}
969
+
970
+ def _product_Tw_L(self, w, L):
971
+ r"""
972
+ Given a permutation ``w`` and a monomial ``L`` return the product
973
+ `T_w L` as a linear combination of terms of the form `L_v T_v`.
974
+
975
+ To do this we write `w = s_{i_1} \cdots s_{i_k}` and then push each
976
+ `T_{i_a}` past `L` using Lemma 3.2 of [MM1998]_ (cf. Lemma 3.3 and
977
+ Proposition 3.4 of [AK1994]_), which says
978
+
979
+ .. MATH::
980
+
981
+ T_i L_i^a L_{i+1}^b = L_i^b L_{i+1}^a T_i + \begin{cases}
982
+ (1-q) sum_{k=0}^{a-1} L_i^{a+k} L_{i+1}^{b-k}, &\text{if } a \leq b,\\
983
+ (q-1) sum_{k=0}^{b-1} L_i^{b+k} L_{i+1}^{a-k}, &\text{if } a \geq b.
984
+ \end{cases}
985
+
986
+ Of course, `T_i` commutes with `L_k`, for `k \neq i,i+1`.
987
+
988
+ This method is not intended to be called directly and, instead,
989
+ is used by :meth:`product_on_basis`.
990
+
991
+ INPUT:
992
+
993
+ - ``w`` -- a permutation
994
+ - ``L`` -- tuple `(a_1, \ldots, a_n)`
995
+
996
+ EXAMPLES::
997
+
998
+ sage: H = algebras.ArikiKoike(5, 4).LT()
999
+ sage: P4 = Permutations(4)
1000
+ sage: H._product_Tw_L(P4([1,3,2,4]), (0,2,2,0))
1001
+ L2^2*L3^2*T[2]
1002
+ sage: H._product_Tw_L(P4([1,3,2,4]), (0,1,3,0))
1003
+ -(1-q)*L2*L3^3 - (1-q)*L2^2*L3^2 + L2^3*L3*T[2]
1004
+ sage: H._product_Tw_L(P4([1,3,2,4]), (0,3,1,0))
1005
+ (1-q)*L2*L3^3 + L2*L3^3*T[2] + (1-q)*L2^2*L3^2
1006
+ sage: H._product_Tw_L(P4([1,3,2,4]), (2,3,1,3))
1007
+ (1-q)*L1^2*L2*L3^3*L4^3 + L1^2*L2*L3^3*L4^3*T[2] + (1-q)*L1^2*L2^2*L3^2*L4^3
1008
+ """
1009
+ # initialize wL to L: this is what we will eventually return
1010
+ wL = {(L, self._one_perm): self.base_ring().one()}
1011
+ q = self._q
1012
+ one = q.parent().one()
1013
+ for i in w.reduced_word()[::-1]:
1014
+ iL = {} # this will become T_i * L, written in standard form
1015
+ for lv, c in wL.items():
1016
+ L = list(lv[0]) # make a copy
1017
+ v = lv[1]
1018
+ a, b = L[i-1], L[i]
1019
+ L[i-1], L[i] = L[i], L[i-1] # swap L_i=L[i-1] and L_{i+1}=L[i]
1020
+ # the term L_1^{a_1} ... L_i^{a_{i+1}} L_{i+1}^{a_i} ... L_n^{a_n} T_i T_v
1021
+ # always appears
1022
+ iaxpy(c, self._product_LTwTv(tuple(L), self._Pn.simple_reflections()[i], v), iL) # need T_i*T_v
1023
+
1024
+ if a < b:
1025
+ Ls = [list(L) for k in range(b-a)] # make copies of L
1026
+ for k in range(b-a):
1027
+ Ls[k][i-1] = a + k
1028
+ Ls[k][i] = b - k
1029
+ c *= (q - one)
1030
+ iaxpy(1, {(tuple(l), v): c for l in Ls}, iL)
1031
+
1032
+ elif a > b:
1033
+ Ls = [list(L) for k in range(a-b)] # make copies of L
1034
+ for k in range(a-b):
1035
+ Ls[k][i-1] = b + k
1036
+ Ls[k][i] = a - k
1037
+ c *= (one - q)
1038
+ iaxpy(1, {(tuple(l), v): c for l in Ls}, iL)
1039
+
1040
+ wL = iL # replace wL with iL and repeat
1041
+ return self._from_dict(wL, remove_zeros=False, coerce=False)
1042
+
1043
+ @cached_method
1044
+ def _Li_power(self, i, m):
1045
+ r"""
1046
+ Return `L_i^m`, where `m \geq 0`.
1047
+
1048
+ To compute `L_i^m` we use Corollary 3.4 of [MM1998]_ which says that
1049
+
1050
+ .. MATH::
1051
+
1052
+ L_i^m = q^{-1} T_{i-1} L_{i-1}^m T_{i-1}
1053
+ + (1 - q^{-1}) \sum_{c=1}^{m-1} L_i^c L_{i-1}^{m-c} T_{i-1}.
1054
+
1055
+ .. WARNING::
1056
+
1057
+ This function is used internally by the multiplication and
1058
+ may return elements that are not in the basis. However
1059
+ these will be eventually resolved after the product has
1060
+ been computed. ::
1061
+
1062
+ sage: H = algebras.ArikiKoike(3, 2).LT()
1063
+ sage: L2 = H.L(2)
1064
+ sage: H._Li_power(2, 4)
1065
+ ((u0^2*u1*u2+u0*u1^2*u2+u0*u1*u2^2)) ...
1066
+ - (q^-1-1)*L1*L2^3*T[1] ...
1067
+ - (q^-1-1)*L1^3*L2*T[1]
1068
+ sage: H._Li_power(2, 4) == L2^4
1069
+ False
1070
+ sage: L2 * H._Li_power(2, 4) == L2^5
1071
+ True
1072
+
1073
+ EXAMPLES::
1074
+
1075
+ sage: H = algebras.ArikiKoike(3, 3).LT()
1076
+ sage: for i in range(1,4):
1077
+ ....: for m in range(4):
1078
+ ....: print('L_{}^{} = {}'.format(i,m,H._Li_power(i,m)))
1079
+ L_1^0 = 1
1080
+ L_1^1 = L1
1081
+ L_1^2 = L1^2
1082
+ L_1^3 = u0*u1*u2 - ((u0*u1+u0*u2+u1*u2))*L1 + ((u0+u1+u2))*L1^2
1083
+ L_2^0 = 1
1084
+ L_2^1 = L2
1085
+ L_2^2 = L2^2
1086
+ L_2^3 = u0*u1*u2 - (u0*u1*u2*q^-1-u0*u1*u2)*T[1]
1087
+ - ((u0*u1+u0*u2+u1*u2))*L2 + ((u0+u1+u2))*L2^2
1088
+ + ((u0+u1+u2)*q^-1+(-u0-u1-u2))*L1*L2*T[1]
1089
+ - (q^-1-1)*L1*L2^2*T[1] - (q^-1-1)*L1^2*L2*T[1]
1090
+ L_3^0 = 1
1091
+ L_3^1 = L3
1092
+ L_3^2 = L3^2
1093
+ L_3^3 = u0*u1*u2 - (u0*u1*u2*q^-1-u0*u1*u2)*T[2]
1094
+ - (u0*u1*u2*q^-2-u0*u1*u2*q^-1)*T[2,1,2]
1095
+ - ((u0*u1+u0*u2+u1*u2))*L3 + ((u0+u1+u2))*L3^2
1096
+ + ((u0+u1+u2)*q^-1+(-u0-u1-u2))*L2*L3*T[2]
1097
+ - (q^-1-1)*L2*L3^2*T[2] - (q^-1-1)*L2^2*L3*T[2]
1098
+ + ((u0+u1+u2)*q^-2+(-2*u0-2*u1-2*u2)*q^-1+(u0+u1+u2))*L1*L3*T[1,2]
1099
+ + ((u0+u1+u2)*q^-2+(-u0-u1-u2)*q^-1)*L1*L3*T[2,1,2]
1100
+ - (q^-2-2*q^-1+1)*L1*L3^2*T[1,2] - (q^-2-q^-1)*L1*L3^2*T[2,1,2]
1101
+ - (q^-2-2*q^-1+1)*L1*L2*L3*T[1,2] - (q^-2-2*q^-1+1)*L1^2*L3*T[1,2]
1102
+ - (q^-2-q^-1)*L1^2*L3*T[2,1,2]
1103
+ """
1104
+ # shorthand for returning a tuple of the form (0,...,a,b,...,0) with a,b
1105
+ # in the (i-1)th and i-th positions, respectively
1106
+ def Ltuple(a, b):
1107
+ return tuple([b if j == i else a if j == i-1 else 0
1108
+ for j in range(1,self._n+1)])
1109
+
1110
+ # return "small" powers of the generators without change
1111
+ if m < self._r:
1112
+ return self.monomial((Ltuple(0, m), self._one_perm))
1113
+
1114
+ if i > 1:
1115
+ si = self._Pn.simple_reflections()[i-1]
1116
+ qsum = self.base_ring().one() - self._q**-1
1117
+ # by calling _Li_power we avoid infinite recursion here
1118
+ return (self.sum_of_terms(((Ltuple(c, m-c), si), qsum) for c in range(1, m))
1119
+ + self._q**-1 * self.T(i-1) * self._Li_power(i-1, m) * self.T(i-1))
1120
+
1121
+ # now left with the case i = 1 and m >= r
1122
+ if m > self._r:
1123
+ return self.monomial((Ltuple(0, 1), self._one_perm)) * self._Li_power(i,m-1)
1124
+
1125
+ z = PolynomialRing(self.base_ring(), 'DUMMY').gen()
1126
+ p = list(prod(z - val for val in self._u)) # [:-1]
1127
+ p.pop() # remove the highest power
1128
+ zero = self.base_ring().zero()
1129
+ return self._from_dict({(Ltuple(0, exp), self._one_perm): -coeff
1130
+ for exp, coeff in enumerate(p)
1131
+ if coeff != zero},
1132
+ remove_zeros=False, coerce=False)
1133
+
1134
+ @cached_method
1135
+ def inverse_T(self, i):
1136
+ r"""
1137
+ Return the inverse of the generator `T_i`.
1138
+
1139
+ From the quadratic relation, we have
1140
+
1141
+ .. MATH::
1142
+
1143
+ T_i^{-1} = q^{-1} T_i + (q^{-1} - 1).
1144
+
1145
+ EXAMPLES::
1146
+
1147
+ sage: LT = algebras.ArikiKoike(3, 4).LT()
1148
+ sage: [LT.inverse_T(i) for i in range(1, 4)]
1149
+ [(q^-1-1) + (q^-1)*T[1],
1150
+ (q^-1-1) + (q^-1)*T[2],
1151
+ (q^-1-1) + (q^-1)*T[3]]
1152
+
1153
+ TESTS::
1154
+
1155
+ sage: LT = algebras.ArikiKoike(4, 4).LT()
1156
+ sage: all(LT.inverse_T(i) * LT.T(i) == LT.one() for i in range(1, 4))
1157
+ True
1158
+ sage: all(LT.T(i) * LT.inverse_T(i) == LT.one() for i in range(1, 4))
1159
+ True
1160
+ """
1161
+ c = ~self._q - self.base_ring().one()
1162
+ m = self.T(i).leading_support()
1163
+ return self._from_dict({m: ~self._q, self.one_basis(): c})
1164
+
1165
+ class Element(CombinatorialFreeModule.Element):
1166
+ def __invert__(self):
1167
+ r"""
1168
+ Return the inverse if ``self`` is a basis element.
1169
+
1170
+ EXAMPLES::
1171
+
1172
+ sage: LT = algebras.ArikiKoike(3, 4).LT()
1173
+ sage: t = LT.T(1) * LT.T(2) * LT.T(3); t
1174
+ T[1,2,3]
1175
+ sage: t.inverse() # indirect doctest
1176
+ (q^-3-3*q^-2+3*q^-1-1) + (q^-3-2*q^-2+q^-1)*T[3]
1177
+ + (q^-3-2*q^-2+q^-1)*T[2] + (q^-3-q^-2)*T[3,2]
1178
+ + (q^-3-2*q^-2+q^-1)*T[1] + (q^-3-q^-2)*T[1,3]
1179
+ + (q^-3-q^-2)*T[2,1] + (q^-3)*T[3,2,1]
1180
+ """
1181
+ if len(self) != 1:
1182
+ raise NotImplementedError("inverse only implemented for monomials")
1183
+ l,w = self.support_of_term()
1184
+ if sum(l) != 0:
1185
+ raise NotImplementedError("inverse only implemented for monomials in T variables")
1186
+ H = self.parent()
1187
+ return ~self[l,w] * H.prod(H.inverse_T(i) for i in reversed(w.reduced_word()))
1188
+
1189
+ class T(_Basis):
1190
+ r"""
1191
+ The basis of the Ariki-Koike algebra given by monomials of the
1192
+ generators `\{ T_i | 0 \leq i < n \}`.
1193
+
1194
+ We use the choice of reduced expression given by [BM1997]_:
1195
+
1196
+ .. MATH::
1197
+
1198
+ T_{1,a_1} \cdots T_{n,a_n} T_w,
1199
+
1200
+ where `T_{i,k} = T_{i-1} \cdots T_2 T_1 T_0^k` (note that
1201
+ `T_{1,k} = T_0^k`) and `w` is a reduced expression of an
1202
+ element in `\mathfrak{S}_n`.
1203
+ """
1204
+ def __init__(self, algebra):
1205
+ r"""
1206
+ Initialize ``self``.
1207
+
1208
+ EXAMPLES::
1209
+
1210
+ sage: T = algebras.ArikiKoike(5, 3).T()
1211
+ sage: TestSuite(T).run()
1212
+ sage: T = algebras.ArikiKoike(1, 4).T()
1213
+ sage: TestSuite(T).run()
1214
+ sage: T = algebras.ArikiKoike(2, 3).T()
1215
+ sage: TestSuite(T).run()
1216
+ sage: T = algebras.ArikiKoike(3, 4).T()
1217
+ sage: TestSuite(T).run() # long time
1218
+ """
1219
+ _Basis.__init__(self, algebra, prefix='T')
1220
+ self._assign_names(['T%s' % i for i in range(self._n)])
1221
+
1222
+ def _basis_to_word(self, t):
1223
+ """
1224
+ Return the basis element indexed by ``m`` to a word.
1225
+ """
1226
+ redword = []
1227
+ for i, k in enumerate(t[0]):
1228
+ if not k:
1229
+ continue
1230
+ redword.extend(list(range(i, 0, -1)) + [0]*k)
1231
+ redword.extend(t[1].reduced_word())
1232
+ return redword
1233
+
1234
+ def _repr_term(self, t):
1235
+ r"""
1236
+ Return a string representation of the basis element indexed by ``m``.
1237
+
1238
+ EXAMPLES::
1239
+
1240
+ sage: T = algebras.ArikiKoike(4, 3).T()
1241
+ sage: T._repr_term( ((1,0,2), Permutation([3,2,1])) )
1242
+ 'T[0,2,1,0,0,2,1,2]'
1243
+ """
1244
+ redword = self._basis_to_word(t)
1245
+ if not redword:
1246
+ return "1"
1247
+ return (self._print_options['prefix']
1248
+ + '[%s]' % ','.join('%d' % i for i in redword))
1249
+
1250
+ def _latex_term(self, t):
1251
+ r"""
1252
+ Return a latex representation for the basis element indexed by ``m``.
1253
+
1254
+ EXAMPLES::
1255
+
1256
+ sage: T = algebras.ArikiKoike(4, 3).T()
1257
+ sage: T._latex_term( ((1,0,2), Permutation([3,2,1])) )
1258
+ 'T_{0}T_{2}T_{1}T_{0}T_{0}T_{2}T_{1}T_{2}'
1259
+ """
1260
+ redword = self._basis_to_word(t)
1261
+ if not redword:
1262
+ return "1"
1263
+ return ''.join("%s_{%d}" % (self._print_options['prefix'], i)
1264
+ for i in redword)
1265
+
1266
+ def _from_LT_basis(self, m):
1267
+ r"""
1268
+ Return the image of the `LT` basis element indexed
1269
+ by ``m`` in ``self``.
1270
+
1271
+ EXAMPLES::
1272
+
1273
+ sage: H = algebras.ArikiKoike(4, 2)
1274
+ sage: LT = H.LT()
1275
+ sage: T = H.T()
1276
+ sage: all(T(Li) == T.L(i+1) for i,Li in enumerate(LT.L()))
1277
+ True
1278
+ sage: all(T(Ti) == T.T(i) for i,Ti in enumerate(LT.T()))
1279
+ True
1280
+
1281
+ Check that the products of elements agrees::
1282
+
1283
+ sage: type_A_words = [p.reduced_word() for p in Permutations(H._n)]
1284
+ sage: def from_reduced_word(B, w):
1285
+ ....: t = B.T()
1286
+ ....: return B.prod(t[i] for i in w)
1287
+ sage: all(T(from_reduced_word(LT, w)) == from_reduced_word(T, w)
1288
+ ....: for w in type_A_words)
1289
+ True
1290
+
1291
+ Check that the composition of the morphisms is the identity::
1292
+
1293
+ sage: all(T(LT(b)) == b for b in T.basis()) # indirect doctest
1294
+ True
1295
+ """
1296
+ ret = self.prod(self.L(i+1)**k for i,k in enumerate(m[0]))
1297
+ return ret * self.monomial((self._zero_tuple, m[1]))
1298
+
1299
+ @cached_method
1300
+ def algebra_generators(self):
1301
+ r"""
1302
+ Return the algebra generators of ``self``.
1303
+
1304
+ EXAMPLES::
1305
+
1306
+ sage: T = algebras.ArikiKoike(5, 3).T()
1307
+ sage: dict(T.algebra_generators())
1308
+ {0: T[0], 1: T[1], 2: T[2]}
1309
+
1310
+ sage: T = algebras.ArikiKoike(1, 4).T()
1311
+ sage: dict(T.algebra_generators())
1312
+ {1: T[1], 2: T[2], 3: T[3]}
1313
+ """
1314
+ start = 1 if self._r == 1 else 0
1315
+ return Family(list(range(start, self._n)), self.T)
1316
+
1317
+ def T(self, i=None):
1318
+ r"""
1319
+ Return the generator(s) `T_i` of ``self``.
1320
+
1321
+ INPUT:
1322
+
1323
+ - ``i`` -- (default: ``None``) the generator `T_i` or if ``None``,
1324
+ then the list of all generators `T_i`
1325
+
1326
+ EXAMPLES::
1327
+
1328
+ sage: T = algebras.ArikiKoike(8, 3).T()
1329
+ sage: T.T(1)
1330
+ T[1]
1331
+ sage: T.T()
1332
+ [T[0], T[1], T[2]]
1333
+
1334
+ sage: T = algebras.ArikiKoike(1, 4).T()
1335
+ """
1336
+ if i is None:
1337
+ return [self.T(j) for j in range(self._n)]
1338
+
1339
+ if i == 0:
1340
+ return self.monomial(((1,) + self._zero_tuple[1:], self._one_perm))
1341
+ s = self._Pn.simple_reflections()
1342
+ return self.monomial((self._zero_tuple, s[i]))
1343
+
1344
+ @cached_method
1345
+ def L(self, i=None):
1346
+ r"""
1347
+ Return the Jucys-Murphy element(s) `L_i`.
1348
+
1349
+ The Jucys-Murphy element `L_i` is defined as
1350
+
1351
+ .. MATH::
1352
+
1353
+ L_i = q^{-i+1} T_{i-1} \cdots T_1 T_0 T_1 \cdots T_{i-1}
1354
+ = q^{-1} T_{i-1} L_{i-1} T_{i-1}.
1355
+
1356
+ INPUT:
1357
+
1358
+ - ``i`` -- (default: ``None``) the Jucys-Murphy element `L_i`
1359
+ or if ``None``, then the list of all `L_i`
1360
+
1361
+ EXAMPLES::
1362
+
1363
+ sage: T = algebras.ArikiKoike(8, 3).T()
1364
+ sage: T.L(2)
1365
+ (q^-1)*T[1,0,1]
1366
+ sage: T.L()
1367
+ [T[0], (q^-1)*T[1,0,1], (q^-2)*T[2,1,0,1,2]]
1368
+
1369
+ sage: T0,T1,T2 = T.T()
1370
+ sage: q = T.q()
1371
+ sage: T.L(1) == T0
1372
+ True
1373
+ sage: T.L(2) == q^-1 * T1*T0*T1
1374
+ True
1375
+ sage: T.L(3) == q^-2 * T2*T1*T0*T1*T2
1376
+ True
1377
+
1378
+ sage: T = algebras.ArikiKoike(1, 3).T()
1379
+ sage: T.L(2)
1380
+ u - (u*q^-1-u)*T[1]
1381
+ sage: T.L()
1382
+ [u,
1383
+ u - (u*q^-1-u)*T[1],
1384
+ u - (u*q^-1-u)*T[2] - (u*q^-2-u*q^-1)*T[2,1,2]]
1385
+
1386
+ TESTS:
1387
+
1388
+ Check that the Jucys-Murphy elements form a commutative
1389
+ subring::
1390
+
1391
+ sage: T = algebras.ArikiKoike(8, 4).T()
1392
+ sage: L = T.L()
1393
+ sage: all(x*y == y*x for x in L for y in L)
1394
+ True
1395
+
1396
+ sage: T = algebras.ArikiKoike(2, 3).T()
1397
+ sage: L = T.L()
1398
+ sage: all(x*y == y*x for x in L for y in L)
1399
+ True
1400
+
1401
+ sage: T = algebras.ArikiKoike(1, 4).T()
1402
+ sage: L = T.L()
1403
+ sage: all(x*y == y*x for x in L for y in L)
1404
+ True
1405
+ """
1406
+ if i is None:
1407
+ return [self.L(j) for j in range(1, self._n+1)]
1408
+
1409
+ if i == 1:
1410
+ if self._r == 1:
1411
+ return self.from_base_ring(self._u[0])
1412
+ else:
1413
+ return self.T(0)
1414
+ T = self.T()
1415
+ return self._q**-1 * T[i-1] * self.L(i-1) * T[i-1]
1416
+
1417
+ @cached_method
1418
+ def product_on_basis(self, m1, m2):
1419
+ r"""
1420
+ Return the product of the basis elements indexed
1421
+ by ``m1`` and ``m2``.
1422
+
1423
+ EXAMPLES::
1424
+
1425
+ sage: T = algebras.ArikiKoike(2, 3).T()
1426
+ sage: T0, T1, T2 = T.T()
1427
+ sage: T.product_on_basis(T0.leading_support(), T1.leading_support())
1428
+ T[0,1]
1429
+ sage: T1 * T2
1430
+ T[1,2]
1431
+ sage: T2 * T1
1432
+ T[2,1]
1433
+ sage: T2 * (T2 * T1 * T0)
1434
+ -(1-q)*T[2,1,0] + q*T[1,0]
1435
+ sage: (T1 * T0 * T1 * T0) * T0
1436
+ -u0*u1*T[1,0,1] + ((u0+u1))*T[0,1,0,1]
1437
+ sage: (T0 * T1 * T0 * T1) * (T0 * T1)
1438
+ -u0*u1*q*T[1,0] + (u0*u1-u0*u1*q)*T[1,0,1]
1439
+ + ((u0+u1)*q)*T[0,1,0] - ((u0+u1)+(-u0-u1)*q)*T[0,1,0,1]
1440
+ sage: T1 * (T0 * T2 * T1 * T0)
1441
+ T[1,0,2,1,0]
1442
+ sage: (T1 * T2) * (T2 * T1 * T0)
1443
+ -(1-q)*T[2,1,0,2] - (q-q^2)*T[1,0] + q^2*T[0]
1444
+ sage: (T2*T1*T2) * (T2*T1*T0*T1*T2)
1445
+ -(q-q^2)*T[2,1,0,1,2] + (1-2*q+q^2)*T[2,1,0,2,1,2]
1446
+ - (q-q^2)*T[1,0,2,1,2] + q^2*T[0,2,1,2]
1447
+
1448
+ We check some relations::
1449
+
1450
+ sage: T0 * T1 * T0 * T1 == T1 * T0 * T1 * T0
1451
+ True
1452
+ sage: T1 * T2 * T1 == T2 * T1 * T2
1453
+ True
1454
+ sage: (T1 * T0) * T0 == T1 * (T0 * T0)
1455
+ True
1456
+ sage: (T.L(1) * T.L(2)) * T.L(2) - T.L(1) * (T.L(2) * T.L(2))
1457
+ 0
1458
+ sage: (T.L(2) * T.L(3)) * T.L(3) - T.L(2) * (T.L(3) * T.L(3))
1459
+ 0
1460
+
1461
+ TESTS::
1462
+
1463
+ sage: T = algebras.ArikiKoike(2, 3).T()
1464
+ sage: T0, T1, T2 = T.T()
1465
+ sage: (T1 * T0 * T1) * (T0 * T0)
1466
+ -u0*u1*T[1,0,1] + ((u0+u1))*T[0,1,0,1]
1467
+ sage: T1 * T.L(3) * T2 * T1 * T0 - T1 * (T.L(3) * T2 * T1 * T0)
1468
+ 0
1469
+
1470
+ sage: T = algebras.ArikiKoike(3, 3).T()
1471
+ sage: x = T.T(0) * T.T(1)
1472
+ sage: (x*x)*x == x*(x*x)
1473
+ True
1474
+
1475
+ sage: T = algebras.ArikiKoike(3, 4).T()
1476
+ sage: L1 = T.L(1)
1477
+ sage: L2 = T.L(2)
1478
+ sage: (L2 * L1^2) * L2 == L2 * (L1^2 * L2)
1479
+ True
1480
+ sage: T1 = T.T(1)
1481
+ sage: (T1 * L1^2) * T1 * L1 * L1 == (T1 * L1^2) * T1 * L1^2
1482
+ True
1483
+ """
1484
+ # We represent T_i for i > 0 as S_i in comments to avoid confusion.
1485
+ # Product is of the form t1*s1 * t2*s2: separate the T's and permutations.
1486
+ t1, s1 = m1
1487
+ t2, s2 = m2
1488
+ one = self.base_ring().one()
1489
+ q = self._q
1490
+ qm1 = q - one
1491
+
1492
+ # We first handle the case when s1 == 1
1493
+ if s1 == self._one_perm:
1494
+ if t1 == self._zero_tuple:
1495
+ # Multiplying 1 * m2
1496
+ return self._from_dict({m2: one}, remove_zeros=False)
1497
+ if t2 == self._zero_tuple:
1498
+ return self._from_dict({(t1, s2): one}, remove_zeros=False)
1499
+ k1 = max(k for k,a in enumerate(t1) if a != 0)
1500
+ k2 = min(k for k,a in enumerate(t2) if a != 0)
1501
+ if k1 < k2:
1502
+ T = list(t1)
1503
+ for k in range(k2, len(t2)):
1504
+ T[k] = t2[k]
1505
+ return self._from_dict({(tuple(T), s2): one}, remove_zeros=False)
1506
+ # This is the most recursive part of the product
1507
+ M = self._product_TT(k1, t1[k1], k2, t2[k2])
1508
+ t1 = list(t1)
1509
+ t2 = list(t2)
1510
+ t1[k1] = 0
1511
+ t2[k2] = 0
1512
+ L = self._from_dict({(tuple(t1), self._one_perm): one}, remove_zeros=False)
1513
+ R = self._from_dict({(tuple(t2), s2): one}, remove_zeros=False)
1514
+ return L * M * R
1515
+
1516
+ # The current product of T's and the type A Hecke algebra
1517
+ tprod = [([(k, a) for k, a in enumerate(t2) if a != 0], {s2: one})]
1518
+
1519
+ # s1 through t2
1520
+ for i in reversed(s1.reduced_word()):
1521
+ new_t = []
1522
+ for index in range(len(tprod)):
1523
+ j = i
1524
+ T, sprod = tprod[index]
1525
+ absorbed = False
1526
+ for ind in range(len(T)):
1527
+ k, a = T[ind]
1528
+ # -1 from i since k is 0-based but i is 1-based
1529
+ if j < k:
1530
+ j += 1
1531
+ elif j == k:
1532
+ absorbed = True
1533
+ # Quadratic relation: S_k^2 = (q - 1) S_k + q
1534
+ # So S_{k-1} T_{k,a} = (q-1) T_{k,a} + q T_{k-1,a}
1535
+ # Make a copy of T since we need to mutate it
1536
+ new_t.append((list(T), {s: q * sprod[s] for s in sprod}))
1537
+ new_t[-1][0][ind] = (k-1, a)
1538
+ for s in sprod:
1539
+ sprod[s] *= qm1
1540
+ break
1541
+ elif j == k + 1:
1542
+ absorbed = True
1543
+ T[ind] = (k+1, a)
1544
+ break
1545
+ # elif j > k: pass
1546
+ if absorbed:
1547
+ # We do not need to update tprod[index] because we
1548
+ # have mutated that pair of objects (T, sprod).
1549
+ continue
1550
+
1551
+ # Do the usual Hecke product of S_j * S
1552
+ temp = {} # start from 0
1553
+ for p in sprod:
1554
+ c = sprod[p]
1555
+ # We have to flip the side due to Sage's
1556
+ # convention for multiplying permutations
1557
+ pj = p.apply_simple_reflection(j, side='left')
1558
+ if p.has_descent(j, side='left'):
1559
+ iaxpy(1, {p: c * qm1, pj: c * self._q}, temp)
1560
+ else:
1561
+ iaxpy(1, {pj: c}, temp)
1562
+ tprod[index] = (T, temp)
1563
+ tprod.extend(new_t)
1564
+
1565
+ # Compute t1 * T * sprod
1566
+ def compute(T, sprod):
1567
+ if not T: # T=1, so just do t1 * sprod, each of which is in order
1568
+ return self._from_dict({(t1, s): sprod[s] for s in sprod},
1569
+ remove_zeros=False, coerce=False)
1570
+
1571
+ s_elt = self._from_dict({(self._zero_tuple, s): sprod[s] for s in sprod},
1572
+ remove_zeros=False, coerce=False)
1573
+ # Break T into basis vectors as much as possible to best take
1574
+ # advantage of the caching
1575
+ cur = list(t1)
1576
+ product = [cur]
1577
+ if t1 != self._zero_tuple:
1578
+ K = max(k for k, a in enumerate(t1) if a != 0)
1579
+ else:
1580
+ K = -1
1581
+ T.reverse() # reverse the list so we can pop off the front
1582
+ while T:
1583
+ k, a = T.pop()
1584
+ if k > K:
1585
+ cur[k] = a
1586
+ else:
1587
+ cur = list(self._zero_tuple)
1588
+ cur[k] = a
1589
+ product.append(cur)
1590
+ K = k
1591
+ return self.prod(self._from_dict({(tuple(p), self._one_perm): one},
1592
+ remove_zeros=False, coerce=False)
1593
+ for p in product) * s_elt
1594
+
1595
+ return self.sum(compute(T, sprod) for T, sprod in tprod)
1596
+
1597
+ @lazy_attribute
1598
+ def _T0_polynomial(self):
1599
+ r"""
1600
+ Return `p` such that `T0^{r-1} - p = \prod_{i=0}^{r-1} (T_0 - u_i)`.
1601
+
1602
+ OUTPUT: a ``dict`` representing the polynomial `p`
1603
+
1604
+ EXAMPLES::
1605
+
1606
+ sage: T = algebras.ArikiKoike(4, 2).T()
1607
+ sage: T._T0_polynomial
1608
+ ((u0 + u1 + u2 + u3))*DUMMY^3
1609
+ + ((-u0*u1 - u0*u2 - u1*u2 - u0*u3 - u1*u3 - u2*u3))*DUMMY^2
1610
+ + ((u0*u1*u2 + u0*u1*u3 + u0*u2*u3 + u1*u2*u3))*DUMMY
1611
+ - u0*u1*u2*u3
1612
+ """
1613
+ z = PolynomialRing(self.base_ring(), 'DUMMY').gen()
1614
+ # Remove the highest power
1615
+ return -prod(z - val for val in self._u).truncate(self._r)
1616
+
1617
+ def _reduced_T0_power(self, exp):
1618
+ r"""
1619
+ Return the element `T_0` to the power ``exp`` in terms
1620
+ of `T_0^k` for `k < r`.
1621
+
1622
+ EXAMPLES::
1623
+
1624
+ sage: T = algebras.ArikiKoike(2, 3).T()
1625
+ sage: T._reduced_T0_power(1)
1626
+ 1
1627
+ sage: T._reduced_T0_power(2)
1628
+ ((u0 + u1))*DUMMY - u0*u1
1629
+ sage: T._reduced_T0_power(3)
1630
+ ((u0^2 + u0*u1 + u1^2))*DUMMY + (-u0^2*u1 - u0*u1^2)
1631
+ sage: T._reduced_T0_power(4)
1632
+ ((u0^3 + u0^2*u1 + u0*u1^2 + u1^3))*DUMMY
1633
+ + (-u0^3*u1 - u0^2*u1^2 - u0*u1^3)
1634
+ sage: T._reduced_T0_power(5)
1635
+ ((u0^4 + u0^3*u1 + u0^2*u1^2 + u0*u1^3 + u1^4))*DUMMY
1636
+ + (-u0^4*u1 - u0^3*u1^2 - u0^2*u1^3 - u0*u1^4)
1637
+ """
1638
+ if exp < self._r:
1639
+ return self.base_ring().one()
1640
+ PR = self._T0_polynomial.parent()
1641
+ z = PR.gen()
1642
+ cur = z ** exp
1643
+ while cur.degree() >= self._r:
1644
+ cur = (PR.sum(coeff * self._T0_polynomial * z**e
1645
+ for e, coeff in enumerate(cur.list()[self._r:]))
1646
+ + cur.truncate(self._r))
1647
+ return cur
1648
+
1649
+ @cached_method
1650
+ def _product_TT(self, kp, a, k, b):
1651
+ r"""
1652
+ Return the product `T_{k',a} T_{k,b}` with `k' \geq k` in terms
1653
+ of the basis elements of ``self``.
1654
+
1655
+ From Lemma 2.3 of [BM1997]_, we have
1656
+
1657
+ .. MATH::
1658
+
1659
+ T_{k',a} T_{k,b} = T_{k-1,b} T_{k',a} T_1
1660
+ + (q - 1) \sum_{i=1}^b T_{k-1,a+b-i} T_{k',i}
1661
+ - T_{k-1,i} T_{k',a+b-i}.
1662
+
1663
+ INPUT:
1664
+
1665
+ - ``kp``, ``k`` -- 0-based indices
1666
+ - ``a``, ``b`` -- the exponents of the `T_0` generator
1667
+
1668
+ EXAMPLES::
1669
+
1670
+ sage: T = algebras.ArikiKoike(4, 3).T()
1671
+ sage: T._product_TT(1, 0, 0, 1)
1672
+ T[1,0]
1673
+ sage: T._product_TT(1, 1, 0, 1)
1674
+ T[1,0,0]
1675
+ sage: T._product_TT(1, 2, 0, 1)
1676
+ T[1,0,0,0]
1677
+ sage: T._product_TT(1, 3, 0, 1)
1678
+ -u0*u1*u2*u3*T[1]
1679
+ + ((u0*u1*u2+u0*u1*u3+u0*u2*u3+u1*u2*u3))*T[1,0]
1680
+ - ((u0*u1+u0*u2+u1*u2+u0*u3+u1*u3+u2*u3))*T[1,0,0]
1681
+ + ((u0+u1+u2+u3))*T[1,0,0,0]
1682
+ sage: T._product_TT(1, 2, 0, 2)
1683
+ -u0*u1*u2*u3*T[1]
1684
+ + ((u0*u1*u2+u0*u1*u3+u0*u2*u3+u1*u2*u3))*T[1,0]
1685
+ - ((u0*u1+u0*u2+u1*u2+u0*u3+u1*u3+u2*u3))*T[1,0,0]
1686
+ + ((u0+u1+u2+u3))*T[1,0,0,0]
1687
+ sage: T._product_TT(2, 1, 0, 3)
1688
+ -u0*u1*u2*u3*T[2,1]
1689
+ + ((u0*u1*u2+u0*u1*u3+u0*u2*u3+u1*u2*u3))*T[2,1,0]
1690
+ - ((u0*u1+u0*u2+u1*u2+u0*u3+u1*u3+u2*u3))*T[2,1,0,0]
1691
+ + ((u0+u1+u2+u3))*T[2,1,0,0,0]
1692
+
1693
+ TESTS::
1694
+
1695
+ sage: H = algebras.ArikiKoike(3, 4)
1696
+ sage: T = H.T()
1697
+ sage: T._product_TT(1, 2, 1, 2)
1698
+ -(u0*u1*u2-u0*u1*u2*q)*T[1,0] + (u0*u1*u2-u0*u1*u2*q)*T[0,1]
1699
+ + ((u0+u1+u2)+(-u0-u1-u2)*q)*T[0,1,0,0]
1700
+ - ((u0+u1+u2)+(-u0-u1-u2)*q)*T[0,0,1,0] + T[0,0,1,0,0,1]
1701
+ sage: T._product_TT(2,2,2,2)
1702
+ -(u0*u1*u2-u0*u1*u2*q)*T[2,1,0,2]
1703
+ + (u0*u1*u2-u0*u1*u2*q)*T[1,0,2,1]
1704
+ + ((u0+u1+u2)+(-u0-u1-u2)*q)*T[1,0,2,1,0,0]
1705
+ - ((u0+u1+u2)+(-u0-u1-u2)*q)*T[1,0,0,2,1,0] + T[1,0,0,2,1,0,0,1]
1706
+ sage: T._product_TT(3,2,3,2)
1707
+ -(u0*u1*u2-u0*u1*u2*q)*T[3,2,1,0,3,2]
1708
+ + (u0*u1*u2-u0*u1*u2*q)*T[2,1,0,3,2,1]
1709
+ + ((u0+u1+u2)+(-u0-u1-u2)*q)*T[2,1,0,3,2,1,0,0]
1710
+ - ((u0+u1+u2)+(-u0-u1-u2)*q)*T[2,1,0,0,3,2,1,0]
1711
+ + T[2,1,0,0,3,2,1,0,0,1]
1712
+ """
1713
+ # Quadratic relation: S_i^2 - (q - 1) S_i - q == 0
1714
+ # [BM1997]_: S_i^2 - (q_1 + q_2) S_i + q_1 q_2 == 0
1715
+ # Implies q_1 = q, q_2 = -1
1716
+ one = self.base_ring().one()
1717
+ # Case T_{k',a} T_0^b = T_{k',a+b}
1718
+ if k == 0:
1719
+ if a + b < self._r:
1720
+ T = list(self._zero_tuple)
1721
+ T[kp] = a + b
1722
+ return self._from_dict({(tuple(T), self._one_perm): one},
1723
+ remove_zeros=False, coerce=False)
1724
+
1725
+ def key(exp):
1726
+ if exp > 0 or kp == 0:
1727
+ T = list(self._zero_tuple)
1728
+ T[kp] = exp
1729
+ return (tuple(T), self._one_perm)
1730
+ # Note that kp is 0-based, but our 0-index in the T portion
1731
+ # is the power of T_0
1732
+ perm = self._Pn.one()
1733
+ for j in range(1, kp+1):
1734
+ perm = perm.apply_simple_reflection_left(j)
1735
+ return (self._zero_tuple, perm)
1736
+ p = self._reduced_T0_power(a + b)
1737
+ zero = self.base_ring().zero()
1738
+ return self._from_dict({key(exp): coeff
1739
+ for exp, coeff in enumerate(p)
1740
+ if coeff != zero},
1741
+ remove_zeros=False, coerce=False)
1742
+
1743
+ # Otherwise k > 0
1744
+ assert kp >= k
1745
+ s1 = self._Pn.simple_reflection(1)
1746
+ qm1 = self._q - one
1747
+ T = list(self._zero_tuple)
1748
+ T[k-1] = b
1749
+ T[kp] = a
1750
+ ret = {(tuple(T), s1): one}
1751
+ zero = self.base_ring().zero()
1752
+
1753
+ def T_index(exp, ind, i, indp):
1754
+ T = list(self._zero_tuple)
1755
+ T[ind] = exp
1756
+ T[indp] = i
1757
+ return tuple(T)
1758
+ for i in range(1, b+1):
1759
+ if a + b - i == i:
1760
+ continue
1761
+ if a + b - i < self._r:
1762
+ T[k-1] = a + b - i
1763
+ T[kp] = i
1764
+ m = (tuple(T), self._one_perm)
1765
+ T[k-1] = i
1766
+ T[kp] = a + b - i
1767
+ mp = (tuple(T), self._one_perm)
1768
+ iaxpy(1, {m: qm1, mp: -qm1}, ret)
1769
+ else:
1770
+ p = self._reduced_T0_power(a + b - i)
1771
+ temp = {(T_index(exp, k-1, i, kp), self._one_perm): qm1 * coeff
1772
+ for exp, coeff in enumerate(p) if coeff != zero}
1773
+ if p[0] != zero and k > 1:
1774
+ # We need to add back in the permutation for the "T_{k-1,0}"
1775
+ # in the reduction from T_{k-1,a+b-i}
1776
+ perm = self._Pn.one()
1777
+ for j in range(2, k+1): # Recall k is 0-based, we add 1 back from Lemma 2.3(a)
1778
+ perm = perm.apply_simple_reflection_left(j)
1779
+ tind = T_index(0, k-1, i, kp)
1780
+ temp[(tind, perm)] = temp[(tind, self._one_perm)]
1781
+ del temp[(tind, self._one_perm)]
1782
+ iaxpy(1, temp, ret)
1783
+ temp = {(T_index(exp, kp, i, k-1), self._one_perm): -qm1 * coeff
1784
+ for exp, coeff in enumerate(p) if coeff != zero}
1785
+ if p[0] != zero:
1786
+ # We need to add back in the permutation for the "T_{k',0}"
1787
+ # in the reduction from T_{k',a+b-i}
1788
+ perm = self._Pn.one()
1789
+ for j in range(1, kp+1): # Recall kp is 0-based
1790
+ perm = perm.apply_simple_reflection_left(j)
1791
+ tind = T_index(0, kp, i, k-1)
1792
+ temp[(tind, perm)] = temp[(tind, self._one_perm)]
1793
+ del temp[(tind, self._one_perm)]
1794
+ iaxpy(1, temp, ret)
1795
+
1796
+ return self._from_dict(ret, remove_zeros=False)