passagemath-combinat 10.6.42__cp314-cp314-musllinux_1_2_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (400) hide show
  1. passagemath_combinat/__init__.py +3 -0
  2. passagemath_combinat-10.6.42.dist-info/METADATA +160 -0
  3. passagemath_combinat-10.6.42.dist-info/RECORD +400 -0
  4. passagemath_combinat-10.6.42.dist-info/WHEEL +5 -0
  5. passagemath_combinat-10.6.42.dist-info/top_level.txt +3 -0
  6. passagemath_combinat.libs/libgmp-0e7fc84e.so.10.5.0 +0 -0
  7. passagemath_combinat.libs/libsymmetrica-81fe8739.so.3.0.0 +0 -0
  8. sage/algebras/affine_nil_temperley_lieb.py +263 -0
  9. sage/algebras/all.py +24 -0
  10. sage/algebras/all__sagemath_combinat.py +35 -0
  11. sage/algebras/askey_wilson.py +935 -0
  12. sage/algebras/associated_graded.py +345 -0
  13. sage/algebras/cellular_basis.py +350 -0
  14. sage/algebras/cluster_algebra.py +2766 -0
  15. sage/algebras/down_up_algebra.py +860 -0
  16. sage/algebras/free_algebra.py +1698 -0
  17. sage/algebras/free_algebra_element.py +345 -0
  18. sage/algebras/free_algebra_quotient.py +405 -0
  19. sage/algebras/free_algebra_quotient_element.py +295 -0
  20. sage/algebras/free_zinbiel_algebra.py +885 -0
  21. sage/algebras/hall_algebra.py +783 -0
  22. sage/algebras/hecke_algebras/all.py +4 -0
  23. sage/algebras/hecke_algebras/ariki_koike_algebra.py +1796 -0
  24. sage/algebras/hecke_algebras/ariki_koike_specht_modules.py +475 -0
  25. sage/algebras/hecke_algebras/cubic_hecke_algebra.py +3520 -0
  26. sage/algebras/hecke_algebras/cubic_hecke_base_ring.py +1473 -0
  27. sage/algebras/hecke_algebras/cubic_hecke_matrix_rep.py +1079 -0
  28. sage/algebras/iwahori_hecke_algebra.py +3095 -0
  29. sage/algebras/jordan_algebra.py +1773 -0
  30. sage/algebras/lie_conformal_algebras/abelian_lie_conformal_algebra.py +113 -0
  31. sage/algebras/lie_conformal_algebras/affine_lie_conformal_algebra.py +156 -0
  32. sage/algebras/lie_conformal_algebras/all.py +18 -0
  33. sage/algebras/lie_conformal_algebras/bosonic_ghosts_lie_conformal_algebra.py +134 -0
  34. sage/algebras/lie_conformal_algebras/examples.py +43 -0
  35. sage/algebras/lie_conformal_algebras/fermionic_ghosts_lie_conformal_algebra.py +131 -0
  36. sage/algebras/lie_conformal_algebras/finitely_freely_generated_lca.py +139 -0
  37. sage/algebras/lie_conformal_algebras/free_bosons_lie_conformal_algebra.py +174 -0
  38. sage/algebras/lie_conformal_algebras/free_fermions_lie_conformal_algebra.py +167 -0
  39. sage/algebras/lie_conformal_algebras/freely_generated_lie_conformal_algebra.py +107 -0
  40. sage/algebras/lie_conformal_algebras/graded_lie_conformal_algebra.py +135 -0
  41. sage/algebras/lie_conformal_algebras/lie_conformal_algebra.py +353 -0
  42. sage/algebras/lie_conformal_algebras/lie_conformal_algebra_element.py +236 -0
  43. sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_basis.py +78 -0
  44. sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py +328 -0
  45. sage/algebras/lie_conformal_algebras/n2_lie_conformal_algebra.py +117 -0
  46. sage/algebras/lie_conformal_algebras/neveu_schwarz_lie_conformal_algebra.py +86 -0
  47. sage/algebras/lie_conformal_algebras/virasoro_lie_conformal_algebra.py +82 -0
  48. sage/algebras/lie_conformal_algebras/weyl_lie_conformal_algebra.py +205 -0
  49. sage/algebras/nil_coxeter_algebra.py +191 -0
  50. sage/algebras/q_commuting_polynomials.py +673 -0
  51. sage/algebras/q_system.py +608 -0
  52. sage/algebras/quantum_clifford.py +959 -0
  53. sage/algebras/quantum_groups/ace_quantum_onsager.py +693 -0
  54. sage/algebras/quantum_groups/all.py +9 -0
  55. sage/algebras/quantum_groups/fock_space.py +2219 -0
  56. sage/algebras/quantum_groups/q_numbers.py +207 -0
  57. sage/algebras/quantum_groups/quantum_group_gap.py +2695 -0
  58. sage/algebras/quantum_groups/representations.py +591 -0
  59. sage/algebras/quantum_matrix_coordinate_algebra.py +1006 -0
  60. sage/algebras/quantum_oscillator.py +623 -0
  61. sage/algebras/quaternion_algebra.py +20 -0
  62. sage/algebras/quaternion_algebra_element.py +55 -0
  63. sage/algebras/rational_cherednik_algebra.py +525 -0
  64. sage/algebras/schur_algebra.py +670 -0
  65. sage/algebras/shuffle_algebra.py +1011 -0
  66. sage/algebras/splitting_algebra.py +779 -0
  67. sage/algebras/tensor_algebra.py +709 -0
  68. sage/algebras/yangian.py +1082 -0
  69. sage/algebras/yokonuma_hecke_algebra.py +1018 -0
  70. sage/all__sagemath_combinat.py +35 -0
  71. sage/combinat/SJT.py +255 -0
  72. sage/combinat/affine_permutation.py +2405 -0
  73. sage/combinat/algebraic_combinatorics.py +55 -0
  74. sage/combinat/all.py +53 -0
  75. sage/combinat/all__sagemath_combinat.py +195 -0
  76. sage/combinat/alternating_sign_matrix.py +2063 -0
  77. sage/combinat/baxter_permutations.py +346 -0
  78. sage/combinat/bijectionist.py +3220 -0
  79. sage/combinat/binary_recurrence_sequences.py +1180 -0
  80. sage/combinat/blob_algebra.py +685 -0
  81. sage/combinat/catalog_partitions.py +27 -0
  82. sage/combinat/chas/all.py +23 -0
  83. sage/combinat/chas/fsym.py +1180 -0
  84. sage/combinat/chas/wqsym.py +2601 -0
  85. sage/combinat/cluster_complex.py +326 -0
  86. sage/combinat/colored_permutations.py +2039 -0
  87. sage/combinat/colored_permutations_representations.py +964 -0
  88. sage/combinat/composition_signed.py +142 -0
  89. sage/combinat/composition_tableau.py +855 -0
  90. sage/combinat/constellation.py +1729 -0
  91. sage/combinat/core.py +751 -0
  92. sage/combinat/counting.py +12 -0
  93. sage/combinat/crystals/affine.py +742 -0
  94. sage/combinat/crystals/affine_factorization.py +518 -0
  95. sage/combinat/crystals/affinization.py +331 -0
  96. sage/combinat/crystals/alcove_path.py +2013 -0
  97. sage/combinat/crystals/all.py +22 -0
  98. sage/combinat/crystals/bkk_crystals.py +141 -0
  99. sage/combinat/crystals/catalog.py +115 -0
  100. sage/combinat/crystals/catalog_elementary_crystals.py +18 -0
  101. sage/combinat/crystals/catalog_infinity_crystals.py +33 -0
  102. sage/combinat/crystals/catalog_kirillov_reshetikhin.py +18 -0
  103. sage/combinat/crystals/crystals.py +257 -0
  104. sage/combinat/crystals/direct_sum.py +260 -0
  105. sage/combinat/crystals/elementary_crystals.py +1251 -0
  106. sage/combinat/crystals/fast_crystals.py +441 -0
  107. sage/combinat/crystals/fully_commutative_stable_grothendieck.py +1205 -0
  108. sage/combinat/crystals/generalized_young_walls.py +1076 -0
  109. sage/combinat/crystals/highest_weight_crystals.py +436 -0
  110. sage/combinat/crystals/induced_structure.py +695 -0
  111. sage/combinat/crystals/infinity_crystals.py +730 -0
  112. sage/combinat/crystals/kac_modules.py +863 -0
  113. sage/combinat/crystals/kirillov_reshetikhin.py +4196 -0
  114. sage/combinat/crystals/kyoto_path_model.py +497 -0
  115. sage/combinat/crystals/letters.cpython-314-x86_64-linux-musl.so +0 -0
  116. sage/combinat/crystals/letters.pxd +79 -0
  117. sage/combinat/crystals/letters.pyx +3056 -0
  118. sage/combinat/crystals/littelmann_path.py +1518 -0
  119. sage/combinat/crystals/monomial_crystals.py +1262 -0
  120. sage/combinat/crystals/multisegments.py +462 -0
  121. sage/combinat/crystals/mv_polytopes.py +467 -0
  122. sage/combinat/crystals/pbw_crystal.py +511 -0
  123. sage/combinat/crystals/pbw_datum.cpython-314-x86_64-linux-musl.so +0 -0
  124. sage/combinat/crystals/pbw_datum.pxd +4 -0
  125. sage/combinat/crystals/pbw_datum.pyx +487 -0
  126. sage/combinat/crystals/polyhedral_realization.py +372 -0
  127. sage/combinat/crystals/spins.cpython-314-x86_64-linux-musl.so +0 -0
  128. sage/combinat/crystals/spins.pxd +21 -0
  129. sage/combinat/crystals/spins.pyx +756 -0
  130. sage/combinat/crystals/star_crystal.py +290 -0
  131. sage/combinat/crystals/subcrystal.py +464 -0
  132. sage/combinat/crystals/tensor_product.py +1177 -0
  133. sage/combinat/crystals/tensor_product_element.cpython-314-x86_64-linux-musl.so +0 -0
  134. sage/combinat/crystals/tensor_product_element.pxd +35 -0
  135. sage/combinat/crystals/tensor_product_element.pyx +1870 -0
  136. sage/combinat/crystals/virtual_crystal.py +420 -0
  137. sage/combinat/cyclic_sieving_phenomenon.py +204 -0
  138. sage/combinat/debruijn_sequence.cpython-314-x86_64-linux-musl.so +0 -0
  139. sage/combinat/debruijn_sequence.pyx +355 -0
  140. sage/combinat/decorated_permutation.py +270 -0
  141. sage/combinat/degree_sequences.cpython-314-x86_64-linux-musl.so +0 -0
  142. sage/combinat/degree_sequences.pyx +588 -0
  143. sage/combinat/derangements.py +527 -0
  144. sage/combinat/descent_algebra.py +1008 -0
  145. sage/combinat/diagram.py +1551 -0
  146. sage/combinat/diagram_algebras.py +5886 -0
  147. sage/combinat/dyck_word.py +4349 -0
  148. sage/combinat/e_one_star.py +1623 -0
  149. sage/combinat/enumerated_sets.py +123 -0
  150. sage/combinat/expnums.cpython-314-x86_64-linux-musl.so +0 -0
  151. sage/combinat/expnums.pyx +148 -0
  152. sage/combinat/fast_vector_partitions.cpython-314-x86_64-linux-musl.so +0 -0
  153. sage/combinat/fast_vector_partitions.pyx +346 -0
  154. sage/combinat/fqsym.py +1977 -0
  155. sage/combinat/free_dendriform_algebra.py +954 -0
  156. sage/combinat/free_prelie_algebra.py +1141 -0
  157. sage/combinat/fully_commutative_elements.py +1077 -0
  158. sage/combinat/fully_packed_loop.py +1523 -0
  159. sage/combinat/gelfand_tsetlin_patterns.py +1409 -0
  160. sage/combinat/gray_codes.py +311 -0
  161. sage/combinat/grossman_larson_algebras.py +667 -0
  162. sage/combinat/growth.py +4352 -0
  163. sage/combinat/hall_polynomial.py +188 -0
  164. sage/combinat/hillman_grassl.py +866 -0
  165. sage/combinat/integer_matrices.py +329 -0
  166. sage/combinat/integer_vectors_mod_permgroup.py +1238 -0
  167. sage/combinat/k_tableau.py +4564 -0
  168. sage/combinat/kazhdan_lusztig.py +215 -0
  169. sage/combinat/key_polynomial.py +885 -0
  170. sage/combinat/knutson_tao_puzzles.py +2286 -0
  171. sage/combinat/lr_tableau.py +311 -0
  172. sage/combinat/matrices/all.py +24 -0
  173. sage/combinat/matrices/hadamard_matrix.py +3790 -0
  174. sage/combinat/matrices/latin.py +2912 -0
  175. sage/combinat/misc.py +401 -0
  176. sage/combinat/multiset_partition_into_sets_ordered.py +3541 -0
  177. sage/combinat/ncsf_qsym/all.py +21 -0
  178. sage/combinat/ncsf_qsym/combinatorics.py +317 -0
  179. sage/combinat/ncsf_qsym/generic_basis_code.py +1427 -0
  180. sage/combinat/ncsf_qsym/ncsf.py +5637 -0
  181. sage/combinat/ncsf_qsym/qsym.py +4053 -0
  182. sage/combinat/ncsf_qsym/tutorial.py +447 -0
  183. sage/combinat/ncsym/all.py +21 -0
  184. sage/combinat/ncsym/bases.py +855 -0
  185. sage/combinat/ncsym/dual.py +593 -0
  186. sage/combinat/ncsym/ncsym.py +2076 -0
  187. sage/combinat/necklace.py +551 -0
  188. sage/combinat/non_decreasing_parking_function.py +634 -0
  189. sage/combinat/nu_dyck_word.py +1474 -0
  190. sage/combinat/output.py +861 -0
  191. sage/combinat/parallelogram_polyomino.py +4326 -0
  192. sage/combinat/parking_functions.py +1602 -0
  193. sage/combinat/partition_algebra.py +1998 -0
  194. sage/combinat/partition_kleshchev.py +1982 -0
  195. sage/combinat/partition_shifting_algebras.py +584 -0
  196. sage/combinat/partition_tuple.py +3114 -0
  197. sage/combinat/path_tableaux/all.py +13 -0
  198. sage/combinat/path_tableaux/catalog.py +29 -0
  199. sage/combinat/path_tableaux/dyck_path.py +380 -0
  200. sage/combinat/path_tableaux/frieze.py +476 -0
  201. sage/combinat/path_tableaux/path_tableau.py +728 -0
  202. sage/combinat/path_tableaux/semistandard.py +510 -0
  203. sage/combinat/perfect_matching.py +779 -0
  204. sage/combinat/plane_partition.py +3300 -0
  205. sage/combinat/q_bernoulli.cpython-314-x86_64-linux-musl.so +0 -0
  206. sage/combinat/q_bernoulli.pyx +128 -0
  207. sage/combinat/quickref.py +81 -0
  208. sage/combinat/recognizable_series.py +2051 -0
  209. sage/combinat/regular_sequence.py +4316 -0
  210. sage/combinat/regular_sequence_bounded.py +543 -0
  211. sage/combinat/restricted_growth.py +81 -0
  212. sage/combinat/ribbon.py +20 -0
  213. sage/combinat/ribbon_shaped_tableau.py +489 -0
  214. sage/combinat/ribbon_tableau.py +1180 -0
  215. sage/combinat/rigged_configurations/all.py +46 -0
  216. sage/combinat/rigged_configurations/bij_abstract_class.py +548 -0
  217. sage/combinat/rigged_configurations/bij_infinity.py +370 -0
  218. sage/combinat/rigged_configurations/bij_type_A.py +163 -0
  219. sage/combinat/rigged_configurations/bij_type_A2_dual.py +338 -0
  220. sage/combinat/rigged_configurations/bij_type_A2_even.py +218 -0
  221. sage/combinat/rigged_configurations/bij_type_A2_odd.py +199 -0
  222. sage/combinat/rigged_configurations/bij_type_B.py +900 -0
  223. sage/combinat/rigged_configurations/bij_type_C.py +267 -0
  224. sage/combinat/rigged_configurations/bij_type_D.py +771 -0
  225. sage/combinat/rigged_configurations/bij_type_D_tri.py +392 -0
  226. sage/combinat/rigged_configurations/bij_type_D_twisted.py +576 -0
  227. sage/combinat/rigged_configurations/bij_type_E67.py +402 -0
  228. sage/combinat/rigged_configurations/bijection.py +143 -0
  229. sage/combinat/rigged_configurations/kleber_tree.py +1475 -0
  230. sage/combinat/rigged_configurations/kr_tableaux.py +1898 -0
  231. sage/combinat/rigged_configurations/rc_crystal.py +461 -0
  232. sage/combinat/rigged_configurations/rc_infinity.py +540 -0
  233. sage/combinat/rigged_configurations/rigged_configuration_element.py +2403 -0
  234. sage/combinat/rigged_configurations/rigged_configurations.py +1918 -0
  235. sage/combinat/rigged_configurations/rigged_partition.cpython-314-x86_64-linux-musl.so +0 -0
  236. sage/combinat/rigged_configurations/rigged_partition.pxd +15 -0
  237. sage/combinat/rigged_configurations/rigged_partition.pyx +680 -0
  238. sage/combinat/rigged_configurations/tensor_product_kr_tableaux.py +499 -0
  239. sage/combinat/rigged_configurations/tensor_product_kr_tableaux_element.py +428 -0
  240. sage/combinat/rsk.py +3438 -0
  241. sage/combinat/schubert_polynomial.py +508 -0
  242. sage/combinat/set_partition.py +3318 -0
  243. sage/combinat/set_partition_iterator.cpython-314-x86_64-linux-musl.so +0 -0
  244. sage/combinat/set_partition_iterator.pyx +136 -0
  245. sage/combinat/set_partition_ordered.py +1590 -0
  246. sage/combinat/sf/abreu_nigro.py +346 -0
  247. sage/combinat/sf/all.py +52 -0
  248. sage/combinat/sf/character.py +576 -0
  249. sage/combinat/sf/classical.py +319 -0
  250. sage/combinat/sf/dual.py +996 -0
  251. sage/combinat/sf/elementary.py +549 -0
  252. sage/combinat/sf/hall_littlewood.py +1028 -0
  253. sage/combinat/sf/hecke.py +336 -0
  254. sage/combinat/sf/homogeneous.py +464 -0
  255. sage/combinat/sf/jack.py +1428 -0
  256. sage/combinat/sf/k_dual.py +1458 -0
  257. sage/combinat/sf/kfpoly.py +447 -0
  258. sage/combinat/sf/llt.py +789 -0
  259. sage/combinat/sf/macdonald.py +2019 -0
  260. sage/combinat/sf/monomial.py +525 -0
  261. sage/combinat/sf/multiplicative.py +113 -0
  262. sage/combinat/sf/new_kschur.py +1786 -0
  263. sage/combinat/sf/ns_macdonald.py +964 -0
  264. sage/combinat/sf/orthogonal.py +246 -0
  265. sage/combinat/sf/orthotriang.py +355 -0
  266. sage/combinat/sf/powersum.py +963 -0
  267. sage/combinat/sf/schur.py +880 -0
  268. sage/combinat/sf/sf.py +1653 -0
  269. sage/combinat/sf/sfa.py +7053 -0
  270. sage/combinat/sf/symplectic.py +253 -0
  271. sage/combinat/sf/witt.py +721 -0
  272. sage/combinat/shifted_primed_tableau.py +2735 -0
  273. sage/combinat/shuffle.py +830 -0
  274. sage/combinat/sidon_sets.py +146 -0
  275. sage/combinat/similarity_class_type.py +1721 -0
  276. sage/combinat/sine_gordon.py +618 -0
  277. sage/combinat/six_vertex_model.py +784 -0
  278. sage/combinat/skew_partition.py +2053 -0
  279. sage/combinat/skew_tableau.py +2989 -0
  280. sage/combinat/sloane_functions.py +8935 -0
  281. sage/combinat/specht_module.py +1403 -0
  282. sage/combinat/species/all.py +48 -0
  283. sage/combinat/species/characteristic_species.py +321 -0
  284. sage/combinat/species/composition_species.py +273 -0
  285. sage/combinat/species/cycle_species.py +284 -0
  286. sage/combinat/species/empty_species.py +155 -0
  287. sage/combinat/species/functorial_composition_species.py +148 -0
  288. sage/combinat/species/generating_series.py +673 -0
  289. sage/combinat/species/library.py +148 -0
  290. sage/combinat/species/linear_order_species.py +169 -0
  291. sage/combinat/species/misc.py +83 -0
  292. sage/combinat/species/partition_species.py +290 -0
  293. sage/combinat/species/permutation_species.py +268 -0
  294. sage/combinat/species/product_species.py +423 -0
  295. sage/combinat/species/recursive_species.py +476 -0
  296. sage/combinat/species/set_species.py +192 -0
  297. sage/combinat/species/species.py +820 -0
  298. sage/combinat/species/structure.py +539 -0
  299. sage/combinat/species/subset_species.py +243 -0
  300. sage/combinat/species/sum_species.py +225 -0
  301. sage/combinat/subword.py +564 -0
  302. sage/combinat/subword_complex.py +2122 -0
  303. sage/combinat/subword_complex_c.cpython-314-x86_64-linux-musl.so +0 -0
  304. sage/combinat/subword_complex_c.pyx +119 -0
  305. sage/combinat/super_tableau.py +821 -0
  306. sage/combinat/superpartition.py +1154 -0
  307. sage/combinat/symmetric_group_algebra.py +3774 -0
  308. sage/combinat/symmetric_group_representations.py +1830 -0
  309. sage/combinat/t_sequences.py +877 -0
  310. sage/combinat/tableau.py +9506 -0
  311. sage/combinat/tableau_residues.py +860 -0
  312. sage/combinat/tableau_tuple.py +5353 -0
  313. sage/combinat/tiling.py +2432 -0
  314. sage/combinat/triangles_FHM.py +777 -0
  315. sage/combinat/tutorial.py +1857 -0
  316. sage/combinat/vector_partition.py +337 -0
  317. sage/combinat/words/abstract_word.py +1722 -0
  318. sage/combinat/words/all.py +59 -0
  319. sage/combinat/words/alphabet.py +268 -0
  320. sage/combinat/words/finite_word.py +7201 -0
  321. sage/combinat/words/infinite_word.py +113 -0
  322. sage/combinat/words/lyndon_word.py +652 -0
  323. sage/combinat/words/morphic.py +351 -0
  324. sage/combinat/words/morphism.py +3878 -0
  325. sage/combinat/words/paths.py +2932 -0
  326. sage/combinat/words/shuffle_product.py +278 -0
  327. sage/combinat/words/suffix_trees.py +1873 -0
  328. sage/combinat/words/word.py +769 -0
  329. sage/combinat/words/word_char.cpython-314-x86_64-linux-musl.so +0 -0
  330. sage/combinat/words/word_char.pyx +847 -0
  331. sage/combinat/words/word_datatypes.cpython-314-x86_64-linux-musl.so +0 -0
  332. sage/combinat/words/word_datatypes.pxd +4 -0
  333. sage/combinat/words/word_datatypes.pyx +1067 -0
  334. sage/combinat/words/word_generators.py +2026 -0
  335. sage/combinat/words/word_infinite_datatypes.py +1218 -0
  336. sage/combinat/words/word_options.py +99 -0
  337. sage/combinat/words/words.py +2396 -0
  338. sage/data_structures/all__sagemath_combinat.py +1 -0
  339. sage/databases/all__sagemath_combinat.py +13 -0
  340. sage/databases/findstat.py +4897 -0
  341. sage/databases/oeis.py +2058 -0
  342. sage/databases/sloane.py +393 -0
  343. sage/dynamics/all__sagemath_combinat.py +14 -0
  344. sage/dynamics/cellular_automata/all.py +7 -0
  345. sage/dynamics/cellular_automata/catalog.py +34 -0
  346. sage/dynamics/cellular_automata/elementary.py +612 -0
  347. sage/dynamics/cellular_automata/glca.py +477 -0
  348. sage/dynamics/cellular_automata/solitons.py +1463 -0
  349. sage/dynamics/finite_dynamical_system.py +1249 -0
  350. sage/dynamics/finite_dynamical_system_catalog.py +382 -0
  351. sage/games/all.py +7 -0
  352. sage/games/hexad.py +704 -0
  353. sage/games/quantumino.py +591 -0
  354. sage/games/sudoku.py +889 -0
  355. sage/games/sudoku_backtrack.cpython-314-x86_64-linux-musl.so +0 -0
  356. sage/games/sudoku_backtrack.pyx +189 -0
  357. sage/groups/all__sagemath_combinat.py +1 -0
  358. sage/groups/indexed_free_group.py +489 -0
  359. sage/libs/all__sagemath_combinat.py +6 -0
  360. sage/libs/lrcalc/__init__.py +1 -0
  361. sage/libs/lrcalc/lrcalc.py +525 -0
  362. sage/libs/symmetrica/__init__.py +7 -0
  363. sage/libs/symmetrica/all.py +101 -0
  364. sage/libs/symmetrica/kostka.pxi +168 -0
  365. sage/libs/symmetrica/part.pxi +193 -0
  366. sage/libs/symmetrica/plet.pxi +42 -0
  367. sage/libs/symmetrica/sab.pxi +196 -0
  368. sage/libs/symmetrica/sb.pxi +332 -0
  369. sage/libs/symmetrica/sc.pxi +192 -0
  370. sage/libs/symmetrica/schur.pxi +956 -0
  371. sage/libs/symmetrica/symmetrica.cpython-314-x86_64-linux-musl.so +0 -0
  372. sage/libs/symmetrica/symmetrica.pxi +1172 -0
  373. sage/libs/symmetrica/symmetrica.pyx +39 -0
  374. sage/monoids/all.py +13 -0
  375. sage/monoids/automatic_semigroup.py +1054 -0
  376. sage/monoids/free_abelian_monoid.py +315 -0
  377. sage/monoids/free_abelian_monoid_element.cpython-314-x86_64-linux-musl.so +0 -0
  378. sage/monoids/free_abelian_monoid_element.pxd +16 -0
  379. sage/monoids/free_abelian_monoid_element.pyx +397 -0
  380. sage/monoids/free_monoid.py +335 -0
  381. sage/monoids/free_monoid_element.py +431 -0
  382. sage/monoids/hecke_monoid.py +65 -0
  383. sage/monoids/string_monoid.py +817 -0
  384. sage/monoids/string_monoid_element.py +547 -0
  385. sage/monoids/string_ops.py +143 -0
  386. sage/monoids/trace_monoid.py +972 -0
  387. sage/rings/all__sagemath_combinat.py +2 -0
  388. sage/sat/all.py +4 -0
  389. sage/sat/boolean_polynomials.py +405 -0
  390. sage/sat/converters/__init__.py +6 -0
  391. sage/sat/converters/anf2cnf.py +14 -0
  392. sage/sat/converters/polybori.py +611 -0
  393. sage/sat/solvers/__init__.py +5 -0
  394. sage/sat/solvers/cryptominisat.py +287 -0
  395. sage/sat/solvers/dimacs.py +783 -0
  396. sage/sat/solvers/picosat.py +228 -0
  397. sage/sat/solvers/sat_lp.py +156 -0
  398. sage/sat/solvers/satsolver.cpython-314-x86_64-linux-musl.so +0 -0
  399. sage/sat/solvers/satsolver.pxd +3 -0
  400. sage/sat/solvers/satsolver.pyx +405 -0
