passagemath-combinat 10.6.42__cp314-cp314t-win_amd64.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 (401) hide show
  1. passagemath_combinat/__init__.py +3 -0
  2. passagemath_combinat-10.6.42.dist-info/DELVEWHEEL +2 -0
  3. passagemath_combinat-10.6.42.dist-info/METADATA +160 -0
  4. passagemath_combinat-10.6.42.dist-info/RECORD +401 -0
  5. passagemath_combinat-10.6.42.dist-info/WHEEL +5 -0
  6. passagemath_combinat-10.6.42.dist-info/top_level.txt +3 -0
  7. passagemath_combinat.libs/libgmp-10-3a5f019e2510aeaad918cab2b57a689d.dll +0 -0
  8. passagemath_combinat.libs/libsymmetrica-3-7dcf900932804d0df5fd0919b4668720.dll +0 -0
  9. sage/algebras/affine_nil_temperley_lieb.py +263 -0
  10. sage/algebras/all.py +24 -0
  11. sage/algebras/all__sagemath_combinat.py +35 -0
  12. sage/algebras/askey_wilson.py +935 -0
  13. sage/algebras/associated_graded.py +345 -0
  14. sage/algebras/cellular_basis.py +350 -0
  15. sage/algebras/cluster_algebra.py +2766 -0
  16. sage/algebras/down_up_algebra.py +860 -0
  17. sage/algebras/free_algebra.py +1698 -0
  18. sage/algebras/free_algebra_element.py +345 -0
  19. sage/algebras/free_algebra_quotient.py +405 -0
  20. sage/algebras/free_algebra_quotient_element.py +295 -0
  21. sage/algebras/free_zinbiel_algebra.py +885 -0
  22. sage/algebras/hall_algebra.py +783 -0
  23. sage/algebras/hecke_algebras/all.py +4 -0
  24. sage/algebras/hecke_algebras/ariki_koike_algebra.py +1796 -0
  25. sage/algebras/hecke_algebras/ariki_koike_specht_modules.py +475 -0
  26. sage/algebras/hecke_algebras/cubic_hecke_algebra.py +3520 -0
  27. sage/algebras/hecke_algebras/cubic_hecke_base_ring.py +1473 -0
  28. sage/algebras/hecke_algebras/cubic_hecke_matrix_rep.py +1079 -0
  29. sage/algebras/iwahori_hecke_algebra.py +3095 -0
  30. sage/algebras/jordan_algebra.py +1773 -0
  31. sage/algebras/lie_conformal_algebras/abelian_lie_conformal_algebra.py +113 -0
  32. sage/algebras/lie_conformal_algebras/affine_lie_conformal_algebra.py +156 -0
  33. sage/algebras/lie_conformal_algebras/all.py +18 -0
  34. sage/algebras/lie_conformal_algebras/bosonic_ghosts_lie_conformal_algebra.py +134 -0
  35. sage/algebras/lie_conformal_algebras/examples.py +43 -0
  36. sage/algebras/lie_conformal_algebras/fermionic_ghosts_lie_conformal_algebra.py +131 -0
  37. sage/algebras/lie_conformal_algebras/finitely_freely_generated_lca.py +139 -0
  38. sage/algebras/lie_conformal_algebras/free_bosons_lie_conformal_algebra.py +174 -0
  39. sage/algebras/lie_conformal_algebras/free_fermions_lie_conformal_algebra.py +167 -0
  40. sage/algebras/lie_conformal_algebras/freely_generated_lie_conformal_algebra.py +107 -0
  41. sage/algebras/lie_conformal_algebras/graded_lie_conformal_algebra.py +135 -0
  42. sage/algebras/lie_conformal_algebras/lie_conformal_algebra.py +353 -0
  43. sage/algebras/lie_conformal_algebras/lie_conformal_algebra_element.py +236 -0
  44. sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_basis.py +78 -0
  45. sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py +328 -0
  46. sage/algebras/lie_conformal_algebras/n2_lie_conformal_algebra.py +117 -0
  47. sage/algebras/lie_conformal_algebras/neveu_schwarz_lie_conformal_algebra.py +86 -0
  48. sage/algebras/lie_conformal_algebras/virasoro_lie_conformal_algebra.py +82 -0
  49. sage/algebras/lie_conformal_algebras/weyl_lie_conformal_algebra.py +205 -0
  50. sage/algebras/nil_coxeter_algebra.py +191 -0
  51. sage/algebras/q_commuting_polynomials.py +673 -0
  52. sage/algebras/q_system.py +608 -0
  53. sage/algebras/quantum_clifford.py +959 -0
  54. sage/algebras/quantum_groups/ace_quantum_onsager.py +693 -0
  55. sage/algebras/quantum_groups/all.py +9 -0
  56. sage/algebras/quantum_groups/fock_space.py +2219 -0
  57. sage/algebras/quantum_groups/q_numbers.py +207 -0
  58. sage/algebras/quantum_groups/quantum_group_gap.py +2695 -0
  59. sage/algebras/quantum_groups/representations.py +591 -0
  60. sage/algebras/quantum_matrix_coordinate_algebra.py +1006 -0
  61. sage/algebras/quantum_oscillator.py +623 -0
  62. sage/algebras/quaternion_algebra.py +20 -0
  63. sage/algebras/quaternion_algebra_element.py +55 -0
  64. sage/algebras/rational_cherednik_algebra.py +525 -0
  65. sage/algebras/schur_algebra.py +670 -0
  66. sage/algebras/shuffle_algebra.py +1011 -0
  67. sage/algebras/splitting_algebra.py +779 -0
  68. sage/algebras/tensor_algebra.py +709 -0
  69. sage/algebras/yangian.py +1082 -0
  70. sage/algebras/yokonuma_hecke_algebra.py +1018 -0
  71. sage/all__sagemath_combinat.py +44 -0
  72. sage/combinat/SJT.py +255 -0
  73. sage/combinat/affine_permutation.py +2405 -0
  74. sage/combinat/algebraic_combinatorics.py +55 -0
  75. sage/combinat/all.py +53 -0
  76. sage/combinat/all__sagemath_combinat.py +195 -0
  77. sage/combinat/alternating_sign_matrix.py +2063 -0
  78. sage/combinat/baxter_permutations.py +346 -0
  79. sage/combinat/bijectionist.py +3220 -0
  80. sage/combinat/binary_recurrence_sequences.py +1180 -0
  81. sage/combinat/blob_algebra.py +685 -0
  82. sage/combinat/catalog_partitions.py +27 -0
  83. sage/combinat/chas/all.py +23 -0
  84. sage/combinat/chas/fsym.py +1180 -0
  85. sage/combinat/chas/wqsym.py +2601 -0
  86. sage/combinat/cluster_complex.py +326 -0
  87. sage/combinat/colored_permutations.py +2039 -0
  88. sage/combinat/colored_permutations_representations.py +964 -0
  89. sage/combinat/composition_signed.py +142 -0
  90. sage/combinat/composition_tableau.py +855 -0
  91. sage/combinat/constellation.py +1729 -0
  92. sage/combinat/core.py +751 -0
  93. sage/combinat/counting.py +12 -0
  94. sage/combinat/crystals/affine.py +742 -0
  95. sage/combinat/crystals/affine_factorization.py +518 -0
  96. sage/combinat/crystals/affinization.py +331 -0
  97. sage/combinat/crystals/alcove_path.py +2013 -0
  98. sage/combinat/crystals/all.py +22 -0
  99. sage/combinat/crystals/bkk_crystals.py +141 -0
  100. sage/combinat/crystals/catalog.py +115 -0
  101. sage/combinat/crystals/catalog_elementary_crystals.py +18 -0
  102. sage/combinat/crystals/catalog_infinity_crystals.py +33 -0
  103. sage/combinat/crystals/catalog_kirillov_reshetikhin.py +18 -0
  104. sage/combinat/crystals/crystals.py +257 -0
  105. sage/combinat/crystals/direct_sum.py +260 -0
  106. sage/combinat/crystals/elementary_crystals.py +1251 -0
  107. sage/combinat/crystals/fast_crystals.py +441 -0
  108. sage/combinat/crystals/fully_commutative_stable_grothendieck.py +1205 -0
  109. sage/combinat/crystals/generalized_young_walls.py +1076 -0
  110. sage/combinat/crystals/highest_weight_crystals.py +436 -0
  111. sage/combinat/crystals/induced_structure.py +695 -0
  112. sage/combinat/crystals/infinity_crystals.py +730 -0
  113. sage/combinat/crystals/kac_modules.py +863 -0
  114. sage/combinat/crystals/kirillov_reshetikhin.py +4196 -0
  115. sage/combinat/crystals/kyoto_path_model.py +497 -0
  116. sage/combinat/crystals/letters.cp314t-win_amd64.pyd +0 -0
  117. sage/combinat/crystals/letters.pxd +79 -0
  118. sage/combinat/crystals/letters.pyx +3056 -0
  119. sage/combinat/crystals/littelmann_path.py +1518 -0
  120. sage/combinat/crystals/monomial_crystals.py +1262 -0
  121. sage/combinat/crystals/multisegments.py +462 -0
  122. sage/combinat/crystals/mv_polytopes.py +467 -0
  123. sage/combinat/crystals/pbw_crystal.py +511 -0
  124. sage/combinat/crystals/pbw_datum.cp314t-win_amd64.pyd +0 -0
  125. sage/combinat/crystals/pbw_datum.pxd +4 -0
  126. sage/combinat/crystals/pbw_datum.pyx +487 -0
  127. sage/combinat/crystals/polyhedral_realization.py +372 -0
  128. sage/combinat/crystals/spins.cp314t-win_amd64.pyd +0 -0
  129. sage/combinat/crystals/spins.pxd +21 -0
  130. sage/combinat/crystals/spins.pyx +756 -0
  131. sage/combinat/crystals/star_crystal.py +290 -0
  132. sage/combinat/crystals/subcrystal.py +464 -0
  133. sage/combinat/crystals/tensor_product.py +1177 -0
  134. sage/combinat/crystals/tensor_product_element.cp314t-win_amd64.pyd +0 -0
  135. sage/combinat/crystals/tensor_product_element.pxd +35 -0
  136. sage/combinat/crystals/tensor_product_element.pyx +1870 -0
  137. sage/combinat/crystals/virtual_crystal.py +420 -0
  138. sage/combinat/cyclic_sieving_phenomenon.py +204 -0
  139. sage/combinat/debruijn_sequence.cp314t-win_amd64.pyd +0 -0
  140. sage/combinat/debruijn_sequence.pyx +355 -0
  141. sage/combinat/decorated_permutation.py +270 -0
  142. sage/combinat/degree_sequences.cp314t-win_amd64.pyd +0 -0
  143. sage/combinat/degree_sequences.pyx +588 -0
  144. sage/combinat/derangements.py +527 -0
  145. sage/combinat/descent_algebra.py +1008 -0
  146. sage/combinat/diagram.py +1551 -0
  147. sage/combinat/diagram_algebras.py +5886 -0
  148. sage/combinat/dyck_word.py +4349 -0
  149. sage/combinat/e_one_star.py +1623 -0
  150. sage/combinat/enumerated_sets.py +123 -0
  151. sage/combinat/expnums.cp314t-win_amd64.pyd +0 -0
  152. sage/combinat/expnums.pyx +148 -0
  153. sage/combinat/fast_vector_partitions.cp314t-win_amd64.pyd +0 -0
  154. sage/combinat/fast_vector_partitions.pyx +346 -0
  155. sage/combinat/fqsym.py +1977 -0
  156. sage/combinat/free_dendriform_algebra.py +954 -0
  157. sage/combinat/free_prelie_algebra.py +1141 -0
  158. sage/combinat/fully_commutative_elements.py +1077 -0
  159. sage/combinat/fully_packed_loop.py +1523 -0
  160. sage/combinat/gelfand_tsetlin_patterns.py +1409 -0
  161. sage/combinat/gray_codes.py +311 -0
  162. sage/combinat/grossman_larson_algebras.py +667 -0
  163. sage/combinat/growth.py +4352 -0
  164. sage/combinat/hall_polynomial.py +188 -0
  165. sage/combinat/hillman_grassl.py +866 -0
  166. sage/combinat/integer_matrices.py +329 -0
  167. sage/combinat/integer_vectors_mod_permgroup.py +1238 -0
  168. sage/combinat/k_tableau.py +4564 -0
  169. sage/combinat/kazhdan_lusztig.py +215 -0
  170. sage/combinat/key_polynomial.py +885 -0
  171. sage/combinat/knutson_tao_puzzles.py +2286 -0
  172. sage/combinat/lr_tableau.py +311 -0
  173. sage/combinat/matrices/all.py +24 -0
  174. sage/combinat/matrices/hadamard_matrix.py +3790 -0
  175. sage/combinat/matrices/latin.py +2912 -0
  176. sage/combinat/misc.py +401 -0
  177. sage/combinat/multiset_partition_into_sets_ordered.py +3541 -0
  178. sage/combinat/ncsf_qsym/all.py +21 -0
  179. sage/combinat/ncsf_qsym/combinatorics.py +317 -0
  180. sage/combinat/ncsf_qsym/generic_basis_code.py +1427 -0
  181. sage/combinat/ncsf_qsym/ncsf.py +5637 -0
  182. sage/combinat/ncsf_qsym/qsym.py +4053 -0
  183. sage/combinat/ncsf_qsym/tutorial.py +447 -0
  184. sage/combinat/ncsym/all.py +21 -0
  185. sage/combinat/ncsym/bases.py +855 -0
  186. sage/combinat/ncsym/dual.py +593 -0
  187. sage/combinat/ncsym/ncsym.py +2076 -0
  188. sage/combinat/necklace.py +551 -0
  189. sage/combinat/non_decreasing_parking_function.py +634 -0
  190. sage/combinat/nu_dyck_word.py +1474 -0
  191. sage/combinat/output.py +861 -0
  192. sage/combinat/parallelogram_polyomino.py +4326 -0
  193. sage/combinat/parking_functions.py +1602 -0
  194. sage/combinat/partition_algebra.py +1998 -0
  195. sage/combinat/partition_kleshchev.py +1982 -0
  196. sage/combinat/partition_shifting_algebras.py +584 -0
  197. sage/combinat/partition_tuple.py +3114 -0
  198. sage/combinat/path_tableaux/all.py +13 -0
  199. sage/combinat/path_tableaux/catalog.py +29 -0
  200. sage/combinat/path_tableaux/dyck_path.py +380 -0
  201. sage/combinat/path_tableaux/frieze.py +476 -0
  202. sage/combinat/path_tableaux/path_tableau.py +728 -0
  203. sage/combinat/path_tableaux/semistandard.py +510 -0
  204. sage/combinat/perfect_matching.py +779 -0
  205. sage/combinat/plane_partition.py +3300 -0
  206. sage/combinat/q_bernoulli.cp314t-win_amd64.pyd +0 -0
  207. sage/combinat/q_bernoulli.pyx +128 -0
  208. sage/combinat/quickref.py +81 -0
  209. sage/combinat/recognizable_series.py +2051 -0
  210. sage/combinat/regular_sequence.py +4316 -0
  211. sage/combinat/regular_sequence_bounded.py +543 -0
  212. sage/combinat/restricted_growth.py +81 -0
  213. sage/combinat/ribbon.py +20 -0
  214. sage/combinat/ribbon_shaped_tableau.py +489 -0
  215. sage/combinat/ribbon_tableau.py +1180 -0
  216. sage/combinat/rigged_configurations/all.py +46 -0
  217. sage/combinat/rigged_configurations/bij_abstract_class.py +548 -0
  218. sage/combinat/rigged_configurations/bij_infinity.py +370 -0
  219. sage/combinat/rigged_configurations/bij_type_A.py +163 -0
  220. sage/combinat/rigged_configurations/bij_type_A2_dual.py +338 -0
  221. sage/combinat/rigged_configurations/bij_type_A2_even.py +218 -0
  222. sage/combinat/rigged_configurations/bij_type_A2_odd.py +199 -0
  223. sage/combinat/rigged_configurations/bij_type_B.py +900 -0
  224. sage/combinat/rigged_configurations/bij_type_C.py +267 -0
  225. sage/combinat/rigged_configurations/bij_type_D.py +771 -0
  226. sage/combinat/rigged_configurations/bij_type_D_tri.py +392 -0
  227. sage/combinat/rigged_configurations/bij_type_D_twisted.py +576 -0
  228. sage/combinat/rigged_configurations/bij_type_E67.py +402 -0
  229. sage/combinat/rigged_configurations/bijection.py +143 -0
  230. sage/combinat/rigged_configurations/kleber_tree.py +1475 -0
  231. sage/combinat/rigged_configurations/kr_tableaux.py +1898 -0
  232. sage/combinat/rigged_configurations/rc_crystal.py +461 -0
  233. sage/combinat/rigged_configurations/rc_infinity.py +540 -0
  234. sage/combinat/rigged_configurations/rigged_configuration_element.py +2403 -0
  235. sage/combinat/rigged_configurations/rigged_configurations.py +1918 -0
  236. sage/combinat/rigged_configurations/rigged_partition.cp314t-win_amd64.pyd +0 -0
  237. sage/combinat/rigged_configurations/rigged_partition.pxd +15 -0
  238. sage/combinat/rigged_configurations/rigged_partition.pyx +680 -0
  239. sage/combinat/rigged_configurations/tensor_product_kr_tableaux.py +499 -0
  240. sage/combinat/rigged_configurations/tensor_product_kr_tableaux_element.py +428 -0
  241. sage/combinat/rsk.py +3438 -0
  242. sage/combinat/schubert_polynomial.py +508 -0
  243. sage/combinat/set_partition.py +3318 -0
  244. sage/combinat/set_partition_iterator.cp314t-win_amd64.pyd +0 -0
  245. sage/combinat/set_partition_iterator.pyx +136 -0
  246. sage/combinat/set_partition_ordered.py +1590 -0
  247. sage/combinat/sf/abreu_nigro.py +346 -0
  248. sage/combinat/sf/all.py +52 -0
  249. sage/combinat/sf/character.py +576 -0
  250. sage/combinat/sf/classical.py +319 -0
  251. sage/combinat/sf/dual.py +996 -0
  252. sage/combinat/sf/elementary.py +549 -0
  253. sage/combinat/sf/hall_littlewood.py +1028 -0
  254. sage/combinat/sf/hecke.py +336 -0
  255. sage/combinat/sf/homogeneous.py +464 -0
  256. sage/combinat/sf/jack.py +1428 -0
  257. sage/combinat/sf/k_dual.py +1458 -0
  258. sage/combinat/sf/kfpoly.py +447 -0
  259. sage/combinat/sf/llt.py +789 -0
  260. sage/combinat/sf/macdonald.py +2019 -0
  261. sage/combinat/sf/monomial.py +525 -0
  262. sage/combinat/sf/multiplicative.py +113 -0
  263. sage/combinat/sf/new_kschur.py +1786 -0
  264. sage/combinat/sf/ns_macdonald.py +964 -0
  265. sage/combinat/sf/orthogonal.py +246 -0
  266. sage/combinat/sf/orthotriang.py +355 -0
  267. sage/combinat/sf/powersum.py +963 -0
  268. sage/combinat/sf/schur.py +880 -0
  269. sage/combinat/sf/sf.py +1653 -0
  270. sage/combinat/sf/sfa.py +7053 -0
  271. sage/combinat/sf/symplectic.py +253 -0
  272. sage/combinat/sf/witt.py +721 -0
  273. sage/combinat/shifted_primed_tableau.py +2735 -0
  274. sage/combinat/shuffle.py +830 -0
  275. sage/combinat/sidon_sets.py +146 -0
  276. sage/combinat/similarity_class_type.py +1721 -0
  277. sage/combinat/sine_gordon.py +618 -0
  278. sage/combinat/six_vertex_model.py +784 -0
  279. sage/combinat/skew_partition.py +2053 -0
  280. sage/combinat/skew_tableau.py +2989 -0
  281. sage/combinat/sloane_functions.py +8935 -0
  282. sage/combinat/specht_module.py +1403 -0
  283. sage/combinat/species/all.py +48 -0
  284. sage/combinat/species/characteristic_species.py +321 -0
  285. sage/combinat/species/composition_species.py +273 -0
  286. sage/combinat/species/cycle_species.py +284 -0
  287. sage/combinat/species/empty_species.py +155 -0
  288. sage/combinat/species/functorial_composition_species.py +148 -0
  289. sage/combinat/species/generating_series.py +673 -0
  290. sage/combinat/species/library.py +148 -0
  291. sage/combinat/species/linear_order_species.py +169 -0
  292. sage/combinat/species/misc.py +83 -0
  293. sage/combinat/species/partition_species.py +290 -0
  294. sage/combinat/species/permutation_species.py +268 -0
  295. sage/combinat/species/product_species.py +423 -0
  296. sage/combinat/species/recursive_species.py +476 -0
  297. sage/combinat/species/set_species.py +192 -0
  298. sage/combinat/species/species.py +820 -0
  299. sage/combinat/species/structure.py +539 -0
  300. sage/combinat/species/subset_species.py +243 -0
  301. sage/combinat/species/sum_species.py +225 -0
  302. sage/combinat/subword.py +564 -0
  303. sage/combinat/subword_complex.py +2122 -0
  304. sage/combinat/subword_complex_c.cp314t-win_amd64.pyd +0 -0
  305. sage/combinat/subword_complex_c.pyx +119 -0
  306. sage/combinat/super_tableau.py +821 -0
  307. sage/combinat/superpartition.py +1154 -0
  308. sage/combinat/symmetric_group_algebra.py +3774 -0
  309. sage/combinat/symmetric_group_representations.py +1830 -0
  310. sage/combinat/t_sequences.py +877 -0
  311. sage/combinat/tableau.py +9506 -0
  312. sage/combinat/tableau_residues.py +860 -0
  313. sage/combinat/tableau_tuple.py +5353 -0
  314. sage/combinat/tiling.py +2432 -0
  315. sage/combinat/triangles_FHM.py +777 -0
  316. sage/combinat/tutorial.py +1857 -0
  317. sage/combinat/vector_partition.py +337 -0
  318. sage/combinat/words/abstract_word.py +1722 -0
  319. sage/combinat/words/all.py +59 -0
  320. sage/combinat/words/alphabet.py +268 -0
  321. sage/combinat/words/finite_word.py +7201 -0
  322. sage/combinat/words/infinite_word.py +113 -0
  323. sage/combinat/words/lyndon_word.py +652 -0
  324. sage/combinat/words/morphic.py +351 -0
  325. sage/combinat/words/morphism.py +3878 -0
  326. sage/combinat/words/paths.py +2932 -0
  327. sage/combinat/words/shuffle_product.py +278 -0
  328. sage/combinat/words/suffix_trees.py +1873 -0
  329. sage/combinat/words/word.py +769 -0
  330. sage/combinat/words/word_char.cp314t-win_amd64.pyd +0 -0
  331. sage/combinat/words/word_char.pyx +847 -0
  332. sage/combinat/words/word_datatypes.cp314t-win_amd64.pyd +0 -0
  333. sage/combinat/words/word_datatypes.pxd +4 -0
  334. sage/combinat/words/word_datatypes.pyx +1067 -0
  335. sage/combinat/words/word_generators.py +2026 -0
  336. sage/combinat/words/word_infinite_datatypes.py +1218 -0
  337. sage/combinat/words/word_options.py +99 -0
  338. sage/combinat/words/words.py +2396 -0
  339. sage/data_structures/all__sagemath_combinat.py +1 -0
  340. sage/databases/all__sagemath_combinat.py +13 -0
  341. sage/databases/findstat.py +4897 -0
  342. sage/databases/oeis.py +2058 -0
  343. sage/databases/sloane.py +393 -0
  344. sage/dynamics/all__sagemath_combinat.py +14 -0
  345. sage/dynamics/cellular_automata/all.py +7 -0
  346. sage/dynamics/cellular_automata/catalog.py +34 -0
  347. sage/dynamics/cellular_automata/elementary.py +612 -0
  348. sage/dynamics/cellular_automata/glca.py +477 -0
  349. sage/dynamics/cellular_automata/solitons.py +1463 -0
  350. sage/dynamics/finite_dynamical_system.py +1249 -0
  351. sage/dynamics/finite_dynamical_system_catalog.py +382 -0
  352. sage/games/all.py +7 -0
  353. sage/games/hexad.py +704 -0
  354. sage/games/quantumino.py +591 -0
  355. sage/games/sudoku.py +889 -0
  356. sage/games/sudoku_backtrack.cp314t-win_amd64.pyd +0 -0
  357. sage/games/sudoku_backtrack.pyx +189 -0
  358. sage/groups/all__sagemath_combinat.py +1 -0
  359. sage/groups/indexed_free_group.py +489 -0
  360. sage/libs/all__sagemath_combinat.py +6 -0
  361. sage/libs/lrcalc/__init__.py +1 -0
  362. sage/libs/lrcalc/lrcalc.py +525 -0
  363. sage/libs/symmetrica/__init__.py +7 -0
  364. sage/libs/symmetrica/all.py +101 -0
  365. sage/libs/symmetrica/kostka.pxi +168 -0
  366. sage/libs/symmetrica/part.pxi +193 -0
  367. sage/libs/symmetrica/plet.pxi +42 -0
  368. sage/libs/symmetrica/sab.pxi +196 -0
  369. sage/libs/symmetrica/sb.pxi +332 -0
  370. sage/libs/symmetrica/sc.pxi +192 -0
  371. sage/libs/symmetrica/schur.pxi +956 -0
  372. sage/libs/symmetrica/symmetrica.cp314t-win_amd64.pyd +0 -0
  373. sage/libs/symmetrica/symmetrica.pxi +1172 -0
  374. sage/libs/symmetrica/symmetrica.pyx +39 -0
  375. sage/monoids/all.py +13 -0
  376. sage/monoids/automatic_semigroup.py +1054 -0
  377. sage/monoids/free_abelian_monoid.py +315 -0
  378. sage/monoids/free_abelian_monoid_element.cp314t-win_amd64.pyd +0 -0
  379. sage/monoids/free_abelian_monoid_element.pxd +16 -0
  380. sage/monoids/free_abelian_monoid_element.pyx +397 -0
  381. sage/monoids/free_monoid.py +335 -0
  382. sage/monoids/free_monoid_element.py +431 -0
  383. sage/monoids/hecke_monoid.py +65 -0
  384. sage/monoids/string_monoid.py +817 -0
  385. sage/monoids/string_monoid_element.py +547 -0
  386. sage/monoids/string_ops.py +143 -0
  387. sage/monoids/trace_monoid.py +972 -0
  388. sage/rings/all__sagemath_combinat.py +2 -0
  389. sage/sat/all.py +4 -0
  390. sage/sat/boolean_polynomials.py +405 -0
  391. sage/sat/converters/__init__.py +6 -0
  392. sage/sat/converters/anf2cnf.py +14 -0
  393. sage/sat/converters/polybori.py +611 -0
  394. sage/sat/solvers/__init__.py +5 -0
  395. sage/sat/solvers/cryptominisat.py +287 -0
  396. sage/sat/solvers/dimacs.py +783 -0
  397. sage/sat/solvers/picosat.py +228 -0
  398. sage/sat/solvers/sat_lp.py +156 -0
  399. sage/sat/solvers/satsolver.cp314t-win_amd64.pyd +0 -0
  400. sage/sat/solvers/satsolver.pxd +3 -0
  401. sage/sat/solvers/satsolver.pyx +405 -0
