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,1154 @@
1
+ # sage_setup: distribution = sagemath-combinat
2
+ r"""
3
+ Super partitions
4
+
5
+ A super partition of size `n` and fermionic sector `m` is a
6
+ pair consisting of a strict partition of some integer `r` of
7
+ length `m` (that may end in a `0`) and an integer partition of
8
+ `n - r`.
9
+
10
+ This module provides tools for manipulating super partitions.
11
+
12
+ Super partitions are the indexing set for symmetric functions in
13
+ super space.
14
+
15
+ Super partitions may be input in two different formats: one as a pair
16
+ consisting of fermionic (strict partition) and a bosonic (partition) part
17
+ and the other as a list of integer values where the negative entries come
18
+ first and are listed in strict order followed by the positive values in
19
+ weak order.
20
+
21
+ A super partition is displayed as two partitions separated by a semicolon
22
+ as a default. Super partitions may also be displayed as a weakly increasing
23
+ sequence of integers that are strict if the numbers are not positive.
24
+
25
+ These combinatorial objects index the space of symmetric polynomials in
26
+ two sets of variables, one commuting and one anti-commuting, and they
27
+ are known as symmetric functions in super space (hence the origin of the
28
+ name super partitions).
29
+
30
+ EXAMPLES::
31
+
32
+ sage: SuperPartitions()
33
+ Super Partitions
34
+ sage: SuperPartitions(2)
35
+ Super Partitions of 2
36
+ sage: SuperPartitions(2).cardinality()
37
+ 8
38
+ sage: SuperPartitions(4,2)
39
+ Super Partitions of 4 and of fermionic sector 2
40
+ sage: [[2,0],[1,1]] in SuperPartitions(4,2)
41
+ True
42
+ sage: [[1,0],[1,1]] in SuperPartitions(4,2)
43
+ False
44
+ sage: [[1,0],[2,1]] in SuperPartitions(4)
45
+ True
46
+ sage: [[1,0],[2,2,1]] in SuperPartitions(4)
47
+ False
48
+ sage: [[1,0],[2,1]] in SuperPartitions()
49
+ True
50
+ sage: [[1,1],[2,1]] in SuperPartitions()
51
+ False
52
+ sage: [-2, 0, 1, 1] in SuperPartitions(4,2)
53
+ True
54
+ sage: [-1, 0, 1, 1] in SuperPartitions(4,2)
55
+ False
56
+ sage: [-2, -2, 2, 1] in SuperPartitions(7,2)
57
+ False
58
+
59
+ REFERENCES:
60
+
61
+ - [JL2016]_
62
+
63
+ AUTHORS:
64
+
65
+ - Mike Zabrocki
66
+ """
67
+
68
+ # ****************************************************************************
69
+ # Copyright (C) 2018 Mike Zabrocki <zabrocki at mathstat.yorku.ca>
70
+ #
71
+ # This program is free software: you can redistribute it and/or modify
72
+ # it under the terms of the GNU General Public License as published by
73
+ # the Free Software Foundation, either version 2 of the License, or
74
+ # (at your option) any later version.
75
+ # https://www.gnu.org/licenses/
76
+ # ****************************************************************************
77
+ from __future__ import annotations
78
+ from functools import reduce
79
+ from itertools import chain
80
+
81
+ from sage.structure.list_clone import ClonableArray
82
+ from sage.structure.unique_representation import UniqueRepresentation
83
+ from sage.structure.parent import Parent
84
+ from sage.structure.richcmp import richcmp, richcmp_method
85
+ from sage.combinat.partition import Partition, Partitions, _Partitions
86
+ from sage.combinat.composition import Composition
87
+ from sage.categories.enumerated_sets import EnumeratedSets
88
+ from sage.rings.integer import Integer
89
+ from sage.structure.global_options import GlobalOptions
90
+ from sage.rings.integer_ring import ZZ
91
+ from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass
92
+
93
+
94
+ @richcmp_method
95
+ class SuperPartition(ClonableArray,
96
+ metaclass=InheritComparisonClasscallMetaclass):
97
+ r"""
98
+ A super partition.
99
+
100
+ A *super partition* of size `n` and fermionic sector `m` is a
101
+ pair consisting of a strict partition of some integer `r` of
102
+ length `m` (that may end in a `0`) and an integer partition of
103
+ `n - r`.
104
+
105
+ EXAMPLES::
106
+
107
+ sage: sp = SuperPartition([[1,0],[2,2,1]]); sp
108
+ [1, 0; 2, 2, 1]
109
+ sage: sp[0]
110
+ (1, 0)
111
+ sage: sp[1]
112
+ (2, 2, 1)
113
+ sage: sp.fermionic_degree()
114
+ 2
115
+ sage: sp.bosonic_degree()
116
+ 6
117
+ sage: sp.length()
118
+ 5
119
+ sage: sp.conjugate()
120
+ [4, 2; ]
121
+ """
122
+ @staticmethod
123
+ def __classcall_private__(cls, lst):
124
+ r"""
125
+ Construct a superpartition in the correct parent.
126
+
127
+ EXAMPLES::
128
+
129
+ sage: SuperPartition([[1],[1]]).parent()
130
+ Super Partitions
131
+ sage: SuperPartition([[1],[1]])
132
+ [1; 1]
133
+ sage: SuperPartition([-1, 1])
134
+ [1; 1]
135
+ sage: SuperPartition([[1,1],[1]])
136
+ Traceback (most recent call last):
137
+ ...
138
+ ValueError: [[1, 1], [1]] not in Super Partitions
139
+ sage: SuperPartition([-1,1])
140
+ [1; 1]
141
+ sage: SuperPartition([])
142
+ [; ]
143
+
144
+ sage: SP = SuperPartitions(8,4)([[3,2,1,0],[2]])
145
+ sage: SuperPartition(SP) is SP
146
+ True
147
+ """
148
+ if isinstance(lst, SuperPartition):
149
+ return lst
150
+ SPs = SuperPartitions()
151
+ if not lst:
152
+ return SPs([[], []])
153
+ elif isinstance(lst[0], (list, tuple)):
154
+ return SPs([[Integer(a) for a in lst[0]],
155
+ [Integer(a) for a in lst[1]]])
156
+ else:
157
+ return SPs([[-a for a in lst if a <= 0],
158
+ [a for a in lst if a > 0]])
159
+
160
+ def __init__(self, parent, lst, check=True, immutable=True):
161
+ """
162
+ Initialize ``self``.
163
+
164
+ EXAMPLES::
165
+
166
+ sage: SP = SuperPartition([[1],[1]])
167
+ sage: TestSuite(SP).run()
168
+ """
169
+ if check and lst not in parent:
170
+ raise ValueError("%s not in %s" % (lst, parent))
171
+ lst = [tuple(lst[0]), tuple(lst[1])]
172
+ ClonableArray.__init__(self, parent, lst, False, immutable)
173
+
174
+ def check(self):
175
+ """
176
+ Check that ``self`` is a valid super partition.
177
+
178
+ EXAMPLES::
179
+
180
+ sage: SP = SuperPartition([[1],[1]])
181
+ sage: SP.check()
182
+ """
183
+ if self not in self.parent():
184
+ raise ValueError("%s not in %s" % (self, self.parent()))
185
+
186
+ def __richcmp__(self, other, op) -> bool:
187
+ r"""
188
+ Check whether ``self`` is equal to ``other``.
189
+
190
+ .. TODO::
191
+
192
+ This overwrites the equality check of
193
+ :class:`~sage.structure.list_clone.ClonableArray`
194
+ in order to circumvent the coercion framework.
195
+ Eventually this should be solved more elegantly.
196
+
197
+ For now, two elements are compared by their defining lists.
198
+ """
199
+ if isinstance(other, SuperPartition):
200
+ return richcmp(list(self), list(other), op)
201
+ else:
202
+ return richcmp(list(self), other, op)
203
+
204
+ def _repr_(self) -> str:
205
+ r"""
206
+ Return a string representation of ``self``.
207
+
208
+ A super partition is represented by the antisymmetric and symmetric
209
+ parts separated by a semicolon.
210
+
211
+ EXAMPLES::
212
+
213
+ sage: SuperPartition([[1],[1]])
214
+ [1; 1]
215
+ sage: SuperPartition([[],[1]])
216
+ [; 1]
217
+ sage: SuperPartition([])
218
+ [; ]
219
+ sage: SuperPartitions.options.display = "list"
220
+ sage: SuperPartition([[1],[1]])
221
+ [-1, 1]
222
+ sage: SuperPartition([[],[1]])
223
+ [1]
224
+ sage: SuperPartition([-2,-1,0,2,1])
225
+ [-2, -1, 0, 2, 1]
226
+ sage: SuperPartitions.options.display = "pair"
227
+ sage: SuperPartition([[1],[1]])
228
+ [[1], [1]]
229
+ sage: SuperPartition([[],[1]])
230
+ [[], [1]]
231
+ sage: SuperPartition([-2,-1,0,2,1])
232
+ [[2, 1, 0], [2, 1]]
233
+ sage: SuperPartitions.options._reset()
234
+ """
235
+ display = self.parent().options.display
236
+ if display == "default":
237
+ asp = ', '.join(str(a) for a in self.antisymmetric_part())
238
+ sp = ', '.join(str(a) for a in self.symmetric_part())
239
+ return '[' + asp + '; ' + sp + ']'
240
+ elif display == "pair":
241
+ return self._repr_pair()
242
+ else: # "list"
243
+ return self._repr_list()
244
+
245
+ def _repr_pair(self) -> str:
246
+ r"""
247
+ Representation of a super partition as a pair.
248
+
249
+ A super partition is represented by a list consisting of the
250
+ antisymmetric and symmetric parts.
251
+
252
+ EXAMPLES::
253
+
254
+ sage: SuperPartition([[1],[1]])._repr_pair()
255
+ '[[1], [1]]'
256
+ sage: SuperPartition([[],[1]])._repr_pair()
257
+ '[[], [1]]'
258
+ sage: SuperPartition([[],[]])._repr_pair()
259
+ '[[], []]'
260
+ """
261
+ return repr(self.to_list())
262
+
263
+ def _repr_list(self) -> str:
264
+ r"""
265
+ Representation of a super partition as a list.
266
+
267
+ A super partition is represented by a list consisting of the
268
+ negative values for the antisymmetric part listed first followed
269
+ by positive values for the symmetric part
270
+
271
+ EXAMPLES::
272
+
273
+ sage: SuperPartition([[1],[1]])._repr_list()
274
+ '[-1, 1]'
275
+ sage: SuperPartition([[],[1]])._repr_list()
276
+ '[1]'
277
+ sage: SuperPartition([[],[]])._repr_list()
278
+ '[]'
279
+ """
280
+ return repr([-a for a in self[0]] + list(self[1]))
281
+
282
+ def _latex_(self) -> str:
283
+ r"""
284
+ Latex a super partition.
285
+
286
+ A super partition is represented by the antisymmetric and symmetric
287
+ parts separated by a semicolon.
288
+
289
+ EXAMPLES::
290
+
291
+ sage: latex(SuperPartition([[1],[1]]))
292
+ (1; 1)
293
+ sage: latex(SuperPartition([[],[1]]))
294
+ (; 1)
295
+ """
296
+ return ('(' + ','.join(str(a) for a in self.antisymmetric_part())
297
+ + '; ' + ', '.join(str(a) for a in self.symmetric_part()) + ')')
298
+
299
+ def to_list(self) -> list:
300
+ r"""
301
+ The list of two lists with the antisymmetric and symmetric parts.
302
+
303
+ EXAMPLES::
304
+
305
+ sage: SuperPartition([[1],[1]]).to_list()
306
+ [[1], [1]]
307
+ sage: SuperPartition([[],[1]]).to_list()
308
+ [[], [1]]
309
+ """
310
+ return [list(self[0]), list(self[1])]
311
+
312
+ def to_composition(self) -> Composition:
313
+ r"""
314
+ Concatenate the antisymmetric and symmetric parts to a composition.
315
+
316
+ OUTPUT:
317
+
318
+ - a (possibly weak) composition
319
+
320
+ EXAMPLES::
321
+
322
+ sage: SuperPartition([[3,1],[2,2,1]]).to_composition()
323
+ [3, 1, 2, 2, 1]
324
+ sage: SuperPartition([[2,1,0],[3,3]]).to_composition()
325
+ [2, 1, 0, 3, 3]
326
+ sage: SuperPartition([[2,1,0],[3,3]]).to_composition().parent()
327
+ Compositions of nonnegative integers
328
+ """
329
+ return Composition(self[0] + self[1])
330
+
331
+ def to_partition(self) -> Partition:
332
+ r"""
333
+ Concatenate and sort the antisymmetric and symmetric parts
334
+ to a partition.
335
+
336
+ OUTPUT: a partition
337
+
338
+ EXAMPLES::
339
+
340
+ sage: SuperPartition([[3,1],[2,2,1]]).to_partition()
341
+ [3, 2, 2, 1, 1]
342
+ sage: SuperPartition([[2,1,0],[3,3]]).to_partition()
343
+ [3, 3, 2, 1]
344
+ sage: SuperPartition([[2,1,0],[3,3]]).to_partition().parent()
345
+ Partitions
346
+ """
347
+ return Partition(sorted(self[0] + self[1], reverse=True)) # type:ignore
348
+
349
+ def antisymmetric_part(self) -> list:
350
+ r"""
351
+ The antisymmetric part as a list of strictly decreasing integers.
352
+
353
+ OUTPUT: list
354
+
355
+ EXAMPLES::
356
+
357
+ sage: SuperPartition([[3,1],[2,2,1]]).antisymmetric_part()
358
+ [3, 1]
359
+ sage: SuperPartition([[2,1,0],[3,3]]).antisymmetric_part()
360
+ [2, 1, 0]
361
+ """
362
+ return list(self[0])
363
+
364
+ a_part = antisymmetric_part
365
+
366
+ def symmetric_part(self) -> list:
367
+ r"""
368
+ The symmetric part as a list of weakly decreasing integers.
369
+
370
+ OUTPUT: list
371
+
372
+ EXAMPLES::
373
+
374
+ sage: SuperPartition([[3,1],[2,2,1]]).symmetric_part()
375
+ [2, 2, 1]
376
+ sage: SuperPartition([[2,1,0],[3,3]]).symmetric_part()
377
+ [3, 3]
378
+ """
379
+ return list(self[1])
380
+
381
+ s_part = symmetric_part
382
+
383
+ def bosonic_degree(self) -> int:
384
+ r"""
385
+ Return the bosonic degree of ``self``.
386
+
387
+ The *bosonic degree* is the sum of the sizes of the
388
+ antisymmetric and symmetric parts.
389
+
390
+ OUTPUT: integer
391
+
392
+ EXAMPLES::
393
+
394
+ sage: SuperPartition([[3,1],[2,2,1]]).bosonic_degree()
395
+ 9
396
+ sage: SuperPartition([[2,1,0],[3,3]]).bosonic_degree()
397
+ 9
398
+ """
399
+ return sum(self.antisymmetric_part() + self.symmetric_part())
400
+
401
+ degree = bosonic_degree
402
+
403
+ def fermionic_degree(self) -> int:
404
+ r"""
405
+ Return the fermionic degree of ``self``.
406
+
407
+ The *fermionic degree* is the length of the antisymmetric part.
408
+
409
+ OUTPUT: integer
410
+
411
+ EXAMPLES::
412
+
413
+ sage: SuperPartition([[3,1],[2,2,1]]).fermionic_degree()
414
+ 2
415
+ sage: SuperPartition([[2,1,0],[3,3]]).fermionic_degree()
416
+ 3
417
+ """
418
+ return len(self.antisymmetric_part())
419
+
420
+ fermionic_sector = fermionic_degree
421
+
422
+ def bi_degree(self) -> tuple:
423
+ r"""
424
+ Return the bidegree of ``self``, which is a pair consisting
425
+ of the bosonic and fermionic degree.
426
+
427
+ OUTPUT: a tuple of two integers
428
+
429
+ EXAMPLES::
430
+
431
+ sage: SuperPartition([[3,1],[2,2,1]]).bi_degree()
432
+ (9, 2)
433
+ sage: SuperPartition([[2,1,0],[3,3]]).bi_degree()
434
+ (9, 3)
435
+ """
436
+ return (self.bosonic_degree(), self.fermionic_degree())
437
+
438
+ def length(self) -> int:
439
+ r"""
440
+ Return the length of ``self``, which is the sum of the
441
+ lengths of the antisymmetric and symmetric part.
442
+
443
+ OUTPUT: integer
444
+
445
+ EXAMPLES::
446
+
447
+ sage: SuperPartition([[3,1],[2,2,1]]).length()
448
+ 5
449
+ sage: SuperPartition([[2,1,0],[3,3]]).length()
450
+ 5
451
+ """
452
+ return self.fermionic_degree() + len(self.symmetric_part())
453
+
454
+ def bosonic_length(self) -> int:
455
+ r"""
456
+ Return the length of the partition of the symmetric part.
457
+
458
+ OUTPUT: integer
459
+
460
+ EXAMPLES::
461
+
462
+ sage: SuperPartition([[3,1],[2,2,1]]).bosonic_length()
463
+ 3
464
+ sage: SuperPartition([[2,1,0],[3,3]]).bosonic_length()
465
+ 2
466
+ """
467
+ return len(self.symmetric_part())
468
+
469
+ def shape_circled_diagram(self) -> Partition:
470
+ r"""
471
+ A concatenated partition with an extra cell for each antisymmetric part
472
+
473
+ OUTPUT: a partition
474
+
475
+ EXAMPLES::
476
+
477
+ sage: SuperPartition([[3,1],[2,2,1]]).shape_circled_diagram()
478
+ [4, 2, 2, 2, 1]
479
+ sage: SuperPartition([[2,1,0],[3,3]]).shape_circled_diagram()
480
+ [3, 3, 3, 2, 1]
481
+ """
482
+ pi = sorted([a + 1 for a in self.antisymmetric_part()] +
483
+ self.symmetric_part(), reverse=True)
484
+ return Partition(pi) # type:ignore
485
+
486
+ @staticmethod
487
+ def from_circled_diagram(shape, corners) -> SuperPartition:
488
+ r"""
489
+ Construct a super partition from a circled diagram.
490
+
491
+ A circled diagram consists of a partition of the concatenation of
492
+ the antisymmetric and symmetric parts and a list of addable cells
493
+ of the partition which indicate the location of the circled cells.
494
+
495
+ INPUT:
496
+
497
+ - ``shape`` -- a partition or list of integers
498
+ - ``corners`` -- list of removable cells of ``shape``
499
+
500
+ OUTPUT: a :class:`SuperPartition`
501
+
502
+ EXAMPLES::
503
+
504
+ sage: SuperPartition.from_circled_diagram([3, 2, 2, 1, 1], [(0, 3), (3, 1)])
505
+ [3, 1; 2, 2, 1]
506
+ sage: SuperPartition.from_circled_diagram([3, 3, 2, 1], [(2, 2), (3, 1), (4, 0)])
507
+ [2, 1, 0; 3, 3]
508
+ sage: from_cd = SuperPartition.from_circled_diagram
509
+ sage: all(sp == from_cd(*sp.to_circled_diagram()) for sp in SuperPartitions(4))
510
+ True
511
+ """
512
+ data = [sorted([c[1] for c in corners], reverse=True),
513
+ [shape[i] for i in range(len(shape))
514
+ if i not in [c[0] for c in corners]]]
515
+ return SuperPartition(data) # type:ignore
516
+
517
+ def to_circled_diagram(self) -> list:
518
+ r"""
519
+ The shape of the circled diagram and a list of addable cells
520
+
521
+ A circled diagram consists of a partition for the outer shape
522
+ and a list of removable cells of the partition indicating the
523
+ location of the circled cells
524
+
525
+ OUTPUT: list consisting of a partition and a list of pairs of integers
526
+
527
+ EXAMPLES::
528
+
529
+ sage: SuperPartition([[3,1],[2,2,1]]).to_circled_diagram()
530
+ [[3, 2, 2, 1, 1], [(0, 3), (3, 1)]]
531
+ sage: SuperPartition([[2,1,0],[3,3]]).to_circled_diagram()
532
+ [[3, 3, 2, 1], [(2, 2), (3, 1), (4, 0)]]
533
+ sage: from_cd = SuperPartition.from_circled_diagram
534
+ sage: all(sp == from_cd(*sp.to_circled_diagram()) for sp in SuperPartitions(4))
535
+ True
536
+ """
537
+ shape = self.to_partition()
538
+ corners = [c for c in shape.addable_cells() if c[1] in self.antisymmetric_part()]
539
+ return [shape, corners]
540
+
541
+ def conjugate(self) -> SuperPartition:
542
+ r"""
543
+ Conjugate of a super partition.
544
+
545
+ The *conjugate* of a super partition is defined by conjugating
546
+ the circled diagram.
547
+
548
+ OUTPUT: a :class:`SuperPartition`
549
+
550
+ EXAMPLES::
551
+
552
+ sage: SuperPartition([[3, 1, 0], [4, 3, 2, 1]]).conjugate()
553
+ [6, 4, 1; 3]
554
+ sage: all(sp == sp.conjugate().conjugate() for sp in SuperPartitions(4))
555
+ True
556
+ sage: all(sp.conjugate() in SuperPartitions(3,2) for sp in SuperPartitions(3,2))
557
+ True
558
+ """
559
+ sd = self.to_circled_diagram()
560
+ return SuperPartition.from_circled_diagram(sd[0].conjugate(),
561
+ [(j, i) for (i, j) in sd[1]])
562
+
563
+ def zee(self) -> Integer:
564
+ r"""
565
+ Return the centralizer size of a permutation of cycle
566
+ type symmetric part of ``self``.
567
+
568
+ OUTPUT: a positive integer
569
+
570
+ EXAMPLES::
571
+
572
+ sage: SuperPartition([[1,0],[3,1,1]]).zee()
573
+ 6
574
+ sage: SuperPartition([[1],[2,2,1]]).zee()
575
+ 8
576
+ sage: sum(1/sp.zee() for sp in SuperPartitions(6,0))
577
+ 1
578
+ """
579
+ return Partition(self.symmetric_part()).centralizer_size() # type:ignore
580
+
581
+ def sign(self) -> int:
582
+ r"""
583
+ Return the sign of a permutation of cycle type the
584
+ symmetric part of ``self``.
585
+
586
+ OUTPUT: either `1` or `-1`
587
+
588
+ EXAMPLES::
589
+
590
+ sage: SuperPartition([[1,0],[3,1,1]]).sign()
591
+ -1
592
+ sage: SuperPartition([[1,0],[3,2,1]]).sign()
593
+ 1
594
+ sage: sum(sp.sign()/sp.zee() for sp in SuperPartitions(6,0))
595
+ 0
596
+ """
597
+ return (-1)**(self.degree() - len(self.symmetric_part()))
598
+
599
+ def dominates(self, other) -> bool:
600
+ r"""
601
+ Return ``True`` if and only if ``self`` dominates ``other``.
602
+
603
+ If the symmetric and anti-symmetric parts of ``self`` and ``other``
604
+ are not the same size then the result is ``False``.
605
+
606
+ EXAMPLES::
607
+
608
+ sage: LA = SuperPartition([[2,1],[2,1,1]])
609
+ sage: LA.dominates([[2,1],[3,1]])
610
+ False
611
+ sage: LA.dominates([[2,1],[1,1,1,1]])
612
+ True
613
+ sage: LA.dominates([[3],[2,1,1]])
614
+ False
615
+ sage: LA.dominates([[1],[1]*6])
616
+ False
617
+ """
618
+ return (self.degree() == sum(other[0]) + sum(other[1]) and
619
+ Partition(self.antisymmetric_part()).dominates(other[0]) and
620
+ Partition(self.symmetric_part()).dominates(other[1]))
621
+
622
+ def add_horizontal_border_strip_star(self, h) -> list:
623
+ r"""
624
+ Return a list of super partitions that differ from ``self``
625
+ by a horizontal strip.
626
+
627
+ The notion of horizontal strip comes from the Pieri rule for the
628
+ Schur-star basis of symmetric functions in super space (see
629
+ Theorem 7 from [JL2016]_).
630
+
631
+ INPUT:
632
+
633
+ - ``h`` -- number of cells in the horizontal strip
634
+
635
+ OUTPUT: list of super partitions
636
+
637
+ EXAMPLES::
638
+
639
+ sage: SuperPartition([[4,1],[3]]).add_horizontal_border_strip_star(3)
640
+ [[3, 1; 7],
641
+ [4, 1; 6],
642
+ [3, 0; 6, 2],
643
+ [3, 1; 6, 1],
644
+ [4, 0; 5, 2],
645
+ [4, 1; 5, 1],
646
+ [3, 0; 5, 3],
647
+ [3, 1; 5, 2],
648
+ [4, 0; 4, 3],
649
+ [4, 1; 4, 2],
650
+ [4, 1; 3, 3]]
651
+ sage: SuperPartition([[2,1],[3]]).add_horizontal_border_strip_star(2)
652
+ [[2, 1; 5], [2, 0; 4, 2], [2, 1; 4, 1], [2, 0; 3, 3], [2, 1; 3, 2]]
653
+ """
654
+ sp1, circ_list = self.to_circled_diagram()
655
+ nsp = [list(la) + [0] for la in sp1.add_horizontal_border_strip(h)]
656
+ sp1 = sp1 + [0]
657
+ out = []
658
+ for elt in nsp:
659
+ row_changed = [row1 - row2 for row1, row2 in zip(elt, sp1)]
660
+ new_sp = [elt, [(i[0] + 1, elt[i[0] + 1]) for i in circ_list
661
+ if row_changed[i[0]] != 0]
662
+ # TODO: Check that this is not supposed to be
663
+ # a tuple of size 1
664
+ + [(i) for i in circ_list if row_changed[i[0]] == 0]]
665
+ if len({k for j, k in new_sp[1]}) == len(new_sp[1]):
666
+ out += [SuperPartition.from_circled_diagram(*new_sp)]
667
+ return out
668
+
669
+ def add_horizontal_border_strip_star_bar(self, h) -> list:
670
+ r"""
671
+ List super partitions that differ from ``self`` by a horizontal strip.
672
+
673
+ The notion of horizontal strip comes from the Pieri rule for the
674
+ Schur-star-bar basis of symmetric functions in super space (see
675
+ Theorem 10 from [JL2016]_).
676
+
677
+ INPUT:
678
+
679
+ - ``h`` -- number of cells in the horizontal strip
680
+
681
+ OUTPUT: list of super partitions
682
+
683
+ EXAMPLES::
684
+
685
+ sage: SuperPartition([[4,1],[5,4]]).add_horizontal_border_strip_star_bar(3)
686
+ [[4, 1; 8, 4],
687
+ [4, 1; 7, 5],
688
+ [4, 2; 7, 4],
689
+ [4, 1; 7, 4, 1],
690
+ [4, 2; 6, 5],
691
+ [4, 1; 6, 5, 1],
692
+ [4, 3; 6, 4],
693
+ [4, 2; 6, 4, 1],
694
+ [4, 1; 6, 4, 2],
695
+ [4, 3; 5, 5],
696
+ [4, 2; 5, 5, 1],
697
+ [4, 1; 5, 5, 2],
698
+ [4, 3; 5, 4, 1],
699
+ [4, 1; 5, 4, 3]]
700
+ sage: SuperPartition([[3,1],[5]]).add_horizontal_border_strip_star_bar(2)
701
+ [[3, 1; 7],
702
+ [4, 1; 6],
703
+ [3, 2; 6],
704
+ [3, 1; 6, 1],
705
+ [4, 2; 5],
706
+ [4, 1; 5, 1],
707
+ [3, 2; 5, 1],
708
+ [3, 1; 5, 2]]
709
+ """
710
+ sp1, circ_list = self.to_circled_diagram()
711
+ nsp = [list(la) + [0] for la in sp1.add_horizontal_border_strip(h)]
712
+ sp1 = sp1 + [0]
713
+ out = []
714
+ for asp in nsp:
715
+ asp = asp + [0]
716
+ change_in_rows = [asp[i] - sp1[i] for i in range(len(sp1))]
717
+ moved_circ_list: list[list[tuple]] = [[] for _ in range(len(circ_list))]
718
+ for i, pos in enumerate(circ_list):
719
+ if change_in_rows[pos[0]] == 0:
720
+ moved_circ_list[i].append(pos)
721
+ else:
722
+ if pos[0] == 0:
723
+ moved_circ_list[i].append((0, pos[1] + change_in_rows[0]))
724
+ if pos[1] == asp[1]:
725
+ moved_circ_list[i].append((1, asp[1]))
726
+ else:
727
+ if pos[1] + change_in_rows[pos[0]] < sp1[pos[0] - 1]:
728
+ moved_circ_list[i].append((pos[0], pos[1] + change_in_rows[pos[0]]))
729
+ if asp[pos[0] + 1] == sp1[pos[0]]:
730
+ moved_circ_list[i].append((pos[0] + 1, pos[1]))
731
+ out += [[moved_circ_list, asp]]
732
+ result = []
733
+ for ti in out:
734
+ if not ti[0]:
735
+ result += [[ti[1], ti[0]]]
736
+ else:
737
+ x = reduce(lambda a, b: [item_a + item_b for item_a in a for item_b in b], ti[0])
738
+ for j in x:
739
+ result += [[ti[1], list(zip(j, j[1:]))[::2]]]
740
+ return [SuperPartition.from_circled_diagram(*ti)
741
+ for ti in result if len(ti[1]) == len(self[0])]
742
+
743
+
744
+ class SuperPartitions(UniqueRepresentation, Parent):
745
+ r"""
746
+ Super partitions.
747
+
748
+ A super partition of size `n` and fermionic sector `m` is a
749
+ pair consisting of a strict partition of some integer `r` of
750
+ length `m` (that may end in a `0`) and an integer partition of
751
+ `n - r`.
752
+
753
+ INPUT:
754
+
755
+ - ``n`` -- integer (default: ``None``)
756
+ - ``m`` -- if ``n`` is specified, an integer (optional: default ``None``)
757
+
758
+ Super partitions are the indexing set for symmetric functions
759
+ in super space.
760
+
761
+ EXAMPLES::
762
+
763
+ sage: SuperPartitions()
764
+ Super Partitions
765
+ sage: SuperPartitions(2)
766
+ Super Partitions of 2
767
+ sage: SuperPartitions(2).cardinality()
768
+ 8
769
+ sage: SuperPartitions(4,2)
770
+ Super Partitions of 4 and of fermionic sector 2
771
+ sage: [[2,0],[1,1]] in SuperPartitions(4,2)
772
+ True
773
+ sage: [[1,0],[1,1]] in SuperPartitions(4,2)
774
+ False
775
+ sage: [[1,0],[2,1]] in SuperPartitions(4)
776
+ True
777
+ sage: [[1,0],[2,2,1]] in SuperPartitions(4)
778
+ False
779
+ sage: [[1,0],[2,1]] in SuperPartitions()
780
+ True
781
+ sage: [[1,1],[2,1]] in SuperPartitions()
782
+ False
783
+ """
784
+ @staticmethod
785
+ def __classcall_private__(self, n=None, m=None, **kwargs):
786
+ r"""
787
+ Return the corresponding parent based upon input.
788
+
789
+ TESTS::
790
+
791
+ sage: from sage.combinat.superpartition import *
792
+ sage: isinstance(SuperPartitions(), SuperPartitions_all)
793
+ True
794
+ sage: isinstance(SuperPartitions(3), SuperPartitions_n)
795
+ True
796
+ sage: isinstance(SuperPartitions(3,2), SuperPartitions_n_m)
797
+ True
798
+
799
+ ::
800
+
801
+ sage: SP = SuperPartitions(5,2)
802
+ sage: SP2 = SuperPartitions(int(5),int(2))
803
+ sage: SP3 = SuperPartitions(ZZ(5),int(2))
804
+ sage: SP is SP2
805
+ True
806
+ sage: SP is SP3
807
+ True
808
+
809
+ ::
810
+
811
+ sage: SP = SuperPartitions(5)
812
+ sage: SP2 = SuperPartitions(int(5))
813
+ sage: SP3 = SuperPartitions(ZZ(5))
814
+ sage: SP is SP2
815
+ True
816
+ sage: SP is SP3
817
+ True
818
+ """
819
+ if n is None:
820
+ return SuperPartitions_all()
821
+ elif n in ZZ:
822
+ if m is None:
823
+ return SuperPartitions_n(n)
824
+ elif m in ZZ:
825
+ return SuperPartitions_n_m(n, m)
826
+ raise ValueError("m must be an integer")
827
+ raise ValueError("n must be an integer")
828
+
829
+ def __init__(self, is_infinite=False):
830
+ """
831
+ Initialize ``self``.
832
+
833
+ EXAMPLES::
834
+
835
+ sage: SP = SuperPartitions()
836
+ sage: TestSuite(SP).run()
837
+ """
838
+ cat = EnumeratedSets()
839
+ if is_infinite:
840
+ cat = cat.Infinite()
841
+ else:
842
+ cat = cat.Finite()
843
+ Parent.__init__(self, category=cat)
844
+
845
+ Element = SuperPartition
846
+
847
+ class options(GlobalOptions):
848
+ """
849
+ Set the global options for elements of the SuperPartition class.
850
+
851
+ The defaults are for Super Partitions to be displayed in a list
852
+ notation with the fermionic part and the bosonic part separated
853
+ by a semicolon. There is a slight disadvantage to this notation
854
+ because a list containing a semicolon can not be used as input
855
+ for a super partition.
856
+
857
+ @OPTIONS@
858
+
859
+ EXAMPLES::
860
+
861
+ sage: sp = SuperPartition([[1, 0], [2, 2, 1]])
862
+ sage: SuperPartitions.options.display
863
+ default
864
+ sage: sp
865
+ [1, 0; 2, 2, 1]
866
+ sage: SuperPartitions.options.display = 'list'
867
+ sage: sp
868
+ [-1, 0, 2, 2, 1]
869
+ sage: SuperPartitions.options._reset()
870
+ """,
871
+ NAME = 'SuperPartition'
872
+ module = 'sage.combinat.superpartition'
873
+ display = dict(default='default',
874
+ description="Specifies how the super partitions should "
875
+ "be printed",
876
+ values=dict(list="the super partitions are displayed in "
877
+ "a list of two lists",
878
+ pair="the super partition is displayed as a "
879
+ "list of integers",
880
+ default="the super partition is displayed in "
881
+ "a form [fermionic part; bosonic part]"),
882
+ case_sensitive=False)
883
+
884
+ def _element_constructor_(self, lst, check=True):
885
+ """
886
+ Construct an element with ``self`` as parent.
887
+
888
+ EXAMPLES::
889
+
890
+ sage: SP = SuperPartitions()
891
+ sage: SP([[],[3,3,1]])
892
+ [; 3, 3, 1]
893
+ sage: SP([[],[3,3,1]]) in SP
894
+ True
895
+ sage: SP([[],[3,3,1]]).parent()
896
+ Super Partitions
897
+ sage: SuperPartitions(7)([[],[3,3,1]])
898
+ [; 3, 3, 1]
899
+ sage: SuperPartitions(7,0)([[],[3,3,1]])
900
+ [; 3, 3, 1]
901
+ sage: SuperPartitions(7,1)([[],[3,3,1]])
902
+ Traceback (most recent call last):
903
+ ...
904
+ ValueError: [[], [3, 3, 1]] not in Super Partitions of 7 and of fermionic sector 1
905
+ """
906
+ if not lst:
907
+ return self.element_class(self, [[], []], check=check)
908
+ if isinstance(lst, SuperPartition):
909
+ lst = list(lst)
910
+ if isinstance(lst[0], (list, tuple)):
911
+ return self.element_class(self, [lst[0], [a for a in lst[1] if a > 0]],
912
+ check=check)
913
+ else:
914
+ return self.element_class(self, [[-a for a in lst if a <= 0],
915
+ [a for a in lst if a > 0]],
916
+ check=check)
917
+
918
+ def __contains__(self, x) -> bool:
919
+ """
920
+ TESTS::
921
+
922
+ sage: [[1],[2,1]] in SuperPartitions()
923
+ True
924
+ sage: [[],[]] in SuperPartitions()
925
+ True
926
+ sage: [[0],[]] in SuperPartitions()
927
+ True
928
+ sage: [[],[0]] in SuperPartitions()
929
+ True
930
+ sage: [-1, 2, 1] in SuperPartitions()
931
+ True
932
+ sage: [2, -1, 1, 0] in SuperPartitions()
933
+ True
934
+ sage: [2, 0, 1, -1] in SuperPartitions()
935
+ False
936
+ sage: [] in SuperPartitions()
937
+ True
938
+ sage: [0] in SuperPartitions()
939
+ True
940
+ """
941
+ if isinstance(x, SuperPartition):
942
+ return True
943
+ if not isinstance(x, (list, tuple)):
944
+ return False
945
+ if all(isinstance(i, (int, Integer)) or i in ZZ for i in x):
946
+ sp = [a for a in x if a <= 0]
947
+ return (all(sp[i] > sp[i - 1] for i in range(1, len(sp)))
948
+ and [a for a in x if a > 0] in _Partitions)
949
+ elif (len(x) == 2 and
950
+ isinstance(x[0], (list, tuple)) and
951
+ isinstance(x[1], (list, tuple))):
952
+ for i in chain(x[0], x[1]):
953
+ if i not in ZZ:
954
+ return False
955
+ if i < 0:
956
+ return False
957
+ return (all(x[0][i] > x[0][i + 1] for i in range(len(x[0]) - 1))
958
+ and all(x[1][i] >= x[1][i + 1] for i in range(len(x[1]) - 1))
959
+ and ((not x[0]) or x[0][-1] >= 0) and ((not x[1]) or x[1][-1] >= 0))
960
+ else:
961
+ return False
962
+
963
+
964
+ class SuperPartitions_n_m(SuperPartitions):
965
+ def __init__(self, n, m):
966
+ """
967
+ Initialize ``self``.
968
+
969
+ TESTS::
970
+
971
+ sage: SP = SuperPartitions(3,2)
972
+ sage: TestSuite(SP).run()
973
+ """
974
+ self.n = n
975
+ self.m = m
976
+ SuperPartitions.__init__(self, False)
977
+
978
+ def _repr_(self) -> str:
979
+ """
980
+ Return a string representation of ``self``.
981
+
982
+ TESTS::
983
+
984
+ sage: repr(SuperPartitions(3,2))
985
+ 'Super Partitions of 3 and of fermionic sector 2'
986
+ """
987
+ return "Super Partitions of %s and of fermionic sector %s" % (self.n, self.m)
988
+
989
+ def __contains__(self, x) -> bool:
990
+ """
991
+ TESTS::
992
+
993
+ sage: [[3,2,1,0],[2]] in SuperPartitions(8,4)
994
+ True
995
+ sage: [[3,2,1,0],[]] in SuperPartitions(6,3)
996
+ False
997
+ sage: [[],[]] in SuperPartitions(0,0)
998
+ True
999
+ sage: [[0],[]] in SuperPartitions(0,1)
1000
+ True
1001
+ sage: [[],[]] in SuperPartitions(0,1)
1002
+ False
1003
+ sage: [-3,-2,-1,0,2] in SuperPartitions(8,4)
1004
+ True
1005
+ sage: [0] in SuperPartitions(0,0)
1006
+ False
1007
+ sage: [] in SuperPartitions(0,0)
1008
+ True
1009
+ sage: [0] in SuperPartitions(0,1)
1010
+ True
1011
+ """
1012
+ if x in SuperPartitions():
1013
+ if not x:
1014
+ return self.n == 0 and self.m == 0
1015
+ if isinstance(x[0], (list, tuple)):
1016
+ n = sum(x[0] + x[1])
1017
+ m = len(x[0])
1018
+ else:
1019
+ n = sum(abs(a) for a in x)
1020
+ m = len([a for a in x if a <= 0])
1021
+ return n == self.n and m == self.m
1022
+ else:
1023
+ return False
1024
+
1025
+ def __iter__(self):
1026
+ r"""
1027
+ An iterator for super partitions of degree ``n`` and sector ``m``.
1028
+
1029
+ EXAMPLES::
1030
+
1031
+ sage: SuperPartitions(6,2).cardinality()
1032
+ 28
1033
+ sage: SuperPartitions(6,4).first()
1034
+ [3, 2, 1, 0; ]
1035
+ """
1036
+ for r in range(self.n + 1):
1037
+ for p1 in Partitions(r):
1038
+ for p0 in Partitions(self.n - r, max_slope=-1, length=self.m):
1039
+ yield self.element_class(self, [list(p0), list(p1)])
1040
+ for p0 in Partitions(self.n - r, max_slope=-1, length=self.m - 1):
1041
+ yield self.element_class(self, [list(p0) + [0], list(p1)])
1042
+
1043
+
1044
+ class SuperPartitions_n(SuperPartitions):
1045
+ def __init__(self, n):
1046
+ """
1047
+ Initialize ``self``.
1048
+
1049
+ TESTS::
1050
+
1051
+ sage: SP = SuperPartitions(3)
1052
+ sage: TestSuite(SP).run()
1053
+ """
1054
+ self.n = n
1055
+ SuperPartitions.__init__(self, False)
1056
+
1057
+ def _repr_(self) -> str:
1058
+ """
1059
+ Return a string representation of ``self``.
1060
+
1061
+ TESTS::
1062
+
1063
+ sage: repr(SuperPartitions(3))
1064
+ 'Super Partitions of 3'
1065
+ """
1066
+ return "Super Partitions of %s" % self.n
1067
+
1068
+ def __contains__(self, x) -> bool:
1069
+ """
1070
+ EXAMPLES::
1071
+
1072
+ sage: SuperPartitions(7)([[],[3,3,1]]) in SuperPartitions()
1073
+ True
1074
+ sage: SuperPartitions()([[],[3,3,1]]) in SuperPartitions(7)
1075
+ True
1076
+ sage: [[],[]] in SuperPartitions(0)
1077
+ True
1078
+ sage: [[0],[]] in SuperPartitions(0)
1079
+ True
1080
+ sage: [0] in SuperPartitions(0)
1081
+ True
1082
+ sage: [] in SuperPartitions(0)
1083
+ True
1084
+ sage: [1] in SuperPartitions(0)
1085
+ False
1086
+ """
1087
+ if x in SuperPartitions():
1088
+ if not x:
1089
+ return self.n == 0
1090
+ if isinstance(x[0], (list, tuple)):
1091
+ n = sum(x[0] + x[1])
1092
+ else:
1093
+ n = sum(abs(a) for a in x)
1094
+ return n == self.n
1095
+ else:
1096
+ return False
1097
+
1098
+ def __iter__(self):
1099
+ r"""
1100
+ An iterator for super partitions of degree ``n``.
1101
+
1102
+ EXAMPLES::
1103
+
1104
+ sage: SuperPartitions(1).list()
1105
+ [[; 1], [1; ], [0; 1], [1, 0; ]]
1106
+ sage: SuperPartitions(6).cardinality()
1107
+ 80
1108
+ """
1109
+ m = 0
1110
+ while self.n >= m * (m - 1) // 2:
1111
+ for LA in SuperPartitions(self.n, m):
1112
+ yield self.element_class(self, LA)
1113
+ m += 1
1114
+
1115
+
1116
+ class SuperPartitions_all(SuperPartitions):
1117
+ def __init__(self):
1118
+ """
1119
+ Initialize ``self``.
1120
+
1121
+ TESTS::
1122
+
1123
+ sage: SP = SuperPartitions()
1124
+ sage: TestSuite(SP).run()
1125
+ """
1126
+ SuperPartitions.__init__(self, True)
1127
+
1128
+ def _repr_(self) -> str:
1129
+ """
1130
+ Return a string representation of ``self``.
1131
+
1132
+ TESTS::
1133
+
1134
+ sage: repr(SuperPartitions())
1135
+ 'Super Partitions'
1136
+ """
1137
+ return "Super Partitions"
1138
+
1139
+ def __iter__(self):
1140
+ """
1141
+ Iterate over all super partitions.
1142
+
1143
+ EXAMPLES::
1144
+
1145
+ sage: SP = SuperPartitions()
1146
+ sage: it = SP.__iter__()
1147
+ sage: [next(it) for i in range(6)]
1148
+ [[; ], [0; ], [; 1], [1; ], [0; 1], [1, 0; ]]
1149
+ """
1150
+ n = 0
1151
+ while True:
1152
+ for sp in SuperPartitions(n):
1153
+ yield self.element_class(self, list(sp))
1154
+ n += 1