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,1082 @@
1
+ # sage_setup: distribution = sagemath-combinat
2
+ # sage.doctest: needs sage.combinat sage.modules
3
+ r"""
4
+ Yangians
5
+
6
+ AUTHORS:
7
+
8
+ - Travis Scrimshaw (2013-10-08): Initial version
9
+ """
10
+
11
+ # ****************************************************************************
12
+ # Copyright (C) 2013 Travis Scrimshaw <tcscrims at gmail.com>
13
+ #
14
+ # This program is free software: you can redistribute it and/or modify
15
+ # it under the terms of the GNU General Public License as published by
16
+ # the Free Software Foundation, either version 2 of the License, or
17
+ # (at your option) any later version.
18
+ # https://www.gnu.org/licenses/
19
+ # ****************************************************************************
20
+
21
+ from sage.misc.cachefunc import cached_method
22
+ from sage.misc.misc_c import prod
23
+
24
+ from sage.categories.hopf_algebras_with_basis import HopfAlgebrasWithBasis
25
+ from sage.categories.graded_hopf_algebras_with_basis import GradedHopfAlgebrasWithBasis
26
+ from sage.categories.cartesian_product import cartesian_product
27
+ from sage.rings.infinity import infinity
28
+ from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
29
+ from sage.sets.family import Family
30
+ from sage.sets.positive_integers import PositiveIntegers
31
+ from sage.monoids.indexed_free_monoid import IndexedFreeAbelianMonoid
32
+ from sage.combinat.free_module import CombinatorialFreeModule
33
+ from sage.algebras.associated_graded import AssociatedGradedAlgebra
34
+
35
+
36
+ class Yangian(CombinatorialFreeModule):
37
+ r"""
38
+ The Yangian `Y(\mathfrak{gl}_n)`.
39
+
40
+ Let `A` be a commutative ring with unity. The *Yangian*
41
+ `Y(\mathfrak{gl}_n)`, associated with the Lie algebra `\mathfrak{gl}_n`
42
+ for `n \geq 1`, is defined to be the unital associative algebra
43
+ generated by `\{t_{ij}^{(r)} \mid 1 \leq i,j \leq n , r \geq 1\}`
44
+ subject to the relations
45
+
46
+ .. MATH::
47
+
48
+ [t_{ij}^{(M+1)}, t_{k\ell}^{(L)}] - [t_{ij}^{(M)}, t_{k\ell}^{(L+1)}]
49
+ = t_{kj}^{(M)} t_{i\ell}^{(L)} - t_{kj}^{(L)} t_{i\ell}^{(M)},
50
+
51
+ where `L,M \geq 0` and `t_{ij}^{(0)} = \delta_{ij} \cdot 1`. This
52
+ system of quadratic relations is equivalent to the system of
53
+ commutation relations
54
+
55
+ .. MATH::
56
+
57
+ [t_{ij}^{(r)}, t_{k\ell}^{(s)}] =
58
+ \sum_{p=0}^{\min\{r,s\}-1} \bigl(t_{kj}^{(p)} t_{i\ell}^{(r+s-1-p)}
59
+ - t_{kj}^{(r+s-1-p)} t_{i\ell}^{(p)} \bigr),
60
+
61
+ where `1 \leq i,j,k,\ell \leq n` and `r,s \geq 1`.
62
+
63
+ Let `u` be a formal variable and, for
64
+ `1 \leq i,j \leq n`, define
65
+
66
+ .. MATH::
67
+
68
+ t_{ij}(u) = \delta_{ij} + \sum_{r=1}^\infty t_{ij}^{(r)} u^{-r}
69
+ \in Y(\mathfrak{gl}_n)[\![u^{-1}]\!].
70
+
71
+ Thus, we can write the defining relations as
72
+
73
+ .. MATH::
74
+
75
+ \begin{aligned}
76
+ (u - v)[t_{ij}(u), t_{k\ell}(v)] & = t_{kj}(u) t_{i\ell}(v)
77
+ - t_{kj}(v) t_{i\ell}(u).
78
+ \end{aligned}
79
+
80
+ These series can be combined into a single matrix:
81
+
82
+ .. MATH::
83
+
84
+ T(u) := \sum_{i,j=1}^n t_{ij}(u) \otimes E_{ij} \in Y(\mathfrak{gl}_n)
85
+ [\![u^{-1}]\!] \otimes \operatorname{End}(\CC^n),
86
+
87
+ where `E_{ij}` is the matrix with a `1` in the `(i,j)` position
88
+ and zeros elsewhere.
89
+
90
+ For `m \geq 2`, define formal variables `u_1, \ldots, u_m`.
91
+ For any `1 \leq k \leq m`, set
92
+
93
+ .. MATH::
94
+
95
+ T_k(u_k) := \sum_{i,j=1}^n t_{ij}(u_k) \otimes (E_{ij})_k \in
96
+ Y(\mathfrak{gl}_n)[\![u_1^{-1},\dots,u_m^{-1}]\!] \otimes
97
+ \operatorname{End}(\CC^n)^{\otimes m},
98
+
99
+ where `(E_{ij})_k = 1^{\otimes (k-1)} \otimes E_{ij} \otimes
100
+ 1^{\otimes (m-k)}`. If we consider `m = 2`, we can then also write
101
+ the defining relations as
102
+
103
+ .. MATH::
104
+
105
+ R(u - v) T_1(u) T_2(v) = T_2(v) T_1(u) R(u - v),
106
+
107
+ where `R(u) = 1 - Pu^{-1}` and `P` is the permutation operator that
108
+ swaps the two factors. Moreover, we can write the Hopf algebra
109
+ structure as
110
+
111
+ .. MATH::
112
+
113
+ \Delta \colon T(u) \mapsto T_{[1]}(u) T_{[2]}(u),
114
+ \qquad
115
+ S \colon T(u) \mapsto T^{-1}(u),
116
+ \qquad
117
+ \epsilon \colon T(u) \mapsto 1,
118
+
119
+ where `T_{[a]} = \sum_{i,j=1}^n (1^{\otimes a-1} \otimes t_{ij}(u)
120
+ \otimes 1^{2-a}) \otimes (E_{ij})_1`.
121
+
122
+ We can also impose two filtrations on `Y(\mathfrak{gl}_n)`: the
123
+ *natural* filtration `\deg t_{ij}^{(r)} = r` and the *loop*
124
+ filtration `\deg t_{ij}^{(r)} = r - 1`. The natural filtration has
125
+ a graded homomorphism with `U(\mathfrak{gl}_n)` by
126
+ `t_{ij}^{(r)} \mapsto (E^r)_{ij}` and an associated graded algebra
127
+ being polynomial algebra. Moreover, this shows a PBW theorem for
128
+ the Yangian, that for any fixed order, we can write elements as
129
+ unique linear combinations of ordered monomials using `t_{ij}^{(r)}`.
130
+ For the loop filtration, the associated graded algebra is isomorphic
131
+ (as Hopf algebras) to `U(\mathfrak{gl}_n[z])` given by
132
+ `\overline{t}_{ij}^{(r)} \mapsto E_{ij} x^{r-1}`, where
133
+ `\overline{t}_{ij}^{(r)}` is the image of `t_{ij}^{(r)}` in the
134
+ `(r - 1)`-th component of `\operatorname{gr}Y(\mathfrak{gl}_n)`.
135
+
136
+ INPUT:
137
+
138
+ - ``base_ring`` -- the base ring
139
+ - ``n`` -- the size `n`
140
+ - ``level`` -- (optional) the level of the Yangian
141
+ - ``variable_name`` -- (default: ``'t'``) the name of the variable
142
+ - ``filtration`` -- (default: ``'loop'``) the filtration and can be
143
+ one of the following:
144
+
145
+ * ``'natural'`` -- the filtration is given by `\deg t_{ij}^{(r)} = r`
146
+ * ``'loop'`` -- the filtration is given by `\deg t_{ij}^{(r)} = r - 1`
147
+
148
+ .. TODO::
149
+
150
+ Implement the antipode.
151
+
152
+ EXAMPLES::
153
+
154
+ sage: Y = Yangian(QQ, 4)
155
+ sage: t = Y.algebra_generators()
156
+ sage: t[6,2,1] * t[2,3,2]
157
+ -t(1)[2,2]*t(6)[3,1] + t(1)[3,1]*t(6)[2,2]
158
+ + t(2)[3,2]*t(6)[2,1] - t(7)[3,1]
159
+ sage: t[6,2,1] * t[3,1,4]
160
+ t(1)[1,1]*t(7)[2,4] + t(1)[1,4]*t(6)[2,1] - t(1)[2,1]*t(6)[1,4]
161
+ - t(1)[2,4]*t(7)[1,1] + t(2)[1,1]*t(6)[2,4] - t(2)[2,4]*t(6)[1,1]
162
+ + t(3)[1,4]*t(6)[2,1] + t(6)[2,4] + t(8)[2,4]
163
+
164
+ We check that the natural filtration has a homomorphism
165
+ to `U(\mathfrak{gl}_n)` as algebras::
166
+
167
+ sage: # needs sage.graphs
168
+ sage: Y = Yangian(QQ, 4, filtration='natural')
169
+ sage: t = Y.algebra_generators()
170
+ sage: gl4 = lie_algebras.gl(QQ, 4)
171
+ sage: Ugl4 = gl4.pbw_basis()
172
+ sage: E = matrix(Ugl4, 4, 4, Ugl4.gens())
173
+ sage: Esq = E^2
174
+ sage: t[2,1,3] * t[1,2,1]
175
+ t(1)[2,1]*t(2)[1,3] - t(2)[2,3]
176
+ sage: Esq[0,2] * E[1,0] == E[1,0] * Esq[0,2] - Esq[1,2]
177
+ True
178
+ sage: Em = [E^k for k in range(1,5)]
179
+ sage: S = list(t.some_elements())[:30:3]
180
+ sage: def convert(x):
181
+ ....: return sum(c * prod(Em[t[0]-1][t[1]-1,t[2]-1] ** e
182
+ ....: for t,e in m._sorted_items())
183
+ ....: for m,c in x)
184
+ sage: for x in S:
185
+ ....: for y in S:
186
+ ....: ret = x * y
187
+ ....: rhs = convert(x) * convert(y)
188
+ ....: assert rhs == convert(ret)
189
+ ....: assert ret.maximal_degree() == rhs.maximal_degree()
190
+
191
+ REFERENCES:
192
+
193
+ - :wikipedia:`Yangian`
194
+ - [MNO1994]_
195
+ - [Mol2007]_
196
+ """
197
+ @staticmethod
198
+ def __classcall_private__(cls, base_ring, n, level=None,
199
+ variable_name='t', filtration='loop'):
200
+ """
201
+ Return the correct parent based upon input.
202
+
203
+ EXAMPLES::
204
+
205
+ sage: Y = Yangian(QQ, 4)
206
+ sage: Y2 = Yangian(QQ, 4)
207
+ sage: Y is Y2
208
+ True
209
+ sage: YL = Yangian(QQ, 4, 3)
210
+ sage: YL2 = Yangian(QQ, 4, 3)
211
+ sage: YL is YL2
212
+ True
213
+ """
214
+ if filtration not in ['natural', 'loop']:
215
+ raise ValueError("invalid filtration")
216
+
217
+ if level is not None:
218
+ return YangianLevel(base_ring, n, level, variable_name, filtration)
219
+ # We need to specify the parameter name for pickling, so it doesn't pass
220
+ # ``variable_name`` as ``level``
221
+ return super().__classcall__(cls, base_ring, n,
222
+ variable_name=variable_name,
223
+ filtration=filtration)
224
+
225
+ def __init__(self, base_ring, n, variable_name, filtration):
226
+ r"""
227
+ Initialize ``self``.
228
+
229
+ EXAMPLES::
230
+
231
+ sage: Y = Yangian(QQ, 4, filtration='loop')
232
+ sage: TestSuite(Y).run(skip='_test_antipode') # Not implemented
233
+ sage: Y = Yangian(QQ, 4, filtration='natural')
234
+ sage: G = Y.algebra_generators()
235
+ sage: elts = [Y.one(), G[1,2,2], G[1,1,4], G[3,3,1], G[1,2,1]*G[2,1,4]]
236
+ sage: TestSuite(Y).run(elements=elts) # long time
237
+ """
238
+ self._n = n
239
+ self._filtration = filtration
240
+ category = HopfAlgebrasWithBasis(base_ring).Filtered()
241
+ if filtration == 'natural':
242
+ category = category.Connected()
243
+ self._index_set = tuple(range(1, n + 1))
244
+ # The keys for the basis are tuples (l, i, j)
245
+ indices = cartesian_product([PositiveIntegers(), self._index_set, self._index_set])
246
+ # We note that the generators are non-commutative, but we always sort
247
+ # them, so they are, in effect, indexed by the free abelian monoid
248
+ basis_keys = IndexedFreeAbelianMonoid(indices, bracket=False,
249
+ prefix=variable_name)
250
+ CombinatorialFreeModule.__init__(self, base_ring, basis_keys,
251
+ sorting_key=Yangian._term_key,
252
+ prefix=variable_name, category=category)
253
+
254
+ def _repr_(self):
255
+ r"""
256
+ Return a string representation of ``self``.
257
+
258
+ EXAMPLES::
259
+
260
+ sage: Yangian(QQ, 4)
261
+ Yangian of gl(4) in the loop filtration over Rational Field
262
+ sage: Yangian(QQ, 4, filtration='natural')
263
+ Yangian of gl(4) in the natural filtration over Rational Field
264
+ """
265
+ return "Yangian of gl({}) in the {} filtration over {}".format(self._n, self._filtration, self.base_ring())
266
+
267
+ def _latex_(self):
268
+ r"""
269
+ Return a latex representation of ``self``.
270
+
271
+ EXAMPLES::
272
+
273
+ sage: latex(Yangian(QQ, 4))
274
+ Y(\mathfrak{gl}_{4}, \Bold{Q})
275
+ """
276
+ from sage.misc.latex import latex
277
+ return "Y(\\mathfrak{{gl}}_{{{}}}, {})".format(self._n, latex(self.base_ring()))
278
+
279
+ @staticmethod
280
+ def _term_key(x):
281
+ """
282
+ Compute a key for ``x`` for comparisons.
283
+
284
+ EXAMPLES::
285
+
286
+ sage: Y = Yangian(QQ, 4)
287
+ sage: x = Y.gen(2, 1, 1).leading_support()
288
+ sage: Yangian._term_key(x)
289
+ (-1, [((2, 1, 1), 1)])
290
+ """
291
+ return (-len(x), x._sorted_items())
292
+
293
+ def _repr_term(self, m):
294
+ """
295
+ Return a string representation of the basis element indexed by ``m``.
296
+
297
+ EXAMPLES::
298
+
299
+ sage: Y = Yangian(QQ, 4)
300
+ sage: I = Y._indices
301
+ sage: Y._repr_term(I.gen((3,1,2))^2 * I.gen((4,3,1)))
302
+ 't(3)[1,2]^2*t(4)[3,1]'
303
+ sage: Y._repr_term(Y.one_basis())
304
+ '1'
305
+ """
306
+ if len(m) == 0:
307
+ return '1'
308
+ prefix = self.prefix()
309
+ return '*'.join(prefix + '({})[{},{}]'.format(r,i,j)
310
+ + ('^{}'.format(exp) if exp > 1 else '')
311
+ for (r,i,j), exp in m._sorted_items())
312
+
313
+ def _latex_term(self, m):
314
+ r"""
315
+ Return a `\LaTeX` representation of the basis element indexed
316
+ by ``m``.
317
+
318
+ EXAMPLES::
319
+
320
+ sage: Y = Yangian(QQ, 4)
321
+ sage: I = Y._indices
322
+ sage: Y._latex_term(I.gen((3,1,2))^2 * I.gen((4,3,1)))
323
+ '\\left(t^{(3)}_{1,2}\\right)^{2} t^{(4)}_{3,1}'
324
+ sage: Y._latex_term(Y.one_basis())
325
+ '1'
326
+ """
327
+ if len(m) == 0:
328
+ return '1'
329
+
330
+ prefix = self.prefix()
331
+
332
+ def term(r, i, j, exp):
333
+ s = prefix + '^{{({})}}_{{{},{}}}'.format(r, i, j)
334
+ if exp == 1:
335
+ return s
336
+ return '\\left({}\\right)^{{{}}}'.format(s, exp)
337
+ return ' '.join(term(r, i, j, exp)
338
+ for (r, i, j), exp in m._sorted_items())
339
+
340
+ def _element_constructor_(self, x):
341
+ """
342
+ Construct an element of ``self`` from ``x``.
343
+
344
+ EXAMPLES::
345
+
346
+ sage: Y = Yangian(QQ, 4)
347
+ sage: Yn = Yangian(QQ, 4, filtration='natural')
348
+ sage: Yn(Y.an_element()) == Yn.an_element()
349
+ True
350
+ sage: Y(Yn.an_element()) == Y.an_element()
351
+ True
352
+ sage: Y6 = Yangian(QQ, 4, level=6, filtration='natural')
353
+ sage: Y(Y6.an_element())
354
+ t(1)[1,1]^2*t(1)[1,2]^2*t(1)[1,3]^3 + 2*t(1)[1,1] + 3*t(1)[1,2] + 1
355
+ """
356
+ if isinstance(x, CombinatorialFreeModule.Element):
357
+ if isinstance(x.parent(), Yangian) and x.parent()._n <= self._n:
358
+ R = self.base_ring()
359
+ return self._from_dict({i: R(c) for i, c in x}, coerce=False)
360
+ return super()._element_constructor_(x)
361
+
362
+ def gen(self, r, i=None, j=None):
363
+ """
364
+ Return the generator `t^{(r)}_{ij}` of ``self``.
365
+
366
+ EXAMPLES::
367
+
368
+ sage: Y = Yangian(QQ, 4)
369
+ sage: Y.gen(2, 1, 3)
370
+ t(2)[1,3]
371
+ sage: Y.gen(12, 2, 1)
372
+ t(12)[2,1]
373
+ sage: Y.gen(0, 1, 1)
374
+ 1
375
+ sage: Y.gen(0, 1, 3)
376
+ 0
377
+ """
378
+ if i is None and j is None:
379
+ r, i, j = r
380
+ if r == 0:
381
+ if i == j:
382
+ return self.one()
383
+ return self.zero()
384
+ m = self._indices.gen((r, i, j))
385
+ return self.element_class(self, {m: self.base_ring().one()})
386
+
387
+ @cached_method
388
+ def algebra_generators(self):
389
+ """
390
+ Return the algebra generators of ``self``.
391
+
392
+ EXAMPLES::
393
+
394
+ sage: Y = Yangian(QQ, 4)
395
+ sage: Y.algebra_generators()
396
+ Lazy family (generator(i))_{i in The Cartesian product of
397
+ (Positive integers, {1, 2, 3, 4}, {1, 2, 3, 4})}
398
+ """
399
+ return Family(self._indices._indices, self.gen, name='generator')
400
+
401
+ @cached_method
402
+ def one_basis(self):
403
+ """
404
+ Return the basis index of the element `1`.
405
+
406
+ EXAMPLES::
407
+
408
+ sage: Y = Yangian(QQ, 4)
409
+ sage: Y.one_basis()
410
+ 1
411
+ """
412
+ return self._indices.one()
413
+
414
+ def degree_on_basis(self, m):
415
+ """
416
+ Return the degree of the monomial index by ``m``.
417
+
418
+ The degree of `t_{ij}^{(r)}` is equal to `r - 1` if ``filtration =
419
+ 'loop'`` and is equal to `r` if ``filtration = 'natural'``.
420
+
421
+ EXAMPLES::
422
+
423
+ sage: Y = Yangian(QQ, 4)
424
+ sage: Y.degree_on_basis(Y.gen(2,1,1).leading_support())
425
+ 1
426
+ sage: x = Y.gen(5,2,3)^4
427
+ sage: Y.degree_on_basis(x.leading_support())
428
+ 16
429
+ sage: elt = Y.gen(10,3,1) * Y.gen(2,1,1) * Y.gen(1,2,4); elt
430
+ t(1)[1,1]*t(1)[2,4]*t(10)[3,1] - t(1)[2,4]*t(1)[3,1]*t(10)[1,1]
431
+ + t(1)[2,4]*t(2)[1,1]*t(10)[3,1] + t(1)[2,4]*t(10)[3,1]
432
+ + t(1)[2,4]*t(11)[3,1]
433
+ sage: for s in sorted(elt.support(), key=str): s, Y.degree_on_basis(s)
434
+ (t(1, 1, 1)*t(1, 2, 4)*t(10, 3, 1), 9)
435
+ (t(1, 2, 4)*t(1, 3, 1)*t(10, 1, 1), 9)
436
+ (t(1, 2, 4)*t(10, 3, 1), 9)
437
+ (t(1, 2, 4)*t(11, 3, 1), 10)
438
+ (t(1, 2, 4)*t(2, 1, 1)*t(10, 3, 1), 10)
439
+
440
+ sage: Y = Yangian(QQ, 4, filtration='natural')
441
+ sage: Y.degree_on_basis(Y.gen(2,1,1).leading_support())
442
+ 2
443
+ sage: x = Y.gen(5,2,3)^4
444
+ sage: Y.degree_on_basis(x.leading_support())
445
+ 20
446
+ sage: elt = Y.gen(10,3,1) * Y.gen(2,1,1) * Y.gen(1,2,4)
447
+ sage: for s in sorted(elt.support(), key=str): s, Y.degree_on_basis(s)
448
+ (t(1, 1, 1)*t(1, 2, 4)*t(10, 3, 1), 12)
449
+ (t(1, 2, 4)*t(1, 3, 1)*t(10, 1, 1), 12)
450
+ (t(1, 2, 4)*t(10, 3, 1), 11)
451
+ (t(1, 2, 4)*t(11, 3, 1), 12)
452
+ (t(1, 2, 4)*t(2, 1, 1)*t(10, 3, 1), 13)
453
+ """
454
+ if self._filtration == 'natural':
455
+ return sum(r[0][0] * r[1] for r in m._monomial.items())
456
+ return sum(max(0, r[0][0] - 1) * r[1] for r in m._monomial.items())
457
+
458
+ def graded_algebra(self):
459
+ """
460
+ Return the associated graded algebra of ``self``.
461
+
462
+ EXAMPLES::
463
+
464
+ sage: Yangian(QQ, 4).graded_algebra()
465
+ Graded Algebra of Yangian of gl(4) in the loop filtration over Rational Field
466
+ sage: Yangian(QQ, 4, filtration='natural').graded_algebra()
467
+ Graded Algebra of Yangian of gl(4) in the natural filtration over Rational Field
468
+ """
469
+ if self._filtration == 'natural':
470
+ return GradedYangianNatural(self)
471
+ return GradedYangianLoop(self)
472
+
473
+ def dimension(self):
474
+ r"""
475
+ Return the dimension of ``self``, which is `\infty`.
476
+
477
+ EXAMPLES::
478
+
479
+ sage: Y = Yangian(QQ, 4)
480
+ sage: Y.dimension()
481
+ +Infinity
482
+ """
483
+ return infinity
484
+
485
+ @cached_method
486
+ def product_on_basis(self, x, y):
487
+ """
488
+ Return the product of two monomials given by ``x`` and ``y``.
489
+
490
+ EXAMPLES::
491
+
492
+ sage: Y = Yangian(QQ, 4)
493
+ sage: Y.gen(12, 2, 1) * Y.gen(2, 1, 1) # indirect doctest
494
+ t(1)[1,1]*t(12)[2,1] - t(1)[2,1]*t(12)[1,1]
495
+ + t(2)[1,1]*t(12)[2,1] + t(12)[2,1] + t(13)[2,1]
496
+ """
497
+ # If x or y indexed by the identity element, it is 1, so return the other
498
+ if len(x) == 0:
499
+ return self.monomial(y)
500
+ if len(y) == 0:
501
+ return self.monomial(x)
502
+ # If it's smaller, just add it to the front
503
+ if x.trailing_support() <= y.leading_support():
504
+ return self.monomial(x * y)
505
+
506
+ # The computation is done on generators, so apply generators one at
507
+ # a time until all have been applied
508
+ if len(x) != 1:
509
+ I = self._indices
510
+ cur = self.monomial(y)
511
+ for gen, exp in reversed(x._sorted_items()):
512
+ for _ in range(exp):
513
+ cur = self.monomial(I.gen(gen)) * cur
514
+ return cur
515
+
516
+ # If we are both generators, then apply the basic computation
517
+ if len(y) == 1:
518
+ return self.product_on_gens(tuple(x.support()[0]), tuple(y.support()[0]))
519
+
520
+ # Otherwise we need to commute it along
521
+ I = self._indices
522
+ cur = self.monomial(x)
523
+ for gen, exp in y._sorted_items():
524
+ for _ in range(exp):
525
+ cur = cur * self.monomial(I.gen(gen))
526
+ return cur
527
+
528
+ @cached_method
529
+ def product_on_gens(self, a, b):
530
+ r"""
531
+ Return the product on two generators indexed by ``a`` and ``b``.
532
+
533
+ We assume `(r, i, j) \geq (s, k, \ell)`, and we start with the basic
534
+ relation:
535
+
536
+ .. MATH::
537
+
538
+ [t_{ij}^{(r)}, t_{k\ell}^{(s)}] - [t_{ij}^{(r-1)}, t_{k\ell}^{(s+1)}]
539
+ = t_{kj}^{(r-1)} t_{i\ell}^{(s)} - t_{kj}^{(s)} t_{i\ell}^{(r-1)}.
540
+
541
+ Solving for the first term and using induction we get:
542
+
543
+ .. MATH::
544
+
545
+ [t_{ij}^{(r)}, t_{k\ell}^{(s)}] = \sum_{a=1}^s \left(
546
+ t_{kj}^{(a-1)} t_{i\ell}^{(r+s-a)} - t_{kj}^{(r+s-a)}
547
+ t_{i\ell}^{(a-1)} \right).
548
+
549
+ Next applying induction on this we get
550
+
551
+ .. MATH::
552
+
553
+ t_{ij}^{(r)} t_{k\ell}^{(s)} = t_{k\ell}^{(s)} t_{ij}^{(r)} +
554
+ \sum C_{abcd}^{m\ell} t_{ab}^{(m)} t_{cd}^{(\ell)}
555
+
556
+ where `m + \ell < r + s` and `t_{ab}^{(m)} < t_{cd}^{(\ell)}`.
557
+
558
+ EXAMPLES::
559
+
560
+ sage: Y = Yangian(QQ, 4)
561
+ sage: Y.product_on_gens((2,1,1), (12,2,1))
562
+ t(2)[1,1]*t(12)[2,1]
563
+ sage: Y.gen(2, 1, 1) * Y.gen(12, 2, 1)
564
+ t(2)[1,1]*t(12)[2,1]
565
+ sage: Y.product_on_gens((12,2,1), (2,1,1))
566
+ t(1)[1,1]*t(12)[2,1] - t(1)[2,1]*t(12)[1,1]
567
+ + t(2)[1,1]*t(12)[2,1] + t(12)[2,1] + t(13)[2,1]
568
+ sage: Y.gen(12, 2, 1) * Y.gen(2, 1, 1)
569
+ t(1)[1,1]*t(12)[2,1] - t(1)[2,1]*t(12)[1,1]
570
+ + t(2)[1,1]*t(12)[2,1] + t(12)[2,1] + t(13)[2,1]
571
+ """
572
+ I = self._indices
573
+ if a <= b:
574
+ return self.monomial(I.gen(a) * I.gen(b))
575
+
576
+ # This is the special term of x = 1
577
+ x1 = self.zero()
578
+ if b[1] == a[2]:
579
+ x1 += self.monomial(I.gen((a[0]+b[0]-1, a[1], b[2])))
580
+ if a[1] == b[2]:
581
+ x1 -= self.monomial(I.gen((a[0]+b[0]-1, b[1], a[2])))
582
+
583
+ return self.monomial(I.gen(b) * I.gen(a)) + x1 + self.sum(
584
+ self.monomial(I.gen((x-1, b[1], a[2])) * I.gen((a[0]+b[0]-x, a[1], b[2])))
585
+ - self.product_on_gens((a[0]+b[0]-x, b[1], a[2]), (x-1, a[1], b[2]))
586
+ for x in range(2, b[0]+1))
587
+
588
+ def coproduct_on_basis(self, m):
589
+ r"""
590
+ Return the coproduct on the basis element indexed by ``m``.
591
+
592
+ The coproduct `\Delta\colon Y(\mathfrak{gl}_n) \longrightarrow
593
+ Y(\mathfrak{gl}_n) \otimes Y(\mathfrak{gl}_n)` is defined by
594
+
595
+ .. MATH::
596
+
597
+ \Delta(t_{ij}(u)) = \sum_{a=1}^n t_{ia}(u) \otimes t_{aj}(u).
598
+
599
+ EXAMPLES::
600
+
601
+ sage: Y = Yangian(QQ, 4)
602
+ sage: Y.gen(2,1,1).coproduct() # indirect doctest
603
+ 1 # t(2)[1,1] + t(1)[1,1] # t(1)[1,1] + t(1)[1,2] # t(1)[2,1]
604
+ + t(1)[1,3] # t(1)[3,1] + t(1)[1,4] # t(1)[4,1] + t(2)[1,1] # 1
605
+ sage: Y.gen(2,3,1).coproduct()
606
+ 1 # t(2)[3,1] + t(1)[3,1] # t(1)[1,1] + t(1)[3,2] # t(1)[2,1]
607
+ + t(1)[3,3] # t(1)[3,1] + t(1)[3,4] # t(1)[4,1] + t(2)[3,1] # 1
608
+ sage: Y.gen(2,2,3).coproduct()
609
+ 1 # t(2)[2,3] + t(1)[2,1] # t(1)[1,3] + t(1)[2,2] # t(1)[2,3]
610
+ + t(1)[2,3] # t(1)[3,3] + t(1)[2,4] # t(1)[4,3] + t(2)[2,3] # 1
611
+ """
612
+ T = self.tensor_square()
613
+ I = self._indices
614
+ return T.prod(T.monomial((I.one(), I.gen((a[0],a[1],a[2]))))
615
+ + T.monomial((I.gen((a[0],a[1],a[2])), I.one()))
616
+ + T.sum_of_terms([((I.gen((s,a[1],k)), I.gen((a[0]-s,k,a[2]))), 1)
617
+ for k in range(1, self._n+1)
618
+ for s in range(1, a[0])])
619
+ for a,exp in m._sorted_items() for p in range(exp))
620
+
621
+ def counit_on_basis(self, m):
622
+ """
623
+ Return the counit on the basis element indexed by ``m``.
624
+
625
+ EXAMPLES::
626
+
627
+ sage: Y = Yangian(QQ, 4)
628
+ sage: Y.gen(2,3,1).counit() # indirect doctest
629
+ 0
630
+ sage: Y.gen(0,0,0).counit()
631
+ 1
632
+ """
633
+ if len(m) == 0:
634
+ return self.base_ring().one()
635
+ return self.base_ring().zero()
636
+
637
+
638
+ class YangianLevel(Yangian):
639
+ r"""
640
+ The Yangian `Y_{\ell}(\mathfrak{gl_n})` of level `\ell`.
641
+
642
+ The Yangian of level `\ell` is the quotient of the Yangian
643
+ `Y(\mathfrak{gl}_n)` by the two-sided ideal generated by `t_{ij}^{(r)}`
644
+ for all `r > p` and all `i,j \in \{1, \ldots, n\}`.
645
+
646
+ EXAMPLES::
647
+
648
+ sage: Y = Yangian(QQ, 4, 3)
649
+ sage: elt = Y.gen(3,2,1) * Y.gen(1,1,3)
650
+ sage: elt * Y.gen(1, 1, 2)
651
+ t(1)[1,2]*t(1)[1,3]*t(3)[2,1] + t(1)[1,2]*t(3)[2,3]
652
+ - t(1)[1,3]*t(3)[1,1] + t(1)[1,3]*t(3)[2,2] - t(3)[1,3]
653
+ """
654
+ def __init__(self, base_ring, n, level, variable_name, filtration):
655
+ """
656
+ Initialize ``self``.
657
+
658
+ EXAMPLES::
659
+
660
+ sage: Y = Yangian(QQ, 4, 3)
661
+ sage: TestSuite(Y).run(skip='_test_antipode')
662
+ """
663
+ self._level = level
664
+ self._n = n
665
+ self._filtration = filtration
666
+ category = HopfAlgebrasWithBasis(base_ring).Filtered()
667
+ self._index_set = tuple(range(1,n+1))
668
+ # The keys for the basis are tuples (l, i, j)
669
+ L = range(1, self._level + 1)
670
+ indices = cartesian_product([L, self._index_set, self._index_set])
671
+ # We note that the generators are non-commutative, but we always sort
672
+ # them, so they are, in effect, indexed by the free abelian monoid
673
+ basis_keys = IndexedFreeAbelianMonoid(indices, bracket=False, prefix=variable_name)
674
+ CombinatorialFreeModule.__init__(self, base_ring, basis_keys,
675
+ prefix=variable_name, category=category)
676
+
677
+ def _repr_(self):
678
+ r"""
679
+ Return a string representation of ``self``.
680
+
681
+ EXAMPLES::
682
+
683
+ sage: Yangian(QQ, 4, 3)
684
+ Yangian of level 3 of gl(4) in the loop filtration over Rational Field
685
+ """
686
+ return "Yangian of level {} of gl({}) in the {} filtration over {}".format(
687
+ self._level, self._n, self._filtration, self.base_ring())
688
+
689
+ def _latex_(self):
690
+ r"""
691
+ Return a latex representation of ``self``.
692
+
693
+ EXAMPLES::
694
+
695
+ sage: latex(Yangian(QQ, 4, level=5))
696
+ Y_{5}(\mathfrak{gl}_{4}, \Bold{Q})
697
+ """
698
+ from sage.misc.latex import latex
699
+ return "Y_{{{}}}(\\mathfrak{{gl}}_{{{}}}, {})".format(
700
+ self._level, self._n, latex(self.base_ring()))
701
+
702
+ def _coerce_map_from_(self, R):
703
+ """
704
+ Return ``True`` or the coercion if there exists a coerce
705
+ map from ``R``.
706
+
707
+ EXAMPLES::
708
+
709
+ sage: Y5 = Yangian(QQ, 7, level=5)
710
+ sage: Y = Yangian(QQ, 3)
711
+ sage: Y5._coerce_map_from_(Y)
712
+ Generic morphism:
713
+ From: Yangian of gl(3) in the loop filtration over Rational Field
714
+ To: Yangian of level 5 of gl(7) in the loop filtration over Rational Field
715
+ sage: phi = Y5.coerce_map_from(Y)
716
+ sage: x = Y.gen(5,2,1) * Y.gen(4,3,2)
717
+ sage: phi(x)
718
+ -t(1)[2,2]*t(5)[3,1] + t(1)[3,1]*t(5)[2,2]
719
+ - t(2)[2,1]*t(5)[3,2] + t(2)[3,2]*t(5)[2,1]
720
+ - t(3)[2,2]*t(5)[3,1] + t(3)[3,1]*t(5)[2,2]
721
+ + t(4)[3,2]*t(5)[2,1]
722
+
723
+ sage: Y = Yangian(QQ, 10)
724
+ sage: Y5.has_coerce_map_from(Y)
725
+ False
726
+
727
+ sage: Y10 = Yangian(QQ, 4, level=10)
728
+ sage: phi = Y5.coerce_map_from(Y10); phi
729
+ Generic morphism:
730
+ From: Yangian of level 10 of gl(4) in the loop filtration over Rational Field
731
+ To: Yangian of level 5 of gl(7) in the loop filtration over Rational Field
732
+ sage: x = Y10.gen(5,2,1) * Y10.gen(4,3,2)
733
+ sage: phi(x)
734
+ -t(1)[2,2]*t(5)[3,1] + t(1)[3,1]*t(5)[2,2]
735
+ - t(2)[2,1]*t(5)[3,2] + t(2)[3,2]*t(5)[2,1]
736
+ - t(3)[2,2]*t(5)[3,1] + t(3)[3,1]*t(5)[2,2]
737
+ + t(4)[3,2]*t(5)[2,1]
738
+
739
+ sage: Y = Yangian(QQ, 3, filtration='natural')
740
+ sage: Y5.has_coerce_map_from(Y)
741
+ False
742
+ """
743
+ if isinstance(R, Yangian) and R._n <= self._n and R._filtration == self._filtration:
744
+ if isinstance(R, YangianLevel) and self._level > R._level:
745
+ return False
746
+ on_gens = lambda m: self.prod(self.gen(*a)**exp for a,exp in m._sorted_items())
747
+ return R.module_morphism(on_gens, codomain=self)
748
+ return super()._coerce_map_from_(R)
749
+
750
+ def level(self):
751
+ """
752
+ Return the level of ``self``.
753
+
754
+ EXAMPLES::
755
+
756
+ sage: Y = Yangian(QQ, 3, 5)
757
+ sage: Y.level()
758
+ 5
759
+ """
760
+ return self._level
761
+
762
+ def defining_polynomial(self, i, j, u=None):
763
+ r"""
764
+ Return the defining polynomial of ``i`` and ``j``.
765
+
766
+ The defining polynomial is given by:
767
+
768
+ .. MATH::
769
+
770
+ T_{ij}(u) = \delta_{ij} u^{\ell} + \sum_{k=1}^{\ell} t_{ij}^{(k)}
771
+ u^{\ell-k}.
772
+
773
+ EXAMPLES::
774
+
775
+ sage: Y = Yangian(QQ, 3, 5)
776
+ sage: Y.defining_polynomial(3, 2)
777
+ t(1)[3,2]*u^4 + t(2)[3,2]*u^3 + t(3)[3,2]*u^2 + t(4)[3,2]*u + t(5)[3,2]
778
+ sage: Y.defining_polynomial(1, 1)
779
+ u^5 + t(1)[1,1]*u^4 + t(2)[1,1]*u^3 + t(3)[1,1]*u^2 + t(4)[1,1]*u + t(5)[1,1]
780
+ """
781
+ if u is None:
782
+ u = PolynomialRing(self.base_ring(), 'u').gen(0)
783
+ ell = self._level
784
+ return sum(self.gen(k, i, j) * u**(ell-k) for k in range(ell+1))
785
+
786
+ def quantum_determinant(self, u=None):
787
+ r"""
788
+ Return the quantum determinant of ``self``.
789
+
790
+ The quantum determinant is defined by:
791
+
792
+ .. MATH::
793
+
794
+ \operatorname{qdet}(u) = \sum_{\sigma \in S_n} (-1)^{\sigma}
795
+ \prod_{k=1}^n T_{\sigma(k),k}(u - k + 1).
796
+
797
+ EXAMPLES::
798
+
799
+ sage: Y = Yangian(QQ, 2, 2)
800
+ sage: Y.quantum_determinant()
801
+ u^4 + (-2 + t(1)[1,1] + t(1)[2,2])*u^3
802
+ + (1 - t(1)[1,1] + t(1)[1,1]*t(1)[2,2] - t(1)[1,2]*t(1)[2,1]
803
+ - 2*t(1)[2,2] + t(2)[1,1] + t(2)[2,2])*u^2
804
+ + (-t(1)[1,1]*t(1)[2,2] + t(1)[1,1]*t(2)[2,2]
805
+ + t(1)[1,2]*t(1)[2,1] - t(1)[1,2]*t(2)[2,1]
806
+ - t(1)[2,1]*t(2)[1,2] + t(1)[2,2] + t(1)[2,2]*t(2)[1,1]
807
+ - t(2)[1,1] - t(2)[2,2])*u
808
+ - t(1)[1,1]*t(2)[2,2] + t(1)[1,2]*t(2)[2,1] + t(2)[1,1]*t(2)[2,2]
809
+ - t(2)[1,2]*t(2)[2,1] + t(2)[2,2]
810
+ """
811
+ if u is None:
812
+ u = PolynomialRing(self.base_ring(), 'u').gen(0)
813
+ from sage.combinat.permutation import Permutations
814
+ n = self._n
815
+ return sum(p.sign() * prod(self.defining_polynomial(p[k], k+1, u - k)
816
+ for k in range(n))
817
+ for p in Permutations(n))
818
+
819
+ def gen(self, r, i=None, j=None):
820
+ """
821
+ Return the generator `t^{(r)}_{ij}` of ``self``.
822
+
823
+ EXAMPLES::
824
+
825
+ sage: Y = Yangian(QQ, 4, 3)
826
+ sage: Y.gen(2, 1, 3)
827
+ t(2)[1,3]
828
+ sage: Y.gen(12, 2, 1)
829
+ 0
830
+ sage: Y.gen(0, 1, 1)
831
+ 1
832
+ sage: Y.gen(0, 1, 3)
833
+ 0
834
+ """
835
+ if i is None and j is None:
836
+ r, i, j = r
837
+ if r > self._level:
838
+ return self.zero()
839
+ return Yangian.gen(self, r, i, j)
840
+
841
+ @cached_method
842
+ def gens(self) -> tuple:
843
+ """
844
+ Return the generators of ``self``.
845
+
846
+ EXAMPLES::
847
+
848
+ sage: Y = Yangian(QQ, 2, 2)
849
+ sage: Y.gens()
850
+ (t(1)[1,1], t(2)[1,1], t(1)[1,2], t(2)[1,2], t(1)[2,1],
851
+ t(2)[2,1], t(1)[2,2], t(2)[2,2])
852
+ """
853
+ return tuple(self.gen(r, i, j)
854
+ for i in range(1, self._n+1)
855
+ for j in range(1, self._n+1)
856
+ for r in range(1, self._level+1))
857
+
858
+ @cached_method
859
+ def product_on_gens(self, a, b):
860
+ r"""
861
+ Return the product on two generators indexed by ``a`` and ``b``.
862
+
863
+ .. SEEALSO::
864
+
865
+ :meth:`Yangian.product_on_gens()`
866
+
867
+ EXAMPLES::
868
+
869
+ sage: Y = Yangian(QQ, 4, 3)
870
+ sage: Y.gen(1,2,2) * Y.gen(2,1,3) # indirect doctest
871
+ t(1)[2,2]*t(2)[1,3]
872
+ sage: Y.gen(1,2,1) * Y.gen(2,1,3) # indirect doctest
873
+ t(1)[2,1]*t(2)[1,3]
874
+ sage: Y.gen(3,2,1) * Y.gen(1,1,3) # indirect doctest
875
+ t(1)[1,3]*t(3)[2,1] + t(3)[2,3]
876
+ """
877
+ I = self._indices
878
+ if a <= b:
879
+ return self.monomial(I.gen(a) * I.gen(b))
880
+
881
+ # This is the special term of x = 1
882
+ x1 = self.zero()
883
+ if a[0]+b[0]-1 <= self._level:
884
+ if b[1] == a[2]:
885
+ x1 += self.monomial(I.gen((a[0]+b[0]-1, a[1], b[2])))
886
+ if a[1] == b[2]:
887
+ x1 -= self.monomial(I.gen((a[0]+b[0]-1, b[1], a[2])))
888
+
889
+ return self.monomial(I.gen(b) * I.gen(a)) + x1 + self.sum(
890
+ self.monomial(I.gen((x-1, b[1], a[2])) * I.gen((a[0]+b[0]-x, a[1], b[2])))
891
+ - self.product_on_gens((a[0]+b[0]-x, b[1], a[2]), (x-1, a[1], b[2]))
892
+ for x in range(2, b[0]+1) if a[0]+b[0]-x <= self._level)
893
+
894
+ #####################################################################
895
+ # Graded algebras
896
+
897
+
898
+ class GradedYangianBase(AssociatedGradedAlgebra):
899
+ """
900
+ Base class for graded algebras associated to a Yangian.
901
+ """
902
+ def _repr_term(self, m):
903
+ """
904
+ Return a string representation of the monomial indexed by ``m``.
905
+
906
+ EXAMPLES::
907
+
908
+ sage: grY = Yangian(QQ, 4).graded_algebra()
909
+ sage: I = grY._indices
910
+ sage: grY._repr_term(I.gen((3,1,2))^2 * I.gen((4,3,1)))
911
+ 'tbar(3)[1,2]^2*tbar(4)[3,1]'
912
+ """
913
+ if len(m) == 0:
914
+ return '1'
915
+ prefix = self.prefix()
916
+ return '*'.join(prefix + '({})[{},{}]'.format(r,i,j)
917
+ + ('^{}'.format(exp) if exp > 1 else '')
918
+ for (r,i,j), exp in m._sorted_items())
919
+
920
+ def _latex_term(self, m):
921
+ r"""
922
+ Return a latex representation of the monomial indexed by ``m``.
923
+
924
+ EXAMPLES::
925
+
926
+ sage: grY = Yangian(QQ, 4).graded_algebra()
927
+ sage: I = grY._indices
928
+ sage: grY._latex_term(I.gen((3,1,2))^2 * I.gen((4,3,1)))
929
+ '\\left(\\overline{t}^{(3)}_{1,2}\\right)^{2} \\overline{t}^{(4)}_{3,1}'
930
+ """
931
+ if len(m) == 0:
932
+ return '1'
933
+
934
+ prefix = "\\overline{{{}}}".format(self._A.prefix())
935
+
936
+ def term(r, i, j, exp):
937
+ s = prefix + '^{{({})}}_{{{},{}}}'.format(r,i,j)
938
+ if exp == 1:
939
+ return s
940
+ return '\\left({}\\right)^{{{}}}'.format(s, exp)
941
+ return ' '.join(term(r, i, j, exp) for (r,i,j), exp in m._sorted_items())
942
+
943
+
944
+ class GradedYangianNatural(GradedYangianBase):
945
+ r"""
946
+ The associated graded algebra corresponding to a Yangian
947
+ `\operatorname{gr} Y(\mathfrak{gl}_n)` with the natural filtration
948
+ of `\deg t_{ij}^{(r)} = r`.
949
+
950
+ INPUT:
951
+
952
+ - ``Y`` -- a Yangian with the natural filtration
953
+ """
954
+ def __init__(self, Y):
955
+ """
956
+ Initialize ``self``.
957
+
958
+ EXAMPLES::
959
+
960
+ sage: grY = Yangian(QQ, 4, filtration='natural').graded_algebra()
961
+ sage: TestSuite(grY).run(skip='_test_antipode')
962
+ """
963
+ if Y._filtration != 'natural':
964
+ raise ValueError("the Yangian must have the natural filtration")
965
+ cat = GradedHopfAlgebrasWithBasis(Y.base_ring()).Connected().Commutative()
966
+ GradedYangianBase.__init__(self, Y, cat)
967
+
968
+ def product_on_basis(self, x, y):
969
+ """
970
+ Return the product on basis elements given by the
971
+ indices ``x`` and ``y``.
972
+
973
+ EXAMPLES::
974
+
975
+ sage: grY = Yangian(QQ, 4, filtration='natural').graded_algebra()
976
+ sage: x = grY.gen(12, 2, 1) * grY.gen(2, 1, 1) # indirect doctest
977
+ sage: x
978
+ tbar(2)[1,1]*tbar(12)[2,1]
979
+ sage: x == grY.gen(2, 1, 1) * grY.gen(12, 2, 1)
980
+ True
981
+ """
982
+ return self.monomial(x * y)
983
+
984
+
985
+ class GradedYangianLoop(GradedYangianBase):
986
+ r"""
987
+ The associated graded algebra corresponding to a Yangian
988
+ `\operatorname{gr} Y(\mathfrak{gl}_n)` with the filtration
989
+ of `\deg t_{ij}^{(r)} = r - 1`.
990
+
991
+ Using this filtration for the Yangian, the associated graded algebra
992
+ is isomorphic to `U(\mathfrak{gl}_n[z])`, the universal enveloping
993
+ algebra of the loop algebra of `\mathfrak{gl}_n`.
994
+
995
+ INPUT:
996
+
997
+ - ``Y`` -- a Yangian with the loop filtration
998
+ """
999
+ def __init__(self, Y):
1000
+ """
1001
+ Initialize ``self``.
1002
+
1003
+ EXAMPLES::
1004
+
1005
+ sage: grY = Yangian(QQ, 4).graded_algebra()
1006
+ sage: g = grY.indices().gens()
1007
+ sage: x = grY(g[1,1,1] * g[1,1,2]^2 * g[1,1,3]^3 * g[3,1,1])
1008
+ sage: elts = [grY(g[1,1,1]), grY(g[2,1,1]), x]
1009
+ sage: TestSuite(grY).run(elements=elts) # long time
1010
+ """
1011
+ if Y._filtration != 'loop':
1012
+ raise ValueError("the Yangian must have the loop filtration")
1013
+ cat = GradedHopfAlgebrasWithBasis(Y.base_ring())
1014
+ GradedYangianBase.__init__(self, Y, cat)
1015
+
1016
+ def antipode_on_basis(self, m):
1017
+ """
1018
+ Return the antipode on a basis element indexed by ``m``.
1019
+
1020
+ EXAMPLES::
1021
+
1022
+ sage: grY = Yangian(QQ, 4).graded_algebra()
1023
+ sage: grY.antipode_on_basis(grY.gen(2,1,1).leading_support())
1024
+ -tbar(2)[1,1]
1025
+
1026
+ sage: x = grY.an_element(); x
1027
+ tbar(1)[1,1]*tbar(1)[1,2]^2*tbar(1)[1,3]^3*tbar(42)[1,1]
1028
+ sage: grY.antipode_on_basis(x.leading_support())
1029
+ -tbar(1)[1,1]*tbar(1)[1,2]^2*tbar(1)[1,3]^3*tbar(42)[1,1]
1030
+ - 2*tbar(1)[1,1]*tbar(1)[1,2]*tbar(1)[1,3]^3*tbar(42)[1,2]
1031
+ - 3*tbar(1)[1,1]*tbar(1)[1,2]^2*tbar(1)[1,3]^2*tbar(42)[1,3]
1032
+ + 5*tbar(1)[1,2]^2*tbar(1)[1,3]^3*tbar(42)[1,1]
1033
+ + 10*tbar(1)[1,2]*tbar(1)[1,3]^3*tbar(42)[1,2]
1034
+ + 15*tbar(1)[1,2]^2*tbar(1)[1,3]^2*tbar(42)[1,3]
1035
+
1036
+ sage: g = grY.indices().gens()
1037
+ sage: x = grY(g[1,1,1] * g[1,1,2]^2 * g[1,1,3]^3 * g[3,1,1]); x
1038
+ tbar(1)[1,1]*tbar(1)[1,2]^2*tbar(1)[1,3]^3*tbar(3)[1,1]
1039
+ sage: grY.antipode_on_basis(x.leading_support())
1040
+ -tbar(1)[1,1]*tbar(1)[1,2]^2*tbar(1)[1,3]^3*tbar(3)[1,1]
1041
+ - 2*tbar(1)[1,1]*tbar(1)[1,2]*tbar(1)[1,3]^3*tbar(3)[1,2]
1042
+ - 3*tbar(1)[1,1]*tbar(1)[1,2]^2*tbar(1)[1,3]^2*tbar(3)[1,3]
1043
+ + 5*tbar(1)[1,2]^2*tbar(1)[1,3]^3*tbar(3)[1,1]
1044
+ + 10*tbar(1)[1,2]*tbar(1)[1,3]^3*tbar(3)[1,2]
1045
+ + 15*tbar(1)[1,2]^2*tbar(1)[1,3]^2*tbar(3)[1,3]
1046
+ """
1047
+ return self.prod((-1)**exp * self.monomial(a**exp)
1048
+ for a,exp in reversed(list(m)))
1049
+
1050
+ def coproduct_on_basis(self, m):
1051
+ """
1052
+ Return the coproduct on the basis element indexed by ``m``.
1053
+
1054
+ EXAMPLES::
1055
+
1056
+ sage: grY = Yangian(QQ, 4).graded_algebra()
1057
+ sage: grY.coproduct_on_basis(grY.gen(2,1,1).leading_support())
1058
+ 1 # tbar(2)[1,1] + tbar(2)[1,1] # 1
1059
+ sage: grY.gen(2,3,1).coproduct()
1060
+ 1 # tbar(2)[3,1] + tbar(2)[3,1] # 1
1061
+ """
1062
+ T = self.tensor_square()
1063
+ I = self._indices
1064
+ one = I.one()
1065
+ return T.prod(T.sum_of_monomials([(one, a), (a, one)])
1066
+ for a, exp in m for p in range(exp))
1067
+
1068
+ def counit_on_basis(self, m):
1069
+ """
1070
+ Return the antipode on the basis element indexed by ``m``.
1071
+
1072
+ EXAMPLES::
1073
+
1074
+ sage: grY = Yangian(QQ, 4).graded_algebra()
1075
+ sage: grY.counit_on_basis(grY.gen(2,3,1).leading_support())
1076
+ 0
1077
+ sage: grY.gen(0,0,0).counit()
1078
+ 1
1079
+ """
1080
+ if len(m) == 0:
1081
+ return self.base_ring().one()
1082
+ return self.base_ring().zero()