@@ -0,0 +1,880 @@
1
+ # sage_setup: distribution = sagemath-combinat
2
+ # sage.doctest: needs sage.combinat sage.modules
3
+ """
4
+ Schur symmetric functions
5
+ """
6
+ # ****************************************************************************
7
+ # Copyright (C) 2007 Mike Hansen <mhansen@gmail.com>
8
+ # 2012 Mike Zabrocki <mike.zabrocki@gmail.com>
9
+ #
10
+ # Distributed under the terms of the GNU General Public License (GPL)
11
+ #
12
+ # This code is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ # General Public License for more details.
16
+ #
17
+ # The full text of the GPL is available at:
18
+ #
19
+ # https://www.gnu.org/licenses/
20
+ # ****************************************************************************
21
+
22
+ from sage.arith.misc import factorial
23
+ from sage.combinat.tableau import StandardTableaux
24
+ from sage.data_structures.blas_dict import convert_remove_zeroes
25
+ from sage.misc.lazy_import import lazy_import
26
+ from sage.misc.misc_c import prod
27
+ from sage.rings.infinity import infinity
28
+ from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
29
+
30
+ from . import classical
31
+
32
+ lazy_import('sage.libs.lrcalc', 'lrcalc')
33
+
34
+
35
+ class SymmetricFunctionAlgebra_schur(classical.SymmetricFunctionAlgebra_classical):
36
+ def __init__(self, Sym):
37
+ """
38
+ A class for methods related to the Schur symmetric function basis.
39
+
40
+ INPUT:
41
+
42
+ - ``self`` -- a Schur symmetric function basis
43
+ - ``Sym`` -- an instance of the ring of the symmetric functions
44
+
45
+ TESTS::
46
+
47
+ sage: s = SymmetricFunctions(QQ).s()
48
+ sage: s == loads(dumps(s))
49
+ True
50
+ sage: TestSuite(s).run(skip=['_test_associativity', '_test_distributivity', '_test_prod']) # needs lrcalc_python
51
+ sage: TestSuite(s).run(elements=[s[1,1]+s[2], s[1]+2*s[1,1]]) # needs lrcalc_python
52
+ """
53
+ classical.SymmetricFunctionAlgebra_classical.__init__(self, Sym, "Schur", 's')
54
+
55
+ def _dual_basis_default(self):
56
+ """
57
+ Return the default value for ``self.dual_basis()``.
58
+
59
+ This method returns the dual basis to the Schur basis with respect to the standard
60
+ scalar product. Since the Schur basis is self-dual, it returns itself.
61
+
62
+ EXAMPLES::
63
+
64
+ sage: s = SymmetricFunctions(QQ).s()
65
+ sage: ds = s.dual_basis()
66
+ sage: s is ds
67
+ True
68
+
69
+ sage: zee = lambda x : x.centralizer_size()
70
+ sage: S = s.dual_basis(zee); S
71
+ Dual basis to Symmetric Functions over Rational Field in the Schur basis
72
+ sage: S[2,1].scalar(s[2,1])
73
+ 1
74
+
75
+ TESTS::
76
+
77
+ sage: s._dual_basis_default() is s.dual_basis()
78
+ True
79
+ """
80
+ return self
81
+
82
+ def product_on_basis(self, left, right):
83
+ """
84
+ Return the product of ``left`` and ``right``.
85
+
86
+ INPUT:
87
+
88
+ - ``self`` -- a Schur symmetric function basis
89
+ - ``left``, ``right`` -- partitions
90
+
91
+ OUTPUT: an element of the Schur basis, the product of ``left`` and ``right``
92
+
93
+ TESTS::
94
+
95
+ sage: # needs lrcalc_python
96
+ sage: s = SymmetricFunctions(QQ).s()
97
+ sage: a = s([2,1]) + 1; a
98
+ s[] + s[2, 1]
99
+ sage: a^2 # indirect doctest
100
+ s[] + 2*s[2, 1] + s[2, 2, 1, 1] + s[2, 2, 2] + s[3, 1, 1, 1]
101
+ + 2*s[3, 2, 1] + s[3, 3] + s[4, 1, 1] + s[4, 2]
102
+
103
+ Examples failing with three different messages in symmetrica::
104
+
105
+ sage: # needs lrcalc_python
106
+ sage: s[123,1]*s[1,1]
107
+ s[123, 1, 1, 1] + s[123, 2, 1] + s[124, 1, 1] + s[124, 2]
108
+ sage: s[123]*s[2,1]
109
+ s[123, 2, 1] + s[124, 1, 1] + s[124, 2] + s[125, 1]
110
+ sage: s[125]*s[3]
111
+ s[125, 3] + s[126, 2] + s[127, 1] + s[128]
112
+
113
+ ::
114
+
115
+ sage: # needs lrcalc_python
116
+ sage: QQx.<x> = QQ[]
117
+ sage: s = SymmetricFunctions(QQx).s()
118
+ sage: a = x^2*s([2,1]) + 2*x; a
119
+ 2*x*s[] + x^2*s[2, 1]
120
+ sage: a^2
121
+ 4*x^2*s[] + 4*x^3*s[2, 1] + x^4*s[2, 2, 1, 1] + x^4*s[2, 2, 2]
122
+ + x^4*s[3, 1, 1, 1] + 2*x^4*s[3, 2, 1] + x^4*s[3, 3]
123
+ + x^4*s[4, 1, 1] + x^4*s[4, 2]
124
+
125
+ ::
126
+
127
+ sage: 0*s([2,1]) # needs lrcalc_python
128
+ 0
129
+
130
+ Example over a field with positive characteristic::
131
+
132
+ sage: # needs lrcalc_python
133
+ sage: s[2,1]^2
134
+ s[2, 2, 1, 1] + s[2, 2, 2] + s[3, 1, 1, 1] + 2*s[3, 2, 1]
135
+ + s[3, 3] + s[4, 1, 1] + s[4, 2]
136
+ sage: s = SymmetricFunctions(GF(2)).s()
137
+ sage: s[2,1]^2
138
+ s[2, 2, 1, 1] + s[2, 2, 2] + s[3, 1, 1, 1] + s[3, 3] + s[4, 1, 1] + s[4, 2]
139
+ """
140
+ return self.element_class(self, convert_remove_zeroes(lrcalc.mult(left, right),
141
+ self.base_ring()))
142
+
143
+ def coproduct_on_basis(self, mu):
144
+ r"""
145
+ Return the coproduct of ``self(mu)``.
146
+
147
+ Here ``self`` is the basis of Schur functions in the ring of symmetric functions.
148
+
149
+ INPUT:
150
+
151
+ - ``self`` -- a Schur symmetric function basis
152
+ - ``mu`` -- a partition
153
+
154
+ OUTPUT:
155
+
156
+ - the image of the ``mu``-th Schur function under the comultiplication of
157
+ the Hopf algebra of symmetric functions; this is an element of the
158
+ tensor square of the Schur basis
159
+
160
+ EXAMPLES::
161
+
162
+ sage: # needs lrcalc_python
163
+ sage: Sym = SymmetricFunctions(QQ)
164
+ sage: s = Sym.schur()
165
+ sage: s.coproduct_on_basis([2])
166
+ s[] # s[2] + s[1] # s[1] + s[2] # s[]
167
+
168
+ TESTS::
169
+
170
+ sage: s = SymmetricFunctions(QQ['t']).s() # needs lrcalc_python
171
+ sage: s[2].coproduct() / 2 # needs lrcalc_python
172
+ 1/2*s[] # s[2] + 1/2*s[1] # s[1] + 1/2*s[2] # s[]
173
+ """
174
+ T = self.tensor_square()
175
+ return T.element_class(T, convert_remove_zeroes(lrcalc.coprod(mu, all=1),
176
+ self.base_ring()))
177
+
178
+ def _element_constructor_(self, x):
179
+ """
180
+ Construct an element of ``self`` from ``x``.
181
+
182
+ TESTS::
183
+
184
+ sage: s = SymmetricFunctions(QQ).s()
185
+ sage: s([[2,1],[1]]) # needs lrcalc_python
186
+ s[1, 1] + s[2]
187
+ sage: s([[],[]]) # needs lrcalc_python
188
+ s[]
189
+ """
190
+ ###################
191
+ # Skew Partitions #
192
+ ###################
193
+ try:
194
+ return self.skew_schur(x)
195
+ except ValueError:
196
+ return super()._element_constructor_(x)
197
+
198
+ def _repeated_bernstein_creation_operator_on_basis(self, la, nu):
199
+ r"""
200
+ A Schur function indexed by a partition or zero from applying creation
201
+ operators on `s(la)`.
202
+
203
+ INPUT:
204
+
205
+ - ``la`` -- a partition
206
+ - ``nu`` -- list of lintegers
207
+
208
+ EXAMPLES::
209
+
210
+ sage: s = SymmetricFunctions(QQ).schur()
211
+ sage: rbco = s._repeated_bernstein_creation_operator_on_basis
212
+ sage: rbco(Partition([2,1]),[1])
213
+ 0
214
+ sage: rbco(Partition([2,1]),[2])
215
+ s[2, 2, 1]
216
+ sage: rbco(Partition([2,1]),[-2])
217
+ s[1]
218
+ sage: rbco(Partition([2,1]),[1, -2])
219
+ s[1, 1]
220
+ sage: rbco(Partition([2,1]),[1, 0])
221
+ -s[1, 1, 1, 1]
222
+ sage: rbco(Partition([2,1]),[-3, 0])
223
+ s[]
224
+ """
225
+ r = len(nu) + len(la)
226
+ ga = [a-b for (a,b) in zip(nu+la.to_list(), range(-r,0))]
227
+ if r == len(set(ga)) and min(ga) > 0:
228
+ m = sum(1 for i in range(len(ga)) for j in range(i, len(ga))
229
+ if ga[i] < ga[j])
230
+ ga.sort(reverse=True)
231
+ return (-1)**m * self([a+b for (a,b) in zip(ga, range(-r,0))])
232
+ return self.zero()
233
+
234
+ def _magma_init_(self, magma):
235
+ """
236
+ Used in converting this ring to the corresponding ring in MAGMA.
237
+
238
+ EXAMPLES::
239
+
240
+ sage: # optional - magma
241
+ sage: S = SymmetricFunctions(QQ).s()
242
+ sage: t = 4*S[3,2]+9
243
+ sage: mt = magma(t); mt
244
+ 9 + 4*$.[3,2]
245
+ sage: mt.sage()
246
+ 9*s[] + 4*s[3, 2]
247
+ """
248
+ B = magma(self.base_ring())
249
+ Bref = B._ref()
250
+ return f"SymmetricFunctionAlgebraSchur({Bref})"
251
+
252
+ class Element(classical.SymmetricFunctionAlgebra_classical.Element):
253
+ def __pow__(self, n):
254
+ """
255
+ Return the naive powering of an instance of ``self``.
256
+
257
+ INPUT:
258
+
259
+ - ``self`` -- an element of the Schur symmetric function basis
260
+ - ``n`` -- nonnegative integer
261
+
262
+ OUTPUT: the `n`-th power of an instance of ``self`` in the Schur basis
263
+
264
+ See ``Monoids.Element.__pow__`` and ``Monoids.Element._pow_naive``.
265
+
266
+ EXAMPLES::
267
+
268
+ sage: s = SymmetricFunctions(QQ['x']).s()
269
+ sage: len(s([2,1])^8) # long time (~ 4 s)
270
+ 1485
271
+ sage: len(s([2,1])^9) # long time (~10 s)
272
+ 2876
273
+
274
+ Binary exponentiation does not seem to bring any speedup for
275
+ Schur functions. This most likely is because of the
276
+ explosion of the number of terms.
277
+
278
+ # sage: s = SymmetricFunctions(QQ).s(); y = s([1])
279
+ # sage: n = 24
280
+ # sage: %timeit y**n # using binary exponentiation
281
+ # 10 loops, best of 3: 1.22 s per loop
282
+ # sage: %timeit prod(y for i in range(n))
283
+ # 10 loops, best of 3: 1.06 s per loop
284
+
285
+ With polynomial coefficients, this is actually much *slower*
286
+ (although this should be profiled further; there seems to
287
+ be an unreasonable number of polynomial multiplication involved,
288
+ besides the fact that 1 * QQ['x'].one() currently involves a
289
+ polynomial multiplication)
290
+
291
+ # sage: sage: s = SymmetricFunctions(QQ['x']).s()
292
+ # sage: y = s([2,1])
293
+ # sage: %timeit y**7
294
+ # 10 loops, best of 3: 18.9 s per loop
295
+ # sage: %timeit y*y*y*y*y*y*y
296
+ # 10 loops, best of 3: 1.73 s per loop
297
+
298
+ Todo: do the same for the other non multiplicative bases?
299
+ """
300
+ return self._pow_naive(n)
301
+
302
+ def omega(self):
303
+ r"""
304
+ Return the image of ``self`` under the omega automorphism.
305
+
306
+ The *omega automorphism* is defined to be the unique algebra
307
+ endomorphism `\omega` of the ring of symmetric functions that
308
+ satisfies `\omega(e_k) = h_k` for all positive integers `k`
309
+ (where `e_k` stands for the `k`-th elementary symmetric
310
+ function, and `h_k` stands for the `k`-th complete homogeneous
311
+ symmetric function). It furthermore is a Hopf algebra
312
+ endomorphism and an involution, and it is also known as the
313
+ *omega involution*. It sends the power-sum symmetric function
314
+ `p_k` to `(-1)^{k-1} p_k` for every positive integer `k`.
315
+
316
+ The images of some bases under the omega automorphism are given by
317
+
318
+ .. MATH::
319
+
320
+ \omega(e_{\lambda}) = h_{\lambda}, \qquad
321
+ \omega(h_{\lambda}) = e_{\lambda}, \qquad
322
+ \omega(p_{\lambda}) = (-1)^{|\lambda| - \ell(\lambda)}
323
+ p_{\lambda}, \qquad
324
+ \omega(s_{\lambda}) = s_{\lambda^{\prime}},
325
+
326
+ where `\lambda` is any partition, where `\ell(\lambda)` denotes
327
+ the length (:meth:`~sage.combinat.partition.Partition.length`)
328
+ of the partition `\lambda`, where `\lambda^{\prime}` denotes the
329
+ conjugate partition
330
+ (:meth:`~sage.combinat.partition.Partition.conjugate`) of
331
+ `\lambda`, and where the usual notations for bases are used
332
+ (`e` = elementary, `h` = complete homogeneous, `p` = powersum,
333
+ `s` = Schur).
334
+
335
+ :meth:`omega_involution()` is a synonym for the :meth:`omega()`
336
+ method.
337
+
338
+ OUTPUT: the image of ``self`` under the omega automorphism
339
+
340
+ EXAMPLES::
341
+
342
+ sage: s = SymmetricFunctions(QQ).s()
343
+ sage: s([2,1]).omega()
344
+ s[2, 1]
345
+ sage: s([2,1,1]).omega()
346
+ s[3, 1]
347
+ """
348
+ conj = lambda part: part.conjugate()
349
+ return self.map_support(conj)
350
+
351
+ omega_involution = omega
352
+
353
+ def scalar(self, x, zee=None):
354
+ r"""
355
+ Return the standard scalar product between ``self`` and `x`.
356
+
357
+ Note that the Schur functions are self-dual with respect to this
358
+ scalar product. They are also lower-triangularly related to the
359
+ monomial symmetric functions with respect to this scalar product.
360
+
361
+ INPUT:
362
+
363
+ - ``x`` -- element of the ring of symmetric functions over the
364
+ same base ring as ``self``
365
+
366
+ - ``zee`` -- an optional function on partitions giving
367
+ the value for the scalar product between the power-sum
368
+ symmetric function `p_{\mu}` and itself
369
+ (the default value is the standard
370
+ :meth:`~sage.combinat.sf.sfa.zee` function)
371
+
372
+ OUTPUT: the scalar product between ``self`` and ``x``
373
+
374
+ EXAMPLES::
375
+
376
+ sage: s = SymmetricFunctions(ZZ).s()
377
+ sage: a = s([2,1])
378
+ sage: b = s([1,1,1])
379
+ sage: c = 2*s([1,1,1])
380
+ sage: d = a + b
381
+ sage: a.scalar(a)
382
+ 1
383
+ sage: b.scalar(b)
384
+ 1
385
+ sage: b.scalar(a)
386
+ 0
387
+ sage: b.scalar(c)
388
+ 2
389
+ sage: c.scalar(c)
390
+ 4
391
+ sage: d.scalar(a)
392
+ 1
393
+ sage: d.scalar(b)
394
+ 1
395
+ sage: d.scalar(c)
396
+ 2
397
+
398
+ ::
399
+
400
+ sage: m = SymmetricFunctions(ZZ).monomial()
401
+ sage: p4 = Partitions(4)
402
+ sage: l = [ [s(p).scalar(m(q)) for q in p4] for p in p4]
403
+ sage: matrix(l)
404
+ [ 1 0 0 0 0]
405
+ [-1 1 0 0 0]
406
+ [ 0 -1 1 0 0]
407
+ [ 1 -1 -1 1 0]
408
+ [-1 2 1 -3 1]
409
+ """
410
+ if zee is None:
411
+ s = self.parent()
412
+ R = s.base_ring()
413
+ one = R.one()
414
+ f = lambda p1, p2: one
415
+ x = s(x)
416
+ return s._apply_multi_module_morphism(self, x, f, orthogonal=True)
417
+ else:
418
+ p = self.parent().realization_of().power()
419
+ return p(self).scalar( x, zee=zee )
420
+
421
+ def verschiebung(self, n):
422
+ r"""
423
+ Return the image of the symmetric function ``self`` under the
424
+ `n`-th Verschiebung operator.
425
+
426
+ The `n`-th Verschiebung operator `\mathbf{V}_n` is defined to be
427
+ the unique algebra endomorphism `V` of the ring of symmetric
428
+ functions that satisfies `V(h_r) = h_{r/n}` for every positive
429
+ integer `r` divisible by `n`, and satisfies `V(h_r) = 0` for
430
+ every positive integer `r` not divisible by `n`. This operator
431
+ `\mathbf{V}_n` is a Hopf algebra endomorphism. For every
432
+ nonnegative integer `r` with `n \mid r`, it satisfies
433
+
434
+ .. MATH::
435
+
436
+ \mathbf{V}_n(h_r) = h_{r/n},
437
+ \quad \mathbf{V}_n(p_r) = n p_{r/n},
438
+ \quad \mathbf{V}_n(e_r) = (-1)^{r - r/n} e_{r/n}
439
+
440
+ (where `h` is the complete homogeneous basis, `p` is the
441
+ powersum basis, and `e` is the elementary basis). For every
442
+ nonnegative integer `r` with `n \nmid r`, it satisfes
443
+
444
+ .. MATH::
445
+
446
+ \mathbf{V}_n(h_r) = \mathbf{V}_n(p_r) = \mathbf{V}_n(e_r) = 0.
447
+
448
+ The `n`-th Verschiebung operator is also called the `n`-th
449
+ Verschiebung endomorphism. Its name derives from the Verschiebung
450
+ (German for "shift") endomorphism of the Witt vectors.
451
+
452
+ The `n`-th Verschiebung operator is adjoint to the `n`-th
453
+ Frobenius operator (see :meth:`frobenius` for its definition)
454
+ with respect to the Hall scalar product (:meth:`scalar`).
455
+
456
+ The action of the `n`-th Verschiebung operator on the Schur basis
457
+ can also be computed explicitly. The following (probably clumsier
458
+ than necessary) description can be obtained by solving exercise
459
+ 7.61 in Stanley's [STA]_.
460
+
461
+ Let `\lambda` be a partition. Let `n` be a positive integer. If
462
+ the `n`-core of `\lambda` is nonempty, then
463
+ `\mathbf{V}_n(s_\lambda) = 0`. Otherwise, the following method
464
+ computes `\mathbf{V}_n(s_\lambda)`: Write the partition `\lambda`
465
+ in the form `(\lambda_1, \lambda_2, \ldots, \lambda_{ns})` for some
466
+ nonnegative integer `s`. (If `n` does not divide the length of
467
+ `\lambda`, then this is achieved by adding trailing zeroes to
468
+ `\lambda`.) Set `\beta_i = \lambda_i + ns - i` for every
469
+ `s \in \{ 1, 2, \ldots, ns \}`. Then,
470
+ `(\beta_1, \beta_2, \ldots, \beta_{ns})` is a strictly decreasing
471
+ sequence of nonnegative integers. Stably sort the list
472
+ `(1, 2, \ldots, ns)` in order of (weakly) increasing remainder of
473
+ `-1 - \beta_i` modulo `n`. Let `\xi` be the sign of the
474
+ permutation that is used for this sorting. Let `\psi` be the sign
475
+ of the permutation that is used to stably sort the list
476
+ `(1, 2, \ldots, ns)` in order of (weakly) increasing remainder of
477
+ `i - 1` modulo `n`. (Notice that `\psi = (-1)^{n(n-1)s(s-1)/4}`.)
478
+ Then, `\mathbf{V}_n(s_\lambda) = \xi \psi \prod_{i = 0}^{n - 1}
479
+ s_{\lambda^{(i)}}`, where
480
+ `(\lambda^{(0)}, \lambda^{(1)}, \ldots, \lambda^{(n - 1)})`
481
+ is the `n`-quotient of `\lambda`.
482
+
483
+ INPUT:
484
+
485
+ - ``n`` -- positive integer
486
+
487
+ OUTPUT:
488
+
489
+ The result of applying the `n`-th Verschiebung operator (on the ring of
490
+ symmetric functions) to ``self``.
491
+
492
+ EXAMPLES::
493
+
494
+ sage: # needs lrcalc_python
495
+ sage: Sym = SymmetricFunctions(ZZ)
496
+ sage: s = Sym.s()
497
+ sage: s[5].verschiebung(2)
498
+ 0
499
+ sage: s[6].verschiebung(6)
500
+ s[1]
501
+ sage: s[6,3].verschiebung(3)
502
+ s[2, 1] + s[3]
503
+ sage: s[6,3,1].verschiebung(2)
504
+ -s[3, 2]
505
+ sage: s[3,2,1].verschiebung(1)
506
+ s[3, 2, 1]
507
+ sage: s([]).verschiebung(1)
508
+ s[]
509
+ sage: s([]).verschiebung(4)
510
+ s[]
511
+
512
+ TESTS:
513
+
514
+ Let us check that this method on the powersum basis gives the
515
+ same result as the implementation in sfa.py on the monomial
516
+ basis::
517
+
518
+ sage: # needs lrcalc_python
519
+ sage: Sym = SymmetricFunctions(QQ)
520
+ sage: s = Sym.s(); h = Sym.h()
521
+ sage: all( h(s(lam)).verschiebung(3) == h(s(lam).verschiebung(3))
522
+ ....: for lam in Partitions(6) )
523
+ True
524
+ sage: all( s(h(lam)).verschiebung(2) == s(h(lam).verschiebung(2))
525
+ ....: for lam in Partitions(4) )
526
+ True
527
+ sage: all( s(h(lam)).verschiebung(5) == s(h(lam).verschiebung(5))
528
+ ....: for lam in Partitions(10) )
529
+ True
530
+ sage: all( s(h(lam)).verschiebung(2) == s(h(lam).verschiebung(2))
531
+ ....: for lam in Partitions(8) )
532
+ True
533
+ sage: all( s(h(lam)).verschiebung(3) == s(h(lam).verschiebung(3))
534
+ ....: for lam in Partitions(12) )
535
+ True
536
+ sage: all( s(h(lam)).verschiebung(3) == s(h(lam).verschiebung(3))
537
+ ....: for lam in Partitions(9) )
538
+ True
539
+ """
540
+ # Extra hack for the n == 1 case, since lam.quotient(1)
541
+ # (for lam being a partition) returns a partition rather than
542
+ # a partition tuple.
543
+ if n == 1:
544
+ return self
545
+
546
+ parent = self.parent()
547
+ s_coords_of_self = self.monomial_coefficients().items()
548
+ result = parent.zero()
549
+ from sage.combinat.permutation import Permutation
550
+ for (lam, coeff) in s_coords_of_self:
551
+ if len(lam.core(n)) == 0:
552
+ quotient = lam.quotient(n)
553
+ quotient_prod = parent.prod(parent(part)
554
+ for part in quotient)
555
+ # Now, compute the sign of quotient_prod in the
556
+ # n-th Verschiebung of lam.
557
+ len_lam = len(lam)
558
+ ns = len_lam + ((- len_lam) % n)
559
+ s = ns // n # This is actually ns / n, as we have n | ns.
560
+ beta_list = lam.beta_numbers(ns)
561
+ zipped_beta_list = sorted(zip(beta_list, range(1, ns + 1)),
562
+ key=lambda a: (-1 - a[0]) % n)
563
+ # We are using the fact that sort is a stable sort.
564
+ perm_list = [a[1] for a in zipped_beta_list]
565
+ if Permutation(perm_list).sign() == 1:
566
+ minus_sign = False
567
+ else:
568
+ minus_sign = True
569
+ if (n * s * (n-1) * (s-1)) % 8 == 4:
570
+ minus_sign = not minus_sign
571
+ if minus_sign:
572
+ result -= coeff * quotient_prod
573
+ else:
574
+ result += coeff * quotient_prod
575
+ return result
576
+
577
+ def expand(self, n, alphabet='x'):
578
+ """
579
+ Expand the symmetric function ``self`` as a symmetric polynomial
580
+ in ``n`` variables.
581
+
582
+ INPUT:
583
+
584
+ - ``n`` -- nonnegative integer
585
+
586
+ - ``alphabet`` -- (default: ``'x'``) a variable for the expansion
587
+
588
+ OUTPUT:
589
+
590
+ A monomial expansion of ``self`` in the `n` variables
591
+ labelled by ``alphabet``.
592
+
593
+ EXAMPLES::
594
+
595
+ sage: s = SymmetricFunctions(QQ).s()
596
+ sage: a = s([2,1])
597
+ sage: a.expand(2)
598
+ x0^2*x1 + x0*x1^2
599
+ sage: a.expand(3)
600
+ x0^2*x1 + x0*x1^2 + x0^2*x2 + 2*x0*x1*x2 + x1^2*x2 + x0*x2^2 + x1*x2^2
601
+ sage: a.expand(4)
602
+ x0^2*x1 + x0*x1^2 + x0^2*x2 + 2*x0*x1*x2 + x1^2*x2 + x0*x2^2 + x1*x2^2 + x0^2*x3 + 2*x0*x1*x3 + x1^2*x3 + 2*x0*x2*x3 + 2*x1*x2*x3 + x2^2*x3 + x0*x3^2 + x1*x3^2 + x2*x3^2
603
+ sage: a.expand(2, alphabet='y')
604
+ y0^2*y1 + y0*y1^2
605
+ sage: a.expand(2, alphabet=['a','b'])
606
+ a^2*b + a*b^2
607
+ sage: s([1,1,1,1]).expand(3)
608
+ 0
609
+ sage: (s([]) + 2*s([1])).expand(3)
610
+ 2*x0 + 2*x1 + 2*x2 + 1
611
+ sage: s([1]).expand(0)
612
+ 0
613
+ sage: (3*s([])).expand(0)
614
+ 3
615
+ """
616
+ condition = lambda part: len(part) > n
617
+ return self._expand(condition, n, alphabet)
618
+
619
+ def principal_specialization(self, n=infinity, q=None):
620
+ r"""
621
+ Return the principal specialization of a symmetric function.
622
+
623
+ The *principal specialization* of order `n` at `q`
624
+ is the ring homomorphism `ps_{n,q}` from the ring of
625
+ symmetric functions to another commutative ring `R`
626
+ given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}`
627
+ and `x_i \mapsto 0` for `i > n`.
628
+ Here, `q` is a given element of `R`, and we assume that
629
+ the variables of our symmetric functions are
630
+ `x_1, x_2, x_3, \ldots`.
631
+ (To be more precise, `ps_{n,q}` is a `K`-algebra
632
+ homomorphism, where `K` is the base ring.)
633
+ See Section 7.8 of [EnumComb2]_.
634
+
635
+ The *stable principal specialization* at `q` is the ring
636
+ homomorphism `ps_q` from the ring of symmetric functions
637
+ to another commutative ring `R` given by
638
+ `x_i \mapsto q^{i-1}` for all `i`.
639
+ This is well-defined only if the resulting infinite sums
640
+ converge; thus, in particular, setting `q = 1` in the
641
+ stable principal specialization is an invalid operation.
642
+
643
+ INPUT:
644
+
645
+ - ``n`` -- (default: ``infinity``) a nonnegative integer or
646
+ ``infinity``, specifying whether to compute the principal
647
+ specialization of order ``n`` or the stable principal
648
+ specialization.
649
+
650
+ - ``q`` -- (default: ``None``) the value to use for `q`; the
651
+ default is to create a ring of polynomials in ``q``
652
+ (or a field of rational functions in ``q``) over the
653
+ given coefficient ring.
654
+
655
+ For `q=1` we use the formula from Corollary 7.21.4 of [EnumComb2]_:
656
+
657
+ .. MATH::
658
+
659
+ ps_{n,1}(s_\lambda) = \prod_{u\in\lambda} (n+c(u)) / h(u),
660
+
661
+ where `h(u)` is the hook length of a cell `u` in `\lambda`,
662
+ and where `c(u)` is the content of a cell `u` in `\lambda`.
663
+
664
+ For `n=infinity` we use the formula from Corollary 7.21.3 of [EnumComb2]_
665
+
666
+ .. MATH::
667
+
668
+ ps_q(s_\lambda) = q^{\sum_i (i-1)\lambda_i} / \prod_{u\in\lambda} (1-q^{h(u)}).
669
+
670
+ Otherwise, we use the formula from Theorem 7.21.2 of [EnumComb2]_,
671
+
672
+ .. MATH::
673
+
674
+ ps_{n,q}(s_\lambda) = q^{\sum_i (i-1)\lambda_i}
675
+ \prod_{u\in\lambda} (1-q^{n+c(u)})/(1-q^{h(u)}).
676
+
677
+ EXAMPLES::
678
+
679
+ sage: s = SymmetricFunctions(QQ).s()
680
+ sage: x = s[2]
681
+ sage: x.principal_specialization(3)
682
+ q^4 + q^3 + 2*q^2 + q + 1
683
+
684
+ sage: x = 3*s[2,2] + 2*s[1] + 1
685
+ sage: x.principal_specialization(3, q=var("q")) # needs sage.symbolic
686
+ 3*(q^4 - 1)*(q^3 - 1)*q^2/((q^2 - 1)*(q - 1)) + 2*(q^3 - 1)/(q - 1) + 1
687
+
688
+ sage: x.principal_specialization(q=var("q")) # needs sage.symbolic
689
+ -2/(q - 1) + 3*q^2/((q^3 - 1)*(q^2 - 1)^2*(q - 1)) + 1
690
+
691
+ TESTS::
692
+
693
+ sage: s.zero().principal_specialization(3)
694
+ 0
695
+ """
696
+ def get_variable(ring, name):
697
+ try:
698
+ ring(name)
699
+ except TypeError:
700
+ from sage.rings.polynomial.polynomial_ring_constructor import (
701
+ PolynomialRing,
702
+ )
703
+ return PolynomialRing(ring, name).gen()
704
+ else:
705
+ raise ValueError("the variable %s is in the base ring, pass it explicitly" % name)
706
+
707
+ if q is None:
708
+ q = get_variable(self.base_ring(), 'q')
709
+ if q == 1:
710
+ if n == infinity:
711
+ raise ValueError("the stable principal specialization at q=1 is not defined")
712
+ f = lambda partition: (prod(n+j-i for (i, j) in partition.cells())
713
+ // prod(h for h in partition.hooks()))
714
+ elif n == infinity:
715
+ f = lambda partition: (q**sum(i*part for i, part in enumerate(partition))
716
+ / prod(1-q**h for h in partition.hooks()))
717
+ else:
718
+ from sage.rings.integer_ring import ZZ
719
+ ZZq = PolynomialRing(ZZ, "q")
720
+ q_lim = ZZq.gen()
721
+
722
+ def f(partition):
723
+ if n < len(partition):
724
+ return 0
725
+ power = q**sum(i * part for i, part in enumerate(partition))
726
+ denom = prod(1 - q**h for h in partition.hooks())
727
+ try:
728
+ ~denom
729
+ rational = (power
730
+ * prod(1-q**(n+j-i)
731
+ for (i, j) in partition.cells())
732
+ / denom)
733
+ return q.parent()(rational)
734
+ except (ZeroDivisionError, NotImplementedError, TypeError):
735
+ # If denom is not invertible, we need to do the
736
+ # computation with universal coefficients instead:
737
+ quotient = ZZq((prod(1-q_lim**(n+j-i)
738
+ for (i, j) in partition.cells()))
739
+ / prod(1-q_lim**h for h in partition.hooks()))
740
+ return power * quotient.subs({q_lim: q})
741
+
742
+ return self.parent()._apply_module_morphism(self, f, q.parent())
743
+
744
+ def exponential_specialization(self, t=None, q=1):
745
+ r"""
746
+ Return the exponential specialization of a
747
+ symmetric function (when `q = 1`), or the
748
+ `q`-exponential specialization (when `q \neq 1`).
749
+
750
+ The *exponential specialization* `ex` at `t` is a
751
+ `K`-algebra homomorphism from the `K`-algebra of
752
+ symmetric functions to another `K`-algebra `R`.
753
+ It is defined whenever the base ring `K` is a
754
+ `\QQ`-algebra and `t` is an element of `R`.
755
+ The easiest way to define it is by specifying its
756
+ values on the powersum symmetric functions to be
757
+ `p_1 = t` and `p_n = 0` for `n > 1`.
758
+ Equivalently, on the homogeneous functions it is
759
+ given by `ex(h_n) = t^n / n!`; see Proposition 7.8.4 of
760
+ [EnumComb2]_.
761
+
762
+ By analogy, the `q`-exponential specialization is a
763
+ `K`-algebra homomorphism from the `K`-algebra of
764
+ symmetric functions to another `K`-algebra `R` that
765
+ depends on two elements `t` and `q` of `R` for which
766
+ the elements `1 - q^i` for all positive integers `i`
767
+ are invertible.
768
+ It can be defined by specifying its values on the
769
+ complete homogeneous symmetric functions to be
770
+
771
+ .. MATH::
772
+
773
+ ex_q(h_n) = t^n / [n]_q!,
774
+
775
+ where `[n]_q!` is the `q`-factorial. Equivalently, for
776
+ `q \neq 1` and a homogeneous symmetric function `f` of
777
+ degree `n`, we have
778
+
779
+ .. MATH::
780
+
781
+ ex_q(f) = (1-q)^n t^n ps_q(f),
782
+
783
+ where `ps_q(f)` is the stable principal specialization of `f`
784
+ (see :meth:`principal_specialization`).
785
+ (See (7.29) in [EnumComb2]_.)
786
+
787
+ The limit of `ex_q` as `q \to 1` is `ex`.
788
+
789
+ INPUT:
790
+
791
+ - ``t`` -- (default: ``None``) the value to use for `t`;
792
+ the default is to create a ring of polynomials in ``t``
793
+
794
+ - ``q`` -- (default: `1`) the value to use for `q`. If
795
+ ``q`` is ``None``, then a ring (or fraction field) of
796
+ polynomials in ``q`` is created.
797
+
798
+ We use the formula in the proof of Corollary 7.21.6 of
799
+ [EnumComb2]_
800
+
801
+ .. MATH::
802
+
803
+ ex_{q}(s_\lambda) = t^{|\lambda|} q^{\sum_i (i-1)\lambda_i}
804
+ / \prod_{u\in\lambda} (1 + q + q^2 + \dots + q^{h(u)-1})
805
+
806
+ where `h(u)` is the hook length of a cell `u` in `\lambda`.
807
+
808
+ As a limit case, we obtain a formula for `q=1`
809
+
810
+ .. MATH::
811
+
812
+ ex_{1}(s_\lambda) = f^\lambda t^{|\lambda|} / |\lambda|!
813
+
814
+ where `f^\lambda` is the number of standard Young
815
+ tableaux of shape `\lambda`.
816
+
817
+ EXAMPLES::
818
+
819
+ sage: s = SymmetricFunctions(QQ).s()
820
+ sage: x = s[5,3]
821
+ sage: x.exponential_specialization()
822
+ 1/1440*t^8
823
+
824
+ sage: x = 5*s[1,1,1] + 3*s[2,1] + 1
825
+ sage: x.exponential_specialization()
826
+ 11/6*t^3 + 1
827
+
828
+ We also support the `q`-exponential_specialization::
829
+
830
+ sage: factor(s[3].exponential_specialization(q=var("q"), t=var("t"))) # needs sage.symbolic
831
+ t^3/((q^2 + q + 1)*(q + 1))
832
+
833
+ TESTS::
834
+
835
+ sage: s.zero().exponential_specialization()
836
+ 0
837
+ """
838
+ def get_variable(ring, name):
839
+ try:
840
+ ring(name)
841
+ except TypeError:
842
+ from sage.rings.polynomial.polynomial_ring_constructor import (
843
+ PolynomialRing,
844
+ )
845
+ return PolynomialRing(ring, name).gen()
846
+ else:
847
+ raise ValueError("the variable %s is in the base ring, pass it explicitly" % name)
848
+
849
+ if q == 1:
850
+ if t is None:
851
+ t = get_variable(self.base_ring(), 't')
852
+
853
+ def f(partition):
854
+ n = partition.size()
855
+ return (StandardTableaux(partition).cardinality()
856
+ * t**n / factorial(n))
857
+
858
+ return self.parent()._apply_module_morphism(self, f, t.parent())
859
+
860
+ if q is None and t is None:
861
+ q = get_variable(self.base_ring(), 'q')
862
+ t = get_variable(q.parent(), 't')
863
+ elif q is None:
864
+ q = get_variable(t.parent(), 'q')
865
+ elif t is None:
866
+ t = get_variable(q.parent(), 't')
867
+
868
+ f = lambda partition: (t**partition.size()
869
+ * q**sum(i*part for i, part in enumerate(partition))
870
+ / prod(sum(q**i for i in range(h)) for h in partition.hooks()))
871
+
872
+ return self.parent()._apply_module_morphism(self, f, t.parent())
873
+
874
+
875
+ # Backward compatibility for unpickling
876
+ from sage.misc.persist import register_unpickle_override
877
+
878
+ register_unpickle_override('sage.combinat.sf.schur',
879
+ 'SymmetricFunctionAlgebraElement_schur',
880
+ SymmetricFunctionAlgebra_schur.Element)