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,2019 @@
1
+ # sage_setup: distribution = sagemath-combinat
2
+ # sage.doctest: needs sage.combinat sage.modules
3
+ r"""
4
+ Macdonald polynomials
5
+
6
+ Notation used in the definitions follows mainly [Mac1995]_.
7
+
8
+ The integral forms of the bases `H` and `Ht` do not appear in
9
+ Macdonald's book. They correspond to the two bases
10
+ `H_\mu[X;q,t] = \sum_{\nu} K_{\nu\mu}(q,t) s_\mu[X]` and
11
+ `{\tilde H}_\mu[X;q,t] = t^{n(\mu)} \sum_{\nu} K_{\nu\mu}(q,1/t) s_\nu[X]`
12
+ where `K_{\mu\nu}(q,t)` are the Macdonald `q,t`-Koskta coefficients.
13
+
14
+ The `Ht` in this case is short for `{\tilde H}` and is the basis which is
15
+ the graded Frobenius image of the Garsia-Haiman modules [GH1993]_.
16
+
17
+ REFERENCES:
18
+
19
+ - [Mac1995]_
20
+
21
+ .. [GH1993] \A. Garsia, M. Haiman, A graded representation module for Macdonald's
22
+ polynomials, Proc. Nat. Acad. U.S.A. no. 90, 3607--3610.
23
+
24
+ .. [BGHT1999] \F. Bergeron, A. M. Garsia, M. Haiman, and G. Tesler, Identities and
25
+ positivity conjectures for some remarkable operators in the theory of symmetric
26
+ functions, Methods Appl. Anal. 6 (1999), no. 3, 363--420.
27
+
28
+ .. [LLM1998] \L. Lapointe, A. Lascoux, J. Morse, Determinantal Expressions for
29
+ Macdonald Polynomials, IRMN no. 18 (1998).
30
+ :arxiv:`math/9808050`.
31
+
32
+ .. [BH2013] \F. Bergeron, M. Haiman, Tableaux Formulas for Macdonald Polynomials,
33
+ Special edition in honor of Christophe Reutenauer 60 birthday, International
34
+ Journal of Algebra and Computation, Volume 23, Issue 4, (2013), pp. 833-852.
35
+ """
36
+
37
+ #*****************************************************************************
38
+ # Copyright (C) 2007 Mike Hansen <mhansen@gmail.com>,
39
+ #
40
+ # Distributed under the terms of the GNU General Public License (GPL)
41
+ #
42
+ # This code is distributed in the hope that it will be useful,
43
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
44
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
45
+ # General Public License for more details.
46
+ #
47
+ # The full text of the GPL is available at:
48
+ #
49
+ # http://www.gnu.org/licenses/
50
+ #*****************************************************************************
51
+
52
+ import functools
53
+
54
+ from sage.categories.homset import Hom
55
+ from sage.categories.modules_with_basis import ModulesWithBasis
56
+ from sage.categories.morphism import SetMorphism
57
+ from sage.combinat.partition import Partitions_n, _Partitions
58
+ from sage.matrix.matrix_space import MatrixSpace
59
+ from sage.misc.cachefunc import cached_function
60
+ from sage.misc.misc_c import prod
61
+ from sage.rings.rational_field import QQ
62
+ from sage.structure.unique_representation import UniqueRepresentation
63
+
64
+ from . import sfa
65
+
66
+ # cache in q,t globally and subs locally with q and t values
67
+ # these caches are stored in self._self_to_s_cache and self._s_to_self_cache
68
+ #J basis cache
69
+ _j_to_s_cache = {}
70
+ _s_to_j_cache = {}
71
+
72
+ #Ht basis cache
73
+ _ht_to_m_cache = {}
74
+
75
+ #S basis cache
76
+ _S_to_s_cache = {}
77
+ _s_to_S_cache = {}
78
+
79
+ _qt_kostka_cache = {}
80
+
81
+
82
+ class Macdonald(UniqueRepresentation):
83
+
84
+ def __repr__(self):
85
+ r"""
86
+ The family of Macdonald symmetric function bases.
87
+
88
+ INPUT:
89
+
90
+ - ``self`` -- a family of Macdonald symmetric function bases
91
+
92
+ OUTPUT: string representing the Macdonald symmetric function family
93
+
94
+ EXAMPLES::
95
+
96
+ sage: t = QQ['t'].gen(); SymmetricFunctions(QQ['t'].fraction_field()).macdonald(q=t,t=1)
97
+ Macdonald polynomials with q=t and t=1 over Fraction Field of Univariate Polynomial Ring in t over Rational Field
98
+ """
99
+ return self._name
100
+
101
+ @staticmethod
102
+ def __classcall__(cls, Sym, q='q', t='t'):
103
+ """
104
+ Normalize the arguments.
105
+
106
+ TESTS::
107
+
108
+ sage: R.<q, t> = QQ[]
109
+ sage: B1 = SymmetricFunctions(R).macdonald().P()
110
+ sage: B2 = SymmetricFunctions(R).macdonald(q, t).P()
111
+ sage: B3 = SymmetricFunctions(R).macdonald(t, q).P()
112
+ sage: B1 is B2
113
+ True
114
+ sage: B1 == B3
115
+ False
116
+ """
117
+ return super().__classcall__(cls, Sym, Sym.base_ring()(q), Sym.base_ring()(t))
118
+
119
+ def __init__(self, Sym, q, t):
120
+ r"""
121
+ Macdonald Symmetric functions including `P`, `Q`, `J`, `H`, `Ht` bases
122
+ also including the S basis which is the plethystic transformation
123
+ of the Schur basis (that which is dual to the Schur basis
124
+ with respect to the Macdonald `q,t`-scalar product)
125
+
126
+ INPUT:
127
+
128
+ - ``self`` -- a family of Macdonald symmetric function bases
129
+
130
+ EXAMPLES::
131
+
132
+ sage: t = QQ['t'].gen(); SymmetricFunctions(QQ['t'].fraction_field()).macdonald(q=t,t=1)
133
+ Macdonald polynomials with q=t and t=1 over Fraction Field of Univariate Polynomial Ring in t over Rational Field
134
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t'])).macdonald()
135
+ Traceback (most recent call last):
136
+ ...
137
+ TypeError: unable to evaluate 'q' in Fraction Field of Univariate Polynomial Ring in t over Rational Field
138
+ """
139
+ self._sym = Sym
140
+ self._s = Sym.s()
141
+ self.q = q
142
+ self.t = t
143
+ self._name_suffix = ""
144
+ if str(q) != 'q':
145
+ self._name_suffix += " with q=%s" % q
146
+ if str(t) != 't':
147
+ self._name_suffix += " and "
148
+ if str(t) != 't':
149
+ if str(q) == 'q':
150
+ self._name_suffix += " with "
151
+ self._name_suffix += "t=%s" % t
152
+ self._name = "Macdonald polynomials"+self._name_suffix+" over "+repr(Sym.base_ring())
153
+
154
+ def base_ring( self ):
155
+ r"""
156
+ Return the base ring of the symmetric functions where the
157
+ Macdonald symmetric functions live.
158
+
159
+ INPUT:
160
+
161
+ - ``self`` -- a family of Macdonald symmetric function bases
162
+
163
+ OUTPUT: the base ring associated to the corresponding symmetric function ring
164
+
165
+ EXAMPLES::
166
+
167
+ sage: Sym = SymmetricFunctions(QQ['q'].fraction_field())
168
+ sage: Mac = Sym.macdonald(t=0)
169
+ sage: Mac.base_ring()
170
+ Fraction Field of Univariate Polynomial Ring in q over Rational Field
171
+ """
172
+ return self._sym.base_ring()
173
+
174
+ def symmetric_function_ring( self ):
175
+ r"""
176
+ Return the base ring of the symmetric functions where the
177
+ Macdonald symmetric functions live.
178
+
179
+ INPUT:
180
+
181
+ - ``self`` -- a family of Macdonald symmetric function bases
182
+
183
+ OUTPUT: the symmetric function ring associated to the Macdonald bases
184
+
185
+ EXAMPLES::
186
+
187
+ sage: Mac = SymmetricFunctions(QQ['q'].fraction_field()).macdonald(t=0)
188
+ sage: Mac.symmetric_function_ring()
189
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in q over Rational Field
190
+ """
191
+ return self._sym
192
+
193
+ def P(self):
194
+ r"""
195
+ Return Macdonald polynomials in `P` basis.
196
+ The `P` basis is defined here as a normalized form of the `J` basis.
197
+
198
+ INPUT:
199
+
200
+ - ``self`` -- a family of Macdonald symmetric function bases
201
+
202
+ OUTPUT: the `P` Macdonald basis of symmetric functions
203
+
204
+ EXAMPLES::
205
+
206
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
207
+ sage: P = Sym.macdonald().P(); P
208
+ Symmetric Functions over Fraction Field of Multivariate Polynomial Ring in q, t over Rational Field in the Macdonald P basis
209
+ sage: P[2]
210
+ McdP[2]
211
+
212
+ The `P` Macdonald basis is upper triangularly related to the monomial symmetric functions and are
213
+ orthogonal with respect to the `qt`-Hall scalar product::
214
+
215
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
216
+ sage: P = Sym.macdonald().P(); P
217
+ Symmetric Functions over Fraction Field of Multivariate Polynomial Ring in q, t over Rational Field in the Macdonald P basis
218
+ sage: m = Sym.monomial()
219
+ sage: P.transition_matrix(m,2)
220
+ [ 1 (q*t - q + t - 1)/(q*t - 1)]
221
+ [ 0 1]
222
+ sage: P([1,1]).scalar_qt(P([2]))
223
+ 0
224
+ sage: P([2]).scalar_qt(P([2]))
225
+ (-q^3 + q^2 + q - 1)/(-q*t^2 + q*t + t - 1)
226
+ sage: P([1,1]).scalar_qt(P([1,1]))
227
+ (-q^2*t + q*t + q - 1)/(-t^3 + t^2 + t - 1)
228
+
229
+ When `q = 0`, the Macdonald polynomials on the `P` basis are the same
230
+ as the Hall-Littlewood polynomials on the `P` basis.
231
+
232
+ ::
233
+
234
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
235
+ sage: P = Sym.macdonald(q=0).P(); P
236
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the Macdonald P with q=0 basis
237
+ sage: P([2])^2
238
+ (t+1)*McdP[2, 2] + (-t+1)*McdP[3, 1] + McdP[4]
239
+ sage: HLP = Sym.hall_littlewood().P()
240
+ sage: HLP([2])^2
241
+ (t+1)*HLP[2, 2] + (-t+1)*HLP[3, 1] + HLP[4]
242
+
243
+ Coercions from the `Q` and `J` basis (proportional) are
244
+ implemented::
245
+
246
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
247
+ sage: P = Sym.macdonald().P()
248
+ sage: Q = Sym.macdonald().Q()
249
+ sage: J = Sym.macdonald().J()
250
+ sage: s = Sym.schur()
251
+
252
+ ::
253
+
254
+ sage: P(Q([2]))
255
+ ((q*t^2-q*t-t+1)/(q^3-q^2-q+1))*McdP[2]
256
+ sage: P(Q([2,1]))
257
+ -((q*t^4-2*q*t^3+q*t^2-t^2+2*t-1)/(-q^4*t+2*q^3*t-q^2*t+q^2-2*q+1))*McdP[2, 1]
258
+
259
+ ::
260
+
261
+ sage: P(J([2]))
262
+ (q*t^2-q*t-t+1)*McdP[2]
263
+ sage: P(J([2,1]))
264
+ -(q*t^4-2*q*t^3+q*t^2-t^2+2*t-1)*McdP[2, 1]
265
+
266
+ By transitivity, one get coercions from the classical bases::
267
+
268
+ sage: P(s([2]))
269
+ ((q-t)/(q*t-1))*McdP[1, 1] + McdP[2]
270
+ sage: P(s([2,1]))
271
+ ((q*t-t^2+q-t)/(q*t^2-1))*McdP[1, 1, 1] + McdP[2, 1]
272
+
273
+ ::
274
+
275
+ sage: Sym = SymmetricFunctions(QQ['x','y','z'].fraction_field())
276
+ sage: (x,y,z) = Sym.base_ring().gens()
277
+ sage: Macxy = Sym.macdonald(q=x,t=y)
278
+ sage: Macyz = Sym.macdonald(q=y,t=z)
279
+ sage: Maczx = Sym.macdonald(q=z,t=x)
280
+ sage: P1 = Macxy.P()
281
+ sage: P2 = Macyz.P()
282
+ sage: P3 = Maczx.P()
283
+ sage: m(P1[2,1])
284
+ -((2*x*y^2-x*y+y^2-x+y-2)/(-x*y^2+1))*m[1, 1, 1] + m[2, 1]
285
+ sage: m(P2[2,1])
286
+ -((2*y*z^2-y*z+z^2-y+z-2)/(-y*z^2+1))*m[1, 1, 1] + m[2, 1]
287
+ sage: m(P1(P2(P3[2,1])))
288
+ -((2*x^2*z+x^2-x*z+x-z-2)/(-x^2*z+1))*m[1, 1, 1] + m[2, 1]
289
+ sage: P1(P2[2])
290
+ -((x*y^2-2*x*y*z+y^2*z+x-2*y+z)/(x*y^2*z-x*y-y*z+1))*McdP[1, 1] + McdP[2]
291
+ sage: m(z*P1[2]+x*P2[2])
292
+ ((x^2*y^2*z+x*y^2*z^2-x^2*y^2+x^2*y*z-x*y*z^2+y^2*z^2-x^2*y-2*x*y*z-y*z^2+x*y-y*z+x+z)/(x*y^2*z-x*y-y*z+1))*m[1, 1] + (x+z)*m[2]
293
+ """
294
+ return MacdonaldPolynomials_p(self)
295
+
296
+ def Q(self):
297
+ r"""
298
+ Return the Macdonald polynomials on the `Q` basis. These are dual to
299
+ the Macdonald polynomials on the P basis with respect to the
300
+ `qt`-Hall scalar product.
301
+ The `Q` basis is defined to be a normalized form of the `J` basis.
302
+
303
+ INPUT:
304
+
305
+ - ``self`` -- a family of Macdonald symmetric function bases
306
+
307
+ OUTPUT: the `Q` Macdonald basis of symmetric functions
308
+
309
+ EXAMPLES::
310
+
311
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
312
+ sage: Q = Sym.macdonald().Q(); Q
313
+ Symmetric Functions over Fraction Field of Multivariate Polynomial Ring in q, t over Rational Field in the Macdonald Q basis
314
+ sage: P = Sym.macdonald().P()
315
+ sage: Q([2]).scalar_qt(P([2]))
316
+ 1
317
+ sage: Q([2]).scalar_qt(P([1,1]))
318
+ 0
319
+ sage: Q([1,1]).scalar_qt(P([2]))
320
+ 0
321
+ sage: Q([1,1]).scalar_qt(P([1,1]))
322
+ 1
323
+ sage: Q(P([2]))
324
+ ((q^3-q^2-q+1)/(q*t^2-q*t-t+1))*McdQ[2]
325
+ sage: Q(P([1,1]))
326
+ ((q^2*t-q*t-q+1)/(t^3-t^2-t+1))*McdQ[1, 1]
327
+
328
+
329
+ Coercions from the `P` and `J` basis (proportional) are implemented::
330
+
331
+ sage: P = Sym.macdonald().P()
332
+ sage: Q = Sym.macdonald().Q()
333
+ sage: J = Sym.macdonald().J()
334
+ sage: s = Sym.schur()
335
+
336
+ ::
337
+
338
+ sage: Q(J([2]))
339
+ (q^3-q^2-q+1)*McdQ[2]
340
+
341
+ ::
342
+
343
+ sage: Q(P([2]))
344
+ ((q^3-q^2-q+1)/(q*t^2-q*t-t+1))*McdQ[2]
345
+ sage: P(Q(P([2])))
346
+ McdP[2]
347
+ sage: Q(P(Q([2])))
348
+ McdQ[2]
349
+
350
+ By transitivity, one gets coercions from the classical bases::
351
+
352
+ sage: Q(s([2]))
353
+ ((q^2-q*t-q+t)/(t^3-t^2-t+1))*McdQ[1, 1] + ((q^3-q^2-q+1)/(q*t^2-q*t-t+1))*McdQ[2]
354
+ """
355
+ return MacdonaldPolynomials_q(self)
356
+
357
+ def J(self):
358
+ r"""
359
+ Return the Macdonald polynomials on the `J` basis also known as the
360
+ integral form of the Macdonald polynomials. These are scalar
361
+ multiples of both the `P` and `Q` bases. When expressed in the `P` or `Q`
362
+ basis, the scaling coefficients are polynomials in `q` and `t` rather
363
+ than rational functions.
364
+
365
+ The `J` basis is calculated using determinantal formulas of
366
+ Lapointe-Lascoux-Morse giving the action on the S-basis [LLM1998]_.
367
+
368
+ INPUT:
369
+
370
+ - ``self`` -- a family of Macdonald symmetric function bases
371
+
372
+ OUTPUT: the `J` Macdonald basis of symmetric functions
373
+
374
+ EXAMPLES::
375
+
376
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
377
+ sage: J = Sym.macdonald().J(); J
378
+ Symmetric Functions over Fraction Field of Multivariate Polynomial Ring in q, t over Rational Field in the Macdonald J basis
379
+ sage: P = Sym.macdonald().P()
380
+ sage: Q = Sym.macdonald().Q()
381
+ sage: P(J([2]))
382
+ (q*t^2-q*t-t+1)*McdP[2]
383
+ sage: P(J([1,1]))
384
+ (t^3-t^2-t+1)*McdP[1, 1]
385
+ sage: Q(J([2]))
386
+ (q^3-q^2-q+1)*McdQ[2]
387
+ sage: Q(J([1,1]))
388
+ (q^2*t-q*t-q+1)*McdQ[1, 1]
389
+
390
+ Coercions from the `Q` and `J` basis (proportional) and to/from
391
+ the Schur basis are implemented::
392
+
393
+ sage: P = Sym.macdonald().P()
394
+ sage: Q = Sym.macdonald().Q()
395
+ sage: J = Sym.macdonald().J()
396
+ sage: s = Sym.schur()
397
+
398
+ ::
399
+
400
+ sage: J(P([2]))
401
+ (1/(q*t^2-q*t-t+1))*McdJ[2]
402
+
403
+ ::
404
+
405
+ sage: J(Q([2]))
406
+ (1/(q^3-q^2-q+1))*McdJ[2]
407
+
408
+ ::
409
+
410
+ sage: s(J([2]))
411
+ -(q*t-t^2-q+t)*s[1, 1] + (q*t^2-q*t-t+1)*s[2]
412
+ sage: J(s([2]))
413
+ ((q-t)/(q*t^4-q*t^3-q*t^2-t^3+q*t+t^2+t-1))*McdJ[1, 1] + (1/(q*t^2-q*t-t+1))*McdJ[2]
414
+ """
415
+ return MacdonaldPolynomials_j(self)
416
+
417
+ def H(self):
418
+ r"""
419
+ Return the Macdonald polynomials on the H basis. When the `H` basis
420
+ is expanded on the Schur basis, the coefficients are the `qt`-Kostka
421
+ numbers.
422
+
423
+ INPUT:
424
+
425
+ - ``self`` -- a family of Macdonald symmetric function bases
426
+
427
+ OUTPUT: the `H` Macdonald basis of symmetric functions
428
+
429
+ EXAMPLES::
430
+
431
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
432
+ sage: H = Sym.macdonald().H(); H
433
+ Symmetric Functions over Fraction Field of Multivariate Polynomial Ring in q, t over Rational Field in the Macdonald H basis
434
+ sage: s = Sym.schur()
435
+ sage: s(H([2]))
436
+ q*s[1, 1] + s[2]
437
+ sage: s(H([1,1]))
438
+ s[1, 1] + t*s[2]
439
+
440
+ Coercions to/from the Schur basis are implemented::
441
+
442
+ sage: H = Sym.macdonald().H()
443
+ sage: s = Sym.schur()
444
+ sage: H(s([2]))
445
+ (q/(q*t-1))*McdH[1, 1] - (1/(q*t-1))*McdH[2]
446
+ """
447
+ return MacdonaldPolynomials_h(self)
448
+
449
+ def Ht(self):
450
+ r"""
451
+ Return the Macdonald polynomials on the `Ht` basis. The elements of
452
+ the `Ht` basis are eigenvectors of the `nabla` operator. When expanded
453
+ on the Schur basis, the coefficients are the modified `qt`-Kostka
454
+ numbers.
455
+
456
+ INPUT:
457
+
458
+ - ``self`` -- a family of Macdonald symmetric function bases
459
+
460
+ OUTPUT: the `Ht` Macdonald basis of symmetric functions
461
+
462
+ EXAMPLES::
463
+
464
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
465
+ sage: Ht = Sym.macdonald().Ht(); Ht
466
+ Symmetric Functions over Fraction Field of Multivariate Polynomial Ring in q, t over Rational Field in the Macdonald Ht basis
467
+ sage: [Ht(p).nabla() for p in Partitions(3)]
468
+ [q^3*McdHt[3], q*t*McdHt[2, 1], t^3*McdHt[1, 1, 1]]
469
+
470
+ ::
471
+
472
+ sage: s = Sym.schur()
473
+ sage: from sage.combinat.sf.macdonald import qt_kostka
474
+ sage: q,t = Ht.base_ring().gens()
475
+ sage: s(Ht([2,1]))
476
+ q*t*s[1, 1, 1] + (q+t)*s[2, 1] + s[3]
477
+ sage: qt_kostka([1,1,1],[2,1]).subs(t=1/t)*t^Partition([2,1]).weighted_size()
478
+ q*t
479
+ sage: qt_kostka([2,1],[2,1]).subs(t=1/t)*t^Partition([2,1]).weighted_size()
480
+ q + t
481
+ sage: qt_kostka([3],[2,1]).subs(t=1/t)*t^Partition([2,1]).weighted_size()
482
+ 1
483
+
484
+ Coercions to/from the Schur basis are implemented::
485
+
486
+ sage: Ht = Sym.macdonald().Ht()
487
+ sage: s = Sym.schur()
488
+ sage: Ht(s([2,1]))
489
+ (q/(q*t^2-t^3-q^2+q*t))*McdHt[1, 1, 1] - ((q^2+q*t+t^2)/(q^2*t^2-q^3-t^3+q*t))*McdHt[2, 1]
490
+ + (t/(-q^3+q^2*t+q*t-t^2))*McdHt[3]
491
+ sage: Ht(s([2]))
492
+ -(q/(-q+t))*McdHt[1, 1] + (t/(-q+t))*McdHt[2]
493
+ """
494
+ return MacdonaldPolynomials_ht(self)
495
+
496
+ def S(self):
497
+ r"""
498
+ Return the modified Schur functions defined by the plethystic
499
+ substitution `S_{\mu} = s_{\mu}[X(1-t)/(1-q)]`. When the
500
+ Macdonald polynomials in the J basis are expressed in terms of the
501
+ modified Schur functions at `q=0`, the coefficients are `qt`-Kostka numbers.
502
+
503
+ INPUT:
504
+
505
+ - ``self`` -- a family of Macdonald symmetric function bases
506
+
507
+ OUTPUT: the `S` Macdonald basis of symmetric functions
508
+
509
+ EXAMPLES::
510
+
511
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
512
+ sage: S = Sym.macdonald().S(); S
513
+ Symmetric Functions over Fraction Field of Multivariate Polynomial Ring in q, t
514
+ over Rational Field in the Macdonald S basis
515
+ sage: p = Sym.power()
516
+ sage: p(S[2,1])
517
+ ((1/3*t^3-t^2+t-1/3)/(q^3-3*q^2+3*q-1))*p[1, 1, 1] - ((1/3*t^3-1/3)/(q^3-1))*p[3]
518
+ sage: J = Sym.macdonald().J()
519
+ sage: S(J([2]))
520
+ (q^3-q^2-q+1)*McdS[2]
521
+ sage: S(J([1,1]))
522
+ (q^2*t-q*t-q+1)*McdS[1, 1] + (q^2-q*t-q+t)*McdS[2]
523
+ sage: S = Sym.macdonald(q=0).S()
524
+ sage: S(J[1,1])
525
+ McdS[1, 1] + t*McdS[2]
526
+ sage: S(J[2])
527
+ q*McdS[1, 1] + McdS[2]
528
+ sage: p(S[2,1])
529
+ -(1/3*t^3-t^2+t-1/3)*p[1, 1, 1] + (1/3*t^3-1/3)*p[3]
530
+
531
+ sage: from sage.combinat.sf.macdonald import qt_kostka
532
+ sage: qt_kostka([2],[1,1])
533
+ t
534
+ sage: qt_kostka([1,1],[2])
535
+ q
536
+
537
+ Coercions to/from the Schur basis are implemented::
538
+
539
+ sage: S = Sym.macdonald().S()
540
+ sage: s = Sym.schur()
541
+ sage: S(s([2]))
542
+ ((q^2-q*t-q+t)/(t^3-t^2-t+1))*McdS[1, 1] - ((q^2*t-q*t-q+1)/(-t^3+t^2+t-1))*McdS[2]
543
+ sage: s(S([1,1]))
544
+ -((q*t^2-q*t-t+1)/(-q^3+q^2+q-1))*s[1, 1] + ((q*t-t^2-q+t)/(-q^3+q^2+q-1))*s[2]
545
+ """
546
+ return MacdonaldPolynomials_s(self)
547
+
548
+
549
+ QQqt = QQ['q,t'].fraction_field()
550
+
551
+ ##############################################
552
+
553
+
554
+ def c1(part, q, t):
555
+ r"""
556
+ This function returns the qt-Hall scalar product between ``J(part)``
557
+ and ``P(part)``.
558
+
559
+ This coefficient is `c_\lambda` in equation (8.1') p. 352 of
560
+ Macdonald's book [Mac1995]_.
561
+
562
+ INPUT:
563
+
564
+ - ``part`` -- a partition
565
+ - ``q``, ``t`` -- parameters
566
+
567
+ OUTPUT: a polynomial of the scalar product between the `J` and `P` bases
568
+
569
+ EXAMPLES::
570
+
571
+ sage: from sage.combinat.sf.macdonald import c1
572
+ sage: R.<q,t> = QQ[]
573
+ sage: c1(Partition([2,1]),q,t)
574
+ -q^4*t + 2*q^3*t - q^2*t + q^2 - 2*q + 1
575
+ sage: c1(Partition([1,1]),q,t)
576
+ q^2*t - q*t - q + 1
577
+ """
578
+ R = q.parent()
579
+ arms = part.arm_lengths(flat=True)
580
+ legs = part.leg_lengths(flat=True)
581
+ return R.prod(1 - q**(a + 1) * t**l for a, l in zip(arms, legs))
582
+
583
+
584
+ def c2(part, q, t):
585
+ r"""
586
+ This function returns the qt-Hall scalar product between J(part)
587
+ and Q(part).
588
+
589
+ This coefficient is `c_\lambda` in equation (8.1) p. 352 of
590
+ Macdonald's book [Mac1995]_.
591
+
592
+ INPUT:
593
+
594
+ - ``part`` -- a partition
595
+ - ``q``, ``t`` -- parameters
596
+
597
+ OUTPUT: a polynomial of the scalar product between the `J` and `P` bases
598
+
599
+ EXAMPLES::
600
+
601
+ sage: from sage.combinat.sf.macdonald import c2
602
+ sage: R.<q,t> = QQ[]
603
+ sage: c2(Partition([1,1]),q,t)
604
+ t^3 - t^2 - t + 1
605
+ sage: c2(Partition([2,1]),q,t)
606
+ -q*t^4 + 2*q*t^3 - q*t^2 + t^2 - 2*t + 1
607
+ """
608
+ R = q.parent()
609
+ arms = part.arm_lengths(flat=True)
610
+ legs = part.leg_lengths(flat=True)
611
+ return R.prod(1 - q**a * t**(l + 1) for a, l in zip(arms, legs))
612
+
613
+
614
+ @cached_function
615
+ def cmunu1(mu, nu):
616
+ r"""
617
+ Return the coefficient of `{\tilde H}_\nu` in `h_1^\perp {\tilde H}_\mu`.
618
+
619
+ INPUT:
620
+
621
+ - ``mu``, ``nu`` -- partitions with ``nu`` precedes ``mu``
622
+
623
+ OUTPUT: an element of the fraction field of polynomials in `q` and `t`
624
+
625
+ EXAMPLES::
626
+
627
+ sage: from sage.combinat.sf.macdonald import cmunu1
628
+ sage: cmunu1(Partition([2,1]),Partition([2]))
629
+ (-t^2 + q)/(q - t)
630
+ sage: cmunu1(Partition([2,1]),Partition([1,1]))
631
+ (-q^2 + t)/(-q + t)
632
+ sage: Sym = SymmetricFunctions(QQ['q','t'].fraction_field())
633
+ sage: h = Sym.h()
634
+ sage: Ht = Sym.macdonald().Ht()
635
+ sage: all(Ht[3,2,1].skew_by(h[1]).coefficient(nu)
636
+ ....: == cmunu1(Partition([3,2,1]),nu)
637
+ ....: for nu in Partition([3,2,1]).down_list())
638
+ True
639
+ """
640
+ q,t = QQqt.gens()
641
+ # The following for loop is equivalent to getting the cell:
642
+ # SkewPartition([mu,nu]).cells()[0]
643
+ for i, val in enumerate(nu._list):
644
+ if val < mu._list[i]:
645
+ A = prod((t**mu.leg_length(i, s) - q**(mu.arm_length(i, s)+1))
646
+ / (t**nu.leg_length(i, s) - q**(nu.arm_length(i, s)+1))
647
+ for s in range(val))
648
+ B = prod((q**mu.arm_length(*s) - t**(mu.leg_length(*s)+1))
649
+ / (q**nu.arm_length(*s) - t**(nu.leg_length(*s)+1))
650
+ for s in nu.cells() if s[1] == val)
651
+ return QQqt(A * B)
652
+
653
+ return QQqt(prod( (q**mu.arm_length(s, 0) - t**(mu.leg_length(s, 0)+1))
654
+ / (q**nu.arm_length(s, 0) - t**(nu.leg_length(s, 0)+1))
655
+ for s in range(len(nu._list)) ))
656
+
657
+
658
+ @cached_function
659
+ def cmunu(mu, nu):
660
+ r"""
661
+ Return the coefficient of `{\tilde H}_\nu` in `h_r^\perp {\tilde H}_\mu`.
662
+
663
+ Proposition 5 of F. Bergeron and M. Haiman [BH2013]_ states
664
+
665
+ .. MATH::
666
+
667
+ c_{\mu\nu} = \sum_{\alpha \leftarrow \nu} c_{\mu\alpha}
668
+ c_{\alpha\nu} B_{\alpha/\nu}/B_{\mu/\nu}
669
+
670
+ where `c_{\mu\nu}` is the coefficient of `{\tilde H}_\nu` in
671
+ `h_r^\perp {\tilde H}_\mu` and `B_{\mu/\nu}` is the bi-exponent generator
672
+ implemented in the function :func:`sage.combinat.sf.macdonald.Bmu`.
673
+
674
+ INPUT:
675
+
676
+ - ``mu``, ``nu`` -- partitions with ``nu`` contained in ``mu``
677
+
678
+ OUTPUT: an element of the fraction field of polynomials in `q` and `t`
679
+
680
+ EXAMPLES::
681
+
682
+ sage: from sage.combinat.sf.macdonald import cmunu
683
+ sage: cmunu(Partition([2,1]),Partition([1]))
684
+ q + t + 1
685
+ sage: cmunu(Partition([2,2]),Partition([1,1]))
686
+ (-q^3 - q^2 + q*t + t)/(-q + t)
687
+ sage: Sym = SymmetricFunctions(QQ['q','t'].fraction_field())
688
+ sage: h = Sym.h()
689
+ sage: Ht = Sym.macdonald().Ht()
690
+ sage: all(Ht[2,2].skew_by(h[r]).coefficient(nu)
691
+ ....: == cmunu(Partition([2,2]),nu)
692
+ ....: for r in range(1,5) for nu in Partitions(4-r))
693
+ True
694
+ """
695
+ if not nu:
696
+ return QQqt.one()
697
+ if not mu.contains(nu):
698
+ return QQqt.zero()
699
+ if mu.size() == nu.size() + 1:
700
+ return cmunu1(mu, nu)
701
+
702
+ # This is equivalent to:
703
+ # Bmu(SkewPartition([outer, inner]))
704
+ def Bmu_skew(outer, inner):
705
+ inner = list(inner) # This makes a (shallow) copy of inner
706
+ inner += [0]*(len(outer)-len(inner))
707
+ q,t = QQqt.gens()
708
+ res = QQqt.zero()
709
+ for i, val in enumerate(outer):
710
+ for j in range(inner[i], val):
711
+ res += t**i * q**j
712
+ return res
713
+
714
+ nulist = nu._list
715
+ return (sum(cmunu(mu, al) * cmunu1(al, nu) * Bmu_skew(al, nulist)
716
+ for al in nu.up()) / Bmu_skew(mu, nulist))
717
+
718
+ #Generic MacdonaldPolynomials
719
+
720
+
721
+ class MacdonaldPolynomials_generic(sfa.SymmetricFunctionAlgebra_generic):
722
+
723
+ def __init__(self, macdonald):
724
+ r"""
725
+ A class for methods for one of the Macdonald bases of the symmetric functions.
726
+
727
+ INPUT:
728
+
729
+ - ``self`` -- a Macdonald basis
730
+ - ``macdonald`` -- a family of Macdonald symmetric function bases
731
+
732
+ EXAMPLES::
733
+
734
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q,t'])); Sym.rename('Sym'); Sym
735
+ Sym
736
+ sage: Sym.macdonald().P()
737
+ Sym in the Macdonald P basis
738
+ sage: Sym.macdonald(t=2).P()
739
+ Sym in the Macdonald P with t=2 basis
740
+ sage: Sym.rename()
741
+
742
+ TESTS::
743
+
744
+ sage: Sym.macdonald().P()._prefix
745
+ 'McdP'
746
+ sage: Sym.macdonald().Ht()._prefix
747
+ 'McdHt'
748
+ """
749
+ s = self.__class__.__name__[21:].capitalize()
750
+ sfa.SymmetricFunctionAlgebra_generic.__init__(
751
+ self, macdonald._sym,
752
+ basis_name="Macdonald " + s + macdonald._name_suffix,
753
+ prefix="Mcd" + s)
754
+ self.q = macdonald.q
755
+ self.t = macdonald.t
756
+ self._macdonald = macdonald
757
+ self._s = self._macdonald._s
758
+
759
+ # Bases defined by orthotriangularity should inherit from some
760
+ # common category BasesByOrthotriangularity (shared with Jack, HL, orthotriang, Mcdo)
761
+ if hasattr(self, "_s_cache"):
762
+ # temporary until Hom(GradedHopfAlgebrasWithBasis work better)
763
+ category = ModulesWithBasis(self.base_ring())
764
+ self.register_coercion(SetMorphism(Hom(self._s, self, category), self._s_to_self))
765
+ self._s.register_coercion(SetMorphism(Hom(self, self._s, category), self._self_to_s))
766
+
767
+ def construction(self):
768
+ """
769
+ Return a pair ``(F, R)``, where ``F`` is a
770
+ :class:`SymmetricFunctionsFunctor` and `R` is a ring, such
771
+ that ``F(R)`` returns ``self``.
772
+
773
+ EXAMPLES::
774
+
775
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q']))
776
+ sage: J = Sym.macdonald(t=2).J()
777
+ sage: J.construction()
778
+ (SymmetricFunctionsFunctor[Macdonald J with t=2],
779
+ Fraction Field of Univariate Polynomial Ring in q over Rational Field)
780
+ """
781
+ return (sfa.SymmetricFunctionsFamilyFunctor(self, Macdonald,
782
+ self.basis_name(),
783
+ self.q, self.t),
784
+ self.base_ring())
785
+
786
+ def _s_to_self(self, x):
787
+ r"""
788
+ Isomorphism from the Schur basis into ``self``.
789
+
790
+ INPUT:
791
+
792
+ - ``self`` -- a Macdonald basis
793
+ - ``x`` -- an element of the Schur basis
794
+
795
+ OUTPUT: the basis element ``x`` in the basis ``self``
796
+
797
+ EXAMPLES::
798
+
799
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q']))
800
+ sage: J = Sym.macdonald(t=2).J()
801
+ sage: s = Sym.schur()
802
+ sage: J._s_to_self(s[2,1])
803
+ ((-1/28*q+1/14)/(q-1/4))*McdJ[1, 1, 1] - (1/4/(q-1/4))*McdJ[2, 1]
804
+
805
+ This is for internal use only. Please use instead::
806
+
807
+ sage: J(s[2,1])
808
+ ((-1/28*q+1/14)/(q-1/4))*McdJ[1, 1, 1] - (1/4/(q-1/4))*McdJ[2, 1]
809
+ """
810
+ return self._from_cache(x, self._s_cache, self._s_to_self_cache,
811
+ q=self.q, t=self.t)
812
+
813
+ def _self_to_s(self, x):
814
+ r"""
815
+ Isomorphism from ``self`` to the Schur basis.
816
+
817
+ INPUT:
818
+
819
+ - ``self`` -- a Macdonald basis
820
+ - ``x`` -- an element of a Macdonald basis
821
+
822
+ OUTPUT: the basis element ``x`` in the Schur functions
823
+
824
+ EXAMPLES::
825
+
826
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q']))
827
+ sage: J = Sym.macdonald(t=2).J()
828
+ sage: s = Sym.schur()
829
+ sage: J._self_to_s(J[2,1])
830
+ (3*q-6)*s[1, 1, 1] + (-4*q+1)*s[2, 1]
831
+
832
+ This is for internal use only. Please use instead::
833
+
834
+ sage: s(J[2,1])
835
+ (3*q-6)*s[1, 1, 1] + (-4*q+1)*s[2, 1]
836
+ """
837
+ return self._s._from_cache(x, self._s_cache, self._self_to_s_cache,
838
+ q=self.q, t=self.t)
839
+
840
+ def c1(self, part):
841
+ r"""
842
+ Return the `qt`-Hall scalar product between ``J(part)`` and ``P(part)``.
843
+
844
+ INPUT:
845
+
846
+ - ``self`` -- a Macdonald basis
847
+ - ``part`` -- a partition
848
+
849
+ OUTPUT:
850
+
851
+ - returns the `qt`-Hall scalar product between ``J(part)`` and ``P(part)``
852
+
853
+ EXAMPLES::
854
+
855
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
856
+ sage: P = Sym.macdonald().P()
857
+ sage: P.c1(Partition([2,1]))
858
+ -q^4*t + 2*q^3*t - q^2*t + q^2 - 2*q + 1
859
+ """
860
+ return c1(part, self.q, self.t)
861
+
862
+ def c2(self, part):
863
+ r"""
864
+ Return the `qt`-Hall scalar product between ``J(part)`` and ``Q(part)``.
865
+
866
+ INPUT:
867
+
868
+ - ``self`` -- a Macdonald basis
869
+ - ``part`` -- a partition
870
+
871
+ OUTPUT:
872
+
873
+ - returns the `qt`-Hall scalar product between ``J(part)`` and ``Q(part)``
874
+
875
+ EXAMPLES::
876
+
877
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
878
+ sage: P = Sym.macdonald().P()
879
+ sage: P.c2(Partition([2,1]))
880
+ -q*t^4 + 2*q*t^3 - q*t^2 + t^2 - 2*t + 1
881
+ """
882
+ return c2(part, self.q, self.t)
883
+
884
+ def product(self, left, right):
885
+ r"""
886
+ Multiply an element of the Macdonald symmetric function
887
+ basis ``self`` and another symmetric function
888
+
889
+ Convert to the Schur basis, do the multiplication there, and
890
+ convert back to ``self`` basis.
891
+
892
+ INPUT:
893
+
894
+ - ``self`` -- a Macdonald symmetric function basis
895
+ - ``left`` -- an element of the basis ``self``
896
+ - ``right`` -- another symmetric function
897
+
898
+ OUTPUT: the product of ``left`` and ``right`` expanded in the basis ``self``
899
+
900
+ EXAMPLES::
901
+
902
+ sage: Mac = SymmetricFunctions(FractionField(QQ['q','t'])).macdonald()
903
+ sage: H = Mac.H()
904
+ sage: J = Mac.J()
905
+ sage: P = Mac.P()
906
+ sage: Q = Mac.Q()
907
+ sage: Ht = Mac.Ht()
908
+ sage: J([1])^2 #indirect doctest
909
+ ((q-1)/(q*t-1))*McdJ[1, 1] + ((t-1)/(q*t-1))*McdJ[2]
910
+ sage: J.product( J[1], J[2] )
911
+ -((q^2-1)/(-q^2*t+1))*McdJ[2, 1] - ((t-1)/(-q^2*t+1))*McdJ[3]
912
+ sage: H.product( H[1], H[2] )
913
+ ((q^2-1)/(q^2*t-1))*McdH[2, 1] - ((t-1)/(-q^2*t+1))*McdH[3]
914
+ sage: P.product( P[1], P[2] )
915
+ -((q^3*t^2-q*t^2-q^2+1)/(-q^3*t^2+q^2*t+q*t-1))*McdP[2, 1] + McdP[3]
916
+ sage: Q.product(Q[1],Q[2])
917
+ McdQ[2, 1] + ((q^2*t-q^2+q*t-q+t-1)/(q^2*t-1))*McdQ[3]
918
+ sage: Ht.product(Ht[1],Ht[2])
919
+ ((q^2-1)/(q^2-t))*McdHt[2, 1] + ((t-1)/(-q^2+t))*McdHt[3]
920
+ """
921
+ return self(self._s(left) * self._s(right))
922
+
923
+ def macdonald_family(self):
924
+ r"""
925
+ Return the family of Macdonald bases associated to the basis ``self``.
926
+
927
+ INPUT:
928
+
929
+ - ``self`` -- a Macdonald basis
930
+
931
+ OUTPUT: the family of Macdonald symmetric functions associated to ``self``
932
+
933
+ EXAMPLES::
934
+
935
+ sage: MacP = SymmetricFunctions(QQ['q'].fraction_field()).macdonald(t=0).P()
936
+ sage: MacP.macdonald_family()
937
+ Macdonald polynomials with t=0 over Fraction Field of Univariate Polynomial Ring in q over Rational Field
938
+ """
939
+ return self._macdonald
940
+
941
+ class Element(sfa.SymmetricFunctionAlgebra_generic.Element):
942
+
943
+ def nabla(self, q=None, t=None, power=1):
944
+ r"""
945
+ Return the value of the nabla operator applied to ``self``.
946
+
947
+ The eigenvectors of the nabla operator are the Macdonald
948
+ polynomials in the `Ht` basis. For more information
949
+ see: [BGHT1999]_.
950
+
951
+ The operator nabla acts on symmetric functions and has the
952
+ Macdonald `Ht` basis as eigenfunctions and the eigenvalues
953
+ are `q^{n(\mu')} t^{n(\mu)}` where
954
+ `n(\mu) = \sum_{i} (i-1) \mu_i` and `\mu'` is the conjugate
955
+ shape of `\mu`.
956
+
957
+ If the parameter ``power`` is an integer then it calculates
958
+ nabla to that integer. The default value of ``power`` is 1.
959
+
960
+ INPUT:
961
+
962
+ - ``self`` -- an element of a Macdonald basis
963
+ - ``q``, ``t`` -- (optional) parameters to specialize
964
+ - ``power`` -- integer (default: 1)
965
+
966
+ OUTPUT: the symmetric function of `\nabla` acting on ``self``
967
+
968
+ EXAMPLES::
969
+
970
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
971
+ sage: P = Sym.macdonald().P()
972
+ sage: P([1,1]).nabla()
973
+ ((q^2*t+q*t^2-2*t)/(q*t-1))*McdP[1, 1] + McdP[2]
974
+ sage: P([1,1]).nabla(t=1)
975
+ ((q^2*t+q*t-t-1)/(q*t-1))*McdP[1, 1] + McdP[2]
976
+ sage: H = Sym.macdonald().H()
977
+ sage: H([1,1]).nabla()
978
+ t*McdH[1, 1] - (t^2-1)*McdH[2]
979
+ sage: H([1,1]).nabla(q=1)
980
+ ((t^2+q-t-1)/(q*t-1))*McdH[1, 1] - ((t^3-t^2-t+1)/(q*t-1))*McdH[2]
981
+ sage: H(0).nabla()
982
+ 0
983
+ sage: H([2,2,1]).nabla(t=1/H.t)
984
+ -(q^2/(-t^4))*McdH[2, 2, 1]
985
+ sage: H([2,2,1]).nabla(t=1/H.t,power=-1)
986
+ -(t^4/(-q^2))*McdH[2, 2, 1]
987
+ """
988
+ parent = self.parent()
989
+ if (q is None and t is None):
990
+ Ht = parent._macdonald.Ht()
991
+ else:
992
+ if q is None:
993
+ q = parent.q
994
+ if t is None:
995
+ t = parent.t
996
+ Ht = parent.realization_of().macdonald(q=q,t=t).Ht()
997
+ return parent(Ht(self).nabla(power=power))
998
+
999
+ #P basis
1000
+
1001
+
1002
+ class MacdonaldPolynomials_p(MacdonaldPolynomials_generic):
1003
+ def __init__(self, macdonald):
1004
+ r"""
1005
+ The `P` basis is defined here as the `J` basis times a
1006
+ normalizing coefficient `c2`.
1007
+
1008
+ INPUT:
1009
+
1010
+ - ``self`` -- a Macdonald `P` basis
1011
+ - ``macdonald`` -- a family of Macdonald bases
1012
+
1013
+ TESTS::
1014
+
1015
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1016
+ sage: P = Sym.macdonald().P()
1017
+ sage: TestSuite(P).run(skip=["_test_associativity","_test_distributivity","_test_prod"]) # long time (20s on sage.math, 2012)
1018
+ sage: TestSuite(P).run(elements = [P.t*P[1,1]+P.q*P[2], P[1]+(P.q+P.t)*P[1,1]]) # long time (depends on previous)
1019
+ """
1020
+ MacdonaldPolynomials_generic.__init__(self, macdonald)
1021
+
1022
+ self._J = macdonald.J()
1023
+ # temporary until Hom(GradedHopfAlgebrasWithBasis work better)
1024
+ category = ModulesWithBasis(self.base_ring())
1025
+ phi = self._J.module_morphism(diagonal=self.c2,
1026
+ codomain=self, category=category)
1027
+ self.register_coercion(phi)
1028
+ self._J.register_coercion(~phi)
1029
+
1030
+ def scalar_qt_basis(self, part1, part2=None):
1031
+ r"""
1032
+ Return the scalar product of `P(part1)` and `P(part2)`
1033
+ This scalar product formula is given in equation (4.11) p.323
1034
+ and (6.19) p.339 of Macdonald's book [Mac1995]_.
1035
+
1036
+ INPUT:
1037
+
1038
+ - ``self`` -- a Macdonald `P` basis
1039
+ - ``part1``, ``part2`` -- partitions
1040
+
1041
+ OUTPUT:
1042
+
1043
+ - returns the scalar product of ``P(part1)`` and ``P(part2)``
1044
+
1045
+ EXAMPLES::
1046
+
1047
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1048
+ sage: P = Sym.macdonald().P()
1049
+ sage: P.scalar_qt_basis(Partition([2,1]), Partition([1,1,1]))
1050
+ 0
1051
+ sage: f = P.scalar_qt_basis(Partition([3,2,1]), Partition([3,2,1]))
1052
+ sage: factor(f.numerator())
1053
+ (q - 1)^3 * (q^2*t - 1)^2 * (q^3*t^2 - 1)
1054
+ sage: factor(f.denominator())
1055
+ (t - 1)^3 * (q*t^2 - 1)^2 * (q^2*t^3 - 1)
1056
+
1057
+ With a single argument, takes `part2 = part1`::
1058
+
1059
+ sage: P.scalar_qt_basis(Partition([2,1]), Partition([2,1]))
1060
+ (-q^4*t + 2*q^3*t - q^2*t + q^2 - 2*q + 1)/(-q*t^4 + 2*q*t^3 - q*t^2 + t^2 - 2*t + 1)
1061
+ """
1062
+ if part2 is not None and part1 != part2:
1063
+ return self.base_ring().zero()
1064
+ return self.c1(part1) / self.c2(part1)
1065
+
1066
+ class Element(MacdonaldPolynomials_generic.Element):
1067
+ pass
1068
+
1069
+
1070
+ #Q basis
1071
+ class MacdonaldPolynomials_q(MacdonaldPolynomials_generic):
1072
+ def __init__(self, macdonald):
1073
+ r"""
1074
+ The `Q` basis is defined here as the `J` basis times a
1075
+ normalizing coefficient.
1076
+
1077
+ INPUT:
1078
+
1079
+ - ``self`` -- a Macdonald `Q` basis
1080
+ - ``macdonald`` -- a family of Macdonald bases
1081
+
1082
+ TESTS::
1083
+
1084
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1085
+ sage: Q = Sym.macdonald().Q()
1086
+ sage: TestSuite(Q).run(skip=["_test_associativity","_test_distributivity","_test_prod"]) # long time (29s on sage.math, 2012)
1087
+ sage: TestSuite(Q).run(elements = [Q.t*Q[1,1]+Q.q*Q[2], Q[1]+(Q.q+Q.t)*Q[1,1]]) # long time (depends on previous)
1088
+ """
1089
+ MacdonaldPolynomials_generic.__init__(self, macdonald)
1090
+
1091
+ self._J = macdonald.J()
1092
+ self._P = macdonald.P()
1093
+
1094
+ # temporary until Hom(GradedHopfAlgebrasWithBasis) works better
1095
+ category = ModulesWithBasis(self.base_ring())
1096
+ phi = self._P.module_morphism(diagonal=self._P.scalar_qt_basis,
1097
+ codomain=self, category=category)
1098
+ self.register_coercion(phi)
1099
+ self._P.register_coercion(~phi)
1100
+
1101
+ class Element(MacdonaldPolynomials_generic.Element):
1102
+ pass
1103
+
1104
+
1105
+ class MacdonaldPolynomials_j(MacdonaldPolynomials_generic):
1106
+ def __init__(self, macdonald):
1107
+ r"""
1108
+ The `J` basis is calculated using determinantal formulas of
1109
+ Lapointe-Lascoux-Morse giving the action on the `S`-basis.
1110
+
1111
+ INPUT:
1112
+
1113
+ - ``self`` -- a Macdonald `J` basis
1114
+ - ``macdonald`` -- a family of Macdonald bases
1115
+
1116
+ TESTS::
1117
+
1118
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1119
+ sage: J = Sym.macdonald().J()
1120
+ sage: TestSuite(J).run(skip=["_test_associativity","_test_distributivity","_test_prod"]) # long time (19s on sage.math, 2012)
1121
+ sage: TestSuite(J).run(elements = [J.t*J[1,1]+J.q*J[2], J[1]+(J.q+J.t)*J[1,1]]) # long time (depends on previous)
1122
+ """
1123
+ self._self_to_s_cache = _j_to_s_cache
1124
+ self._s_to_self_cache = _s_to_j_cache
1125
+ MacdonaldPolynomials_generic.__init__(self, macdonald)
1126
+
1127
+ def _s_cache(self, n):
1128
+ r"""
1129
+ Compute the change of basis and its inverse between the Macdonald
1130
+ polynomials on the `J` basis and the Schur functions
1131
+ these computations are completed with coefficients in fraction
1132
+ field of polynomials in `q` and `t`
1133
+
1134
+ INPUT:
1135
+
1136
+ - ``self`` -- a Macdonald `J` basis
1137
+ - ``n`` -- nonnegative integer
1138
+
1139
+ EXAMPLES::
1140
+
1141
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1142
+ sage: J = Sym.macdonald().J()
1143
+ sage: J._s_cache(2)
1144
+ sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())]
1145
+ sage: l( J._s_to_self_cache[2] )
1146
+ [([1, 1], [([1, 1], 1/(t^3 - t^2 - t + 1))]),
1147
+ ([2],
1148
+ [([1, 1], (q - t)/(q*t^4 - q*t^3 - q*t^2 - t^3 + q*t + t^2 + t - 1)),
1149
+ ([2], 1/(q*t^2 - q*t - t + 1))])]
1150
+ sage: l( J._self_to_s_cache[2] )
1151
+ [([1, 1], [([1, 1], t^3 - t^2 - t + 1)]),
1152
+ ([2], [([1, 1], -q*t + t^2 + q - t), ([2], q*t^2 - q*t - t + 1)])]
1153
+ """
1154
+ self._invert_morphism(n, QQqt, self._self_to_s_cache,
1155
+ self._s_to_self_cache,
1156
+ to_other_function=self._to_s,
1157
+ upper_triangular=False)
1158
+
1159
+ def _to_s(self, part):
1160
+ r"""
1161
+ Return a function which gives the coefficient of a partition in
1162
+ the Schur expansion of self(part).
1163
+
1164
+ These computations are completed with coefficients in fraction
1165
+ field of polynomials in `q` and `t`
1166
+
1167
+ INPUT:
1168
+
1169
+ - ``self`` -- a Macdonald `J` basis
1170
+ - ``part`` -- a partition
1171
+
1172
+ OUTPUT:
1173
+
1174
+ - returns a function which returns the coefficients of the expansion of `J`
1175
+ in the Schur basis
1176
+
1177
+ EXAMPLES::
1178
+
1179
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1180
+ sage: J = Sym.macdonald().J()
1181
+ sage: f21 = J._to_s(Partition([2,1]))
1182
+ sage: [f21(part) for part in Partitions(3)]
1183
+ [0,
1184
+ -q*t^4 + 2*q*t^3 - q*t^2 + t^2 - 2*t + 1,
1185
+ q*t^3 - t^4 - q*t^2 + t^3 - q*t + t^2 + q - t]
1186
+ sage: Sym.schur()( J[2,1] )
1187
+ (q*t^3-t^4-q*t^2+t^3-q*t+t^2+q-t)*s[1, 1, 1] - (q*t^4-2*q*t^3+q*t^2-t^2+2*t-1)*s[2, 1]
1188
+ """
1189
+ q, t = QQqt.gens()
1190
+ S = self._macdonald.S()
1191
+ res = S(1)
1192
+ for k in reversed(part):
1193
+ res = res.creation(k)
1194
+ res = res._omega_qt_in_schurs()
1195
+ res = res.map_coefficients(lambda c: c(t, q))
1196
+ f = res.coefficient
1197
+ return f
1198
+
1199
+ class Element(MacdonaldPolynomials_generic.Element):
1200
+ pass
1201
+
1202
+
1203
+ class MacdonaldPolynomials_h(MacdonaldPolynomials_generic):
1204
+ def __init__(self, macdonald):
1205
+ r"""
1206
+ The `H` basis is defined as `H_\mu = \sum_{\lambda} K_{\lambda\mu}(q,t) s_\lambda`
1207
+ where `K_{\lambda\mu}(q,t)` are the Macdonald Kostka coefficients.
1208
+
1209
+ In this implementation, it is calculated by using the Macdonald `Ht` basis and
1210
+ substituting `t \rightarrow 1/t` and multiplying by `t^{n(\mu)}`.
1211
+
1212
+ INPUT:
1213
+
1214
+ - ``self`` -- a Macdonald `H` basis
1215
+ - ``macdonald`` -- a family of Macdonald bases
1216
+
1217
+ TESTS::
1218
+
1219
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1220
+ sage: H = Sym.macdonald().H()
1221
+ sage: TestSuite(H).run(skip=["_test_associativity","_test_distributivity","_test_prod"])
1222
+ sage: TestSuite(H).run(elements = [H.t*H[1,1]+H.q*H[2], H[1]+(H.q+H.t)*H[1,1]]) # long time (26s on sage.math, 2012)
1223
+ """
1224
+ MacdonaldPolynomials_generic.__init__(self, macdonald)
1225
+ self._m = self._sym.m()
1226
+ self._Lmunu = macdonald.Ht()._Lmunu
1227
+ if not self.t:
1228
+ self._Qp = self._sym.hall_littlewood(t=self.q).Qp()
1229
+ category = ModulesWithBasis(self.base_ring())
1230
+ self._s.register_coercion(SetMorphism(Hom(self, self._s, category), self._self_to_s))
1231
+ self.register_coercion(SetMorphism(Hom(self._s, self, category), self._s_to_self))
1232
+ self._m.register_coercion(SetMorphism(Hom(self, self._m, category), self._self_to_m))
1233
+ self.register_coercion(SetMorphism(Hom(self._m, self, category), self._m_to_self))
1234
+
1235
+ def _self_to_s(self, x):
1236
+ r"""
1237
+ Return an element ``x`` of ``self`` expanded in the Schur basis.
1238
+
1239
+ If `t=0` then the expression for `H_\mu[X;q,0]` is equal to
1240
+ `\omega Q'_{\mu'}[X;q]` where `Q'` is the Hall-Littlewood basis.
1241
+
1242
+ If `t \neq 0` then the conversion uses the monomial basis.
1243
+
1244
+ INPUT:
1245
+
1246
+ - ``x`` -- an element of ``H`` basis
1247
+
1248
+ OUTPUT: an element of the Schur basis
1249
+
1250
+ EXAMPLES::
1251
+
1252
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1253
+ sage: H = Sym.macdonald().H()
1254
+ sage: s = Sym.s()
1255
+ sage: s(H[2,1])
1256
+ q*s[1, 1, 1] + (q*t+1)*s[2, 1] + t*s[3]
1257
+ sage: H2 = Sym.macdonald(t=0).H()
1258
+ sage: s(H2[2,1])
1259
+ q*s[1, 1, 1] + s[2, 1]
1260
+
1261
+ sage: Sym = SymmetricFunctions(FractionField(QQ['x']))
1262
+ sage: x = Sym.base_ring().gen()
1263
+ sage: H = Sym.macdonald(q=x,t=1/x).H()
1264
+ sage: s = Sym.s()
1265
+ sage: s(H[2,1])
1266
+ x*s[1, 1, 1] + 2*s[2, 1] + 1/x*s[3]
1267
+ """
1268
+ if self.t:
1269
+ return self._s(self._self_to_m(x))
1270
+ else:
1271
+ return sum(cmu*self._s(self._Qp(mu.conjugate())) for mu,cmu in x).omega()
1272
+
1273
+ def _s_to_self(self, x):
1274
+ r"""
1275
+ Return an element of the Schur basis ``x`` expanded in the ``H`` basis.
1276
+
1277
+ If `t=0` then the expression for `H_\mu[X;q,0]` is equal to
1278
+ `\omega Q'_{\mu'}[X;q]` where `Q'` is the Hall-Littlewood basis.
1279
+
1280
+ If `t \neq 0` then the conversion uses the monomial basis.
1281
+
1282
+ INPUT:
1283
+
1284
+ - ``x`` -- an element of the Schur basis
1285
+
1286
+ OUTPUT: an element of the ``H`` basis
1287
+
1288
+ EXAMPLES::
1289
+
1290
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1291
+ sage: H = Sym.macdonald().H()
1292
+ sage: s = Sym.s()
1293
+ sage: H(s[1,1])
1294
+ -(1/(q*t-1))*McdH[1, 1] + (t/(q*t-1))*McdH[2]
1295
+ sage: (q,t) = Sym.base_ring().gens()
1296
+ sage: H(q*s[1, 1, 1] + (q*t+1)*s[2, 1] + t*s[3])
1297
+ McdH[2, 1]
1298
+ sage: H2 = Sym.macdonald(t=0).H()
1299
+ sage: H2(q*s[1, 1, 1] + (q*t+1)*s[2, 1] + t*s[3])
1300
+ -(q^2*t-1)*McdH[2, 1] + t*McdH[3]
1301
+
1302
+ sage: Sym = SymmetricFunctions(FractionField(QQ['x']))
1303
+ sage: x = Sym.base_ring().gen()
1304
+ sage: H = Sym.macdonald(q=x,t=1/x).H()
1305
+ sage: s = Sym.s()
1306
+ sage: H(x*s[1, 1, 1] + 2*s[2, 1] + 1/x*s[3])
1307
+ McdH[2, 1]
1308
+ """
1309
+ if self.t:
1310
+ return self._m_to_self(self._m(x))
1311
+ else:
1312
+ return self._from_dict({mu.conjugate() : cmu for mu,cmu in self._Qp(x.omega())})
1313
+
1314
+ def _self_to_m(self, x):
1315
+ r"""
1316
+ Return an element ``x`` of ``self`` expanded in the monomial basis.
1317
+
1318
+ INPUT:
1319
+
1320
+ - ``x`` -- an element of ``H`` basis
1321
+
1322
+ OUTPUT: an element of the monomial basis
1323
+
1324
+ EXAMPLES::
1325
+
1326
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1327
+ sage: H = Sym.macdonald().H()
1328
+ sage: m = Sym.m()
1329
+ sage: m(H[2,1])
1330
+ (2*q*t+q+t+2)*m[1, 1, 1] + (q*t+t+1)*m[2, 1] + t*m[3]
1331
+
1332
+ sage: Sym = SymmetricFunctions(FractionField(QQ['x']))
1333
+ sage: x = Sym.base_ring().gen()
1334
+ sage: H = Sym.macdonald(q=x,t=1/x).H()
1335
+ sage: m = Sym.m()
1336
+ sage: m(H[2,1])
1337
+ ((x^2+4*x+1)/x)*m[1, 1, 1] + ((2*x+1)/x)*m[2, 1] + 1/x*m[3]
1338
+ sage: H2 = Sym.macdonald(q=x,t=1).H()
1339
+ sage: H2((3*x+3)*m[1, 1, 1] + (x+2)*m[2, 1] + m[3])
1340
+ McdH[2, 1]
1341
+ sage: H3 = Sym.macdonald(q=x,t=0).H()
1342
+ sage: H3((3*x+3)*m[1, 1, 1] + (x+2)*m[2, 1] + m[3])
1343
+ (-x^2+1)*McdH[2, 1] + McdH[3]
1344
+ """
1345
+ if self.t:
1346
+ tinv = ~self.t
1347
+ part_coeff = lambda x, d: sorted((mu,c) for mu,c in x if sum(mu) == d)
1348
+ return self._m._from_dict({ part2:
1349
+ self._base( sum(c * self.t**mu.weighted_size()
1350
+ * self._Lmunu(part2, mu).subs(q=self.q, t=tinv)
1351
+ for mu,c in part_coeff(x, d)) )
1352
+ for d in range(x.degree()+1) for part2 in Partitions_n(d) })
1353
+ else:
1354
+ return self._m(self._self_to_s(x))
1355
+
1356
+ def _m_to_self( self, f ):
1357
+ r"""
1358
+ Convert an element ``f`` from the monomial basis to the ``H`` basis.
1359
+
1360
+ This calculation is performed by using the fact that `H_\mu[X(1-t)]`
1361
+ is `c_\mu m_\mu` plus terms which are smaller in dominance order.
1362
+ The leading coefficient of the expansion of ``f`` in the `H_\mu`
1363
+ basis is equal to the leading coefficient of `c_\mu^{-1} f[X(1-t)]`.
1364
+
1365
+ If `t=1`, we must appeal to another triangularity since ``Ht``
1366
+ is (usually) still a basis, however `H_\mu[X(1-t)]=0`. In this
1367
+ case we assume that it is a basis and `H_\mu[X(q-1)]` is
1368
+ `c_\mu m_{\mu'}` plus terms which are lower in dominance order.
1369
+
1370
+ INPUT:
1371
+
1372
+ - ``f`` -- an element of the monomial basis
1373
+
1374
+ OUTPUT: an element of the ``H`` basis
1375
+
1376
+ EXAMPLES::
1377
+
1378
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1379
+ sage: H = Sym.macdonald().H()
1380
+ sage: m = Sym.m()
1381
+ sage: H(m[1,1])
1382
+ -(1/(q*t-1))*McdH[1, 1] + (t/(q*t-1))*McdH[2]
1383
+ sage: (q,t) = Sym.base_ring().gens()
1384
+ sage: H((2*q*t+q+t+2)*m[1, 1, 1] + (q*t+t+1)*m[2, 1] + t*m[3])
1385
+ McdH[2, 1]
1386
+
1387
+ sage: Sym = SymmetricFunctions(FractionField(QQ['x']))
1388
+ sage: x = Sym.base_ring().gen()
1389
+ sage: H = Sym.macdonald(q=x,t=1).H()
1390
+ sage: m = Sym.m()
1391
+ sage: H((3*x+3)*m[1, 1, 1] + (x+2)*m[2, 1] + m[3])
1392
+ McdH[2, 1]
1393
+ """
1394
+ if self.t == 1:
1395
+ g = f.omega_qt(q=self.q, t=0)
1396
+ fl = lambda x: x.conjugate()
1397
+ mu_to_H = lambda mu: self._self_to_m(self(mu.conjugate())).omega_qt(q=self.q, t=0)
1398
+ else:
1399
+ g = f.theta_qt(q=self.t, t=0)
1400
+ fl = lambda x: x
1401
+ mu_to_H = lambda mu: self._self_to_m(self(mu)).theta_qt(q=self.t, t=0)
1402
+ out = {}
1403
+ while not g.is_zero():
1404
+ sprt = sorted(g.support())
1405
+ Hmu = mu_to_H(sprt[-1])
1406
+ fl_sprt = fl(sprt[-1])
1407
+ out[fl_sprt] = self._base(g.coefficient(sprt[-1]) / Hmu.coefficient(sprt[-1]))
1408
+ g -= out[fl_sprt] * Hmu
1409
+ return self._from_dict(out)
1410
+
1411
+ class Element(MacdonaldPolynomials_generic.Element):
1412
+ pass
1413
+
1414
+
1415
+ class MacdonaldPolynomials_ht(MacdonaldPolynomials_generic):
1416
+ def __init__(self, macdonald):
1417
+ r"""
1418
+ The `Ht` basis is defined as `{\tilde H}_\mu = t^{n(\mu)} \sum_{\lambda}
1419
+ K_{\lambda\mu}(q,t^{-1}) s_\lambda` where `K_{\lambda\mu}(q,t)` are the
1420
+ Macdonald `(q,t)`-Kostka coefficients and `n(\mu) = \sum_{i} (i-1) \mu_i`.
1421
+
1422
+ It is implemented here by using a Pieri formula due to F. Bergeron
1423
+ and M. Haiman [BH2013]_.
1424
+
1425
+ INPUT:
1426
+
1427
+ - ``self`` -- a Macdonald `Ht` basis
1428
+ - ``macdonald`` -- a family of Macdonald bases
1429
+
1430
+ TESTS::
1431
+
1432
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1433
+ sage: Ht = Sym.macdonald().Ht()
1434
+ sage: TestSuite(Ht).run(skip=["_test_associativity","_test_distributivity","_test_prod"]) # long time (26s on sage.math, 2012)
1435
+ sage: TestSuite(Ht).run(elements = [Ht.t*Ht[1,1]+Ht.q*Ht[2], Ht[1]+(Ht.q+Ht.t)*Ht[1,1]]) # long time (depends on previous)
1436
+ """
1437
+ MacdonaldPolynomials_generic.__init__(self, macdonald)
1438
+ self._self_to_m_cache = _ht_to_m_cache
1439
+ self._m = self._sym.m()
1440
+ category = ModulesWithBasis(self.base_ring())
1441
+ self._s.register_coercion(SetMorphism(Hom(self, self._s, category), self._self_to_s))
1442
+ self.register_coercion(SetMorphism(Hom(self._s, self, category), self._s_to_self))
1443
+ self._m.register_coercion(SetMorphism(Hom(self, self._m, category), self._self_to_m))
1444
+ self.register_coercion(SetMorphism(Hom(self._m, self, category), self._m_to_self))
1445
+
1446
+ def _self_to_s(self, x):
1447
+ r"""
1448
+ Convert an element of the ``Ht`` basis to the Schur basis.
1449
+
1450
+ This function is here to force the coercion path to the Schur basis
1451
+ because these bases are computed using their monomial expansion.
1452
+
1453
+ INPUT:
1454
+
1455
+ - ``x`` -- an element of ``self``
1456
+
1457
+ OUTPUT: an element of the Schur basis
1458
+
1459
+ EXAMPLES::
1460
+
1461
+ sage: Ht = SymmetricFunctions(FractionField(QQ['q','t'])).macdonald().Ht()
1462
+ sage: s = Ht.symmetric_function_ring().s()
1463
+ sage: Ht._self_to_s(Ht[2,1])
1464
+ q*t*s[1, 1, 1] + (q+t)*s[2, 1] + s[3]
1465
+ """
1466
+ return self._s(self._self_to_m(x))
1467
+
1468
+ def _s_to_self( self, x ):
1469
+ r"""
1470
+ Convert an element of either the Schur basis to the ``Ht`` basis.
1471
+
1472
+ This function is here to force the coercion path from the Schur basis
1473
+ because these bases are computed using the monomial expansion.
1474
+
1475
+ INPUT:
1476
+
1477
+ - ``x`` -- an element of ``s`` basis
1478
+
1479
+ OUTPUT: an element of the basis ``self``
1480
+
1481
+ EXAMPLES::
1482
+
1483
+ sage: s = SymmetricFunctions(FractionField(QQ['q','t'])).s()
1484
+ sage: Ht = s.symmetric_function_ring().macdonald().Ht()
1485
+ sage: Ht._s_to_self(s[2])
1486
+ -(q/(-q+t))*McdHt[1, 1] + (t/(-q+t))*McdHt[2]
1487
+ """
1488
+ return self._m_to_self(self._m(x))
1489
+
1490
+ def _Lmunu(self, nu, mu):
1491
+ r"""
1492
+ Return the coefficient of `m_\nu` in `{\tilde H}_\mu`.
1493
+
1494
+ The coefficient is a `(q,t)`-analogue of `n` choose `\nu`. Let
1495
+ `c_{\mu\gamma}` be the coefficient of `{\tilde H}_\gamma` in
1496
+ `h_r^\perp {\tilde H}_\mu`. The coefficient of `m_\nu` in
1497
+ `{\tilde H}_\mu` is
1498
+
1499
+ .. MATH::
1500
+
1501
+ L_{\mu\nu} = \sum_{\gamma} c_{\mu\gamma} L_{\gamma\overline{\nu}},
1502
+
1503
+ where the sum is over partitions `\gamma \subseteq \mu` with
1504
+ `\gamma \vdash |(\nu_1, \ldots, \nu_{\ell(\nu)-1})|`. There is a
1505
+ recursive formula for `c_{\mu\gamma}` which is due to F. Bergeron
1506
+ and M. Haiman [BH2013]_ and this is implemented in
1507
+ :func:`sage.combinat.sf.macdonald.cmunu`.
1508
+
1509
+ INPUT:
1510
+
1511
+ - ``nu``, ``mu`` -- partitions of the same size
1512
+
1513
+ OUTPUT: a polynomial in `q` and `t`
1514
+
1515
+ EXAMPLES::
1516
+
1517
+ sage: Lmunu = SymmetricFunctions(FractionField(QQ['q','t'])).macdonald().Ht()._Lmunu
1518
+ sage: Lmunu(Partition([3,1]),Partition([3,1]))
1519
+ q^2 + q + t + 1
1520
+ sage: Lmunu(Partition([3,1]),Partition([2,2]))
1521
+ q*t + q + t + 1
1522
+ sage: Lmunu(Partition([3,1]),Partition([2,1,1]))
1523
+ t^2 + q + t + 1
1524
+ sage: Lmunu(Partition([2,2]),Partition([2,1,1]))
1525
+ q*t + 2*t^2 + q + t + 1
1526
+ """
1527
+ if not mu:
1528
+ if not nu:
1529
+ return QQqt.one()
1530
+ else:
1531
+ return QQqt.zero()
1532
+ if (mu,nu) in self._self_to_m_cache:
1533
+ return self._self_to_m_cache[(mu,nu)]
1534
+ if len(nu) == 1:
1535
+ return QQqt.one()
1536
+ short_nu = _Partitions(nu[:-1])
1537
+ if nu[-1] == 1:
1538
+ self._self_to_m_cache[(mu,nu)] = QQqt( sum(cmunu1(mu,ga) * self._Lmunu(short_nu, ga)
1539
+ for ga in mu.down()) )
1540
+ else:
1541
+ self._self_to_m_cache[(mu,nu)] = QQqt( sum(cmunu(mu,ga) * self._Lmunu(short_nu, ga)
1542
+ for ga in Partitions_n(short_nu.size()) if mu.contains(ga) ) )
1543
+ return self._self_to_m_cache[(mu,nu)]
1544
+
1545
+ def _self_to_m(self, x):
1546
+ r"""
1547
+ Take an element of the ``Ht`` basis and return the expansion in the
1548
+ monomial basis.
1549
+
1550
+ INPUT:
1551
+
1552
+ - ``x`` -- an element of ``Ht`` basis
1553
+
1554
+ OUTPUT: an element of the monomial basis
1555
+
1556
+ EXAMPLES::
1557
+
1558
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1559
+ sage: Ht = Sym.macdonald().Ht()
1560
+ sage: m = Sym.m()
1561
+ sage: m(Ht[2,1])
1562
+ (q*t+2*q+2*t+1)*m[1, 1, 1] + (q+t+1)*m[2, 1] + m[3]
1563
+
1564
+ sage: Sym = SymmetricFunctions(FractionField(QQ['x']))
1565
+ sage: x = Sym.base_ring().gen()
1566
+ sage: Ht = Sym.macdonald(q=x,t=1/x).Ht()
1567
+ sage: m = Sym.m()
1568
+ sage: m(Ht[2,1])
1569
+ ((2*x^2+2*x+2)/x)*m[1, 1, 1] + ((x^2+x+1)/x)*m[2, 1] + m[3]
1570
+ """
1571
+ part_coeff = lambda x, d: sorted((mu,c) for mu,c in x if sum(mu) == d)
1572
+ return self._m._from_dict({ part2:
1573
+ self._base( sum(c * self._Lmunu(part2, mu).subs(q=self.q, t=self.t)
1574
+ for mu,c in part_coeff(x, d)) )
1575
+ for d in range(x.degree()+1) for part2 in Partitions_n(d) })
1576
+
1577
+ def _m_to_self( self, f ):
1578
+ r"""
1579
+ Convert an element ``f`` from the monomial basis to the ``Ht`` basis.
1580
+
1581
+ This calculation is performed by using the fact that
1582
+ `{\tilde H}_\mu[X(t-1)]` is `c_\mu m_\mu` plus terms which are
1583
+ smaller in dominance order. The leading coefficient of the
1584
+ expansion of ``f`` in the `{\tilde H}_\mu` basis is equal to
1585
+ the leading coefficient of `c_\mu^{-1} f[X(t-1)]`.
1586
+
1587
+ If `t=1`, we must appeal to another triangularity since ``Ht``
1588
+ is (usually) still a basis, however `{\tilde H}_\mu[X(t-1)]=0`.
1589
+ In this case we assume that it is a basis and `{\tilde H}_\mu[X(q-1)]`
1590
+ is `c_\mu m_{\mu'}` plus terms which are lower in dominance order.
1591
+
1592
+ INPUT:
1593
+
1594
+ - ``f`` -- an element of the monomial basis
1595
+
1596
+ OUTPUT: an element of the ``Ht`` basis
1597
+
1598
+ EXAMPLES::
1599
+
1600
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1601
+ sage: Ht = Sym.macdonald().Ht()
1602
+ sage: m = Sym.m()
1603
+ sage: Ht(m[1,1])
1604
+ (1/(-q+t))*McdHt[1, 1] - (1/(-q+t))*McdHt[2]
1605
+ sage: (q,t) = Sym.base_ring().gens()
1606
+ sage: Ht((q*t+2*q+2*t+1)*m[1, 1, 1] + (q+t+1)*m[2, 1] + m[3])
1607
+ McdHt[2, 1]
1608
+
1609
+ sage: Sym = SymmetricFunctions(FractionField(QQ['x']))
1610
+ sage: x = Sym.base_ring().gen()
1611
+ sage: Ht = Sym.macdonald(q=x,t=1).Ht()
1612
+ sage: m = Sym.m()
1613
+ sage: Ht((3*x+3)*m[1, 1, 1] + (x+2)*m[2, 1] + m[3])
1614
+ McdHt[2, 1]
1615
+ """
1616
+ if self.t == 1:
1617
+ subsval = self.q
1618
+ fl = lambda x: x.conjugate()
1619
+ else:
1620
+ subsval = self.t
1621
+ fl = lambda x: x
1622
+ g = f.omega_qt(q=subsval, t=0)
1623
+ out = {}
1624
+ while not g.is_zero():
1625
+ sprt = sorted(g.support())
1626
+ Htmu = self._self_to_m(self(fl(sprt[-1]))).omega_qt(q=subsval, t=0)
1627
+ out[fl(sprt[-1])] = self._base(g.coefficient(sprt[-1]) / Htmu.coefficient(sprt[-1]))
1628
+ g -= out[fl(sprt[-1])] * Htmu
1629
+ return self._from_dict(out)
1630
+
1631
+ class Element(MacdonaldPolynomials_generic.Element):
1632
+ def nabla(self, q=None, t=None, power=1):
1633
+ r"""
1634
+ Return the value of the nabla operator applied to ``self``. The
1635
+ eigenvectors of the `nabla` operator are the Macdonald polynomials in
1636
+ the `Ht` basis. For more information see: [BGHT1999]_.
1637
+
1638
+ The operator `nabla` acts on symmetric functions and has the
1639
+ Macdonald `Ht` basis as eigenfunctions and the eigenvalues
1640
+ are `q^{n(\mu')} t^{n(\mu)}` where `n(\mu) = \sum_{i} (i-1) \mu_i`.
1641
+
1642
+ If the parameter ``power`` is an integer then it calculates
1643
+ nabla to that integer. The default value of ``power`` is 1.
1644
+
1645
+ INPUT:
1646
+
1647
+ - ``self`` -- an element of the Macdonald `Ht` basis
1648
+ - ``q``, ``t`` -- (optional) parameters to specialize
1649
+ - ``power`` -- integer (default: 1)
1650
+
1651
+ OUTPUT: the symmetric function of `\nabla` acting on ``self``
1652
+
1653
+ EXAMPLES::
1654
+
1655
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1656
+ sage: Ht = Sym.macdonald().Ht()
1657
+ sage: t = Ht.t; q = Ht.q
1658
+ sage: s = Sym.schur()
1659
+ sage: a = sum(Ht(p) for p in Partitions(3))
1660
+ sage: Ht(0).nabla()
1661
+ 0
1662
+ sage: a.nabla() == t^3*Ht([1,1,1])+q*t*Ht([2,1]) + q^3*Ht([3])
1663
+ True
1664
+ sage: a.nabla(t=3) == 27*Ht([1,1,1])+3*q*Ht([2,1]) + q^3*Ht([3])
1665
+ True
1666
+ sage: a.nabla(q=3) == t^3*Ht([1,1,1])+3*t*Ht([2,1]) + 27*Ht([3])
1667
+ True
1668
+ sage: Ht[2,1].nabla(power=-1)
1669
+ 1/(q*t)*McdHt[2, 1]
1670
+ sage: Ht[2,1].nabla(power=4)
1671
+ q^4*t^4*McdHt[2, 1]
1672
+ sage: s(a.nabla(q=3))
1673
+ (t^6+27*q^3+3*q*t^2)*s[1, 1, 1] + (t^5+t^4+27*q^2+3*q*t+3*t^2+27*q)*s[2, 1] + (t^3+3*t+27)*s[3]
1674
+ sage: Ht = Sym.macdonald(q=3).Ht()
1675
+ sage: a = sum(Ht(p) for p in Partitions(3))
1676
+ sage: s(a.nabla())
1677
+ (t^6+9*t^2+729)*s[1, 1, 1] + (t^5+t^4+3*t^2+9*t+324)*s[2, 1] + (t^3+3*t+27)*s[3]
1678
+ """
1679
+ P = self.parent()
1680
+ Ht = P._macdonald.Ht()
1681
+ selfHt = Ht(self)
1682
+ if self == Ht.zero():
1683
+ return Ht.zero()
1684
+ if q is None:
1685
+ q = Ht.q
1686
+ if t is None:
1687
+ t = Ht.t
1688
+ f = lambda part: t**(part.weighted_size()*power)*q**(part.conjugate().weighted_size()*power)*Ht(part)
1689
+ return P(Ht._apply_module_morphism(selfHt, f))
1690
+
1691
+
1692
+ class MacdonaldPolynomials_s(MacdonaldPolynomials_generic):
1693
+ def __init__(self, macdonald):
1694
+ r"""
1695
+ An implementation of the basis `s_\lambda[(1-t)X/(1-q)]`.
1696
+
1697
+ This is perhaps misnamed as a 'Macdonald' basis for
1698
+ the symmetric functions but is used in the calculation
1699
+ of the Macdonald `J` basis (see method 'creation' below)
1700
+ but does use both of the two parameters and can be
1701
+ specialized to `s_\lambda[(1-t)X]` and `s_\lambda[X/(1-t)]`.
1702
+
1703
+ INPUT:
1704
+
1705
+ - ``self`` -- a Macdonald `S` basis
1706
+ - ``macdonald`` -- a family of Macdonald bases
1707
+
1708
+ TESTS::
1709
+
1710
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1711
+ sage: S = Sym.macdonald().S()
1712
+ sage: TestSuite(S).run(skip=["_test_associativity","_test_distributivity","_test_prod"])
1713
+ sage: TestSuite(S).run(elements = [S.t*S[1,1]+S.q*S[2], S[1]+(S.q+S.t)*S[1,1]])
1714
+ """
1715
+ MacdonaldPolynomials_generic.__init__(self, macdonald)
1716
+ self._s = macdonald._s
1717
+ self._self_to_s_cache = _S_to_s_cache
1718
+ self._s_to_self_cache = _s_to_S_cache
1719
+
1720
+ def product(self, left, right):
1721
+ r"""
1722
+ The multiplication of the modified Schur functions behaves the same
1723
+ as the multiplication of the Schur functions.
1724
+
1725
+ INPUT:
1726
+
1727
+ - ``self`` -- a Macdonald `S` basis
1728
+ - ``left``, ``right`` -- a symmetric functions
1729
+
1730
+ OUTPUT: the product of ``left`` and ``right``
1731
+
1732
+ EXAMPLES::
1733
+
1734
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1735
+ sage: S = Sym.macdonald().S()
1736
+ sage: S([2])^2 #indirect doctest
1737
+ McdS[2, 2] + McdS[3, 1] + McdS[4]
1738
+ """
1739
+ s_left = self._s._from_element(left)
1740
+ s_right = self._s._from_element(right)
1741
+ product = s_left * s_right
1742
+ return self._from_element(product)
1743
+
1744
+ def _to_s(self, part):
1745
+ r"""
1746
+ Return a function which gives the coefficient of a partition in
1747
+ the Schur expansion of ``self(part)``.
1748
+ these computations are completed with coefficients in fraction
1749
+ field of polynomials in `q` and `t`
1750
+
1751
+ INPUT:
1752
+
1753
+ - ``self`` -- a Macdonald `S` basis
1754
+ - ``part`` -- a partition
1755
+
1756
+ OUTPUT:
1757
+
1758
+ - returns a function which accepts a partition ``part2`` and
1759
+ this function returns the coefficient of the Schur function
1760
+ indexed by ``part2`` in ``S(part)``
1761
+
1762
+ EXAMPLES::
1763
+
1764
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1765
+ sage: S = Sym.macdonald().S()
1766
+ sage: S2 = S._to_s(Partition([2]))
1767
+ sage: S2(Partition([2]))
1768
+ (-q*t^2 + q*t + t - 1)/(-q^3 + q^2 + q - 1)
1769
+ sage: S2(Partition([1,1]))
1770
+ (q*t - t^2 - q + t)/(-q^3 + q^2 + q - 1)
1771
+ """
1772
+ # Convert to the power sum
1773
+ (q, t) = QQqt.gens()
1774
+ p = self._sym.p()
1775
+ s = self._s
1776
+ p_x = p(s(part))
1777
+ f = lambda m, c: (m, c * prod([(1 - t**k) / (1 - q**k) for k in m]))
1778
+ res = s(p_x.map_item(f))
1779
+ f = res.coefficient
1780
+ return f
1781
+
1782
+ def _s_cache(self, n):
1783
+ r"""
1784
+ Compute the change of basis and its inverse between the Macdonald
1785
+ polynomials on the S basis and the Schur functions.
1786
+
1787
+ These computations are completed with coefficients in fraction
1788
+ field of polynomials in `q` and `t`.
1789
+
1790
+ INPUT:
1791
+
1792
+ - ``self`` -- a Macdonald `S` basis
1793
+ - ``n`` -- positive integer
1794
+
1795
+ EXAMPLES::
1796
+
1797
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1798
+ sage: S = Sym.macdonald().S()
1799
+ sage: S._s_cache(2)
1800
+ sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())]
1801
+ sage: l( S._s_to_self_cache[2] )
1802
+ [([1, 1], [([1, 1], (q^2*t - q*t - q + 1)/(t^3 - t^2 - t + 1)), ([2], (q^2 - q*t - q + t)/(t^3 - t^2 - t + 1))]), ([2], [([1, 1], (q^2 - q*t - q + t)/(t^3 - t^2 - t + 1)), ([2], (-q^2*t + q*t + q - 1)/(-t^3 + t^2 + t - 1))])]
1803
+ sage: l( S._self_to_s_cache[2] )
1804
+ [([1, 1], [([1, 1], (-q*t^2 + q*t + t - 1)/(-q^3 + q^2 + q - 1)), ([2], (q*t - t^2 - q + t)/(-q^3 + q^2 + q - 1))]), ([2], [([1, 1], (q*t - t^2 - q + t)/(-q^3 + q^2 + q - 1)), ([2], (-q*t^2 + q*t + t - 1)/(-q^3 + q^2 + q - 1))])]
1805
+ """
1806
+ self._invert_morphism(n, QQqt, self._self_to_s_cache,
1807
+ self._s_to_self_cache,
1808
+ to_other_function=self._to_s)
1809
+
1810
+ class Element(MacdonaldPolynomials_generic.Element):
1811
+
1812
+ def _creation_by_determinant_helper(self, k, part):
1813
+ r"""
1814
+ Formula from [LLM1998]_ Corollary 4.3 p. 970.
1815
+
1816
+ This is part of a formula for a column adding creation operator
1817
+ for the `J` basis and its action on the `S` basis.
1818
+
1819
+ INPUT:
1820
+
1821
+ - ``self`` -- an element of the Macdonald `S` basis
1822
+ - ``k`` -- positive integer at least as big as the length of ``part``
1823
+ - ``part`` -- a partition
1824
+
1825
+ OUTPUT:
1826
+
1827
+ - returns a symmetric function which is the action of a
1828
+ column adding operator on the `J` basis
1829
+
1830
+ EXAMPLES::
1831
+
1832
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1833
+ sage: S = Sym.macdonald().S()
1834
+ sage: a = S([2,1])
1835
+ sage: a._creation_by_determinant_helper(2,[1])
1836
+ (q^3*t-q^2*t-q+1)*McdS[2, 1] + (q^3-q^2*t-q+t)*McdS[3]
1837
+ """
1838
+ (q,t) = QQqt.gens()
1839
+ from sage.combinat.sf.sf import SymmetricFunctions
1840
+ S = SymmetricFunctions(QQqt).macdonald().S()
1841
+
1842
+ part += [0]*(k-len(part))
1843
+
1844
+ if len(part) > k:
1845
+ raise ValueError("the column to add is too small")
1846
+
1847
+ #Create the matrix over the homogeneous symmetric
1848
+ #functions and take its determinant
1849
+ h = S._sym.homogeneous()
1850
+ MS = MatrixSpace(h, k, k)
1851
+ m = []
1852
+ for i in range(k):
1853
+ row = [0]*max(0, (i+1)-2-part[i])
1854
+ for j in range(max(0, (i+1)-2-part[i]),k):
1855
+ value = part[i]+j-i+1
1856
+ p = [value] if value > 0 else []
1857
+ row.append( (1-q**(part[i]+j-i+1)*t**(k-(j+1)))*h(p) )
1858
+ m.append(row)
1859
+ M = MS(m)
1860
+ res = M.det()
1861
+
1862
+ #Convert to the Schurs
1863
+ res = S._s( res )
1864
+ return S._from_element(res)
1865
+
1866
+ def _creation_by_determinant(self, k):
1867
+ r"""
1868
+ This function is a creation operator for the `J`-basis
1869
+ for which the action is known on the Macdonald `S`-basis
1870
+ by formula from [LLM1998]_.
1871
+
1872
+ INPUT:
1873
+
1874
+ - ``self`` -- an element of the Macdonald `S` basis
1875
+ - ``k`` -- positive integer
1876
+
1877
+ OUTPUT: the column adding operator on the `J` basis on ``self``
1878
+
1879
+ EXAMPLES::
1880
+
1881
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1882
+ sage: S = Sym.macdonald().S()
1883
+ sage: a = S(1)
1884
+ sage: a = a._creation_by_determinant(1); a
1885
+ -(q-1)*McdS[1]
1886
+ sage: a = a._creation_by_determinant(3)
1887
+ sage: Sym.macdonald().J()(a)
1888
+ McdJ[2, 1, 1]
1889
+ """
1890
+ S = self.parent()
1891
+ f = functools.partial(self._creation_by_determinant_helper,k)
1892
+ return S._apply_module_morphism(self, f)
1893
+
1894
+ def creation(self, k):
1895
+ r"""
1896
+ This function is a creation operator for the J-basis
1897
+ for which the action is known on the 'Macdonald' S-basis
1898
+ by formula from [LLM1998]_.
1899
+
1900
+ INPUT:
1901
+
1902
+ - ``self`` -- an element of the Macdonald `S` basis
1903
+ - ``k`` -- positive integer
1904
+
1905
+ OUTPUT: the column adding operator on the `J` basis on ``self``
1906
+
1907
+ EXAMPLES::
1908
+
1909
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1910
+ sage: S = Sym.macdonald().S()
1911
+ sage: a = S(1)
1912
+ sage: a.creation(1)
1913
+ -(q-1)*McdS[1]
1914
+ sage: a.creation(2)
1915
+ (q^2*t-q*t-q+1)*McdS[1, 1] + (q^2-q*t-q+t)*McdS[2]
1916
+ """
1917
+ return self._creation_by_determinant(k)
1918
+
1919
+ def _omega_qt_in_schurs(self):
1920
+ r"""
1921
+ Return the image of ``self`` under the omega_qt automorphism in the
1922
+ Schur basis.
1923
+
1924
+ INPUT:
1925
+
1926
+ - ``self`` -- an element of the Macdonald `S` basis
1927
+
1928
+ OUTPUT:
1929
+
1930
+ - the action of the `\omega_{qt}` operator changes the
1931
+ Macdonald `S` basis indexed by the partition `\mu` to
1932
+ the Schur indexed by the conjugate of `\mu`
1933
+
1934
+ EXAMPLES::
1935
+
1936
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
1937
+ sage: S = Sym.macdonald().S()
1938
+ sage: a = S([2,1]) + S([1,1,1])
1939
+ sage: a._omega_qt_in_schurs()
1940
+ s[2, 1] + s[3]
1941
+ """
1942
+ S = self.parent()
1943
+ f = lambda part: S._s(part.conjugate())
1944
+ return S._s._apply_module_morphism(self, f)
1945
+
1946
+
1947
+ def qt_kostka(lam, mu):
1948
+ r"""
1949
+ Return the `K_{\lambda\mu}(q,t)` by computing the change
1950
+ of basis from the Macdonald H basis to the Schurs.
1951
+
1952
+ INPUT:
1953
+
1954
+ - ``lam``, ``mu`` -- partitions of the same size
1955
+
1956
+ OUTPUT:
1957
+
1958
+ - returns the `q,t`-Kostka polynomial indexed by the
1959
+ partitions ``lam`` and ``mu``
1960
+
1961
+ EXAMPLES::
1962
+
1963
+ sage: from sage.combinat.sf.macdonald import qt_kostka
1964
+ sage: qt_kostka([2,1,1],[1,1,1,1])
1965
+ t^3 + t^2 + t
1966
+ sage: qt_kostka([1,1,1,1],[2,1,1])
1967
+ q
1968
+ sage: qt_kostka([1,1,1,1],[3,1])
1969
+ q^3
1970
+ sage: qt_kostka([1,1,1,1],[1,1,1,1])
1971
+ 1
1972
+ sage: qt_kostka([2,1,1],[2,2])
1973
+ q^2*t + q*t + q
1974
+ sage: qt_kostka([2,2],[2,2])
1975
+ q^2*t^2 + 1
1976
+ sage: qt_kostka([4],[3,1])
1977
+ t
1978
+ sage: qt_kostka([2,2],[3,1])
1979
+ q^2*t + q
1980
+ sage: qt_kostka([3,1],[2,1,1])
1981
+ q*t^3 + t^2 + t
1982
+ sage: qt_kostka([2,1,1],[2,1,1])
1983
+ q*t^2 + q*t + 1
1984
+ sage: qt_kostka([2,1],[1,1,1,1])
1985
+ 0
1986
+ """
1987
+ lam = _Partitions(lam)
1988
+ mu = _Partitions(mu)
1989
+
1990
+ if lam.size() != mu.size():
1991
+ return QQqt.zero()
1992
+
1993
+ if (lam,mu) in _qt_kostka_cache:
1994
+ return _qt_kostka_cache[(lam,mu)]
1995
+
1996
+ from sage.combinat.sf.sf import SymmetricFunctions
1997
+ Sym = SymmetricFunctions(QQqt)
1998
+ H = Sym.macdonald().H()
1999
+ s = Sym.schur()
2000
+
2001
+ parts = Partitions_n(mu.size())
2002
+
2003
+ for p2 in parts:
2004
+ res = s(H(p2))
2005
+ for p1 in parts:
2006
+ _qt_kostka_cache[(p1, p2)] = QQqt(res.coefficient(p1).numerator())
2007
+
2008
+ return _qt_kostka_cache[(lam, mu)]
2009
+
2010
+
2011
+ # Backward compatibility for unpickling
2012
+ from sage.misc.persist import register_unpickle_override
2013
+
2014
+ register_unpickle_override('sage.combinat.sf.macdonald', 'MacdonaldPolynomial_h', MacdonaldPolynomials_h.Element)
2015
+ register_unpickle_override('sage.combinat.sf.macdonald', 'MacdonaldPolynomial_ht', MacdonaldPolynomials_ht.Element)
2016
+ register_unpickle_override('sage.combinat.sf.macdonald', 'MacdonaldPolynomial_j', MacdonaldPolynomials_j.Element)
2017
+ register_unpickle_override('sage.combinat.sf.macdonald', 'MacdonaldPolynomial_p', MacdonaldPolynomials_p.Element)
2018
+ register_unpickle_override('sage.combinat.sf.macdonald', 'MacdonaldPolynomial_q', MacdonaldPolynomials_q.Element)
2019
+ register_unpickle_override('sage.combinat.sf.macdonald', 'MacdonaldPolynomial_s', MacdonaldPolynomials_s.Element)