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
sage/combinat/sf/sf.py ADDED
@@ -0,0 +1,1653 @@
1
+ # sage_setup: distribution = sagemath-combinat
2
+ # sage.doctest: needs sage.combinat sage.modules
3
+ """
4
+ Symmetric functions, with their multiple realizations
5
+ """
6
+ # ****************************************************************************
7
+ # Copyright (C) 2007 Mike Hansen <mhansen@gmail.com>
8
+ # 2009-2012 Jason Bandlow <jbandlow@gmail.com>
9
+ # 2012 Anne Schilling <anne at math.ucdavis.edu>
10
+ # 2009-2012 Nicolas M. Thiery <nthiery at users.sf.net>
11
+ # 2012 Mike Zabrocki <mike.zabrocki@gmail.com>
12
+ #
13
+ # Distributed under the terms of the GNU General Public License (GPL)
14
+ #
15
+ # This code is distributed in the hope that it will be useful,
16
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
+ # General Public License for more details.
19
+ #
20
+ # The full text of the GPL is available at:
21
+ #
22
+ # http://www.gnu.org/licenses/
23
+ #*****************************************************************************
24
+ from sage.categories.fields import Fields
25
+ from sage.categories.graded_hopf_algebras import GradedHopfAlgebras
26
+ from sage.categories.principal_ideal_domains import PrincipalIdealDomains
27
+ from sage.categories.rings import Rings
28
+ from sage.categories.unique_factorization_domains import UniqueFactorizationDomains
29
+ from sage.combinat.partition import Partitions
30
+ from sage.misc.lazy_import import lazy_import
31
+ from sage.rings.rational_field import QQ
32
+ from sage.structure.parent import Parent
33
+ from sage.structure.unique_representation import UniqueRepresentation
34
+
35
+ from . import (
36
+ elementary,
37
+ hall_littlewood,
38
+ homogeneous,
39
+ jack,
40
+ llt,
41
+ macdonald,
42
+ monomial,
43
+ powersum,
44
+ schur,
45
+ )
46
+
47
+ lazy_import('sage.combinat.free_module', 'CombinatorialFreeModule')
48
+
49
+
50
+ class SymmetricFunctions(UniqueRepresentation, Parent):
51
+ r"""
52
+ The abstract algebra of commutative symmetric functions.
53
+
54
+ .. rubric:: Symmetric Functions in Sage
55
+
56
+ .. MODULEAUTHOR:: Jason Bandlow, Anne Schilling, Nicolas M. Thiery, Mike Zabrocki
57
+
58
+ This document is an introduction to working with symmetric function
59
+ theory in Sage.
60
+ It is not intended to be an introduction to the theory
61
+ of symmetric functions ([MAC]_ and [STA]_, Chapter 7, are two excellent
62
+ references.) The reader is also expected to be familiar with Sage.
63
+
64
+ .. rubric:: The algebra of symmetric functions
65
+
66
+ The algebra of symmetric functions is the unique free commutative graded
67
+ connected algebra over the given ring, with one generator in each degree. It
68
+ can also be thought of as the inverse limit (in the category of graded
69
+ algebras) of the algebra of symmetric polynomials in `n` variables as `n \rightarrow \infty`.
70
+ Sage allows us to construct the algebra of symmetric functions over
71
+ any ring. We will use a base ring of rational numbers in these first
72
+ examples::
73
+
74
+ sage: Sym = SymmetricFunctions(QQ)
75
+ sage: Sym
76
+ Symmetric Functions over Rational Field
77
+
78
+ Sage knows certain categorical information about this algebra::
79
+
80
+ sage: Sym.category()
81
+ Join of Category of Hopf algebras over Rational Field
82
+ and Category of unique factorization domains
83
+ and Category of graded algebras over Rational Field
84
+ and Category of commutative algebras over Rational Field
85
+ and Category of monoids with realizations
86
+ and Category of graded coalgebras over Rational Field
87
+ and Category of coalgebras over Rational Field with realizations
88
+ and Category of cocommutative coalgebras over Rational Field
89
+
90
+ Notice that ``Sym`` is an *abstract* algebra. This reflects the fact that
91
+ there are multiple natural bases. To work with specific
92
+ elements, we need a *realization* of this algebra. In practice, this
93
+ means we need to specify a basis.
94
+
95
+ .. rubric:: An example basis - power sums
96
+
97
+ Here is an example of how one might use the power sum realization::
98
+
99
+ sage: p = Sym.powersum()
100
+ sage: p
101
+ Symmetric Functions over Rational Field in the powersum basis
102
+
103
+ ``p`` now represents the realization of the symmetric function algebra on
104
+ the power sum basis. The basis itself is accessible through::
105
+
106
+ sage: p.basis()
107
+ Lazy family (Term map from Partitions to Symmetric Functions over Rational Field in the powersum basis(i))_{i in Partitions}
108
+ sage: p.basis().keys()
109
+ Partitions
110
+
111
+ This last line means that ``p.basis()`` is an association between the set
112
+ of Partitions and the basis elements of the algebra ``p``. To construct a
113
+ specific element one can therefore do::
114
+
115
+ sage: p.basis()[Partition([2,1,1])]
116
+ p[2, 1, 1]
117
+
118
+ As this is rather cumbersome, realizations of the symmetric function
119
+ algebra allow for the following abuses of notation::
120
+
121
+ sage: p[Partition([2, 1, 1])]
122
+ p[2, 1, 1]
123
+ sage: p[[2, 1, 1]]
124
+ p[2, 1, 1]
125
+ sage: p[2, 1, 1]
126
+ p[2, 1, 1]
127
+
128
+ or even::
129
+
130
+ sage: p[(i for i in [2, 1, 1])]
131
+ p[2, 1, 1]
132
+
133
+ In the special case of the empty partition, due to a limitation in
134
+ Python syntax, one cannot use::
135
+
136
+ sage: p[] # todo: not implemented
137
+
138
+ Please use instead::
139
+
140
+ sage: p[[]]
141
+ p[]
142
+
143
+ .. NOTE:: When elements are constructed using the ``p[something ]`` syntax ,
144
+ an error will be raised if the input cannot be interpreted as a partition.
145
+ This is *not* the case when ``p.basis()`` is used::
146
+
147
+ sage: p['something']
148
+ Traceback (most recent call last):
149
+ ...
150
+ ValueError: all parts of 'something' should be nonnegative integers
151
+ sage: p.basis()['something']
152
+ p'something'
153
+
154
+ Elements of ``p`` are linear combinations of such compositions::
155
+
156
+ sage: p.an_element()
157
+ 2*p[] + 2*p[1] + 3*p[2]
158
+
159
+ .. rubric:: Algebra structure
160
+
161
+ Algebraic combinations of basis elements can be entered in a natural way::
162
+
163
+ sage: p[2,1,1] + 2 * p[1] * (p[4] + p[2,1])
164
+ 3*p[2, 1, 1] + 2*p[4, 1]
165
+
166
+ Let us explore the other operations of ``p``. We can ask for
167
+ the mathematical properties of ``p``::
168
+
169
+ sage: p.categories()
170
+ [Category of graded bases of Symmetric Functions over Rational Field,
171
+ Category of filtered bases of Symmetric Functions over Rational Field,
172
+ Category of bases of Symmetric Functions over Rational Field,
173
+ Category of graded Hopf algebras with basis over Rational Field,
174
+ ...]
175
+
176
+ To start with, ``p`` is a graded algebra, the grading being induced
177
+ by the size of the partitions. Due to this, the one is the basis
178
+ element indexed by the empty partition::
179
+
180
+ sage: p.one()
181
+ p[]
182
+
183
+ The ``p`` basis is multiplicative; that is, multiplication is induced by
184
+ linearity from the (nonincreasingly sorted) concatenation of partitions::
185
+
186
+ sage: p[3,1] * p[2,1]
187
+ p[3, 2, 1, 1]
188
+
189
+ sage: (p.one() + 2 * p[3,1]) * p[4, 2]
190
+ p[4, 2] + 2*p[4, 3, 2, 1]
191
+
192
+ .. rubric:: The classical bases
193
+
194
+ In addition to the power sum basis, other classical bases of the
195
+ symmetric function algebra include the elementary, complete
196
+ homogeneous, monomial, and Schur bases::
197
+
198
+ sage: e = Sym.elementary()
199
+ sage: h = Sym.homogeneous()
200
+ sage: m = Sym.monomial()
201
+ sage: s = Sym.schur()
202
+
203
+ These and others can be defined all at once with the single command::
204
+
205
+ sage: Sym.inject_shorthands()
206
+ Defining e as shorthand for Symmetric Functions over Rational Field in the elementary basis
207
+ Defining f as shorthand for Symmetric Functions over Rational Field in the forgotten basis
208
+ Defining h as shorthand for Symmetric Functions over Rational Field in the homogeneous basis
209
+ Defining m as shorthand for Symmetric Functions over Rational Field in the monomial basis
210
+ Defining p as shorthand for Symmetric Functions over Rational Field in the powersum basis
211
+ Defining s as shorthand for Symmetric Functions over Rational Field in the Schur basis
212
+
213
+ We can then do conversions from one basis to another::
214
+
215
+ sage: s(p[2,1])
216
+ -s[1, 1, 1] + s[3]
217
+
218
+ sage: m(p[3])
219
+ m[3]
220
+ sage: m(p[3,2])
221
+ m[3, 2] + m[5]
222
+
223
+ For computations which mix bases, Sage will return a result with respect
224
+ to a single (not necessarily predictable) basis::
225
+
226
+ sage: p[2] * s[2] - m[4]
227
+ 1/2*p[2, 1, 1] + 1/2*p[2, 2] - p[4]
228
+
229
+ sage: p( m[1] * ( e[3]*s[2] + 1 ))
230
+ p[1] + 1/12*p[1, 1, 1, 1, 1, 1] - 1/6*p[2, 1, 1, 1, 1] - 1/4*p[2, 2, 1, 1] + 1/6*p[3, 1, 1, 1] + 1/6*p[3, 2, 1]
231
+
232
+
233
+ The one for different bases such as the power sum and Schur function is the same::
234
+
235
+ sage: s.one() == p.one()
236
+ True
237
+
238
+ .. rubric:: Basic computations
239
+
240
+ In this section, we explore some of the many methods that can be applied
241
+ to an arbitrary symmetric function::
242
+
243
+ sage: f = s[2]^2; f
244
+ s[2, 2] + s[3, 1] + s[4]
245
+
246
+ For more methods than discussed here, create a symmetric function as
247
+ above, and use ``f.<tab>``.
248
+
249
+ .. _`Representation theory of the symmetric group`:
250
+
251
+ .. rubric:: Representation theory of the symmetric group
252
+
253
+ The Schur functions `s_\lambda` can also be interpreted as irreducible characters of the symmetric
254
+ group `S_n`, where `n` is the size of the partition `\lambda`. Since the Schur functions of
255
+ degree `n` form a basis of the symmetric functions of degree `n`, it
256
+ follows that an arbitrary symmetric function (homogeneous of degree
257
+ `n`) may be interpreted as a function on the symmetric group. In this
258
+ interpretation the power sum symmetric function `p_\lambda` is the characteristic
259
+ function of the conjugacy class with shape `\lambda`, multiplied by the order of
260
+ the centralizer of an element. Hence the irreducible characters can be computed
261
+ as follows::
262
+
263
+ sage: Sym = SymmetricFunctions(QQ)
264
+ sage: s = Sym.schur()
265
+ sage: p = Sym.power()
266
+ sage: P = Partitions(5).list()
267
+ sage: P = [P[i] for i in range(len(P)-1,-1,-1)]
268
+ sage: M = matrix([[s[P[i]].scalar(p[P[j]]) for j in range(len(P))] for i in range(len(P))])
269
+ sage: M
270
+ [ 1 -1 1 1 -1 -1 1]
271
+ [ 4 -2 0 1 1 0 -1]
272
+ [ 5 -1 1 -1 -1 1 0]
273
+ [ 6 0 -2 0 0 0 1]
274
+ [ 5 1 1 -1 1 -1 0]
275
+ [ 4 2 0 1 -1 0 -1]
276
+ [ 1 1 1 1 1 1 1]
277
+
278
+ We can indeed check that this agrees with the character table of `S_5`::
279
+
280
+ sage: SymmetricGroup(5).character_table() == M
281
+ True
282
+
283
+ In this interpretation of symmetric functions as characters on the
284
+ symmetric group, the multiplication and comultiplication are
285
+ interpreted as induction (from `S_n\times S_m` to `S_{n+m}`)
286
+ and restriction, respectively. The Schur functions can also be interpreted
287
+ as characters of `GL_n`, see `Partitions and Schur functions`__.
288
+
289
+ __ ../../../../../thematic_tutorials/lie/lie_basics.html#partitions-and-schur-polynomials
290
+
291
+ .. rubric:: The omega involution
292
+
293
+ The `\omega` involution is the linear extension of the map which sends
294
+ `e_\lambda` to `h_{\lambda}`::
295
+
296
+ sage: h(f)
297
+ h[2, 2]
298
+ sage: e(f.omega())
299
+ e[2, 2]
300
+
301
+ .. rubric:: The Hall scalar product
302
+
303
+ The Hall scalar product on the algebra of symmetric functions makes the
304
+ Schur functions into an orthonormal basis::
305
+
306
+ sage: f.scalar(f)
307
+ 3
308
+
309
+ .. rubric:: Skewing
310
+
311
+ *Skewing* is the adjoint operation to multiplication with respect to
312
+ this scalar product::
313
+
314
+ sage: f.skew_by(s[1])
315
+ 2*s[2, 1] + 2*s[3]
316
+
317
+ In general, ``s[la].skew_by(s[mu])`` is the symmetric function typically
318
+ denoted `s_{\lambda \setminus \mu}` or `s_{\lambda / \mu}`.
319
+
320
+ .. rubric:: Expanding into variables
321
+
322
+ We can expand a symmetric function into a symmetric polynomial in a
323
+ specified number of variables::
324
+
325
+ sage: f.expand(2)
326
+ x0^4 + 2*x0^3*x1 + 3*x0^2*x1^2 + 2*x0*x1^3 + x1^4
327
+
328
+ See the documentation for ``expand`` for more examples.
329
+
330
+ .. rubric:: The Kronecker product
331
+
332
+ As in the section on the `Representation theory of
333
+ the symmetric group`_, a symmetric function may be considered as a
334
+ class function on the symmetric group where the elements
335
+ `p_\mu/z_\mu` are the indicators of a permutation having
336
+ cycle structure `\mu`. The Kronecker product of two
337
+ symmetric functions corresponds to the pointwise product
338
+ of these class functions.
339
+
340
+ Since the Schur functions are the irreducible characters
341
+ of the symmetric group under this identification, the Kronecker
342
+ product of two Schur functions corresponds to the internal
343
+ tensor product of two irreducible symmetric group representations.
344
+
345
+ Under this identification, the Kronecker
346
+ product of `p_\mu/z_\mu` and `p_\nu/z_\nu` is `p_\mu/z_\mu`
347
+ if `\mu=\nu`, and the result is equal to `0` otherwise.
348
+
349
+ ``internal_product``, ``kronecker_product``, ``inner_tensor`` and
350
+ ``itensor`` are different names for the same function.
351
+
352
+ ::
353
+
354
+ sage: f.kronecker_product(f)
355
+ s[1, 1, 1, 1] + 3*s[2, 1, 1] + 4*s[2, 2] + 5*s[3, 1] + 3*s[4]
356
+
357
+ .. rubric:: Plethysm
358
+
359
+ The *plethysm* of symmetric functions is the operation corresponding to
360
+ composition of representations of the general linear group. See [STA]_
361
+ Chapter 7, Appendix 2 for details.
362
+ ::
363
+
364
+ sage: s[2].plethysm(s[2])
365
+ s[2, 2] + s[4]
366
+
367
+ Plethysm can also be written as a composition of functions::
368
+
369
+ sage: s[2]( s[2] )
370
+ s[2, 2] + s[4]
371
+
372
+ If the coefficient ring contains degree 1 elements, these are handled
373
+ properly by plethysm::
374
+
375
+ sage: R.<t> = QQ[]; s = SymmetricFunctions(R).schur()
376
+ sage: s[2]( (1-t)*s[1] )
377
+ (t^2-t)*s[1, 1] + (-t+1)*s[2]
378
+
379
+ See the documentation for ``plethysm`` for more information.
380
+
381
+ .. rubric:: Inner plethysm
382
+
383
+ The operation of inner plethysm ``f.inner_plethysm(g)`` models the
384
+ composition of the `S_n` representation represented by `g` with the
385
+ `GL_m` representation whose character is `f`. See the documentation of
386
+ ``inner_plethysm``, [ST94]_ or [STA]_, exercise 7.74 solutions for more
387
+ information::
388
+
389
+ sage: s = SymmetricFunctions(QQ).schur()
390
+ sage: f = s[2]^2 # needs lrcalc_python
391
+ sage: f.inner_plethysm(s[2]) # needs lrcalc_python
392
+ s[2]
393
+
394
+ .. rubric:: Hopf algebra structure
395
+
396
+ The ring of symmetric functions is further endowed with a coalgebra
397
+ structure. The coproduct is an algebra morphism, and therefore
398
+ determined by its values on the generators; the power sum generators
399
+ are primitive::
400
+
401
+ sage: p[1].coproduct()
402
+ p[] # p[1] + p[1] # p[]
403
+ sage: p[2].coproduct()
404
+ p[] # p[2] + p[2] # p[]
405
+
406
+ The coproduct, being cocommutative on the generators, is cocommutative everywhere::
407
+
408
+ sage: p[2, 1].coproduct()
409
+ p[] # p[2, 1] + p[1] # p[2] + p[2] # p[1] + p[2, 1] # p[]
410
+
411
+ This coproduct, along with the counit which sends every symmetric function
412
+ to its `0`-th homogeneous component, makes the ring of symmetric functions
413
+ into a graded connected bialgebra. It is known that every graded connected
414
+ bialgebra has an antipode. For the ring of symmetric functions, the antipode
415
+ can be characterized explicitly: The antipode is an anti-algebra morphism
416
+ (thus an algebra morphism, since our algebra is commutative) which sends
417
+ `p_{\lambda}` to `(-1)^{\mathrm{length}(\lambda)} p_{\lambda}` for every
418
+ partition `\lambda`. Thus, in particular, it sends the generators on the
419
+ ``p`` basis to their opposites::
420
+
421
+ sage: p[3].antipode()
422
+ -p[3]
423
+ sage: p[3,2,1].antipode()
424
+ -p[3, 2, 1]
425
+
426
+ The graded connected bialgebra of symmetric functions over a `\QQ`-algebra
427
+ has a rather simply-understood structure: It is (isomorphic to) the
428
+ symmetric algebra of its space of primitives (which is spanned by the
429
+ power-sum symmetric functions).
430
+
431
+ Here are further examples::
432
+
433
+ sage: # needs lrcalc_python
434
+ sage: f = s[2]^2
435
+ sage: f.antipode()
436
+ s[1, 1, 1, 1] + s[2, 1, 1] + s[2, 2]
437
+ sage: f.coproduct()
438
+ s[] # s[2, 2] + s[] # s[3, 1] + s[] # s[4] + 2*s[1] # s[2, 1] + 2*s[1] # s[3] + s[1, 1] # s[1, 1]
439
+ + s[1, 1] # s[2] + s[2] # s[1, 1] + 3*s[2] # s[2] + 2*s[2, 1] # s[1] + s[2, 2] # s[] + 2*s[3] # s[1]
440
+ + s[3, 1] # s[] + s[4] # s[]
441
+ sage: f.coproduct().apply_multilinear_morphism( lambda x,y: x*y.antipode() )
442
+ 0
443
+
444
+ .. rubric:: Transformations of symmetric functions
445
+
446
+ There are many methods in Sage which make it easy to manipulate symmetric
447
+ functions. For example, if we have some function which acts on partitions
448
+ (say, conjugation), it is a simple matter to apply it to the support of a
449
+ symmetric function. Here is an example::
450
+
451
+ sage: conj = lambda mu: mu.conjugate()
452
+ sage: f = h[4] + 2*h[3,1]
453
+ sage: f.map_support(conj)
454
+ h[1, 1, 1, 1] + 2*h[2, 1, 1]
455
+
456
+ We can also easily modify the coefficients::
457
+
458
+ sage: def foo(mu, coeff): return mu.conjugate(), -coeff
459
+ sage: f.map_item(foo)
460
+ -h[1, 1, 1, 1] - 2*h[2, 1, 1]
461
+
462
+ See also ``map_coefficients``.
463
+
464
+ There are also methods for building functions directly::
465
+
466
+ sage: s.sum_of_monomials(mu for mu in Partitions(3))
467
+ s[1, 1, 1] + s[2, 1] + s[3]
468
+ sage: s.sum_of_monomials(Partitions(3))
469
+ s[1, 1, 1] + s[2, 1] + s[3]
470
+ sage: s.sum_of_terms( (mu, mu[0]) for mu in Partitions(3))
471
+ s[1, 1, 1] + 2*s[2, 1] + 3*s[3]
472
+
473
+ These are the preferred way to build elements within a program;
474
+ the result will usually be faster than using :func:`sum`. It also
475
+ guarantees that empty sums yields the zero of ``s`` (see also
476
+ ``s.sum``).
477
+
478
+ Note also that it is a good idea to use::
479
+
480
+ sage: s.one()
481
+ s[]
482
+ sage: s.zero()
483
+ 0
484
+
485
+ instead of ``s(1)`` and ``s(0)`` within programs where speed is important,
486
+ in order to prevent unnecessary coercions.
487
+
488
+ .. rubric:: Different base rings
489
+
490
+ Depending on the base ring, the different realizations of the symmetric
491
+ function algebra may not span the same space::
492
+
493
+ sage: SZ = SymmetricFunctions(ZZ)
494
+ sage: p = SZ.power(); s = SZ.schur()
495
+ sage: p(s[1,1,1])
496
+ Traceback (most recent call last):
497
+ ...
498
+ TypeError: no conversion of this rational to integer
499
+
500
+ Because of this, some functions may not behave as expected when working over
501
+ the integers, even though they make mathematical sense::
502
+
503
+ sage: s[1,1,1].plethysm(s[1,1,1])
504
+ Traceback (most recent call last):
505
+ ...
506
+ TypeError: no conversion of this rational to integer
507
+
508
+ It is possible to work over different base rings simultaneously::
509
+
510
+ sage: s = SymmetricFunctions(QQ).schur()
511
+ sage: p = SymmetricFunctions(QQ).power()
512
+ sage: sz = SymmetricFunctions(ZZ).schur(); sz._prefix = 'sz'
513
+ sage: pz = SymmetricFunctions(ZZ).power(); pz._prefix = 'pz'
514
+ sage: p(sz[1,1,1])
515
+ 1/6*p[1, 1, 1] - 1/2*p[2, 1] + 1/3*p[3]
516
+ sage: sz( 1/6*p[1, 1, 1] - 1/2*p[2, 1] + 1/3*p[3] )
517
+ sz[1, 1, 1]
518
+
519
+ As shown in this example, if you are working over multiple base rings
520
+ simultaneously, it is a good idea to change the prefix in some cases, so that
521
+ you can tell from the output which realization your result is in.
522
+
523
+ Let us change the notation back for the remainder of this tutorial::
524
+
525
+ sage: sz._prefix = 's'
526
+ sage: pz._prefix = 'p'
527
+
528
+ One can also use the Sage standard renaming idiom to get shorter outputs::
529
+
530
+ sage: Sym = SymmetricFunctions(QQ)
531
+ sage: Sym.rename('Sym')
532
+ sage: Sym
533
+ Sym
534
+ sage: Sym.rename()
535
+
536
+ And we name it back::
537
+
538
+ sage: Sym.rename('Symmetric Functions over Rational Field'); Sym
539
+ Symmetric Functions over Rational Field
540
+
541
+ .. rubric:: Other bases
542
+
543
+ There are two additional basis of the symmetric functions which are not
544
+ considered as classical bases:
545
+
546
+ * forgotten basis
547
+ * Witt basis
548
+
549
+ The forgotten basis is the dual basis of the elementary symmetric
550
+ functions basis with respect to the Hall scalar product. The Witt basis
551
+ can be constructed by
552
+
553
+ .. MATH::
554
+
555
+ \prod_{d=1}^{\infty} (1 - w_d t^d)^{-1} = \sum_{n=0}^{\infty} h_n t^n
556
+
557
+ where `t` is a formal variable.
558
+
559
+ There are further bases of the ring of symmetric functions, in general over
560
+ fields with parameters such as `q` and `t`:
561
+
562
+ * Hall-Littlewood bases
563
+ * Jack bases
564
+ * Macdonald bases
565
+ * `k`-Schur functions
566
+ * Hecke character basis
567
+
568
+ We briefly demonstrate how to access these bases. For more information, see
569
+ the documentation of the individual bases.
570
+
571
+ The *Jack polynomials* can be obtained as::
572
+
573
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
574
+ sage: Jack = Sym.jack()
575
+ sage: P = Jack.P(); J = Jack.J(); Q = Jack.Q()
576
+ sage: J(P[2,1])
577
+ (1/(t+2))*JackJ[2, 1]
578
+
579
+ The parameter `t` can be specialized as follows::
580
+
581
+ sage: Sym = SymmetricFunctions(QQ)
582
+ sage: Jack = Sym.jack(t = 1)
583
+ sage: P = Jack.P(); J = Jack.J(); Q = Jack.Q()
584
+ sage: J(P[2,1])
585
+ 1/3*JackJ[2, 1]
586
+
587
+ Similarly one can access the Hall-Littlewood and Macdonald polynomials, etc::
588
+
589
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
590
+ sage: Mcd = Sym.macdonald()
591
+ sage: P = Mcd.P(); J = Mcd.J(); Q = Mcd.Q()
592
+ sage: J(P[2,1])
593
+ (1/(-q*t^4+2*q*t^3-q*t^2+t^2-2*t+1))*McdJ[2, 1]
594
+
595
+ We can also construct the `\bar{q}` basis that can be used
596
+ to determine character tables for Hecke algebras (with quadratic
597
+ relation `T_i^2 = (1-q) T_i + q`)::
598
+
599
+ sage: Sym = SymmetricFunctions(ZZ['q'].fraction_field())
600
+ sage: qbar = Sym.hecke_character()
601
+ sage: s = Sym.s()
602
+ sage: s(qbar[2,1])
603
+ -s[1, 1, 1] + (q-1)*s[2, 1] + q*s[3]
604
+
605
+ .. rubric:: `k`-Schur functions
606
+
607
+ The `k`-Schur functions live in the `k`-bounded subspace of the ring of
608
+ symmetric functions. It is possible to compute in the `k`-bounded subspace
609
+ directly::
610
+
611
+ sage: Sym = SymmetricFunctions(QQ)
612
+ sage: ks = Sym.kschur(3,1)
613
+ sage: f = ks[2,1]*ks[2,1]; f # needs lrcalc_python
614
+ ks3[2, 2, 1, 1] + ks3[2, 2, 2] + ks3[3, 1, 1, 1]
615
+
616
+ or to lift to the ring of symmetric functions::
617
+
618
+ sage: f.lift() # needs lrcalc_python
619
+ s[2, 2, 1, 1] + s[2, 2, 2] + s[3, 1, 1, 1] + 2*s[3, 2, 1] + s[3, 3] + s[4, 1, 1] + s[4, 2]
620
+
621
+ However, it is not always possible to convert a symmetric function to the `k`-bounded subspace::
622
+
623
+ sage: s = Sym.schur()
624
+ sage: ks(s[2,1,1]) # needs lrcalc_python
625
+ Traceback (most recent call last):
626
+ ...
627
+ ValueError: s[2, 1, 1] is not in the image
628
+
629
+ The `k`-Schur functions are more generally defined with a parameter `t` and they are
630
+ a basis of the subspace spanned by the Hall-Littlewood ``Qp`` symmetric functions
631
+ indexed by partitions whose first part is less than or equal to `k`::
632
+
633
+ sage: Sym = SymmetricFunctions(QQ['t'].fraction_field())
634
+ sage: SymS3 = Sym.kBoundedSubspace(3) # default t='t'
635
+ sage: ks = SymS3.kschur()
636
+ sage: Qp = Sym.hall_littlewood().Qp()
637
+ sage: ks(Qp[2,1,1,1])
638
+ ks3[2, 1, 1, 1] + (t^2+t)*ks3[2, 2, 1] + (t^3+t^2)*ks3[3, 1, 1] + t^4*ks3[3, 2]
639
+
640
+ The subspace spanned by the `k`-Schur functions with a parameter `t` are not known
641
+ to form a natural algebra. However it is known that the product of a `k`-Schur
642
+ function and an `\ell`-Schur function is in the linear span of the `k+\ell`-Schur
643
+ functions::
644
+
645
+ sage: # needs lrcalc_python
646
+ sage: ks(ks[2,1]*ks[1,1])
647
+ Traceback (most recent call last):
648
+ ...
649
+ ValueError: s[2, 1, 1, 1] + s[2, 2, 1] + s[3, 1, 1] + s[3, 2] is not in the image
650
+ sage: ks[2,1]*ks[1,1]
651
+ s[2, 1, 1, 1] + s[2, 2, 1] + s[3, 1, 1] + s[3, 2]
652
+ sage: ks6 = Sym.kBoundedSubspace(6).kschur()
653
+ sage: ks6(ks[3,1,1]*ks[3])
654
+ ks6[3, 3, 1, 1] + ks6[4, 2, 1, 1] + (t+1)*ks6[4, 3, 1] + t*ks6[4, 4]
655
+ + ks6[5, 1, 1, 1] + ks6[5, 2, 1] + t*ks6[5, 3] + ks6[6, 1, 1]
656
+
657
+ The `k`-split basis is a second basis of the ring spanned by the `k`-Schur
658
+ functions with a parameter `t`. The `k`-split basis has the property that
659
+ `Q'_\lambda[X;t]` expands positively in the `k`-split basis and the
660
+ `k`-split basis conjecturally expands positively in the `k`-Schur functions.
661
+ The definition can be found in [LLMSSZ]_ p. 81.::
662
+
663
+ sage: # needs lrcalc_python
664
+ sage: ksp3 = SymS3.ksplit()
665
+ sage: ksp3(Qp[2,1,1,1])
666
+ ksp3[2, 1, 1, 1] + t^2*ksp3[2, 2, 1] + (t^3+t^2)*ksp3[3, 1, 1] + t^4*ksp3[3, 2]
667
+ sage: [ks(ksp3(la)) for la in sorted(ksp3(Qp[2,1,1,1]).support())]
668
+ [ks3[2, 1, 1, 1] + t*ks3[2, 2, 1], ks3[2, 2, 1], ks3[3, 1, 1], ks3[3, 2]]
669
+
670
+ .. rubric:: dual `k`-Schur functions
671
+
672
+ The dual space to the subspace spanned by the `k`-Schur functions is most naturally
673
+ realized as a quotient of the ring of symmetric functions by an ideal. When `t=1`
674
+ the ideal is generated by the monomial symmetric functions indexed by partitions
675
+ whose first part is greater than `k`.::
676
+
677
+ sage: # needs lrcalc_python
678
+ sage: Sym = SymmetricFunctions(QQ)
679
+ sage: SymQ3 = Sym.kBoundedQuotient(3,t=1)
680
+ sage: km = SymQ3.kmonomial()
681
+ sage: km[2,1]*km[2,1]
682
+ 4*m3[2, 2, 1, 1] + 6*m3[2, 2, 2] + 2*m3[3, 2, 1] + 2*m3[3, 3]
683
+ sage: F = SymQ3.affineSchur()
684
+ sage: F[2,1]*F[2,1]
685
+ 2*F3[1, 1, 1, 1, 1, 1] + 4*F3[2, 1, 1, 1, 1] + 4*F3[2, 2, 1, 1] + 4*F3[2, 2, 2]
686
+ + 2*F3[3, 1, 1, 1] + 4*F3[3, 2, 1] + 2*F3[3, 3]
687
+
688
+ When `t` is not equal to `1`, the subspace spanned by the `k`-Schur functions is
689
+ realized as a quotient of the ring of symmetric functions by the ideal generated by
690
+ the Hall-Littlewood symmetric functions in the P basis indexed by partitions with
691
+ first part greater than `k`.::
692
+
693
+ sage: # needs lrcalc_python
694
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
695
+ sage: SymQ3 = Sym.kBoundedQuotient(3)
696
+ sage: kHLP = SymQ3.kHallLittlewoodP()
697
+ sage: kHLP[2,1]*kHLP[2,1]
698
+ (t^2+2*t+1)*HLP3[2, 2, 1, 1] + (t^3+2*t^2+2*t+1)*HLP3[2, 2, 2]
699
+ + (-t^4-t^3+t+1)*HLP3[3, 1, 1, 1] + (-t^2+t+2)*HLP3[3, 2, 1] + (t+1)*HLP3[3, 3]
700
+ sage: HLP = Sym.hall_littlewood().P()
701
+ sage: kHLP(HLP[3,1])
702
+ HLP3[3, 1]
703
+ sage: kHLP(HLP[4])
704
+ 0
705
+
706
+ In this space, the basis which is dual to the `k`-Schur functions conjecturally
707
+ expands positively in the `k`-bounded Hall-Littlewood functions and has positive
708
+ structure coefficients.::
709
+
710
+ sage: # needs lrcalc_python
711
+ sage: dks = SymQ3.dual_k_Schur()
712
+ sage: kHLP(dks[2,2])
713
+ (t^4+t^2)*HLP3[1, 1, 1, 1] + t*HLP3[2, 1, 1] + HLP3[2, 2]
714
+ sage: dks[2,1]*dks[1,1]
715
+ (t^2+t)*dks3[1, 1, 1, 1, 1] + (t+1)*dks3[2, 1, 1, 1] + (t+1)*dks3[2, 2, 1]
716
+ + dks3[3, 1, 1] + dks3[3, 2]
717
+
718
+ At `t=1` the `k`-bounded Hall-Littlewood basis is equal to the `k`-bounded monomial
719
+ basis and the dual `k`-Schur elements are equal to the affine Schur basis. The
720
+ `k`-bounded monomial basis and affine Schur functions are faster and should be used
721
+ instead of the `k`-bounded Hall-Littlewood P basis and dual `k`-Schur functions when
722
+ `t=1`.::
723
+
724
+ sage: SymQ3 = Sym.kBoundedQuotient(3,t=1)
725
+ sage: dks = SymQ3.dual_k_Schur()
726
+ sage: F = SymQ3.affineSchur()
727
+ sage: F[3,1]==dks[3,1] # needs lrcalc_python
728
+ True
729
+
730
+ .. rubric:: Implementing new bases
731
+
732
+ In order to implement a new symmetric function basis, Sage will need
733
+ to know at a minimum how to change back and forth between at least one
734
+ other basis (although they do not necessarily have to be the same basis).
735
+ All of the standard functions associated with the basis will have a
736
+ default implementation (although a more specific implementation may
737
+ be more efficient).
738
+
739
+ To present an idea of how this is done, we will create
740
+ here the example of how to implement the basis `s_\mu[X(1-t)]`.
741
+
742
+ To begin, we import the class
743
+ :class:`sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic()`. Our
744
+ new basis will inherit all of the default methods from this class::
745
+
746
+ sage: from sage.combinat.sf.sfa import SymmetricFunctionAlgebra_generic as SFA_generic
747
+
748
+ Now the basis we are creating has a parameter `t` which is possible
749
+ to specialize. In this example we will convert to and from the Schur
750
+ basis. For this we implement methods ``_self_to_s`` and ``_s_to_self``.
751
+ By registering these two functions as coercions, Sage then knows
752
+ automatically how it possible to change between any two bases for
753
+ which there is a path of changes of bases. ::
754
+
755
+ sage: from sage.categories.morphism import SetMorphism
756
+ sage: class SFA_st(SFA_generic):
757
+ ....: def __init__(self, Sym, t):
758
+ ....: SFA_generic.__init__(self, Sym, basis_name=
759
+ ....: "Schur functions with a plethystic substitution of X -> X(1-t)",
760
+ ....: prefix='st')
761
+ ....: self._s = Sym.s()
762
+ ....: self.t = Sym.base_ring()(t)
763
+ ....: cat = HopfAlgebras(Sym.base_ring()).WithBasis()
764
+ ....: self.register_coercion(
765
+ ....: SetMorphism(Hom(self._s, self, cat), self._s_to_self))
766
+ ....: self._s.register_coercion(
767
+ ....: SetMorphism(Hom(self, self._s, cat), self._self_to_s))
768
+ ....: def _s_to_self(self, f):
769
+ ....: # f is a Schur function and the output is in the st basis
770
+ ....: return self._from_dict(f.theta_qt(0,self.t)._monomial_coefficients)
771
+ ....: def _self_to_s(self, f):
772
+ ....: # f is in the st basis and the output is in the Schur basis
773
+ ....: return self._s.sum(cmu*self._s(mu).theta_qt(self.t,0) for mu,cmu in f)
774
+ ....: class Element(SFA_generic.Element):
775
+ ....: pass
776
+
777
+ An instance of this basis is created by calling it with a symmetric
778
+ function ring ``Sym`` and a parameter ``t`` which is in the base ring
779
+ of ``Sym``. The ``Element`` class inherits all of the methods from
780
+ :class:`sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element`.
781
+
782
+ In the reference [MAC]_ on page 354, this basis is denoted
783
+ `S_\lambda(x;t)` and the change of basis coefficients of the
784
+ Macdonald ``J`` basis are the coefficients `K_{\lambda\mu}(q,t)`.
785
+ Here is an example of its use::
786
+
787
+ sage: # needs lrcalc_python
788
+ sage: QQqt = QQ['q','t'].fraction_field()
789
+ sage: (q,t) = QQqt.gens()
790
+ sage: st = SFA_st(SymmetricFunctions(QQqt),t)
791
+ sage: st
792
+ Symmetric Functions over Fraction Field of Multivariate Polynomial
793
+ Ring in q, t over Rational Field in the Schur functions with a
794
+ plethystic substitution of X -> X(1-t) basis
795
+ sage: st[2,1] * st[1]
796
+ st[2, 1, 1] + st[2, 2] + st[3, 1]
797
+ sage: st([2]).coproduct()
798
+ st[] # st[2] + st[1] # st[1] + st[2] # st[]
799
+ sage: J = st.symmetric_function_ring().macdonald().J()
800
+ sage: st(J[2,1])
801
+ q*st[1, 1, 1] + (q*t+1)*st[2, 1] + t*st[3]
802
+
803
+ .. rubric:: Acknowledgements
804
+
805
+ The design is heavily inspired from the implementation of
806
+ symmetric functions in MuPAD-Combinat (see [HT04]_ and [FD06]_).
807
+
808
+ REFERENCES:
809
+
810
+ .. [FD06] Francois Descouens, Making research on symmetric functions using MuPAD-Combinat.
811
+ In Andres Iglesias and Nobuki Takayama, editors, 2nd International Congress on Mathematical Software (ICMS'06),
812
+ volume 4151 of LNCS, pages 407-418, Castro Urdiales, Spain, September 2006. Springer-Verlag.
813
+ :arxiv:`0806.1873`
814
+
815
+ .. [HT04] Florent Hivert and Nicolas M. Thiery,
816
+ MuPAD-Combinat, an open-source package for research in algebraic combinatorics.
817
+ Sem. Lothar. Combin., 51 :Art. B51z, 70 pp. (electronic), 2004.
818
+ http://mupad-combinat.sf.net/.
819
+
820
+ .. [MAC] Ian Macdonald, Symmetric Functions and Orthogonal Polynomials,
821
+ Second edition. With contributions by A. Zelevinsky. Oxford Mathematical Monographs.
822
+ Oxford Science Publications. The Clarendon Press, Oxford University Press, New York, 1995. x+475 pp.
823
+ ISBN: 0-19-853489-2
824
+
825
+ .. [STA] Richard Stanley, Enumerative combinatorics. Vol. 2.
826
+ With a foreword by Gian-Carlo Rota and appendix 1 by Sergey Fomin.
827
+ Cambridge Studies in Advanced Mathematics, 62. Cambridge University Press, Cambridge, 1999. xii+581 pp.
828
+ ISBN: 0-521-56069-1; 0-521-78987-7
829
+
830
+ .. [ST94] Scharf, Thomas, Thibon, Jean-Yves,
831
+ A Hopf-algebra approach to inner plethysm.
832
+ Adv. Math. 104 (1994), no. 1, 30-58.
833
+ :doi:`10.1006/aima.1994.1019`
834
+
835
+ .. RUBRIC:: Further tests
836
+
837
+ TESTS::
838
+
839
+ sage: Sym = SymmetricFunctions(QQ)
840
+ sage: Sym
841
+ Symmetric Functions over Rational Field
842
+ sage: h = Sym.h(); e = Sym.e(); s = Sym.s(); m = Sym.m(); p = Sym.p()
843
+ sage: ( ( h[2,1] * ( 1 + 3 * h[2,1]) ) + s[2]. antipode()) . coproduct()
844
+ h[] # h[1, 1] - h[] # h[2] + h[] # h[2, 1] + 3*h[] # h[2, 2, 1, 1] + h[1] # h[1] + h[1] # h[1, 1]
845
+ + h[1] # h[2] + 6*h[1] # h[2, 1, 1, 1] + 6*h[1] # h[2, 2, 1] + h[1, 1] # h[] + h[1, 1] # h[1]
846
+ + 3*h[1, 1] # h[1, 1, 1, 1] + 12*h[1, 1] # h[2, 1, 1] + 3*h[1, 1] # h[2, 2] + 6*h[1, 1, 1] # h[1, 1, 1]
847
+ + 6*h[1, 1, 1] # h[2, 1] + 3*h[1, 1, 1, 1] # h[1, 1] - h[2] # h[] + h[2] # h[1] + 6*h[2] # h[2, 1, 1]
848
+ + h[2, 1] # h[] + 6*h[2, 1] # h[1, 1, 1] + 12*h[2, 1] # h[2, 1] + 12*h[2, 1, 1] # h[1, 1]
849
+ + 6*h[2, 1, 1] # h[2] + 6*h[2, 1, 1, 1] # h[1] + 3*h[2, 2] # h[1, 1] + 6*h[2, 2, 1] # h[1] + 3*h[2, 2, 1, 1] # h[]
850
+
851
+ .. TODO::
852
+
853
+ - Introduce fields with degree 1 elements as in
854
+ MuPAD-Combinat, to get proper plethysm.
855
+ - Use UniqueRepresentation to get rid of all the manual cache
856
+ handling for the bases
857
+ - Devise a mechanism so that pickling bases of symmetric
858
+ functions pickles the coercions which have a cache.
859
+ """
860
+ def __init__(self, R):
861
+ r"""
862
+ Initialization of ``self``.
863
+
864
+ INPUT:
865
+
866
+ - ``R`` -- a ring
867
+
868
+ EXAMPLES::
869
+
870
+ sage: Sym = SymmetricFunctions(QQ)
871
+
872
+ TESTS::
873
+
874
+ sage: Sym1 = SymmetricFunctions(FiniteField(23))
875
+ sage: Sym2 = SymmetricFunctions(Integers(23))
876
+ sage: TestSuite(Sym).run() # needs lrcalc_python
877
+ """
878
+ # change the line below to assert(R in Rings()) once MRO issues from #15536, #15475 are resolved
879
+ assert R in Fields() or R in Rings() # side effect of this statement assures MRO exists for R
880
+ self._base = R # Won't be needed when CategoryObject won't override anymore base_ring
881
+ cat = GradedHopfAlgebras(R).Commutative().Cocommutative()
882
+ if R in PrincipalIdealDomains():
883
+ cat &= UniqueFactorizationDomains()
884
+ Parent.__init__(self, category=cat.WithRealizations())
885
+
886
+ def a_realization(self):
887
+ r"""
888
+ Return a particular realization of ``self`` (the Schur basis).
889
+
890
+ EXAMPLES::
891
+
892
+ sage: Sym = SymmetricFunctions(QQ)
893
+ sage: Sym.a_realization()
894
+ Symmetric Functions over Rational Field in the Schur basis
895
+ """
896
+ return self.schur()
897
+
898
+ def _repr_(self): # could be taken care of by the category
899
+ r"""
900
+ Representation of ``self``
901
+
902
+ TESTS::
903
+
904
+ sage: SymmetricFunctions(RR) # indirect doctest
905
+ Symmetric Functions over Real Field with 53 bits of precision
906
+ """
907
+ return "Symmetric Functions over %s" % self.base_ring()
908
+
909
+ def schur(self):
910
+ r"""
911
+ The Schur basis of the Symmetric Functions.
912
+
913
+ EXAMPLES::
914
+
915
+ sage: SymmetricFunctions(QQ).schur()
916
+ Symmetric Functions over Rational Field in the Schur basis
917
+ """
918
+ return schur.SymmetricFunctionAlgebra_schur(self)
919
+ s = schur
920
+ Schur = schur # Currently needed by SymmetricFunctions.__init_extra__
921
+
922
+ def powersum(self):
923
+ r"""
924
+ The power sum basis of the Symmetric Functions.
925
+
926
+ EXAMPLES::
927
+
928
+ sage: SymmetricFunctions(QQ).powersum()
929
+ Symmetric Functions over Rational Field in the powersum basis
930
+ """
931
+ return powersum.SymmetricFunctionAlgebra_power(self)
932
+ p = powersum
933
+ power = powersum # Todo: get rid of this one when it won't be needed anymore
934
+
935
+ def complete(self):
936
+ r"""
937
+ The complete basis of the Symmetric Functions.
938
+
939
+ EXAMPLES::
940
+
941
+ sage: SymmetricFunctions(QQ).complete()
942
+ Symmetric Functions over Rational Field in the homogeneous basis
943
+ """
944
+ return homogeneous.SymmetricFunctionAlgebra_homogeneous(self)
945
+ h = complete
946
+ homogeneous = complete
947
+
948
+ def elementary(self):
949
+ r"""
950
+ The elementary basis of the Symmetric Functions.
951
+
952
+ EXAMPLES::
953
+
954
+ sage: SymmetricFunctions(QQ).elementary()
955
+ Symmetric Functions over Rational Field in the elementary basis
956
+ """
957
+ return elementary.SymmetricFunctionAlgebra_elementary(self)
958
+ e = elementary
959
+
960
+ def monomial(self):
961
+ r"""
962
+ The monomial basis of the Symmetric Functions.
963
+
964
+ EXAMPLES::
965
+
966
+ sage: SymmetricFunctions(QQ).monomial()
967
+ Symmetric Functions over Rational Field in the monomial basis
968
+ """
969
+ return monomial.SymmetricFunctionAlgebra_monomial(self)
970
+ m = monomial
971
+
972
+ def witt(self, coerce_h=None, coerce_e=None, coerce_p=None):
973
+ r"""
974
+ The Witt basis of the symmetric functions.
975
+
976
+ EXAMPLES::
977
+
978
+ sage: SymmetricFunctions(QQ).witt()
979
+ Symmetric Functions over Rational Field in the Witt basis
980
+
981
+ TESTS::
982
+
983
+ sage: SymmetricFunctions(QQ).witt(coerce_p=True)
984
+ doctest:warning
985
+ ...
986
+ DeprecationWarning: the coerce_* inputs are deprecated and ignored
987
+ See https://github.com/sagemath/sage/issues/37736 for details.
988
+ Symmetric Functions over Rational Field in the Witt basis
989
+ """
990
+ if coerce_h is not None or coerce_e is not None or coerce_p is not None:
991
+ from sage.misc.superseded import deprecation
992
+ deprecation(37736, "the coerce_* inputs are deprecated and ignored")
993
+ from . import witt
994
+ return witt.SymmetricFunctionAlgebra_witt(self)
995
+ w = witt
996
+ Witt = witt
997
+
998
+ def irreducible_symmetric_group_character(self):
999
+ r"""
1000
+ The irreducible `S_n` character basis of the Symmetric Functions.
1001
+
1002
+ This basis has the property that if the element indexed by the
1003
+ partition `\lambda` is evaluated at the roots of a permutation of
1004
+ cycle structure `\rho` then the value is the irreducible character
1005
+ `\chi^{(|\rho|-|\lambda|,\lambda)}(\rho)`.
1006
+
1007
+ In terms of methods that are implemented in Sage, if ``n`` is
1008
+ a sufficiently large integer, then
1009
+ ``st(lam).character_to_frobenius_image(n)`` is equal the Schur function
1010
+ indexed by ``[n-sum(lam)]+lam``.
1011
+
1012
+ This basis is introduced in [OZ2015]_.
1013
+
1014
+ .. SEEALSO::
1015
+
1016
+ :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.character_to_frobenius_image`,
1017
+ :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.eval_at_permutation_roots`
1018
+
1019
+ EXAMPLES::
1020
+
1021
+ sage: SymmetricFunctions(QQ).irreducible_symmetric_group_character()
1022
+ Symmetric Functions over Rational Field in the irreducible symmetric group character basis
1023
+ sage: st = SymmetricFunctions(QQ).st()
1024
+ sage: s = SymmetricFunctions(QQ).s()
1025
+ sage: s(st([3,2]).character_to_frobenius_image(9))
1026
+ s[4, 3, 2]
1027
+ sage: s(st([3,2]).character_to_frobenius_image(7))
1028
+ 0
1029
+ sage: s(st([3,2]).character_to_frobenius_image(6))
1030
+ -s[2, 2, 2]
1031
+ sage: list(SymmetricGroup(5).character_table()[-2])
1032
+ [4, 2, 0, 1, -1, 0, -1]
1033
+ sage: list(reversed([st([1]).eval_at_permutation_roots(rho)
1034
+ ....: for rho in Partitions(5)]))
1035
+ [4, 2, 0, 1, -1, 0, -1]
1036
+ """
1037
+ from .character import IrreducibleCharacterBasis
1038
+ return IrreducibleCharacterBasis(self)
1039
+
1040
+ st = irreducible_symmetric_group_character
1041
+
1042
+ def induced_trivial_character(self):
1043
+ r"""
1044
+ The induced trivial character basis of the Symmetric Functions.
1045
+
1046
+ The trivial character of
1047
+
1048
+ .. MATH::
1049
+
1050
+ S_{n-|\lambda|} \times S_{\lambda_1} \times S_{\lambda_2} \times
1051
+ \cdots \times S_{\lambda_\ell(\lambda)}
1052
+
1053
+ induced to the group `S_{n}` is a symmetric function in the
1054
+ eigenvalues of a permutation matrix. This basis is that character.
1055
+
1056
+ It has the property that if the element indexed by the
1057
+ partition `\lambda` is evaluated at the roots of a permutation of
1058
+ cycle structure `\rho` then the value is the coefficient
1059
+ `\left< h_{(n-|\lambda|,\lambda)}, p_\rho \right>`.
1060
+
1061
+ In terms of methods that are implemented in Sage, if ``n`` is
1062
+ a sufficiently large integer, then
1063
+ ``ht(lam).character_to_frobenius_image(n)`` is equal the complete
1064
+ function indexed by ``[n-sum(lam)]+lam``.
1065
+
1066
+ This basis is introduced in [OZ2015]_.
1067
+
1068
+ .. SEEALSO::
1069
+
1070
+ :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.character_to_frobenius_image`,
1071
+ :meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.eval_at_permutation_roots`
1072
+
1073
+ EXAMPLES::
1074
+
1075
+ sage: SymmetricFunctions(QQ).induced_trivial_character()
1076
+ Symmetric Functions over Rational Field in the induced trivial symmetric group character basis
1077
+ sage: ht = SymmetricFunctions(QQ).ht()
1078
+ sage: h = SymmetricFunctions(QQ).h()
1079
+ sage: h(ht([3,2]).character_to_frobenius_image(9))
1080
+ h[4, 3, 2]
1081
+ sage: h(ht([3,2]).character_to_frobenius_image(7))
1082
+ h[3, 2, 2]
1083
+ sage: h(ht([3,2]).character_to_frobenius_image(5))
1084
+ h[3, 2]
1085
+ sage: h(ht([3,2]).character_to_frobenius_image(4))
1086
+ 0
1087
+ sage: p = SymmetricFunctions(QQ).p()
1088
+ sage: [h([4,1]).scalar(p(rho)) for rho in Partitions(5)]
1089
+ [0, 1, 0, 2, 1, 3, 5]
1090
+ sage: [ht([1]).eval_at_permutation_roots(rho) for rho in Partitions(5)]
1091
+ [0, 1, 0, 2, 1, 3, 5]
1092
+ """
1093
+ from .character import InducedTrivialCharacterBasis
1094
+ return InducedTrivialCharacterBasis(self)
1095
+
1096
+ ht = induced_trivial_character
1097
+
1098
+ def forgotten(self):
1099
+ r"""
1100
+ The forgotten basis of the Symmetric Functions (or the basis dual to
1101
+ the elementary basis with respect to the Hall scalar product).
1102
+
1103
+ EXAMPLES::
1104
+
1105
+ sage: SymmetricFunctions(QQ).forgotten()
1106
+ Symmetric Functions over Rational Field in the forgotten basis
1107
+
1108
+ TESTS:
1109
+
1110
+ Over the rationals::
1111
+
1112
+ sage: Sym = SymmetricFunctions(QQ)
1113
+ sage: e = Sym.e()
1114
+ sage: f = Sym.f()
1115
+ sage: h = Sym.h()
1116
+ sage: p = Sym.p()
1117
+ sage: s = Sym.s()
1118
+ sage: m = Sym.m()
1119
+ sage: e(f([2,1]))
1120
+ -2*e[1, 1, 1] + 5*e[2, 1] - 3*e[3]
1121
+ sage: f(e([2,1]))
1122
+ 3*f[1, 1, 1] + 2*f[2, 1] + f[3]
1123
+ sage: h(f([2,1]))
1124
+ h[2, 1] - 3*h[3]
1125
+ sage: f(h([2,1]))
1126
+ 3*f[1, 1, 1] + f[2, 1]
1127
+ sage: p(f([2,1]))
1128
+ -p[2, 1] - p[3]
1129
+ sage: f(p([2,1]))
1130
+ -f[2, 1] - f[3]
1131
+ sage: s(f([2,1]))
1132
+ s[2, 1] - 2*s[3]
1133
+ sage: f(s([2,1]))
1134
+ 2*f[1, 1, 1] + f[2, 1]
1135
+ sage: m(f([2,1]))
1136
+ -m[2, 1] - 2*m[3]
1137
+ sage: f(m([2,1]))
1138
+ -f[2, 1] - 2*f[3]
1139
+
1140
+ Over the integers::
1141
+
1142
+ sage: Sym = SymmetricFunctions(ZZ)
1143
+ sage: e = Sym.e()
1144
+ sage: f = Sym.f()
1145
+ sage: h = Sym.h()
1146
+ sage: p = Sym.p()
1147
+ sage: s = Sym.s()
1148
+ sage: m = Sym.m()
1149
+ sage: e(f([2,1]))
1150
+ -2*e[1, 1, 1] + 5*e[2, 1] - 3*e[3]
1151
+ sage: f(e([2,1]))
1152
+ 3*f[1, 1, 1] + 2*f[2, 1] + f[3]
1153
+ sage: h(f([2,1]))
1154
+ h[2, 1] - 3*h[3]
1155
+ sage: f(h([2,1]))
1156
+ 3*f[1, 1, 1] + f[2, 1]
1157
+ sage: f(p([2,1]))
1158
+ -f[2, 1] - f[3]
1159
+ sage: s(f([2,1]))
1160
+ s[2, 1] - 2*s[3]
1161
+ sage: f(s([2,1]))
1162
+ 2*f[1, 1, 1] + f[2, 1]
1163
+ sage: m(f([2,1]))
1164
+ -m[2, 1] - 2*m[3]
1165
+ sage: f(m([2,1]))
1166
+ -f[2, 1] - 2*f[3]
1167
+
1168
+ Conversion from the forgotten basis to the power-sum basis over the
1169
+ integers is not well-defined in general, even if the result happens
1170
+ to have integral coefficients::
1171
+
1172
+ sage: p(f([2,1]))
1173
+ Traceback (most recent call last):
1174
+ ...
1175
+ TypeError: no conversion of this rational to integer
1176
+
1177
+ Fun exercise: prove that `p(f_{\lambda})` and `p(m_{\lambda})` have
1178
+ integral coefficients whenever `\lambda` is a strict partition.
1179
+ """
1180
+ return self.elementary().dual_basis()
1181
+ f = forgotten
1182
+
1183
+ def symplectic(self):
1184
+ """
1185
+ The symplectic basis of the symmetric functions.
1186
+
1187
+ .. SEEALSO:: :class:`~sage.combinat.sf.symplectic.SymmetricFunctionAlgebra_symplectic`
1188
+
1189
+ EXAMPLES::
1190
+
1191
+ sage: SymmetricFunctions(QQ).symplectic() # needs lrcalc_python
1192
+ Symmetric Functions over Rational Field in the symplectic basis
1193
+ """
1194
+ from . import symplectic
1195
+ return symplectic.SymmetricFunctionAlgebra_symplectic(self)
1196
+ sp = symplectic
1197
+
1198
+ def orthogonal(self):
1199
+ """
1200
+ The orthogonal basis of the symmetric functions.
1201
+
1202
+ .. SEEALSO:: :class:`~sage.combinat.sf.orthogonal.SymmetricFunctionAlgebra_orthogonal`
1203
+
1204
+ EXAMPLES::
1205
+
1206
+ sage: SymmetricFunctions(QQ).orthogonal() # needs lrcalc_python
1207
+ Symmetric Functions over Rational Field in the orthogonal basis
1208
+ """
1209
+ from . import orthogonal
1210
+ return orthogonal.SymmetricFunctionAlgebra_orthogonal(self)
1211
+ o = orthogonal
1212
+
1213
+ def hecke_character(self, q='q'):
1214
+ """
1215
+ The basis of symmetric functions that determines the character
1216
+ tables for Hecke algebras.
1217
+
1218
+ EXAMPLES::
1219
+
1220
+ sage: SymmetricFunctions(ZZ['q'].fraction_field()).hecke_character()
1221
+ Symmetric Functions over
1222
+ Fraction Field of Univariate Polynomial Ring in q over Integer Ring
1223
+ in the Hecke character with q=q basis
1224
+ sage: SymmetricFunctions(QQ).hecke_character(1/2)
1225
+ Symmetric Functions over Rational Field in the Hecke character with q=1/2 basis
1226
+ """
1227
+ from sage.combinat.sf.hecke import HeckeCharacter
1228
+ return HeckeCharacter(self, q)
1229
+ qbar = hecke_character
1230
+
1231
+ def macdonald(self, q='q', t='t'):
1232
+ r"""
1233
+ Return the entry point for the various Macdonald bases.
1234
+
1235
+ INPUT:
1236
+
1237
+ - ``q``, ``t`` -- parameters
1238
+
1239
+ Macdonald symmetric functions including bases `P`, `Q`, `J`, `H`, `Ht`.
1240
+ This also contains the `S` basis which is dual to the Schur basis with
1241
+ respect to the `q,t` scalar product.
1242
+
1243
+ The parameters `q` and `t` must be in the base_ring of parent.
1244
+
1245
+ EXAMPLES::
1246
+
1247
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1248
+ sage: P = Sym.macdonald().P(); P
1249
+ Symmetric Functions over Fraction Field of Multivariate Polynomial Ring in q, t over Rational Field in the Macdonald P basis
1250
+ sage: P[2]
1251
+ McdP[2]
1252
+ sage: Q = Sym.macdonald().Q(); Q
1253
+ Symmetric Functions over Fraction Field of Multivariate Polynomial Ring in q, t over Rational Field in the Macdonald Q basis
1254
+ sage: S = Sym.macdonald().S()
1255
+ sage: s = Sym.schur()
1256
+ sage: matrix([[S(la).scalar_qt(s(mu)) for la in Partitions(3)] for mu in Partitions(3)])
1257
+ [1 0 0]
1258
+ [0 1 0]
1259
+ [0 0 1]
1260
+ sage: H = Sym.macdonald().H()
1261
+ sage: s(H[2,2])
1262
+ q^2*s[1, 1, 1, 1] + (q^2*t+q*t+q)*s[2, 1, 1] + (q^2*t^2+1)*s[2, 2] + (q*t^2+q*t+t)*s[3, 1] + t^2*s[4]
1263
+
1264
+ sage: Sym = SymmetricFunctions(QQ['z','q'].fraction_field())
1265
+ sage: (z,q) = Sym.base_ring().gens()
1266
+ sage: Hzq = Sym.macdonald(q=z,t=q).H()
1267
+ sage: H1z = Sym.macdonald(q=1,t=z).H()
1268
+ sage: s = Sym.schur()
1269
+ sage: s(H1z([2,2]))
1270
+ s[1, 1, 1, 1] + (2*z+1)*s[2, 1, 1] + (z^2+1)*s[2, 2] + (z^2+2*z)*s[3, 1] + z^2*s[4]
1271
+ sage: s(Hzq[2,2])
1272
+ z^2*s[1, 1, 1, 1] + (z^2*q+z*q+z)*s[2, 1, 1] + (z^2*q^2+1)*s[2, 2] + (z*q^2+z*q+q)*s[3, 1] + q^2*s[4]
1273
+ sage: s(H1z(Hzq[2,2]))
1274
+ z^2*s[1, 1, 1, 1] + (z^2*q+z*q+z)*s[2, 1, 1] + (z^2*q^2+1)*s[2, 2] + (z*q^2+z*q+q)*s[3, 1] + q^2*s[4]
1275
+ """
1276
+ return macdonald.Macdonald(self, q=q, t=t)
1277
+
1278
+ def hall_littlewood(self, t='t'):
1279
+ """
1280
+ Return the entry point for the various Hall-Littlewood bases.
1281
+
1282
+ INPUT:
1283
+
1284
+ - ``t`` -- parameter
1285
+
1286
+ Hall-Littlewood symmetric functions including bases `P`, `Q`, `Qp`.
1287
+ The Hall-Littlewood `P` and `Q` functions at `t=-1` are the
1288
+ Schur-P and Schur-Q functions when indexed by strict partitions.
1289
+
1290
+ The parameter `t` must be in the base ring of parent.
1291
+
1292
+ EXAMPLES::
1293
+
1294
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
1295
+ sage: P = Sym.hall_littlewood().P(); P
1296
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the Hall-Littlewood P basis
1297
+ sage: P[2]
1298
+ HLP[2]
1299
+ sage: Q = Sym.hall_littlewood().Q(); Q
1300
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the Hall-Littlewood Q basis
1301
+ sage: Q[2]
1302
+ HLQ[2]
1303
+ sage: Qp = Sym.hall_littlewood().Qp(); Qp
1304
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the Hall-Littlewood Qp basis
1305
+ sage: Qp[2]
1306
+ HLQp[2]
1307
+ """
1308
+ return hall_littlewood.HallLittlewood(self, t=t)
1309
+
1310
+ def jack(self, t='t'):
1311
+ """
1312
+ Return the entry point for the various Jack bases.
1313
+
1314
+ INPUT:
1315
+
1316
+ - ``t`` -- parameter
1317
+
1318
+ Jack symmetric functions including bases `P`, `Q`, `Qp`.
1319
+
1320
+ The parameter `t` must be in the base ring of parent.
1321
+
1322
+ EXAMPLES::
1323
+
1324
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
1325
+ sage: JP = Sym.jack().P(); JP
1326
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the Jack P basis
1327
+ sage: JQ = Sym.jack().Q(); JQ
1328
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the Jack Q basis
1329
+ sage: JJ = Sym.jack().J(); JJ
1330
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the Jack J basis
1331
+ sage: JQp = Sym.jack().Qp(); JQp
1332
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the Jack Qp basis
1333
+ """
1334
+ return jack.Jack( self, t=t )
1335
+
1336
+ def abreu_nigro(self, q='q'):
1337
+ """
1338
+ The Abreu-Nigro basis of the Symmetric Functions.
1339
+
1340
+ EXAMPLES::
1341
+
1342
+ sage: q = ZZ['q'].fraction_field().gen()
1343
+ sage: SymmetricFunctions(q.parent()).abreu_nigro()
1344
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in q over Integer Ring in the Abreu-Nigro basis
1345
+ """
1346
+ from sage.combinat.sf.abreu_nigro import SymmetricFunctionAlgebra_AbreuNigro
1347
+ return SymmetricFunctionAlgebra_AbreuNigro(self, q)
1348
+
1349
+ def zonal(self):
1350
+ """
1351
+ The zonal basis of the Symmetric Functions.
1352
+
1353
+ EXAMPLES::
1354
+
1355
+ sage: SymmetricFunctions(QQ).zonal()
1356
+ Symmetric Functions over Rational Field in the zonal basis
1357
+ """
1358
+ return jack.SymmetricFunctionAlgebra_zonal( self )
1359
+
1360
+ def llt(self, k, t='t'):
1361
+ """
1362
+ The LLT symmetric functions.
1363
+
1364
+ INPUT:
1365
+
1366
+ - ``k`` -- positive integer indicating the level
1367
+ - ``t`` -- a parameter (default: `t`)
1368
+
1369
+ LLT polynomials in `hspin` and `hcospin` bases.
1370
+
1371
+ EXAMPLES::
1372
+
1373
+ sage: llt3 = SymmetricFunctions(QQ['t'].fraction_field()).llt(3); llt3
1374
+ level 3 LLT polynomials over Fraction Field of Univariate Polynomial Ring in t over Rational Field
1375
+ sage: llt3.hspin()
1376
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the level 3 LLT spin basis
1377
+ sage: llt3.hcospin()
1378
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the level 3 LLT cospin basis
1379
+ sage: llt3.hcospin()
1380
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the level 3 LLT cospin basis
1381
+ """
1382
+ return llt.LLT_class( self, k, t=t )
1383
+
1384
+ def from_polynomial(self, f):
1385
+ """
1386
+ Convert a symmetric polynomial ``f`` to a symmetric function.
1387
+
1388
+ INPUT:
1389
+
1390
+ - ``f`` -- a symmetric polynomial
1391
+
1392
+ This function converts a symmetric polynomial `f` in a polynomial ring in finitely
1393
+ many variables to a symmetric function in the monomial
1394
+ basis of the ring of symmetric functions over the same base ring.
1395
+
1396
+ EXAMPLES::
1397
+
1398
+ sage: P = PolynomialRing(QQ, 'x', 3)
1399
+ sage: x = P.gens()
1400
+ sage: f = x[0] + x[1] + x[2]
1401
+ sage: S = SymmetricFunctions(QQ)
1402
+ sage: S.from_polynomial(f)
1403
+ m[1]
1404
+
1405
+ sage: f = x[0] + 2*x[1] + x[2]
1406
+ sage: S.from_polynomial(f)
1407
+ Traceback (most recent call last):
1408
+ ...
1409
+ ValueError: x0 + 2*x1 + x2 is not a symmetric polynomial
1410
+ """
1411
+ return self.m().from_polynomial(f)
1412
+
1413
+ def register_isomorphism(self, morphism, only_conversion=False):
1414
+ r"""
1415
+ Register an isomorphism between two bases of ``self``, as a canonical coercion
1416
+ (unless the optional keyword ``only_conversion`` is set to ``True``,
1417
+ in which case the isomorphism is registered as conversion only).
1418
+
1419
+ EXAMPLES:
1420
+
1421
+ We override the canonical coercion from the Schur basis to the
1422
+ powersum basis by a (stupid!) map `s_\lambda\mapsto 2p_\lambda`.
1423
+ ::
1424
+
1425
+ sage: Sym = SymmetricFunctions(QQ['zorglub']) # make sure we are not going to screw up later tests
1426
+ sage: s = Sym.s(); p = Sym.p().dual_basis()
1427
+ sage: phi = s.module_morphism(diagonal = lambda t: 2, codomain = p)
1428
+ sage: phi(s[2, 1])
1429
+ 2*d_p[2, 1]
1430
+ sage: Sym.register_isomorphism(phi)
1431
+ sage: p(s[2,1])
1432
+ 2*d_p[2, 1]
1433
+
1434
+ The map is supposed to implement the canonical isomorphism
1435
+ between the two bases. Otherwise, the results will be
1436
+ mathematically wrong, as above. Use with care!
1437
+ """
1438
+ if only_conversion:
1439
+ morphism.codomain().register_conversion(morphism)
1440
+ else:
1441
+ morphism.codomain().register_coercion(morphism)
1442
+
1443
+ _shorthands = ['e', 'f', 'h', 'm', 'p', 's']
1444
+ _shorthands_all = sorted(_shorthands + ['ht', 'o', 'sp', 'st', 'w'])
1445
+
1446
+ def __init_extra__(self):
1447
+ """
1448
+ Set up the coercions between the different bases.
1449
+
1450
+ EXAMPLES::
1451
+
1452
+ sage: Sym = SymmetricFunctions(QQ) # indirect doctest
1453
+ sage: s = Sym.s(); p = Sym.p()
1454
+ sage: f = s.coerce_map_from(p); f
1455
+ Generic morphism:
1456
+ From: Symmetric Functions over Rational Field in the powersum basis
1457
+ To: Symmetric Functions over Rational Field in the Schur basis
1458
+ sage: p.an_element()
1459
+ 2*p[] + 2*p[1] + 3*p[2]
1460
+ sage: f(p.an_element())
1461
+ 2*s[] + 2*s[1] - 3*s[1, 1] + 3*s[2]
1462
+ sage: f(p.an_element()) == p.an_element()
1463
+ True
1464
+ """
1465
+ #powersum = self.powersum ()
1466
+ #complete = self.complete ()
1467
+ #elementary = self.elementary()
1468
+ #schur = self.schur ()
1469
+ #monomial = self.monomial ()
1470
+
1471
+ iso = self.register_isomorphism
1472
+
1473
+ from sage.combinat.sf.classical import conversion_functions
1474
+
1475
+ for (basis1_name, basis2_name) in conversion_functions:
1476
+ basis1 = getattr(self, basis1_name)()
1477
+ basis2 = getattr(self, basis2_name)()
1478
+ on_basis = SymmetricaConversionOnBasis(t=conversion_functions[basis1_name,basis2_name], domain=basis1, codomain=basis2)
1479
+ from sage.rings.rational_field import RationalField
1480
+ if basis2_name != "powersum" or self._base.has_coerce_map_from(RationalField()):
1481
+ iso(basis1._module_morphism(on_basis, codomain=basis2))
1482
+ else:
1483
+ # Don't register conversions to powersums as coercions,
1484
+ # unless the base ring is a `\QQ`-algebra
1485
+ # (otherwise the coercion graph loses commutativity).
1486
+ iso(basis1._module_morphism(on_basis, codomain=basis2),
1487
+ only_conversion=True)
1488
+
1489
+ # Todo: fill in with other conversion functions on the classical bases
1490
+
1491
+ def kBoundedSubspace(self, k, t='t'):
1492
+ r"""
1493
+ Return the `k`-bounded subspace of the ring of symmetric functions.
1494
+
1495
+ INPUT:
1496
+
1497
+ - ``k`` -- positive integer
1498
+ - ``t`` -- a formal parameter; `t=1` yields a subring
1499
+
1500
+ The subspace of the ring of symmetric functions spanned by
1501
+ `\{ s_{\lambda}[X/(1-t)] \}_{\lambda_1\le k} = \{ s_{\lambda}^{(k)}[X,t]\}_{\lambda_1 \le k}`
1502
+ over the base ring `\QQ[t]`. When `t=1`, this space is in fact a subalgebra of
1503
+ the ring of symmetric functions generated by the complete homogeneous symmetric functions
1504
+ `h_i` for `1\le i \le k`.
1505
+
1506
+ .. SEEALSO:: :meth:`sage.combinat.sf.new_kschur.KBoundedSubspace`
1507
+
1508
+ EXAMPLES::
1509
+
1510
+ sage: Sym = SymmetricFunctions(QQ)
1511
+ sage: KB = Sym.kBoundedSubspace(3,1); KB
1512
+ 3-bounded Symmetric Functions over Rational Field with t=1
1513
+
1514
+ sage: Sym = SymmetricFunctions(QQ['t'])
1515
+ sage: Sym.kBoundedSubspace(3)
1516
+ 3-bounded Symmetric Functions over Univariate Polynomial Ring in t over Rational Field
1517
+
1518
+ sage: Sym = SymmetricFunctions(QQ['z'])
1519
+ sage: z = Sym.base_ring().gens()[0]
1520
+ sage: Sym.kBoundedSubspace(3,t=z)
1521
+ 3-bounded Symmetric Functions over Univariate Polynomial Ring in z over Rational Field with t=z
1522
+ """
1523
+ from sage.combinat.sf.new_kschur import KBoundedSubspace
1524
+ return KBoundedSubspace(self, k, t=t)
1525
+
1526
+ def kschur(self, k, t='t'):
1527
+ r"""
1528
+ Return the `k`-Schur functions.
1529
+
1530
+ EXAMPLES::
1531
+
1532
+ sage: Sym = SymmetricFunctions(QQ)
1533
+ sage: ks = Sym.kschur(3,1)
1534
+ sage: ks[2]*ks[2] # needs lrcalc_python
1535
+ ks3[2, 2] + ks3[3, 1]
1536
+ sage: ks[2,1,1].lift() # needs lrcalc_python
1537
+ s[2, 1, 1] + s[3, 1]
1538
+
1539
+ sage: Sym = SymmetricFunctions(QQ['t'])
1540
+ sage: ks = Sym.kschur(3)
1541
+ sage: ks[2,2,1].lift() # needs lrcalc_python
1542
+ s[2, 2, 1] + t*s[3, 2]
1543
+ """
1544
+ return self.kBoundedSubspace(k, t=t).kschur()
1545
+
1546
+ def ksplit(self, k, t='t'):
1547
+ r"""
1548
+ Return the `k`-split basis of the `k`-bounded subspace.
1549
+
1550
+ EXAMPLES::
1551
+
1552
+ sage: Sym = SymmetricFunctions(QQ)
1553
+ sage: ksp = Sym.ksplit(3,1)
1554
+ sage: ksp[2]*ksp[2] # needs lrcalc_python
1555
+ ksp3[2, 2] + ksp3[3, 1]
1556
+ sage: ksp[2,1,1].lift() # needs lrcalc_python
1557
+ s[2, 1, 1] + s[2, 2] + s[3, 1]
1558
+
1559
+ sage: Sym = SymmetricFunctions(QQ['t'])
1560
+ sage: ksp = Sym.ksplit(3)
1561
+ sage: ksp[2,1,1].lift() # needs lrcalc_python
1562
+ s[2, 1, 1] + t*s[2, 2] + t*s[3, 1]
1563
+ """
1564
+ return self.kBoundedSubspace(k, t=t).ksplit()
1565
+
1566
+ def khomogeneous(self, k):
1567
+ r"""
1568
+ Return the homogeneous symmetric functions in the `k`-bounded subspace.
1569
+
1570
+ EXAMPLES::
1571
+
1572
+ sage: Sym = SymmetricFunctions(QQ)
1573
+ sage: kh = Sym.khomogeneous(4)
1574
+ sage: kh[3]*kh[4]
1575
+ h4[4, 3]
1576
+ sage: kh[4].lift()
1577
+ h[4]
1578
+ """
1579
+ return self.kBoundedSubspace(k, t=1).khomogeneous()
1580
+
1581
+ def kBoundedQuotient(self, k, t='t'):
1582
+ r"""
1583
+ Return the `k`-bounded quotient space of the ring of symmetric functions.
1584
+
1585
+ INPUT:
1586
+
1587
+ - ``k`` -- positive integer
1588
+
1589
+ The quotient of the ring of symmetric functions ...
1590
+
1591
+ .. SEEALSO:: :meth:`sage.combinat.sf.k_dual.KBoundedQuotient`
1592
+
1593
+ EXAMPLES::
1594
+
1595
+ sage: Sym = SymmetricFunctions(QQ)
1596
+ sage: KQ = Sym.kBoundedQuotient(3); KQ
1597
+ Traceback (most recent call last):
1598
+ ...
1599
+ TypeError: unable to convert 't' to a rational
1600
+ sage: KQ = Sym.kBoundedQuotient(3,t=1); KQ
1601
+ 3-Bounded Quotient of Symmetric Functions over Rational Field with t=1
1602
+ sage: Sym = SymmetricFunctions(QQ['t'].fraction_field())
1603
+ sage: KQ = Sym.kBoundedQuotient(3); KQ
1604
+ 3-Bounded Quotient of Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field
1605
+ """
1606
+ from sage.combinat.sf.k_dual import KBoundedQuotient
1607
+ return KBoundedQuotient(self, k, t)
1608
+
1609
+
1610
+ class SymmetricaConversionOnBasis:
1611
+ def __init__(self, t, domain, codomain):
1612
+ """
1613
+ Initialization of ``self``.
1614
+
1615
+ INPUT:
1616
+
1617
+ - ``t`` -- a function taking a monomial in CombinatorialFreeModule(QQ, Partitions()),
1618
+ and returning a (partition, coefficient) list
1619
+
1620
+ - ``domain``, ``codomain`` -- parents
1621
+
1622
+ Construct a function mapping a partition to an element of ``codomain``.
1623
+
1624
+ This is a temporary quick hack to wrap around the existing
1625
+ symmetrica conversions, without changing their specs.
1626
+
1627
+ EXAMPLES::
1628
+
1629
+ sage: Sym = SymmetricFunctions(QQ['x'])
1630
+ sage: p = Sym.p(); s = Sym.s()
1631
+ sage: def t(x) : [(p, c)] = x; return [ (p, 2*c), (p.conjugate(), c) ]
1632
+ sage: f = sage.combinat.sf.sf.SymmetricaConversionOnBasis(t, p, s)
1633
+ sage: f(Partition([3,1]))
1634
+ s[2, 1, 1] + 2*s[3, 1]
1635
+ """
1636
+ self._domain = domain
1637
+ self.fake_sym = CombinatorialFreeModule(QQ, Partitions())
1638
+ self._codomain = codomain
1639
+ self._t = t
1640
+
1641
+ def __call__(self, partition):
1642
+ """
1643
+ EXAMPLES::
1644
+
1645
+ sage: Sym = SymmetricFunctions(QQ['x'])
1646
+ sage: p = Sym.p(); s = Sym.s()
1647
+ sage: p[1] + s[1] # indirect doctest
1648
+ 2*p[1]
1649
+ """
1650
+ # TODO: use self._codomain.sum_of_monomials, when the later
1651
+ # will have an optional optimization for the case when there
1652
+ # is no repetition in the support
1653
+ return self._codomain._from_dict(dict(self._t(self.fake_sym.monomial(partition))), coerce=True)