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,1428 @@
1
+ # sage_setup: distribution = sagemath-combinat
2
+ # sage.doctest: needs sage.combinat sage.modules
3
+ r"""
4
+ Jack symmetric functions
5
+
6
+ Jack's symmetric functions appear in [Ma1995]_ Chapter VI, section 10.
7
+ Zonal polynomials are the subject of [Ma1995]_ Chapter VII.
8
+ The parameter `\alpha` in that reference is the parameter `t` in this
9
+ implementation in sage.
10
+
11
+ REFERENCES:
12
+
13
+ .. [Jack1970] \H. Jack,
14
+ *A class of symmetric functions with a parameter*,
15
+ Proc. R. Soc. Edinburgh (A), 69, 1-18.
16
+
17
+ .. [Ma1995] \I. G. Macdonald,
18
+ *Symmetric functions and Hall polynomials*,
19
+ second ed.,
20
+ The Clarendon Press, Oxford University Press, New York, 1995, With contributions
21
+ by A. Zelevinsky, Oxford Science Publications.
22
+ """
23
+ # ****************************************************************************
24
+ # Copyright (C) 2007 Mike Hansen <mhansen@gmail.com>
25
+ # 2012 Mike Zabrocki <mike.zabrocki@gmail.com>
26
+ #
27
+ # This program is free software: you can redistribute it and/or modify
28
+ # it under the terms of the GNU General Public License as published by
29
+ # the Free Software Foundation, either version 2 of the License, or
30
+ # (at your option) any later version.
31
+ # https://www.gnu.org/licenses/
32
+ # ****************************************************************************
33
+
34
+ import sage.categories.all
35
+ from sage.arith.functions import lcm
36
+ from sage.arith.misc import gcd
37
+ from sage.categories.homset import End, Hom
38
+ from sage.categories.morphism import SetMorphism
39
+ from sage.misc.misc_c import prod
40
+ from sage.rings.fraction_field import FractionField, FractionField_generic
41
+ from sage.rings.integer import Integer
42
+ from sage.rings.rational_field import QQ
43
+ from sage.structure.unique_representation import UniqueRepresentation
44
+
45
+ from . import sfa
46
+
47
+ QQt = FractionField(QQ['t'])
48
+
49
+ p_to_m_cache = {}
50
+ m_to_p_cache = {}
51
+
52
+
53
+ class Jack(UniqueRepresentation):
54
+ @staticmethod
55
+ def __classcall__(cls, Sym, t='t'):
56
+ """
57
+ Normalize the arguments.
58
+
59
+ TESTS::
60
+
61
+ sage: R.<q, t> = QQ[]
62
+ sage: B1 = SymmetricFunctions(R).jack().P()
63
+ sage: B2 = SymmetricFunctions(R).jack(t).P()
64
+ sage: B3 = SymmetricFunctions(R).jack(q).P()
65
+ sage: B1 is B2
66
+ True
67
+ sage: B1 == B3
68
+ False
69
+ """
70
+ return super().__classcall__(cls, Sym, Sym.base_ring()(t))
71
+
72
+ def __init__(self, Sym, t):
73
+ r"""
74
+ The family of Jack symmetric functions including the `P`, `Q`, `J`, `Qp`
75
+ bases. The default parameter is ``t``.
76
+
77
+ INPUT:
78
+
79
+ - ``self`` -- the family of Jack symmetric function bases
80
+ - ``Sym`` -- a ring of symmetric functions
81
+ - ``t`` -- an optional parameter (default: ``'t'``)
82
+
83
+ EXAMPLES::
84
+
85
+ sage: SymmetricFunctions(FractionField(QQ['t'])).jack()
86
+ Jack polynomials over Fraction Field of Univariate Polynomial Ring in t over Rational Field
87
+ sage: SymmetricFunctions(QQ).jack(1)
88
+ Jack polynomials with t=1 over Rational Field
89
+ """
90
+ self._sym = Sym
91
+ self.t = t
92
+ self._name_suffix = ""
93
+ if str(t) != 't':
94
+ self._name_suffix += " with t=%s" % t
95
+ self._name = "Jack polynomials"+self._name_suffix+" over "+repr(Sym.base_ring())
96
+
97
+ def __repr__(self):
98
+ r"""
99
+ The string representation for the family of Jack symmetric function bases.
100
+
101
+ INPUT:
102
+
103
+ - ``self`` -- the family of Jack symmetric function bases
104
+
105
+ OUTPUT: the name of the family of bases
106
+
107
+ EXAMPLES::
108
+
109
+ sage: SymmetricFunctions(QQ).jack(1)
110
+ Jack polynomials with t=1 over Rational Field
111
+ """
112
+ return self._name
113
+
114
+ def base_ring( self ):
115
+ r"""
116
+ Return the base ring of the symmetric functions in which the
117
+ Jack symmetric functions live.
118
+
119
+ INPUT:
120
+
121
+ - ``self`` -- the family of Jack symmetric function bases
122
+
123
+ OUTPUT: the base ring of the symmetric functions ring of ``self``
124
+
125
+ EXAMPLES::
126
+
127
+ sage: J2 = SymmetricFunctions(QQ).jack(t=2)
128
+ sage: J2.base_ring()
129
+ Rational Field
130
+ """
131
+ return self._sym.base_ring()
132
+
133
+ def symmetric_function_ring( self ):
134
+ r"""
135
+ Return the base ring of the symmetric functions of the Jack symmetric
136
+ function bases
137
+
138
+ INPUT:
139
+
140
+ - ``self`` -- the family of Jack symmetric function bases
141
+
142
+ OUTPUT: the symmetric functions ring of ``self``
143
+
144
+ EXAMPLES::
145
+
146
+ sage: Jacks = SymmetricFunctions(FractionField(QQ['t'])).jack()
147
+ sage: Jacks.symmetric_function_ring()
148
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field
149
+ """
150
+ return self._sym
151
+
152
+ def P(self):
153
+ r"""
154
+ Return the algebra of Jack polynomials in the `P` basis.
155
+
156
+ INPUT:
157
+
158
+ - ``self`` -- the family of Jack symmetric function bases
159
+
160
+ OUTPUT: the `P` basis of the Jack symmetric functions
161
+
162
+ EXAMPLES::
163
+
164
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
165
+ sage: JP = Sym.jack().P(); JP
166
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the Jack P basis
167
+ sage: Sym.jack(t=-1).P()
168
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the Jack P with t=-1 basis
169
+
170
+ At `t = 1`, the Jack polynomials in the `P` basis are the Schur
171
+ symmetric functions.
172
+
173
+ ::
174
+
175
+ sage: Sym = SymmetricFunctions(QQ)
176
+ sage: JP = Sym.jack(t=1).P()
177
+ sage: s = Sym.schur()
178
+ sage: s(JP([2,2,1]))
179
+ s[2, 2, 1]
180
+ sage: JP(s([2,2,1]))
181
+ JackP[2, 2, 1]
182
+ sage: JP([2,1])^2
183
+ JackP[2, 2, 1, 1] + JackP[2, 2, 2] + JackP[3, 1, 1, 1] + 2*JackP[3, 2, 1] + JackP[3, 3] + JackP[4, 1, 1] + JackP[4, 2]
184
+
185
+ At `t = 2`, the Jack polynomials in the `P` basis are the zonal
186
+ polynomials.
187
+
188
+ ::
189
+
190
+ sage: Sym = SymmetricFunctions(QQ)
191
+ sage: JP = Sym.jack(t=2).P()
192
+ sage: Z = Sym.zonal()
193
+ sage: Z(JP([2,2,1]))
194
+ Z[2, 2, 1]
195
+ sage: JP(Z[2, 2, 1])
196
+ JackP[2, 2, 1]
197
+ sage: JP([2])^2
198
+ 64/45*JackP[2, 2] + 16/21*JackP[3, 1] + JackP[4]
199
+ sage: Z([2])^2
200
+ 64/45*Z[2, 2] + 16/21*Z[3, 1] + Z[4]
201
+
202
+ ::
203
+
204
+ sage: Sym = SymmetricFunctions(QQ['a','b'].fraction_field())
205
+ sage: (a,b) = Sym.base_ring().gens()
206
+ sage: Jacka = Sym.jack(t=a)
207
+ sage: Jackb = Sym.jack(t=b)
208
+ sage: m = Sym.monomial()
209
+ sage: JPa = Jacka.P()
210
+ sage: JPb = Jackb.P()
211
+ sage: m(JPa[2,1])
212
+ (6/(a+2))*m[1, 1, 1] + m[2, 1]
213
+ sage: m(JPb[2,1])
214
+ (6/(b+2))*m[1, 1, 1] + m[2, 1]
215
+ sage: m(a*JPb([2,1]) + b*JPa([2,1]))
216
+ ((6*a^2+6*b^2+12*a+12*b)/(a*b+2*a+2*b+4))*m[1, 1, 1] + (a+b)*m[2, 1]
217
+ sage: JPa(JPb([2,1]))
218
+ ((6*a-6*b)/(a*b+2*a+2*b+4))*JackP[1, 1, 1] + JackP[2, 1]
219
+
220
+ ::
221
+
222
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
223
+ sage: JQ = Sym.jack().Q()
224
+ sage: JP = Sym.jack().P()
225
+ sage: JJ = Sym.jack().J()
226
+
227
+ ::
228
+
229
+ sage: JP(JQ([2,1]))
230
+ ((1/2*t+1)/(t^3+1/2*t^2))*JackP[2, 1]
231
+ sage: JP(JQ([3]))
232
+ ((1/3*t^2+1/2*t+1/6)/t^3)*JackP[3]
233
+ sage: JP(JQ([1,1,1]))
234
+ (6/(t^3+3*t^2+2*t))*JackP[1, 1, 1]
235
+
236
+ ::
237
+
238
+ sage: JP(JJ([3]))
239
+ (2*t^2+3*t+1)*JackP[3]
240
+ sage: JP(JJ([2,1]))
241
+ (t+2)*JackP[2, 1]
242
+ sage: JP(JJ([1,1,1]))
243
+ 6*JackP[1, 1, 1]
244
+
245
+ ::
246
+
247
+ sage: s = Sym.schur()
248
+ sage: JP(s([2,1]))
249
+ ((2*t-2)/(t+2))*JackP[1, 1, 1] + JackP[2, 1]
250
+ sage: s(_)
251
+ s[2, 1]
252
+ """
253
+ return JackPolynomials_p(self)
254
+
255
+ def Q(self):
256
+ r"""
257
+ Return the algebra of Jack polynomials in the `Q` basis.
258
+
259
+ INPUT:
260
+
261
+ - ``self`` -- the family of Jack symmetric function bases
262
+
263
+ OUTPUT: the `Q` basis of the Jack symmetric functions
264
+
265
+ EXAMPLES::
266
+
267
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
268
+ sage: JQ = Sym.jack().Q(); JQ
269
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the Jack Q basis
270
+ sage: Sym = SymmetricFunctions(QQ)
271
+ sage: Sym.jack(t=-1).Q()
272
+ Symmetric Functions over Rational Field in the Jack Q with t=-1 basis
273
+
274
+ ::
275
+
276
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
277
+ sage: JQ = Sym.jack().Q()
278
+ sage: JP = Sym.jack().P()
279
+ sage: JQ(sum(JP(p) for p in Partitions(3)))
280
+ (1/6*t^3+1/2*t^2+1/3*t)*JackQ[1, 1, 1] + ((2*t^3+t^2)/(t+2))*JackQ[2, 1] + (3*t^3/(t^2+3/2*t+1/2))*JackQ[3]
281
+
282
+ ::
283
+
284
+ sage: s = Sym.schur()
285
+ sage: JQ(s([3])) # indirect doctest
286
+ (1/6*t^3-1/2*t^2+1/3*t)*JackQ[1, 1, 1] + ((2*t^3-2*t^2)/(t+2))*JackQ[2, 1] + (3*t^3/(t^2+3/2*t+1/2))*JackQ[3]
287
+ sage: JQ(s([2,1]))
288
+ (1/3*t^3-1/3*t)*JackQ[1, 1, 1] + ((2*t^3+t^2)/(t+2))*JackQ[2, 1]
289
+ sage: JQ(s([1,1,1]))
290
+ (1/6*t^3+1/2*t^2+1/3*t)*JackQ[1, 1, 1]
291
+ """
292
+ return JackPolynomials_q(self)
293
+
294
+ def J(self):
295
+ r"""
296
+ Return the algebra of Jack polynomials in the `J` basis.
297
+
298
+ INPUT:
299
+
300
+ - ``self`` -- the family of Jack symmetric function bases
301
+
302
+ OUTPUT: the `J` basis of the Jack symmetric functions
303
+
304
+ EXAMPLES::
305
+
306
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
307
+ sage: JJ = Sym.jack().J(); JJ
308
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the Jack J basis
309
+ sage: Sym = SymmetricFunctions(QQ)
310
+ sage: Sym.jack(t=-1).J()
311
+ Symmetric Functions over Rational Field in the Jack J with t=-1 basis
312
+
313
+ At `t = 1`, the Jack polynomials in the `J` basis are scalar multiples
314
+ of the Schur functions with the scalar given by a Partition's
315
+ :meth:`~sage.combinat.partition.Partition.hook_product` method at 1::
316
+
317
+ sage: Sym = SymmetricFunctions(QQ)
318
+ sage: JJ = Sym.jack(t=1).J()
319
+ sage: s = Sym.schur()
320
+ sage: p = Partition([3,2,1,1])
321
+ sage: s(JJ(p)) == p.hook_product(1)*s(p) # long time (4s on sage.math, 2012)
322
+ True
323
+
324
+ At `t = 2`, the Jack polynomials in the `J` basis are scalar multiples
325
+ of the zonal polynomials with the scalar given by a Partition's
326
+ :meth:`~sage.combinat.partition.Partition.hook_product` method at 2.
327
+
328
+ ::
329
+
330
+ sage: Sym = SymmetricFunctions(QQ)
331
+ sage: JJ = Sym.jack(t=2).J()
332
+ sage: Z = Sym.zonal()
333
+ sage: p = Partition([2,2,1])
334
+ sage: Z(JJ(p)) == p.hook_product(2)*Z(p)
335
+ True
336
+
337
+ ::
338
+
339
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
340
+ sage: JJ = Sym.jack().J()
341
+ sage: JP = Sym.jack().P()
342
+ sage: JJ(sum(JP(p) for p in Partitions(3)))
343
+ 1/6*JackJ[1, 1, 1] + (1/(t+2))*JackJ[2, 1] + (1/2/(t^2+3/2*t+1/2))*JackJ[3]
344
+
345
+ ::
346
+
347
+ sage: s = Sym.schur()
348
+ sage: JJ(s([3])) # indirect doctest
349
+ ((1/6*t^2-1/2*t+1/3)/(t^2+3*t+2))*JackJ[1, 1, 1] + ((t-1)/(t^2+5/2*t+1))*JackJ[2, 1] + (1/2/(t^2+3/2*t+1/2))*JackJ[3]
350
+ sage: JJ(s([2,1]))
351
+ ((1/3*t-1/3)/(t+2))*JackJ[1, 1, 1] + (1/(t+2))*JackJ[2, 1]
352
+ sage: JJ(s([1,1,1]))
353
+ 1/6*JackJ[1, 1, 1]
354
+ """
355
+ return JackPolynomials_j(self)
356
+
357
+ def Qp(self):
358
+ r"""
359
+ Return the algebra of Jack polynomials in the `Qp`, which is dual to
360
+ the `P` basis with respect to the standard scalar product.
361
+
362
+ INPUT:
363
+
364
+ - ``self`` -- the family of Jack symmetric function bases
365
+
366
+ OUTPUT: the `Q'` basis of the Jack symmetric functions
367
+
368
+ EXAMPLES::
369
+
370
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
371
+ sage: JP = Sym.jack().P()
372
+ sage: JQp = Sym.jack().Qp(); JQp
373
+ Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the Jack Qp basis
374
+ sage: a = JQp([2])
375
+ sage: a.scalar(JP([2]))
376
+ 1
377
+ sage: a.scalar(JP([1,1]))
378
+ 0
379
+ sage: JP(JQp([2])) # todo: missing auto normalization
380
+ ((t-1)/(t+1))*JackP[1, 1] + JackP[2]
381
+ sage: JP._normalize(JP(JQp([2])))
382
+ ((t-1)/(t+1))*JackP[1, 1] + JackP[2]
383
+ """
384
+ return JackPolynomials_qp(self)
385
+
386
+ ###################################################################
387
+
388
+
389
+ def c1(part, t):
390
+ r"""
391
+ Return the `t`-Jack scalar product between ``J(part)`` and ``P(part)``.
392
+
393
+ INPUT:
394
+
395
+ - ``part`` -- a partition
396
+ - ``t`` -- an optional parameter (default: uses the parameter `t` from the
397
+ Jack basis)
398
+
399
+ OUTPUT:
400
+
401
+ - a polynomial in the parameter ``t`` which is equal to the scalar
402
+ product of ``J(part)`` and ``P(part)``
403
+
404
+ EXAMPLES::
405
+
406
+ sage: from sage.combinat.sf.jack import c1
407
+ sage: t = QQ['t'].gen()
408
+ sage: [c1(p,t) for p in Partitions(3)]
409
+ [2*t^2 + 3*t + 1, t + 2, 6]
410
+ """
411
+ return prod([1+t*part.arm_lengths(flat=True)[i]+part.leg_lengths(flat=True)[i] for i in range(sum(part))],
412
+ t.parent().one())
413
+
414
+
415
+ def c2(part, t):
416
+ r"""
417
+ Return the t-Jack scalar product between ``J(part)`` and ``Q(part)``.
418
+
419
+ INPUT:
420
+
421
+ - ``self`` -- a Jack basis of the symmetric functions
422
+ - ``part`` -- a partition
423
+ - ``t`` -- an optional parameter (default: uses the parameter `t` from the
424
+ Jack basis)
425
+
426
+ OUTPUT:
427
+
428
+ - a polynomial in the parameter ``t`` which is equal to the scalar
429
+ product of ``J(part)`` and ``Q(part)``
430
+
431
+ EXAMPLES::
432
+
433
+ sage: from sage.combinat.sf.jack import c2
434
+ sage: t = QQ['t'].gen()
435
+ sage: [c2(p,t) for p in Partitions(3)]
436
+ [6*t^3, 2*t^3 + t^2, t^3 + 3*t^2 + 2*t]
437
+ """
438
+ return prod([t+t*part.arm_lengths(flat=True)[i]+part.leg_lengths(flat=True)[i] for i in range(sum(part))],
439
+ t.parent().one())
440
+
441
+
442
+ def normalize_coefficients(self, c):
443
+ r"""
444
+ If our coefficient ring is the field of fractions over a univariate
445
+ polynomial ring over the rationals, then we should clear both the
446
+ numerator and denominator of the denominators of their
447
+ coefficients.
448
+
449
+ INPUT:
450
+
451
+ - ``self`` -- a Jack basis of the symmetric functions
452
+ - ``c`` -- a coefficient in the base ring of ``self``
453
+
454
+ OUTPUT: divide numerator and denominator by the greatest common divisor
455
+
456
+ EXAMPLES::
457
+
458
+ sage: JP = SymmetricFunctions(FractionField(QQ['t'])).jack().P()
459
+ sage: t = JP.base_ring().gen()
460
+ sage: a = 2/(1/2*t+1/2)
461
+ sage: JP._normalize_coefficients(a)
462
+ 4/(t + 1)
463
+ sage: a = 1/(1/3+1/6*t)
464
+ sage: JP._normalize_coefficients(a)
465
+ 6/(t + 2)
466
+ sage: a = 24/(4*t^2 + 12*t + 8)
467
+ sage: JP._normalize_coefficients(a)
468
+ 6/(t^2 + 3*t + 2)
469
+ """
470
+ BR = self.base_ring()
471
+ if isinstance(BR, FractionField_generic) and BR.base_ring() == QQ:
472
+ denom = c.denominator()
473
+ numer = c.numerator()
474
+
475
+ #Clear the denominators
476
+ a = lcm([i.denominator() for i in denom.coefficients(sparse=False)])
477
+ b = lcm([i.denominator() for i in numer.coefficients(sparse=False)])
478
+ l = Integer(a).lcm(Integer(b))
479
+ denom *= l
480
+ numer *= l
481
+
482
+ #Divide through by the gcd of the numerators
483
+ a = gcd([i.numerator() for i in denom.coefficients(sparse=False)])
484
+ b = gcd([i.numerator() for i in numer.coefficients(sparse=False)])
485
+ l = Integer(a).gcd(Integer(b))
486
+
487
+ denom = denom // l
488
+ numer = numer // l
489
+
490
+ return c.parent()(numer, denom)
491
+ else:
492
+ return c
493
+
494
+ ####################################################################
495
+
496
+
497
+ class JackPolynomials_generic(sfa.SymmetricFunctionAlgebra_generic):
498
+ def __init__(self, jack):
499
+ r"""
500
+ A class of methods which are common to all Jack bases of the symmetric functions.
501
+
502
+ INPUT:
503
+
504
+ - ``self`` -- a Jack basis of the symmetric functions
505
+ - ``jack`` -- a family of Jack symmetric function bases
506
+
507
+ EXAMPLES::
508
+
509
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
510
+ sage: JP = Sym.jack().P(); JP.base_ring()
511
+ Fraction Field of Univariate Polynomial Ring in t over Rational Field
512
+ sage: Sym = SymmetricFunctions(QQ)
513
+ sage: JP = Sym.jack(t=2).P(); JP.base_ring()
514
+ Rational Field
515
+ """
516
+ s = self.__class__.__name__[16:].capitalize()
517
+ sfa.SymmetricFunctionAlgebra_generic.__init__(
518
+ self, jack._sym,
519
+ basis_name="Jack " + s + jack._name_suffix,
520
+ prefix="Jack" + s)
521
+ self.t = jack.t
522
+ self._sym = jack._sym
523
+ self._jack = jack
524
+
525
+ # Bases defined by orthotriangularity should inherit from some
526
+ # common category BasesByOrthotriangularity (shared with Jack, HL, orthotriang, Mcdo)
527
+ if hasattr(self, "_m_cache"):
528
+ # temporary until Hom(GradedHopfAlgebrasWithBasis work better)
529
+ category = sage.categories.all.ModulesWithBasis(self._sym.base_ring())
530
+ self._m = self._sym.monomial()
531
+ self .register_coercion(SetMorphism(Hom(self._m, self, category), self._m_to_self))
532
+ self._m.register_coercion(SetMorphism(Hom(self, self._m, category), self._self_to_m))
533
+ if hasattr(self, "_h_cache"):
534
+ # temporary until Hom(GradedHopfAlgebrasWithBasis work better)
535
+ category = sage.categories.all.ModulesWithBasis(self._sym.base_ring())
536
+ self._h = self._sym.homogeneous()
537
+ self .register_coercion(SetMorphism(Hom(self._h, self, category), self._h_to_self))
538
+ self._h.register_coercion(SetMorphism(Hom(self, self._h, category), self._self_to_h))
539
+
540
+ def construction(self):
541
+ """
542
+ Return a pair ``(F, R)``, where ``F`` is a
543
+ :class:`SymmetricFunctionsFunctor` and `R` is a ring, such
544
+ that ``F(R)`` returns ``self``.
545
+
546
+ EXAMPLES::
547
+
548
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
549
+ sage: JP = Sym.jack().P()
550
+ sage: JP.construction()
551
+ (SymmetricFunctionsFunctor[Jack P],
552
+ Fraction Field of Univariate Polynomial Ring in t over Rational Field)
553
+ """
554
+ return (sfa.SymmetricFunctionsFamilyFunctor(self, Jack,
555
+ self.basis_name(),
556
+ self.t),
557
+ self.base_ring())
558
+
559
+ def _m_to_self(self, x):
560
+ r"""
561
+ Isomorphism from the monomial basis into ``self``.
562
+
563
+ INPUT:
564
+
565
+ - ``self`` -- a Jack basis of the symmetric functions
566
+ - ``x`` -- element of the monomial basis
567
+
568
+ OUTPUT: an element of ``self`` equivalent to ``x``
569
+
570
+ EXAMPLES::
571
+
572
+ sage: Sym = SymmetricFunctions(QQ)
573
+ sage: JP = Sym.jack(t=2).P()
574
+ sage: m = Sym.monomial()
575
+ sage: JP._m_to_self(m[2,1])
576
+ -3/2*JackP[1, 1, 1] + JackP[2, 1]
577
+
578
+ This is for internal use only. Please use instead::
579
+
580
+ sage: JP(m[2,1])
581
+ -3/2*JackP[1, 1, 1] + JackP[2, 1]
582
+ """
583
+ return self._from_cache(x, self._m_cache, self._m_to_self_cache,
584
+ t=self.t)
585
+
586
+ def _self_to_m(self, x):
587
+ r"""
588
+ Isomorphism from ``self`` to the monomial basis.
589
+
590
+ INPUT:
591
+
592
+ - ``self`` -- a Jack basis of the symmetric functions
593
+ - ``x`` -- an element of ``self``
594
+
595
+ OUTPUT: an element of the monomial basis equivalent to ``x``
596
+
597
+ EXAMPLES::
598
+
599
+ sage: Sym = SymmetricFunctions(QQ)
600
+ sage: JP = Sym.jack(t=2).P()
601
+ sage: m = Sym.monomial()
602
+ sage: JP._self_to_m(JP[2,1])
603
+ 3/2*m[1, 1, 1] + m[2, 1]
604
+
605
+ This is for internal use only. Please use instead::
606
+
607
+ sage: m(JP[2,1])
608
+ 3/2*m[1, 1, 1] + m[2, 1]
609
+ """
610
+ return self._m._from_cache(x, self._m_cache, self._self_to_m_cache,
611
+ t=self.t)
612
+
613
+ def c1(self, part):
614
+ r"""
615
+ Return the `t`-Jack scalar product between ``J(part)`` and ``P(part)``.
616
+
617
+ INPUT:
618
+
619
+ - ``self`` -- a Jack basis of the symmetric functions
620
+ - ``part`` -- a partition
621
+ - ``t`` -- an optional parameter (default: uses the parameter `t` from the
622
+ Jack basis)
623
+
624
+ OUTPUT:
625
+
626
+ - a polynomial in the parameter ``t`` which is equal to the scalar
627
+ product of ``J(part)`` and ``P(part)``
628
+
629
+ EXAMPLES::
630
+
631
+ sage: JP = SymmetricFunctions(FractionField(QQ['t'])).jack().P()
632
+ sage: JP.c1(Partition([2,1]))
633
+ t + 2
634
+ """
635
+ return c1(part, self.t)
636
+
637
+ def c2(self, part):
638
+ r"""
639
+ Return the `t`-Jack scalar product between ``J(part)`` and ``Q(part)``.
640
+
641
+ INPUT:
642
+
643
+ - ``self`` -- a Jack basis of the symmetric functions
644
+ - ``part`` -- a partition
645
+ - ``t`` -- an optional parameter (default: uses the parameter `t` from the
646
+ Jack basis)
647
+
648
+ OUTPUT:
649
+
650
+ - a polynomial in the parameter ``t`` which is equal to the scalar
651
+ product of ``J(part)`` and ``Q(part)``
652
+
653
+ EXAMPLES::
654
+
655
+ sage: JP = SymmetricFunctions(FractionField(QQ['t'])).jack().P()
656
+ sage: JP.c2(Partition([2,1]))
657
+ 2*t^3 + t^2
658
+ """
659
+ return c2(part, self.t)
660
+
661
+ _normalize_coefficients = normalize_coefficients
662
+
663
+ def _normalize(self, x):
664
+ r"""
665
+ Normalize the coefficients of ``x``.
666
+
667
+ INPUT:
668
+
669
+ - ``self`` -- a Jack basis of the symmetric functions
670
+ - ``x`` -- an element of ``self``
671
+
672
+ OUTPUT: ``x`` with _normalize_coefficient applied to each of the coefficients
673
+
674
+ EXAMPLES::
675
+
676
+ sage: JP = SymmetricFunctions(FractionField(QQ['t'])).jack().P()
677
+ sage: t = JP.base_ring().gen()
678
+ sage: a = 2/(1/2*t+1/2)
679
+ sage: b = 1/(1/3+1/6*t)
680
+ sage: c = 24/(4*t^2 + 12*t + 8)
681
+ sage: JP._normalize( a*JP[1] + b*JP[2] + c*JP[2,1] )
682
+ (4/(t+1))*JackP[1] + (6/(t+2))*JackP[2] + (6/(t^2+3*t+2))*JackP[2, 1]
683
+
684
+ .. TODO:: this should be a method on the elements (what's the standard name for such methods?)
685
+ """
686
+ return x.map_coefficients(self._normalize_coefficients)
687
+
688
+ def _normalize_morphism(self, category):
689
+ r"""
690
+ Return the normalize morphism.
691
+
692
+ INPUT:
693
+
694
+ - ``self`` -- a Jack basis of the symmetric functions
695
+ - ``category`` -- a category
696
+
697
+ EXAMPLES::
698
+
699
+ sage: JP = SymmetricFunctions(FractionField(QQ['t'])).jack().P()
700
+ sage: normal = JP._normalize_morphism(AlgebrasWithBasis(JP.base_ring()))
701
+ sage: normal.parent()
702
+ Set of Homomorphisms from Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the Jack P basis to Symmetric Functions over Fraction Field of Univariate Polynomial Ring in t over Rational Field in the Jack P basis
703
+ sage: normal.category_for()
704
+ Category of algebras with basis over Fraction Field of Univariate Polynomial Ring in t over Rational Field
705
+
706
+ sage: t = JP.t
707
+ sage: a = 2/(1/2*t+1/2)
708
+ sage: b = 1/(1/3+1/6*t)
709
+ sage: c = 24/(4*t^2 + 12*t + 8)
710
+ sage: normal( a*JP[1] + b*JP[2] + c*JP[2,1] )
711
+ (4/(t+1))*JackP[1] + (6/(t+2))*JackP[2] + (6/(t^2+3*t+2))*JackP[2, 1]
712
+
713
+ .. TODO::
714
+
715
+ This method should not be needed once short idioms to
716
+ construct morphisms are available
717
+ """
718
+ return SetMorphism(End(self, category), self._normalize)
719
+
720
+ def product(self, left, right):
721
+ r"""
722
+ The product of two Jack symmetric functions is done by multiplying the
723
+ elements in the `P` basis and then expressing the elements
724
+ in the basis ``self``.
725
+
726
+ INPUT:
727
+
728
+ - ``self`` -- a Jack basis of the symmetric functions
729
+ - ``left``, ``right`` -- symmetric function elements
730
+
731
+ OUTPUT: the product of ``left`` and ``right`` expanded in the basis ``self``
732
+
733
+ EXAMPLES::
734
+
735
+ sage: JJ = SymmetricFunctions(FractionField(QQ['t'])).jack().J()
736
+ sage: JJ([1])^2 # indirect doctest
737
+ (t/(t+1))*JackJ[1, 1] + (1/(t+1))*JackJ[2]
738
+ sage: JJ([2])^2
739
+ (t^2/(t^2+3/2*t+1/2))*JackJ[2, 2] + (4/3*t/(t^2+4/3*t+1/3))*JackJ[3, 1] + ((1/6*t+1/6)/(t^2+5/6*t+1/6))*JackJ[4]
740
+ sage: JQ = SymmetricFunctions(FractionField(QQ['t'])).jack().Q()
741
+ sage: JQ([1])^2 # indirect doctest
742
+ JackQ[1, 1] + (2/(t+1))*JackQ[2]
743
+ sage: JQ([2])^2
744
+ JackQ[2, 2] + (2/(t+1))*JackQ[3, 1] + ((t+1)/(t^2+5/6*t+1/6))*JackQ[4]
745
+ """
746
+ return self(self._P(left) * self._P(right))
747
+
748
+ def jack_family(self):
749
+ r"""
750
+ Return the family of Jack bases associated to the basis ``self``.
751
+
752
+ INPUT:
753
+
754
+ - ``self`` -- a Jack basis of the symmetric functions
755
+
756
+ EXAMPLES::
757
+
758
+ sage: JackP = SymmetricFunctions(QQ).jack(t=2).P()
759
+ sage: JackP.jack_family()
760
+ Jack polynomials with t=2 over Rational Field
761
+ """
762
+ return self._jack
763
+
764
+ def coproduct_by_coercion(self, elt):
765
+ r"""
766
+ Return the coproduct of the element ``elt`` by coercion to the Schur basis.
767
+
768
+ INPUT:
769
+
770
+ - ``self`` -- a Jack symmetric function basis
771
+ - ``elt`` -- an instance of this basis
772
+
773
+ OUTPUT:
774
+
775
+ - The coproduct acting on ``elt``, the result is an element of the
776
+ tensor squared of the Jack symmetric function basis
777
+
778
+ EXAMPLES::
779
+
780
+ sage: Sym = SymmetricFunctions(QQ['t'].fraction_field())
781
+ sage: Sym.jack().P()[2,2].coproduct() # indirect doctest # needs lrcalc_python
782
+ JackP[] # JackP[2, 2] + (2/(t+1))*JackP[1] # JackP[2, 1] + ((8*t+4)/(t^3+4*t^2+5*t+2))*JackP[1, 1] # JackP[1, 1] + JackP[2] # JackP[2] + (2/(t+1))*JackP[2, 1] # JackP[1] + JackP[2, 2] # JackP[]
783
+ """
784
+ from sage.categories.tensor import tensor
785
+ s = self.realization_of().schur()
786
+ g = self.tensor_square().sum(coeff*tensor([self(s[x]), self(s[y])])
787
+ for ((x,y), coeff) in s(elt).coproduct())
788
+ normalize = self._normalize_coefficients
789
+ return self.tensor_square().sum(normalize(coeff)*tensor([self(x), self(y)])
790
+ for ((x,y), coeff) in g)
791
+
792
+ class Element(sfa.SymmetricFunctionAlgebra_generic.Element):
793
+ def scalar_jack(self, x, t=None):
794
+ r"""
795
+ A scalar product where the power sums are orthogonal and
796
+ `\langle p_\mu, p_\mu \rangle = z_\mu t^{length(\mu)}`
797
+
798
+ INPUT:
799
+
800
+ - ``self`` -- an element of a Jack basis of the symmetric functions
801
+ - ``x`` -- an element of the symmetric functions
802
+ - ``t`` -- an optional parameter (default: ``None``; uses the
803
+ parameter from the basis)
804
+
805
+ OUTPUT: the Jack scalar product between ``x`` and ``self``
806
+
807
+ EXAMPLES::
808
+
809
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
810
+ sage: JP = Sym.jack().P()
811
+ sage: JQ = Sym.jack().Q()
812
+ sage: p = Partitions(3).list()
813
+ sage: matrix([[JP(a).scalar_jack(JQ(b)) for a in p] for b in p])
814
+ [1 0 0]
815
+ [0 1 0]
816
+ [0 0 1]
817
+ """
818
+ parent = self.parent()
819
+ p = parent.realization_of().power()
820
+ res = p(self).scalar_jack(p(x), t)
821
+
822
+ return parent._normalize_coefficients(res)
823
+
824
+
825
+ def part_scalar_jack(part1, part2, t):
826
+ r"""
827
+ Return the Jack scalar product between ``p(part1)`` and ``p(part2)`` where
828
+ `p` is the power-sum basis.
829
+
830
+ INPUT:
831
+
832
+ - ``part1``, ``part2`` -- two partitions
833
+ - ``t`` -- a parameter
834
+
835
+ OUTPUT: the scalar product between the power sum indexed by ``part1`` and ``part2``
836
+
837
+ EXAMPLES::
838
+
839
+ sage: Q.<t> = QQ[]
840
+ sage: from sage.combinat.sf.jack import part_scalar_jack
841
+ sage: matrix([[part_scalar_jack(p1,p2,t) for p1 in Partitions(4)] for p2 in Partitions(4)])
842
+ [ 4*t 0 0 0 0]
843
+ [ 0 3*t^2 0 0 0]
844
+ [ 0 0 8*t^2 0 0]
845
+ [ 0 0 0 4*t^3 0]
846
+ [ 0 0 0 0 24*t^4]
847
+ """
848
+ if part1 != part2:
849
+ return 0
850
+ else:
851
+ return part1.centralizer_size()*t**len(part1)
852
+
853
+ #P basis
854
+
855
+
856
+ class JackPolynomials_p(JackPolynomials_generic):
857
+
858
+ def __init__(self, jack):
859
+ r"""
860
+ The `P` basis is uni-triangularly related to the monomial basis and
861
+ orthogonal with respect to the Jack scalar product.
862
+
863
+ INPUT:
864
+
865
+ - ``self`` -- an instance of the Jack `P` basis of the symmetric functions
866
+ - ``jack`` -- a family of Jack symmetric function bases
867
+
868
+ EXAMPLES::
869
+
870
+ sage: # needs lrcalc_python
871
+ sage: P = SymmetricFunctions(FractionField(QQ['t'])).jack().P()
872
+ sage: TestSuite(P).run(skip=['_test_associativity', '_test_distributivity', '_test_prod']) # products are too expensive
873
+ sage: TestSuite(P).run(elements = [P.t*P[1,1]+P[2], P[1]+(1+P.t)*P[1,1]])
874
+ """
875
+ self._name = "Jack polynomials in the P basis"
876
+ self._prefix = "JackP"
877
+
878
+ self._m_to_self_cache = m_to_p_cache
879
+ self._self_to_m_cache = p_to_m_cache
880
+ JackPolynomials_generic.__init__(self, jack)
881
+
882
+ def _m_cache(self, n):
883
+ r"""
884
+ Compute the change of basis between the Jack polynomials in the `P`
885
+ basis and the monomial symmetric functions. This uses Gram-Schmidt
886
+ to go to the monomials, and then that matrix is simply inverted.
887
+
888
+ INPUT:
889
+
890
+ - ``self`` -- an instance of the Jack `P` basis of the symmetric functions
891
+ - ``n`` -- positive integer indicating the degree
892
+
893
+ EXAMPLES::
894
+
895
+ sage: JP = SymmetricFunctions(FractionField(QQ['t'])).jack().P()
896
+ sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())]
897
+ sage: JP._m_cache(2)
898
+ sage: l(JP._self_to_m_cache[2])
899
+ [([1, 1], [([1, 1], 1)]), ([2], [([1, 1], 2/(t + 1)), ([2], 1)])]
900
+ sage: l(JP._m_to_self_cache[2])
901
+ [([1, 1], [([1, 1], 1)]), ([2], [([1, 1], -2/(t + 1)), ([2], 1)])]
902
+ sage: JP._m_cache(3)
903
+ sage: l(JP._m_to_self_cache[3])
904
+ [([1, 1, 1], [([1, 1, 1], 1)]),
905
+ ([2, 1], [([1, 1, 1], -6/(t + 2)), ([2, 1], 1)]),
906
+ ([3], [([1, 1, 1], 6/(t^2 + 3*t + 2)), ([2, 1], -3/2/(t + 1/2)), ([3], 1)])]
907
+ sage: l(JP._self_to_m_cache[3])
908
+ [([1, 1, 1], [([1, 1, 1], 1)]),
909
+ ([2, 1], [([1, 1, 1], 6/(t + 2)), ([2, 1], 1)]),
910
+ ([3],
911
+ [([1, 1, 1], 3/(t^2 + 3/2*t + 1/2)), ([2, 1], 3/2/(t + 1/2)), ([3], 1)])]
912
+ """
913
+ if n in self._self_to_m_cache:
914
+ return
915
+ self._self_to_m_cache[n] = {}
916
+ t = QQt.gen()
917
+ monomial = sage.combinat.sf.sf.SymmetricFunctions(QQt).monomial()
918
+ JP = sage.combinat.sf.sf.SymmetricFunctions(QQt).jack().P()
919
+ JP._gram_schmidt(n, monomial, lambda p: part_scalar_jack(p, p, t),
920
+ self._self_to_m_cache[n], upper_triangular=True)
921
+ JP._invert_morphism(n, QQt, self._self_to_m_cache,
922
+ self._m_to_self_cache, to_other_function=self._to_m)
923
+
924
+ def _to_m(self, part):
925
+ r"""
926
+ Return a function that takes in a partition lambda that returns the
927
+ coefficient of lambda in the expansion of self(part) in the
928
+ monomial basis.
929
+
930
+ This assumes that the cache from the Jack polynomials in the `P`
931
+ basis to the monomial symmetric functions has already been
932
+ computed.
933
+
934
+ INPUT:
935
+
936
+ - ``self`` -- an instance of the Jack `P` basis of the symmetric functions
937
+ - ``part`` -- a partition
938
+
939
+ OUTPUT:
940
+
941
+ - returns a function that accepts a partition and returns the coefficients
942
+ of the expansion of the element of ``P(part)`` in the monomial basis
943
+
944
+ EXAMPLES::
945
+
946
+ sage: JP = SymmetricFunctions(FractionField(QQ['t'])).jack().P()
947
+ sage: JP._m_cache(3)
948
+ sage: f = JP._to_m(Partition([2,1]))
949
+ sage: [f(part) for part in Partitions(3)]
950
+ [0, 1, 6/(t + 2)]
951
+ sage: JP.symmetric_function_ring().m()(JP[2,1])
952
+ (6/(t+2))*m[1, 1, 1] + m[2, 1]
953
+ """
954
+ f = lambda part2: self._self_to_m_cache[sum(part)][part].get(part2, 0)
955
+ return f
956
+
957
+ def product(self, left, right):
958
+ r"""
959
+ The product of two Jack symmetric functions is done by multiplying the
960
+ elements in the monomial basis and then expressing the elements
961
+ the basis ``self``.
962
+
963
+ INPUT:
964
+
965
+ - ``self`` -- a Jack basis of the symmetric functions
966
+ - ``left``, ``right`` -- symmetric function elements
967
+
968
+ OUTPUT: the product of ``left`` and ``right`` expanded in the basis ``self``
969
+
970
+ EXAMPLES::
971
+
972
+ sage: JP = SymmetricFunctions(FractionField(QQ['t'])).jack().P()
973
+ sage: m = JP.symmetric_function_ring().m()
974
+ sage: JP([1])^2 # indirect doctest
975
+ (2*t/(t+1))*JackP[1, 1] + JackP[2]
976
+ sage: m(_)
977
+ 2*m[1, 1] + m[2]
978
+ sage: JP = SymmetricFunctions(QQ).jack(t=2).P()
979
+ sage: JP([2,1])^2
980
+ 125/63*JackP[2, 2, 1, 1] + 25/12*JackP[2, 2, 2] + 25/18*JackP[3, 1, 1, 1] + 12/5*JackP[3, 2, 1] + 4/3*JackP[3, 3] + 4/3*JackP[4, 1, 1] + JackP[4, 2]
981
+ sage: m(_)
982
+ 45*m[1, 1, 1, 1, 1, 1] + 51/2*m[2, 1, 1, 1, 1] + 29/2*m[2, 2, 1, 1] + 33/4*m[2, 2, 2] + 9*m[3, 1, 1, 1] + 5*m[3, 2, 1] + 2*m[3, 3] + 2*m[4, 1, 1] + m[4, 2]
983
+ """
984
+ return self(self._m(left) * self._m(right))
985
+
986
+ def scalar_jack_basis(self, part1, part2=None):
987
+ r"""
988
+ Return the scalar product of `P(part1)` and `P(part2)`.
989
+
990
+ This is equation (10.16) of [Mc1995]_ on page 380.
991
+
992
+ INPUT:
993
+
994
+ - ``self`` -- an instance of the Jack `P` basis of the symmetric functions
995
+ - ``part1`` -- a partition
996
+ - ``part2`` -- an optional partition (default: ``None``)
997
+
998
+ OUTPUT:
999
+
1000
+ - the scalar product between `P(part1)` and `P(part2)` (or itself if `part2` is None)
1001
+
1002
+ REFERENCES:
1003
+
1004
+ .. [Mc1995] \I. G. Macdonald, Symmetric functions and Hall
1005
+ polynomials, second ed., The Clarendon Press, Oxford
1006
+ University Press, New York, 1995, With contributions by
1007
+ A. Zelevinsky, Oxford Science Publications.
1008
+
1009
+ EXAMPLES::
1010
+
1011
+ sage: JP = SymmetricFunctions(FractionField(QQ['t'])).jack().P()
1012
+ sage: JJ = SymmetricFunctions(FractionField(QQ['t'])).jack().J()
1013
+ sage: JP.scalar_jack_basis(Partition([2,1]), Partition([1,1,1]))
1014
+ 0
1015
+ sage: JP._normalize_coefficients(JP.scalar_jack_basis(Partition([3,2,1]), Partition([3,2,1])))
1016
+ (6*t^6 + 10*t^5 + 11/2*t^4 + t^3)/(t^3 + 11/2*t^2 + 10*t + 6)
1017
+ sage: JJ(JP[3,2,1]).scalar_jack(JP[3,2,1])
1018
+ (6*t^6 + 10*t^5 + 11/2*t^4 + t^3)/(t^3 + 11/2*t^2 + 10*t + 6)
1019
+
1020
+ With a single argument, takes `part2 = part1`::
1021
+
1022
+ sage: JP.scalar_jack_basis(Partition([2,1]), Partition([2,1]))
1023
+ (2*t^3 + t^2)/(t + 2)
1024
+ sage: JJ(JP[2,1]).scalar_jack(JP[2,1])
1025
+ (2*t^3 + t^2)/(t + 2)
1026
+ """
1027
+ if part2 is not None and part1 != part2:
1028
+ return self.base_ring().zero()
1029
+ return self.c2(part1) / self.c1(part1)
1030
+
1031
+ class Element(JackPolynomials_generic.Element):
1032
+ def scalar_jack(self, x, t=None):
1033
+ r"""
1034
+ The scalar product on the symmetric functions where the power sums
1035
+ are orthogonal and `\langle p_\mu, p_\mu \rangle = z_\mu t^{length(mu)}`
1036
+ where the t parameter from the Jack symmetric function family.
1037
+
1038
+ INPUT:
1039
+
1040
+ - ``self`` -- an element of the Jack `P` basis
1041
+ - ``x`` -- an element of the `P` basis
1042
+
1043
+ EXAMPLES::
1044
+
1045
+ sage: JP = SymmetricFunctions(FractionField(QQ['t'])).jack().P()
1046
+ sage: l = [JP(p) for p in Partitions(3)]
1047
+ sage: matrix([[a.scalar_jack(b) for a in l] for b in l])
1048
+ [3*t^3/(t^2 + 3/2*t + 1/2) 0 0]
1049
+ [ 0 (2*t^3 + t^2)/(t + 2) 0]
1050
+ [ 0 0 1/6*t^3 + 1/2*t^2 + 1/3*t]
1051
+ """
1052
+ if isinstance(x, JackPolynomials_p) and t is None:
1053
+ P = self.parent()
1054
+ return P._apply_multi_module_morphism(self, x, P.scalar_jack_basis, orthogonal=True)
1055
+ else:
1056
+ return JackPolynomials_generic.Element.scalar_jack(self, x, t)
1057
+
1058
+ #J basis
1059
+
1060
+
1061
+ class JackPolynomials_j(JackPolynomials_generic):
1062
+
1063
+ def __init__(self, jack):
1064
+ r"""
1065
+ The `J` basis is a defined as a normalized form of the `P` basis.
1066
+
1067
+ INPUT:
1068
+
1069
+ - ``self`` -- an instance of the Jack `P` basis of the symmetric functions
1070
+ - ``jack`` -- a family of Jack symmetric function bases
1071
+
1072
+ EXAMPLES::
1073
+
1074
+ sage: # needs lrcalc_python
1075
+ sage: J = SymmetricFunctions(FractionField(QQ['t'])).jack().J()
1076
+ sage: TestSuite(J).run(skip=['_test_associativity', '_test_distributivity', '_test_prod']) # products are too expensive
1077
+ sage: TestSuite(J).run(elements = [J.t*J[1,1]+J[2], J[1]+(1+J.t)*J[1,1]]) # long time (3s on sage.math, 2012)
1078
+ """
1079
+ self._name = "Jack polynomials in the J basis"
1080
+ self._prefix = "JackJ"
1081
+ JackPolynomials_generic.__init__(self, jack)
1082
+
1083
+ # Should be shared with _q (and possibly other bases in Macdo/HL) as BasesByRenormalization
1084
+ self._P = self._jack.P()
1085
+ # temporary until Hom(GradedHopfAlgebrasWithBasis) works better
1086
+ category = sage.categories.all.ModulesWithBasis(self.base_ring())
1087
+ phi = self.module_morphism(diagonal=self.c1,
1088
+ codomain=self._P, category=category)
1089
+ # should use module_morphism(on_coeffs = ...) once it exists
1090
+ self._P.register_coercion(self._P._normalize_morphism(category) * phi)
1091
+ self .register_coercion(self ._normalize_morphism(category) * ~phi)
1092
+
1093
+ class Element(JackPolynomials_generic.Element):
1094
+ pass
1095
+
1096
+
1097
+ #Q basis
1098
+ class JackPolynomials_q(JackPolynomials_generic):
1099
+
1100
+ def __init__(self, jack):
1101
+ r"""
1102
+ The `Q` basis is defined as a normalized form of the `P` basis.
1103
+
1104
+ INPUT:
1105
+
1106
+ - ``self`` -- an instance of the Jack `Q` basis of the symmetric functions
1107
+ - ``jack`` -- a family of Jack symmetric function bases
1108
+
1109
+ EXAMPLES::
1110
+
1111
+ sage: # needs lrcalc_python
1112
+ sage: Q = SymmetricFunctions(FractionField(QQ['t'])).jack().Q()
1113
+ sage: TestSuite(Q).run(skip=['_test_associativity', '_test_distributivity', '_test_prod']) # products are too expensive
1114
+ sage: TestSuite(Q).run(elements = [Q.t*Q[1,1]+Q[2], Q[1]+(1+Q.t)*Q[1,1]]) # long time (3s on sage.math, 2012)
1115
+ """
1116
+ self._name = "Jack polynomials in the Q basis"
1117
+ self._prefix = "JackQ"
1118
+ JackPolynomials_generic.__init__(self, jack)
1119
+
1120
+ # Should be shared with _j (and possibly other bases in Macdo/HL) as BasesByRenormalization
1121
+ self._P = self._jack.P()
1122
+ # temporary until Hom(GradedHopfAlgebrasWithBasis) works better
1123
+ category = sage.categories.all.ModulesWithBasis(self.base_ring())
1124
+ phi = self._P.module_morphism(diagonal=self._P.scalar_jack_basis,
1125
+ codomain=self, category=category)
1126
+ self.register_coercion(self._normalize_morphism(category) * phi)
1127
+ self._P.register_coercion(self._P._normalize_morphism(category) * ~phi)
1128
+
1129
+ class Element(JackPolynomials_generic.Element):
1130
+ pass
1131
+
1132
+
1133
+ qp_to_h_cache = {}
1134
+ h_to_qp_cache = {}
1135
+
1136
+
1137
+ class JackPolynomials_qp(JackPolynomials_generic):
1138
+ def __init__(self, jack):
1139
+ r"""
1140
+ The `Qp` basis is the dual basis to the `P` basis with respect to the
1141
+ standard scalar product
1142
+
1143
+ INPUT:
1144
+
1145
+ - ``self`` -- an instance of the Jack `Qp` basis of the symmetric functions
1146
+ - ``jack`` -- a family of Jack symmetric function bases
1147
+
1148
+ EXAMPLES::
1149
+
1150
+ sage: Qp = SymmetricFunctions(FractionField(QQ['t'])).jack().Qp()
1151
+ sage: TestSuite(Qp).run(skip=['_test_associativity', '_test_distributivity', '_test_prod']) # products are too expensive
1152
+ sage: TestSuite(Qp).run(elements = [Qp.t*Qp[1,1]+Qp[2], Qp[1]+(1+Qp.t)*Qp[1,1]]) # long time (3s on sage.math, 2012)
1153
+ """
1154
+ self._name = "Jack polynomials in the Qp basis"
1155
+ self._prefix = "JackQp"
1156
+ JackPolynomials_generic.__init__(self, jack)
1157
+ self._P = self._jack.P()
1158
+ self._self_to_h_cache = qp_to_h_cache
1159
+ self._h_to_self_cache = h_to_qp_cache
1160
+
1161
+ def product(self, left, right):
1162
+ r"""
1163
+ The product of two Jack symmetric functions is done by multiplying the
1164
+ elements in the monomial basis and then expressing the elements
1165
+ the basis ``self``.
1166
+
1167
+ INPUT:
1168
+
1169
+ - ``self`` -- an instance of the Jack `Qp` basis of the symmetric functions
1170
+ - ``left``, ``right`` -- symmetric function elements
1171
+
1172
+ OUTPUT: the product of ``left`` and ``right`` expanded in the basis ``self``
1173
+
1174
+ EXAMPLES::
1175
+
1176
+ sage: JQp = SymmetricFunctions(FractionField(QQ['t'])).jack().Qp()
1177
+ sage: h = JQp.symmetric_function_ring().h()
1178
+ sage: JQp([1])^2 # indirect doctest
1179
+ JackQp[1, 1] + (2/(t+1))*JackQp[2]
1180
+ sage: h(_)
1181
+ h[1, 1]
1182
+ sage: JQp = SymmetricFunctions(QQ).jack(t=2).Qp()
1183
+ sage: h = SymmetricFunctions(QQ).h()
1184
+ sage: JQp([2,1])^2
1185
+ JackQp[2, 2, 1, 1] + 2/3*JackQp[2, 2, 2] + 2/3*JackQp[3, 1, 1, 1] + 48/35*JackQp[3, 2, 1] + 28/75*JackQp[3, 3] + 128/225*JackQp[4, 1, 1] + 28/75*JackQp[4, 2]
1186
+ sage: h(_)
1187
+ h[2, 2, 1, 1] - 6/5*h[3, 2, 1] + 9/25*h[3, 3]
1188
+ """
1189
+ return self(self._h(left) * self._h(right))
1190
+
1191
+ def _h_cache(self, n):
1192
+ r"""
1193
+ Compute the change of basis between the Jack polynomials in the `Qp`
1194
+ basis and the homogeneous symmetric functions. This uses the coefficients
1195
+ in the change of basis between the Jack `P` basis and the monomial basis.
1196
+
1197
+ INPUT:
1198
+
1199
+ - ``self`` -- an instance of the Jack `Qp` basis of the symmetric functions
1200
+ - ``n`` -- positive integer indicating the degree
1201
+
1202
+ EXAMPLES::
1203
+
1204
+ sage: JQp = SymmetricFunctions(FractionField(QQ['t'])).jack().Qp()
1205
+ sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())]
1206
+ sage: JQp._h_cache(2)
1207
+ sage: l(JQp._self_to_h_cache[2])
1208
+ [([1, 1], [([1, 1], 1), ([2], -2/(t + 1))]), ([2], [([2], 1)])]
1209
+ sage: l(JQp._h_to_self_cache[2])
1210
+ [([1, 1], [([1, 1], 1), ([2], 2/(t + 1))]), ([2], [([2], 1)])]
1211
+ sage: JQp._h_cache(3)
1212
+ sage: l(JQp._h_to_self_cache[3])
1213
+ [([1, 1, 1],
1214
+ [([1, 1, 1], 1), ([2, 1], 6/(t + 2)), ([3], 3/(t^2 + 3/2*t + 1/2))]),
1215
+ ([2, 1], [([2, 1], 1), ([3], 3/2/(t + 1/2))]),
1216
+ ([3], [([3], 1)])]
1217
+ sage: l(JQp._self_to_h_cache[3])
1218
+ [([1, 1, 1], [([1, 1, 1], 1), ([2, 1], -6/(t + 2)), ([3], 6/(t^2 + 3*t + 2))]),
1219
+ ([2, 1], [([2, 1], 1), ([3], -3/2/(t + 1/2))]),
1220
+ ([3], [([3], 1)])]
1221
+ """
1222
+ if n in self._self_to_h_cache:
1223
+ return
1224
+ else:
1225
+ self._self_to_h_cache[n] = {}
1226
+ self._h_to_self_cache[n] = {}
1227
+ self._P._m_cache(n)
1228
+ from_cache_1 = self._P._self_to_m_cache[n]
1229
+ to_cache_1 = self._self_to_h_cache[n]
1230
+ from_cache_2 = self._P._m_to_self_cache[n]
1231
+ to_cache_2 = self._h_to_self_cache[n]
1232
+ for mu in from_cache_1:
1233
+ for la in from_cache_1[mu]:
1234
+ if la not in to_cache_1:
1235
+ to_cache_1[la] = {}
1236
+ to_cache_2[la] = {}
1237
+ to_cache_2[la][mu] = from_cache_1[mu][la]
1238
+ to_cache_1[la][mu] = from_cache_2[mu][la]
1239
+
1240
+ def _self_to_h( self, x ):
1241
+ r"""
1242
+ Isomorphism from ``self`` to the homogeneous basis.
1243
+
1244
+ INPUT:
1245
+
1246
+ - ``self`` -- a Jack `Qp` basis of the symmetric functions
1247
+ - ``x`` -- an element of the Jack `Qp` basis
1248
+
1249
+ OUTPUT: an element of the homogeneous basis equivalent to ``x``
1250
+
1251
+ EXAMPLES::
1252
+
1253
+ sage: Sym = SymmetricFunctions(QQ)
1254
+ sage: JQp = Sym.jack(t=2).Qp()
1255
+ sage: h = Sym.homogeneous()
1256
+ sage: JQp._self_to_h(JQp[2,1])
1257
+ h[2, 1] - 3/5*h[3]
1258
+
1259
+ This is for internal use only. Please use instead::
1260
+
1261
+ sage: h(JQp[2,1])
1262
+ h[2, 1] - 3/5*h[3]
1263
+ """
1264
+ return self._h._from_cache(x, self._h_cache, self._self_to_h_cache,
1265
+ t=self.t)
1266
+
1267
+ def _h_to_self(self, x):
1268
+ r"""
1269
+ Isomorphism from the homogeneous basis into ``self``.
1270
+
1271
+ INPUT:
1272
+
1273
+ - ``self`` -- a Jack `Qp` basis of the symmetric functions
1274
+ - ``x`` -- element of the homogeneous basis
1275
+
1276
+ OUTPUT: an element of the Jack `Qp` basis equivalent to ``x``
1277
+
1278
+ EXAMPLES::
1279
+
1280
+ sage: Sym = SymmetricFunctions(QQ)
1281
+ sage: JQp = Sym.jack(t=2).Qp()
1282
+ sage: h = Sym.homogeneous()
1283
+ sage: JQp._h_to_self(h[2,1])
1284
+ JackQp[2, 1] + 3/5*JackQp[3]
1285
+
1286
+ This is for internal use only. Please use instead::
1287
+
1288
+ sage: JQp(h[2,1])
1289
+ JackQp[2, 1] + 3/5*JackQp[3]
1290
+ """
1291
+ return self._from_cache(x, self._h_cache, self._h_to_self_cache,
1292
+ t=self.t)
1293
+
1294
+ def coproduct_by_coercion(self, elt):
1295
+ r"""
1296
+ Return the coproduct of the element ``elt`` by coercion to the Schur basis.
1297
+
1298
+ INPUT:
1299
+
1300
+ - ``elt`` -- an instance of the ``Qp`` basis
1301
+
1302
+ OUTPUT:
1303
+
1304
+ - The coproduct acting on ``elt``, the result is an element of the
1305
+ tensor squared of the ``Qp`` symmetric function basis
1306
+
1307
+ EXAMPLES::
1308
+
1309
+ sage: Sym = SymmetricFunctions(QQ['t'].fraction_field())
1310
+ sage: JQp = Sym.jack().Qp()
1311
+ sage: JQp[2,2].coproduct() #indirect doctest
1312
+ JackQp[] # JackQp[2, 2] + (2*t/(t+1))*JackQp[1] # JackQp[2, 1] + JackQp[1, 1] # JackQp[1, 1] + ((2*t^3+4*t^2)/(t^3+5/2*t^2+2*t+1/2))*JackQp[2] # JackQp[2] + (2*t/(t+1))*JackQp[2, 1] # JackQp[1] + JackQp[2, 2] # JackQp[]
1313
+ """
1314
+ h = elt.parent().realization_of().h()
1315
+ parent = elt.parent()
1316
+ from sage.categories.tensor import tensor
1317
+ cfunc = lambda x, y: tensor([parent(x), parent(y)])
1318
+ cprod = h(elt).coproduct().apply_multilinear_morphism( cfunc )
1319
+ normalize = lambda c: normalize_coefficients( parent, c )
1320
+ return cprod.parent().sum(normalize(coeff)*tensor([parent(x), parent(y)])
1321
+ for ((x,y), coeff) in cprod)
1322
+
1323
+ class Element(JackPolynomials_generic.Element):
1324
+ pass
1325
+
1326
+ #Zonal polynomials ( =P(at t=2) )
1327
+
1328
+
1329
+ class SymmetricFunctionAlgebra_zonal(sfa.SymmetricFunctionAlgebra_generic):
1330
+ def __init__(self, Sym):
1331
+ r"""
1332
+ Return the algebra of zonal polynomials.
1333
+
1334
+ INPUT:
1335
+
1336
+ - ``self`` -- a zonal basis of the symmetric functions
1337
+ - ``Sym`` -- a ring of the symmetric functions
1338
+
1339
+ EXAMPLES::
1340
+
1341
+ sage: # needs lrcalc_python
1342
+ sage: Z = SymmetricFunctions(QQ).zonal()
1343
+ sage: Z([2])^2
1344
+ 64/45*Z[2, 2] + 16/21*Z[3, 1] + Z[4]
1345
+ sage: Z = SymmetricFunctions(QQ).zonal()
1346
+ sage: TestSuite(Z).run(skip=['_test_associativity', '_test_distributivity', '_test_prod']) # products are too expensive
1347
+ sage: TestSuite(Z).run(elements = [Z[1,1]+Z[2], Z[1]+2*Z[1,1]])
1348
+ """
1349
+ self._sym = Sym
1350
+ self._jack = self._sym.jack(t=2)
1351
+ self._P = self._jack.P()
1352
+ #self._m_to_self_cache = {} Now that we compute Jacks once, there is a global cache
1353
+ #self._self_to_m_cache = {} and we don't need to compute it separately for zonals
1354
+ sfa.SymmetricFunctionAlgebra_generic.__init__(self, self._sym,
1355
+ prefix='Z', basis_name='zonal')
1356
+ category = sage.categories.all.ModulesWithBasis(self._sym.base_ring())
1357
+ self .register_coercion(SetMorphism(Hom(self._P, self, category), self.sum_of_terms))
1358
+ self._P.register_coercion(SetMorphism(Hom(self, self._P, category), self._P.sum_of_terms))
1359
+
1360
+ def product(self, left, right):
1361
+ r"""
1362
+ The product of two zonal symmetric functions is done by multiplying the
1363
+ elements in the monomial basis and then expressing the elements
1364
+ in the basis ``self``.
1365
+
1366
+ INPUT:
1367
+
1368
+ - ``self`` -- a zonal basis of the symmetric functions
1369
+ - ``left``, ``right`` -- symmetric function elements
1370
+
1371
+ OUTPUT: the product of ``left`` and ``right`` expanded in the basis ``self``
1372
+
1373
+ EXAMPLES::
1374
+
1375
+ sage: Sym = SymmetricFunctions(QQ)
1376
+ sage: Z = Sym.zonal()
1377
+ sage: JP = Sym.jack(t=1).P()
1378
+ sage: Z([2])*Z([3]) # indirect doctest
1379
+ 192/175*Z[3, 2] + 32/45*Z[4, 1] + Z[5]
1380
+ sage: Z([2])*JP([2])
1381
+ 10/27*Z[2, 1, 1] + 64/45*Z[2, 2] + 23/21*Z[3, 1] + Z[4]
1382
+ sage: JP = Sym.jack(t=2).P()
1383
+ sage: Z([2])*JP([2])
1384
+ 64/45*Z[2, 2] + 16/21*Z[3, 1] + Z[4]
1385
+ """
1386
+ return self(self._P(left) * self._P(right))
1387
+
1388
+ class Element(sfa.SymmetricFunctionAlgebra_generic.Element):
1389
+ def scalar_zonal(self, x):
1390
+ r"""
1391
+ The zonal scalar product has the power sum basis and the zonal
1392
+ symmetric functions are orthogonal. In particular,
1393
+ `\langle p_\mu, p_\mu \rangle = z_\mu 2^{length(\mu)}`.
1394
+
1395
+ INPUT:
1396
+
1397
+ - ``self`` -- an element of the zonal basis
1398
+ - ``x`` -- an element of the symmetric function
1399
+
1400
+ OUTPUT: the scalar product between ``self`` and ``x``
1401
+
1402
+ EXAMPLES::
1403
+
1404
+ sage: Sym = SymmetricFunctions(QQ)
1405
+ sage: Z = Sym.zonal()
1406
+ sage: parts = Partitions(3).list()
1407
+ sage: matrix([[Z(a).scalar_zonal(Z(b)) for a in parts] for b in parts])
1408
+ [16/5 0 0]
1409
+ [ 0 5 0]
1410
+ [ 0 0 4]
1411
+ sage: p = Z.symmetric_function_ring().power()
1412
+ sage: matrix([[Z(p(a)).scalar_zonal(p(b)) for a in parts] for b in parts])
1413
+ [ 6 0 0]
1414
+ [ 0 8 0]
1415
+ [ 0 0 48]
1416
+ """
1417
+ P = self.parent()._P
1418
+ return P(self).scalar_jack(P(x),2)
1419
+
1420
+
1421
+ # Backward compatibility for unpickling
1422
+ from sage.misc.persist import register_unpickle_override
1423
+
1424
+ register_unpickle_override('sage.combinat.sf.jack', 'JackPolynomial_qp', JackPolynomials_qp.Element)
1425
+ register_unpickle_override('sage.combinat.sf.jack', 'JackPolynomial_j', JackPolynomials_j.Element)
1426
+ register_unpickle_override('sage.combinat.sf.jack', 'JackPolynomial_p', JackPolynomials_p.Element)
1427
+ register_unpickle_override('sage.combinat.sf.jack', 'JackPolynomial_q', JackPolynomials_q.Element)
1428
+ #register_unpickle_override('sage.combinat.sf.jack', 'SymmetricFunctionAlgebra_zonal', SymmetricFunctionAlgebra_zonal.Element)