@@ -0,0 +1,673 @@
1
+ # sage_setup: distribution = sagemath-combinat
2
+ r"""
3
+ Generating series
4
+
5
+ This file makes a number of extensions to lazy power series by
6
+ endowing them with some semantic content for how they're to be
7
+ interpreted.
8
+
9
+ This code is based on the work of Ralf Hemmecke and Martin Rubey's
10
+ Aldor-Combinat, which can be found at
11
+ http://www.risc.uni-linz.ac.at/people/hemmecke/aldor/combinat/index.html.
12
+ In particular, the relevant section for this file can be found at
13
+ http://www.risc.uni-linz.ac.at/people/hemmecke/AldorCombinat/combinatse10.html.
14
+ One notable difference is that we use power-sum symmetric functions
15
+ as the coefficients of our cycle index series.
16
+
17
+ TESTS::
18
+
19
+ sage: # needs sage.modules
20
+ sage: from sage.combinat.species.generating_series import CycleIndexSeriesRing
21
+ sage: p = SymmetricFunctions(QQ).power()
22
+ sage: CIS = CycleIndexSeriesRing(QQ)
23
+ sage: geo1 = CIS(lambda i: p([1])^i)
24
+ sage: geo2 = CIS(lambda i: p([2])^(i // 2) if is_even(i) else 0)
25
+ sage: s = geo1 * geo2
26
+ sage: s[0]
27
+ p[]
28
+ sage: s[1]
29
+ p[1]
30
+ sage: s[2]
31
+ p[1, 1] + p[2]
32
+ sage: s[3]
33
+ p[1, 1, 1] + p[2, 1]
34
+ """
35
+
36
+ # ****************************************************************************
37
+ # Copyright (C) 2008 Mike Hansen <mhansen@gmail.com>
38
+ #
39
+ # This program is free software: you can redistribute it and/or modify
40
+ # it under the terms of the GNU General Public License as published by
41
+ # the Free Software Foundation, either version 2 of the License, or
42
+ # (at your option) any later version.
43
+ # https://www.gnu.org/licenses/
44
+ # ****************************************************************************
45
+
46
+ from sage.rings.lazy_series import LazyPowerSeries, LazySymmetricFunction
47
+ from sage.rings.lazy_series_ring import LazyPowerSeriesRing, LazySymmetricFunctions
48
+ from sage.rings.integer import Integer
49
+ from sage.rings.rational_field import QQ
50
+ from sage.arith.misc import divisors, factorial
51
+ from sage.combinat.partition import Partition, Partitions
52
+ from sage.misc.cachefunc import cached_function
53
+ from sage.misc.lazy_import import lazy_import
54
+
55
+ lazy_import('sage.combinat.sf.sf', 'SymmetricFunctions')
56
+
57
+
58
+ class OrdinaryGeneratingSeries(LazyPowerSeries):
59
+ r"""
60
+ A class for ordinary generating series.
61
+
62
+ Note that it is just a :class:`LazyPowerSeries` whose elements
63
+ have some extra methods.
64
+
65
+ EXAMPLES::
66
+
67
+ sage: from sage.combinat.species.generating_series import OrdinaryGeneratingSeriesRing
68
+ sage: R = OrdinaryGeneratingSeriesRing(QQ)
69
+ sage: f = R(lambda n: n)
70
+ sage: f
71
+ z + 2*z^2 + 3*z^3 + 4*z^4 + 5*z^5 + 6*z^6 + O(z^7)
72
+ """
73
+
74
+ def count(self, n):
75
+ """
76
+ Return the number of structures on a set of size ``n``.
77
+
78
+ INPUT:
79
+
80
+ - ``n`` -- the size of the set
81
+
82
+ EXAMPLES::
83
+
84
+ sage: from sage.combinat.species.generating_series import OrdinaryGeneratingSeriesRing
85
+ sage: R = OrdinaryGeneratingSeriesRing(QQ)
86
+ sage: f = R(range(20))
87
+ sage: f.count(10)
88
+ 10
89
+ """
90
+ return self.coefficient(n)
91
+
92
+ def counts(self, n):
93
+ """
94
+ Return the number of structures on a set for size ``i`` for
95
+ each ``i`` in ``range(n)``.
96
+
97
+ EXAMPLES::
98
+
99
+ sage: from sage.combinat.species.generating_series import OrdinaryGeneratingSeriesRing
100
+ sage: R = OrdinaryGeneratingSeriesRing(QQ)
101
+ sage: f = R(range(20))
102
+ sage: f.counts(10)
103
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
104
+ """
105
+ return [self.count(i) for i in range(n)]
106
+
107
+
108
+ class OrdinaryGeneratingSeriesRing(LazyPowerSeriesRing):
109
+ r"""
110
+ Return the ring of ordinary generating series over ``R``.
111
+
112
+ Note that it is just a
113
+ :class:`LazyPowerSeriesRing` whose elements have
114
+ some extra methods.
115
+
116
+ EXAMPLES::
117
+
118
+ sage: from sage.combinat.species.generating_series import OrdinaryGeneratingSeriesRing
119
+ sage: R = OrdinaryGeneratingSeriesRing(QQ); R
120
+ Lazy Taylor Series Ring in z over Rational Field
121
+ sage: [R(lambda n: 1).coefficient(i) for i in range(4)]
122
+ [1, 1, 1, 1]
123
+ sage: R(lambda n: 1).counts(4)
124
+ [1, 1, 1, 1]
125
+ sage: R == loads(dumps(R))
126
+ True
127
+
128
+ TESTS:
129
+
130
+ We test to make sure that caching works::
131
+
132
+ sage: R is OrdinaryGeneratingSeriesRing(QQ)
133
+ True
134
+ """
135
+
136
+ def __init__(self, base_ring):
137
+ """
138
+ Initialize ``self``.
139
+
140
+ TESTS::
141
+
142
+ sage: from sage.combinat.species.generating_series import OrdinaryGeneratingSeriesRing
143
+ sage: OrdinaryGeneratingSeriesRing.options.halting_precision(15)
144
+ sage: R = OrdinaryGeneratingSeriesRing(QQ)
145
+ sage: TestSuite(R).run(skip="_test_construction")
146
+
147
+ sage: OrdinaryGeneratingSeriesRing.options._reset() # reset options
148
+ """
149
+ super().__init__(base_ring, names='z')
150
+
151
+ Element = OrdinaryGeneratingSeries
152
+
153
+
154
+ class ExponentialGeneratingSeries(LazyPowerSeries):
155
+ r"""
156
+ A class for ordinary generating series.
157
+
158
+ Note that it is just a
159
+ :class:`LazyPowerSeries` whose elements have
160
+ some extra methods.
161
+
162
+ EXAMPLES::
163
+
164
+ sage: from sage.combinat.species.generating_series import OrdinaryGeneratingSeriesRing
165
+ sage: R = OrdinaryGeneratingSeriesRing(QQ)
166
+ sage: f = R(lambda n: n)
167
+ sage: f
168
+ z + 2*z^2 + 3*z^3 + 4*z^4 + 5*z^5 + 6*z^6 + O(z^7)
169
+ """
170
+
171
+ def count(self, n):
172
+ """
173
+ Return the number of structures of size ``n``.
174
+
175
+ EXAMPLES::
176
+
177
+ sage: from sage.combinat.species.generating_series import ExponentialGeneratingSeriesRing
178
+ sage: R = ExponentialGeneratingSeriesRing(QQ)
179
+ sage: f = R(lambda n: 1)
180
+ sage: [f.count(i) for i in range(7)]
181
+ [1, 1, 2, 6, 24, 120, 720]
182
+ """
183
+ return factorial(n) * self.coefficient(n)
184
+
185
+ def counts(self, n):
186
+ """
187
+ Return the number of structures on a set for size ``i`` for
188
+ each ``i`` in ``range(n)``.
189
+
190
+ EXAMPLES::
191
+
192
+ sage: from sage.combinat.species.generating_series import ExponentialGeneratingSeriesRing
193
+ sage: R = ExponentialGeneratingSeriesRing(QQ)
194
+ sage: f = R(range(20))
195
+ sage: f.counts(5)
196
+ [0, 1, 4, 18, 96]
197
+ """
198
+ return [self.count(i) for i in range(n)]
199
+
200
+ def functorial_composition(self, y):
201
+ r"""
202
+ Return the exponential generating series which is the functorial
203
+ composition of ``self`` with ``y``.
204
+
205
+ If `f = \sum_{n=0}^{\infty} f_n \frac{x^n}{n!}` and
206
+ `g = \sum_{n=0}^{\infty} g_n \frac{x^n}{n!}`, then
207
+ functorial composition `f \Box g` is defined as
208
+
209
+ .. MATH::
210
+
211
+ f \Box g = \sum_{n=0}^{\infty} f_{g_n} \frac{x^n}{n!}.
212
+
213
+ REFERENCES:
214
+
215
+ - Section 2.2 of [BLL1998]_.
216
+
217
+ EXAMPLES::
218
+
219
+ sage: G = species.SimpleGraphSpecies()
220
+ sage: g = G.generating_series()
221
+ sage: [g.coefficient(i) for i in range(10)]
222
+ [1, 1, 1, 4/3, 8/3, 128/15, 2048/45, 131072/315, 2097152/315, 536870912/2835]
223
+
224
+ sage: E = species.SetSpecies()
225
+ sage: E2 = E.restricted(min=2, max=3)
226
+ sage: WP = species.SubsetSpecies()
227
+ sage: P2 = E2*E
228
+ sage: g1 = WP.generating_series()
229
+ sage: g2 = P2.generating_series()
230
+ sage: g1.functorial_composition(g2)[:10]
231
+ [1, 1, 1, 4/3, 8/3, 128/15, 2048/45, 131072/315, 2097152/315, 536870912/2835]
232
+ """
233
+ P = self.parent()
234
+ return P(lambda n: self.count(y.count(n)) / factorial(n), 0)
235
+
236
+
237
+ class ExponentialGeneratingSeriesRing(LazyPowerSeriesRing):
238
+ r"""
239
+ Return the ring of exponential generating series over ``R``.
240
+
241
+ Note that it is just a
242
+ :class:`LazyPowerSeriesRing` whose elements have
243
+ some extra methods.
244
+
245
+ EXAMPLES::
246
+
247
+ sage: from sage.combinat.species.generating_series import ExponentialGeneratingSeriesRing
248
+ sage: R = ExponentialGeneratingSeriesRing(QQ); R
249
+ Lazy Taylor Series Ring in z over Rational Field
250
+ sage: [R(lambda n: 1).coefficient(i) for i in range(4)]
251
+ [1, 1, 1, 1]
252
+ sage: R(lambda n: 1).counts(4)
253
+ [1, 1, 2, 6]
254
+
255
+ TESTS:
256
+
257
+ We test to make sure that caching works::
258
+
259
+ sage: R is ExponentialGeneratingSeriesRing(QQ)
260
+ True
261
+ """
262
+
263
+ def __init__(self, base_ring):
264
+ """
265
+ Initialize ``self``.
266
+
267
+ TESTS::
268
+
269
+ sage: from sage.combinat.species.generating_series import ExponentialGeneratingSeriesRing
270
+ sage: ExponentialGeneratingSeriesRing.options.halting_precision(15)
271
+ sage: R = ExponentialGeneratingSeriesRing(QQ)
272
+ sage: TestSuite(R).run(skip="_test_construction")
273
+
274
+ sage: ExponentialGeneratingSeriesRing.options._reset() # reset options
275
+ """
276
+ super().__init__(base_ring, names='z')
277
+
278
+ Element = ExponentialGeneratingSeries
279
+
280
+
281
+ class CycleIndexSeries(LazySymmetricFunction):
282
+ def count(self, t):
283
+ """
284
+ Return the number of structures corresponding to a certain cycle
285
+ type ``t``.
286
+
287
+ EXAMPLES::
288
+
289
+ sage: # needs sage.modules
290
+ sage: from sage.combinat.species.generating_series import CycleIndexSeriesRing
291
+ sage: p = SymmetricFunctions(QQ).power()
292
+ sage: CIS = CycleIndexSeriesRing(QQ)
293
+ sage: f = CIS([0, p([1]), 2*p([1,1]), 3*p([2,1])])
294
+ sage: f.count([1])
295
+ 1
296
+ sage: f.count([1,1])
297
+ 4
298
+ sage: f.count([2,1])
299
+ 6
300
+ """
301
+ t = Partition(t)
302
+ return t.aut() * self.coefficient_cycle_type(t)
303
+
304
+ def coefficient_cycle_type(self, t):
305
+ """
306
+ Return the coefficient of a cycle type ``t`` in ``self``.
307
+
308
+ EXAMPLES::
309
+
310
+ sage: # needs sage.modules
311
+ sage: from sage.combinat.species.generating_series import CycleIndexSeriesRing
312
+ sage: p = SymmetricFunctions(QQ).power()
313
+ sage: CIS = CycleIndexSeriesRing(QQ)
314
+ sage: f = CIS([0, p([1]), 2*p([1,1]),3*p([2,1])])
315
+ sage: f.coefficient_cycle_type([1])
316
+ 1
317
+ sage: f.coefficient_cycle_type([1,1])
318
+ 2
319
+ sage: f.coefficient_cycle_type([2,1])
320
+ 3
321
+ """
322
+ t = Partition(t)
323
+ p = self.coefficient(t.size())
324
+ return p.coefficient(t)
325
+
326
+ def isotype_generating_series(self):
327
+ """
328
+ Return the isotype generating series of ``self``.
329
+
330
+ EXAMPLES::
331
+
332
+ sage: P = species.PermutationSpecies()
333
+ sage: cis = P.cycle_index_series() # needs sage.modules
334
+ sage: f = cis.isotype_generating_series() # needs sage.modules
335
+ sage: f[:10] # needs sage.modules
336
+ [1, 1, 2, 3, 5, 7, 11, 15, 22, 30]
337
+ """
338
+ R = self.base_ring()
339
+ OGS = OrdinaryGeneratingSeriesRing(R)
340
+ return OGS(lambda n: self._ogs_gen(n, self._coeff_stream._approximate_order),
341
+ self._coeff_stream._approximate_order)
342
+
343
+ def _ogs_gen(self, n, ao):
344
+ """
345
+ Return a generator for the coefficients of the ordinary generating
346
+ series obtained from a cycle index series.
347
+
348
+ EXAMPLES::
349
+
350
+ sage: P = species.PermutationSpecies()
351
+ sage: cis = P.cycle_index_series() # needs sage.modules
352
+ sage: [cis._ogs_gen(i, 0) for i in range(10)] # needs sage.modules
353
+ [1, 1, 2, 3, 5, 7, 11, 15, 22, 30]
354
+ """
355
+ if n < ao:
356
+ return 0
357
+ return sum(self.coefficient(n).coefficients())
358
+
359
+ def generating_series(self):
360
+ """
361
+ Return the generating series of ``self``.
362
+
363
+ EXAMPLES::
364
+
365
+ sage: P = species.PartitionSpecies()
366
+ sage: cis = P.cycle_index_series() # needs sage.modules
367
+ sage: f = cis.generating_series() # needs sage.modules
368
+ sage: f[:5] # needs sage.modules
369
+ [1, 1, 1, 5/6, 5/8]
370
+ """
371
+ R = self.base_ring()
372
+ EGS = ExponentialGeneratingSeriesRing(R)
373
+ return EGS(lambda n: self._egs_gen(n, self._coeff_stream._approximate_order),
374
+ self._coeff_stream._approximate_order)
375
+
376
+ def _egs_gen(self, n, ao):
377
+ """
378
+ Return a generator for the coefficients of the exponential
379
+ generating series obtained from a cycle index series.
380
+
381
+ EXAMPLES::
382
+
383
+ sage: P = species.PermutationSpecies()
384
+ sage: cis = P.cycle_index_series() # needs sage.modules
385
+ sage: [cis._egs_gen(i, 0) for i in range(10)] # needs sage.modules
386
+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
387
+ """
388
+ if n < ao:
389
+ return 0
390
+ return self.coefficient(n).coefficient([1]*n)
391
+
392
+ def derivative(self, n=1):
393
+ r"""
394
+ Return the species-theoretic `n`-th derivative of ``self``.
395
+
396
+ For a cycle index series `F (p_{1}, p_{2}, p_{3}, \ldots)`, its
397
+ derivative is the cycle index series `F' = D_{p_{1}} F` (that is,
398
+ the formal derivative of `F` with respect to the variable `p_{1}`).
399
+
400
+ If `F` is the cycle index series of a species `S` then `F'` is the
401
+ cycle index series of an associated species `S'` of `S`-structures
402
+ with a "hole".
403
+
404
+ EXAMPLES:
405
+
406
+ The species `E` of sets satisfies the relationship `E' = E`::
407
+
408
+ sage: E = species.SetSpecies().cycle_index_series() # needs sage.modules
409
+ sage: E[:8] == E.derivative()[:8] # needs sage.modules
410
+ True
411
+
412
+ The species `C` of cyclic orderings and the species `L` of linear
413
+ orderings satisfy the relationship `C' = L`::
414
+
415
+ sage: C = species.CycleSpecies().cycle_index_series() # needs sage.modules
416
+ sage: L = species.LinearOrderSpecies().cycle_index_series() # needs sage.modules
417
+ sage: L[:8] == C.derivative()[:8] # needs sage.libs.pari sage.modules
418
+ True
419
+ """
420
+ return self.derivative_with_respect_to_p1(n=n)
421
+
422
+ def pointing(self):
423
+ r"""
424
+ Return the species-theoretic pointing of ``self``.
425
+
426
+ For a cycle index `F`, its pointing is the cycle index series
427
+ `F^{\bullet} = p_{1} \cdot F'`.
428
+
429
+ If `F` is the cycle index series of a species `S` then `F^{\bullet}`
430
+ is the cycle index series of an associated species `S^{\bullet}`
431
+ of `S`-structures with a marked "root".
432
+
433
+ EXAMPLES:
434
+
435
+ The species `E^{\bullet}` of "pointed sets" satisfies
436
+ `E^{\bullet} = X \cdot E`::
437
+
438
+ sage: E = species.SetSpecies().cycle_index_series() # needs sage.modules
439
+ sage: X = species.SingletonSpecies().cycle_index_series() # needs sage.modules
440
+ sage: E.pointing()[:8] == (X*E)[:8] # needs sage.modules
441
+ True
442
+ """
443
+ X = self.parent()([1], valuation=1)
444
+ return X * self.derivative_with_respect_to_p1()
445
+
446
+ def exponential(self):
447
+ r"""
448
+ Return the species-theoretic exponential of ``self``.
449
+
450
+ For a cycle index `Z_{F}` of a species `F`, its exponential is the
451
+ cycle index series `Z_{E} \circ Z_{F}`, where `Z_{E}` is the
452
+ :meth:`~sage.combinat.species.generating_series.ExponentialCycleIndexSeries`.
453
+
454
+ The exponential `Z_{E} \circ Z_{F}` is then the cycle index series
455
+ of the species `E \circ F` of "sets of `F`-structures".
456
+
457
+ EXAMPLES:
458
+
459
+ Let `BT` be the species of binary trees, `BF` the species of binary
460
+ forests, and `E` the species of sets. Then we have `BF = E \circ BT`::
461
+
462
+ sage: BT = species.BinaryTreeSpecies().cycle_index_series() # needs sage.modules
463
+ sage: BF = species.BinaryForestSpecies().cycle_index_series() # needs sage.modules
464
+ sage: BT.exponential().isotype_generating_series()[:8] == BF.isotype_generating_series()[:8] # needs sage.modules
465
+ True
466
+ """
467
+ base_ring = self.parent().base_ring().base_ring()
468
+ E = ExponentialCycleIndexSeries(base_ring)
469
+ return E(self)
470
+
471
+ def logarithm(self):
472
+ r"""
473
+ Return the combinatorial logarithm of ``self``.
474
+
475
+ For a cycle index `Z_{F}` of a species `F`, its logarithm is the
476
+ cycle index series `Z_{\Omega} \circ Z_{F}`, where `Z_{\Omega}` is the
477
+ :meth:`~sage.combinat.species.generating_series.LogarithmCycleIndexSeries`.
478
+
479
+ The logarithm `Z_{\Omega} \circ Z_{F}` is then the cycle index series
480
+ of the (virtual) species `\Omega \circ F` of "connected `F`-structures".
481
+ In particular, if `F = E^{+} \circ G` for `E^{+}` the species of
482
+ nonempty sets and `G` some other species, then `\Omega \circ F = G`.
483
+
484
+ EXAMPLES:
485
+
486
+ Let `G` be the species of nonempty graphs and `CG` be the species of nonempty connected
487
+ graphs. Then `G = E^{+} \circ CG`, so `CG = \Omega \circ G`::
488
+
489
+ sage: G = species.SimpleGraphSpecies().cycle_index_series() - 1 # needs sage.modules
490
+ sage: from sage.combinat.species.generating_series import LogarithmCycleIndexSeries
491
+ sage: CG = LogarithmCycleIndexSeries()(G) # needs sage.modules
492
+ sage: CG.isotype_generating_series()[0:8] # needs sage.libs.pari sage.modules
493
+ [0, 1, 1, 2, 6, 21, 112, 853]
494
+ """
495
+ base_ring = self.parent().base_ring().base_ring()
496
+ Omega = LogarithmCycleIndexSeries(base_ring)
497
+ return Omega(self)
498
+
499
+
500
+ class CycleIndexSeriesRing(LazySymmetricFunctions):
501
+ r"""
502
+ Return the ring of cycle index series over ``R``.
503
+
504
+ This is the ring of formal power series `\Lambda[x]`, where
505
+ `\Lambda` is the ring of symmetric functions over ``R`` in the
506
+ `p`-basis. Its purpose is to house the cycle index series of
507
+ species (in a somewhat nonstandard notation tailored to Sage):
508
+ If `F` is a species, then the *cycle index series* of `F` is
509
+ defined to be the formal power series
510
+
511
+ .. MATH::
512
+
513
+ \sum_{n \geq 0} \frac{1}{n!} (\sum_{\sigma \in S_n}
514
+ \operatorname{fix} F[\sigma]
515
+ \prod_{z \text{ is a cycle of } \sigma}
516
+ p_{\text{length of } z}) x^n
517
+ \in \Lambda_\QQ [x],
518
+
519
+ where `\operatorname{fix} F[\sigma]` denotes the number of
520
+ fixed points of the permutation `F[\sigma]` of `F[n]`. We
521
+ notice that this power series is "equigraded" (meaning that
522
+ its `x^n`-coefficient is homogeneous of degree `n`). A more
523
+ standard convention in combinatorics would be to use
524
+ `x_i` instead of `p_i`, and drop the `x` (that is, evaluate
525
+ the above power series at `x = 1`); but this would be more
526
+ difficult to implement in Sage, as it would be an element
527
+ of a power series ring in infinitely many variables.
528
+
529
+ Note that it is just a :class:`LazyPowerSeriesRing` (whose base
530
+ ring is `\Lambda`) whose elements have some extra methods.
531
+
532
+ EXAMPLES::
533
+
534
+ sage: from sage.combinat.species.generating_series import CycleIndexSeriesRing
535
+ sage: R = CycleIndexSeriesRing(QQ); R # needs sage.modules
536
+ Cycle Index Series Ring over Rational Field
537
+ sage: p = SymmetricFunctions(QQ).p() # needs sage.modules
538
+ sage: R(lambda n: p[n]) # needs sage.modules
539
+ p[] + p[1] + p[2] + p[3] + p[4] + p[5] + p[6] + O^7
540
+
541
+ TESTS:
542
+
543
+ We test to make sure that caching works::
544
+
545
+ sage: R is CycleIndexSeriesRing(QQ) # needs sage.modules
546
+ True
547
+ """
548
+ Element = CycleIndexSeries
549
+
550
+ def __init__(self, base_ring, sparse=True):
551
+ """
552
+ Initialize ``self``.
553
+
554
+ TESTS::
555
+
556
+ sage: from sage.combinat.species.generating_series import CycleIndexSeriesRing
557
+ sage: CycleIndexSeriesRing.options.halting_precision(12)
558
+ sage: R = CycleIndexSeriesRing(QQ) # needs sage.modules
559
+ sage: TestSuite(R).run() # needs sage.libs.singular sage.modules
560
+
561
+ sage: CycleIndexSeriesRing.options._reset() # reset options
562
+ """
563
+ p = SymmetricFunctions(base_ring).power()
564
+ super().__init__(p)
565
+
566
+ def _repr_(self):
567
+ """
568
+ Return a string representation of ``self``.
569
+
570
+ EXAMPLES::
571
+
572
+ sage: from sage.combinat.species.generating_series import CycleIndexSeriesRing
573
+ sage: CycleIndexSeriesRing(QQ) # needs sage.modules
574
+ Cycle Index Series Ring over Rational Field
575
+ """
576
+ return "Cycle Index Series Ring over %s" % self.base_ring()
577
+
578
+
579
+ @cached_function
580
+ def _exp_term(n, R=QQ):
581
+ r"""
582
+ Compute the order-``n`` term of the cycle index series of the species
583
+ `E` of sets.
584
+
585
+ EXAMPLES::
586
+
587
+ sage: from sage.combinat.species.generating_series import _exp_term
588
+ sage: [_exp_term(i) for i in range(4)] # needs sage.modules
589
+ [p[], p[1], 1/2*p[1, 1] + 1/2*p[2], 1/6*p[1, 1, 1] + 1/2*p[2, 1] + 1/3*p[3]]
590
+ """
591
+ p = SymmetricFunctions(R).power()
592
+ return sum(p(part) / part.aut() for part in Partitions(n))
593
+
594
+
595
+ @cached_function
596
+ def ExponentialCycleIndexSeries(R=QQ):
597
+ r"""
598
+ Return the cycle index series of the species `E` of sets.
599
+
600
+ This cycle index satisfies
601
+
602
+ .. MATH::
603
+
604
+ Z_{E} = \sum_{n \geq 0} \sum_{\lambda \vdash n}
605
+ \frac{p_{\lambda}}{z_{\lambda}}.
606
+
607
+ EXAMPLES::
608
+
609
+ sage: from sage.combinat.species.generating_series import ExponentialCycleIndexSeries
610
+ sage: ExponentialCycleIndexSeries()[:5] # needs sage.modules
611
+ [p[], p[1], 1/2*p[1, 1] + 1/2*p[2], 1/6*p[1, 1, 1] + 1/2*p[2, 1]
612
+ + 1/3*p[3], 1/24*p[1, 1, 1, 1] + 1/4*p[2, 1, 1] + 1/8*p[2, 2]
613
+ + 1/3*p[3, 1] + 1/4*p[4]]
614
+ """
615
+ CIS = CycleIndexSeriesRing(R)
616
+ return CIS(_exp_term)
617
+
618
+
619
+ @cached_function
620
+ def _cl_term(n, R=QQ):
621
+ r"""
622
+ Compute the order-``n`` term of the cycle index series of
623
+ the virtual species `\Omega`, the compositional inverse of
624
+ the species `E^{+}` of nonempty sets.
625
+
626
+ EXAMPLES::
627
+
628
+ sage: from sage.combinat.species.generating_series import _cl_term
629
+ sage: [_cl_term(i) for i in range(4)] # needs sage.modules
630
+ [0, p[1], -1/2*p[1, 1] - 1/2*p[2], 1/3*p[1, 1, 1] - 1/3*p[3]]
631
+ """
632
+ n = Integer(n) # check that n is an integer
633
+
634
+ p = SymmetricFunctions(R).power()
635
+
636
+ res = p.zero()
637
+ if n == 1:
638
+ res = p([1])
639
+ elif n > 1:
640
+ res = 1/n * ((-1)**(n-1) * p([1])**n - sum(d * p([n // d]).plethysm(_cl_term(d, R)) for d in divisors(n)[:-1]))
641
+
642
+ return res
643
+
644
+
645
+ @cached_function
646
+ def LogarithmCycleIndexSeries(R=QQ):
647
+ r"""
648
+ Return the cycle index series of the virtual species `\Omega`, the
649
+ compositional inverse of the species `E^{+}` of nonempty sets.
650
+
651
+ The notion of virtual species is treated thoroughly in [BLL1998]_.
652
+ The specific algorithm used here to compute the cycle index of
653
+ `\Omega` is found in [Labelle2008]_.
654
+
655
+ EXAMPLES:
656
+
657
+ The virtual species `\Omega` is 'properly virtual', in the sense that
658
+ its cycle index has negative coefficients::
659
+
660
+ sage: from sage.combinat.species.generating_series import LogarithmCycleIndexSeries
661
+ sage: LogarithmCycleIndexSeries()[0:4] # needs sage.modules
662
+ [0, p[1], -1/2*p[1, 1] - 1/2*p[2], 1/3*p[1, 1, 1] - 1/3*p[3]]
663
+
664
+ Its defining property is that `\Omega \circ E^{+} = E^{+} \circ \Omega = X`
665
+ (that is, that composition with `E^{+}` in both directions yields the
666
+ multiplicative identity `X`)::
667
+
668
+ sage: Eplus = sage.combinat.species.set_species.SetSpecies(min=1).cycle_index_series() # needs sage.modules
669
+ sage: LogarithmCycleIndexSeries()(Eplus)[0:4] # needs sage.modules
670
+ [0, p[1], 0, 0]
671
+ """
672
+ CIS = CycleIndexSeriesRing(R)
673
+ return CIS(_cl_term)