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.
- passagemath_combinat/__init__.py +3 -0
- passagemath_combinat-10.6.42.dist-info/METADATA +160 -0
- passagemath_combinat-10.6.42.dist-info/RECORD +400 -0
- passagemath_combinat-10.6.42.dist-info/WHEEL +5 -0
- passagemath_combinat-10.6.42.dist-info/top_level.txt +3 -0
- passagemath_combinat.libs/libgmp-0e7fc84e.so.10.5.0 +0 -0
- passagemath_combinat.libs/libsymmetrica-81fe8739.so.3.0.0 +0 -0
- sage/algebras/affine_nil_temperley_lieb.py +263 -0
- sage/algebras/all.py +24 -0
- sage/algebras/all__sagemath_combinat.py +35 -0
- sage/algebras/askey_wilson.py +935 -0
- sage/algebras/associated_graded.py +345 -0
- sage/algebras/cellular_basis.py +350 -0
- sage/algebras/cluster_algebra.py +2766 -0
- sage/algebras/down_up_algebra.py +860 -0
- sage/algebras/free_algebra.py +1698 -0
- sage/algebras/free_algebra_element.py +345 -0
- sage/algebras/free_algebra_quotient.py +405 -0
- sage/algebras/free_algebra_quotient_element.py +295 -0
- sage/algebras/free_zinbiel_algebra.py +885 -0
- sage/algebras/hall_algebra.py +783 -0
- sage/algebras/hecke_algebras/all.py +4 -0
- sage/algebras/hecke_algebras/ariki_koike_algebra.py +1796 -0
- sage/algebras/hecke_algebras/ariki_koike_specht_modules.py +475 -0
- sage/algebras/hecke_algebras/cubic_hecke_algebra.py +3520 -0
- sage/algebras/hecke_algebras/cubic_hecke_base_ring.py +1473 -0
- sage/algebras/hecke_algebras/cubic_hecke_matrix_rep.py +1079 -0
- sage/algebras/iwahori_hecke_algebra.py +3095 -0
- sage/algebras/jordan_algebra.py +1773 -0
- sage/algebras/lie_conformal_algebras/abelian_lie_conformal_algebra.py +113 -0
- sage/algebras/lie_conformal_algebras/affine_lie_conformal_algebra.py +156 -0
- sage/algebras/lie_conformal_algebras/all.py +18 -0
- sage/algebras/lie_conformal_algebras/bosonic_ghosts_lie_conformal_algebra.py +134 -0
- sage/algebras/lie_conformal_algebras/examples.py +43 -0
- sage/algebras/lie_conformal_algebras/fermionic_ghosts_lie_conformal_algebra.py +131 -0
- sage/algebras/lie_conformal_algebras/finitely_freely_generated_lca.py +139 -0
- sage/algebras/lie_conformal_algebras/free_bosons_lie_conformal_algebra.py +174 -0
- sage/algebras/lie_conformal_algebras/free_fermions_lie_conformal_algebra.py +167 -0
- sage/algebras/lie_conformal_algebras/freely_generated_lie_conformal_algebra.py +107 -0
- sage/algebras/lie_conformal_algebras/graded_lie_conformal_algebra.py +135 -0
- sage/algebras/lie_conformal_algebras/lie_conformal_algebra.py +353 -0
- sage/algebras/lie_conformal_algebras/lie_conformal_algebra_element.py +236 -0
- sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_basis.py +78 -0
- sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py +328 -0
- sage/algebras/lie_conformal_algebras/n2_lie_conformal_algebra.py +117 -0
- sage/algebras/lie_conformal_algebras/neveu_schwarz_lie_conformal_algebra.py +86 -0
- sage/algebras/lie_conformal_algebras/virasoro_lie_conformal_algebra.py +82 -0
- sage/algebras/lie_conformal_algebras/weyl_lie_conformal_algebra.py +205 -0
- sage/algebras/nil_coxeter_algebra.py +191 -0
- sage/algebras/q_commuting_polynomials.py +673 -0
- sage/algebras/q_system.py +608 -0
- sage/algebras/quantum_clifford.py +959 -0
- sage/algebras/quantum_groups/ace_quantum_onsager.py +693 -0
- sage/algebras/quantum_groups/all.py +9 -0
- sage/algebras/quantum_groups/fock_space.py +2219 -0
- sage/algebras/quantum_groups/q_numbers.py +207 -0
- sage/algebras/quantum_groups/quantum_group_gap.py +2695 -0
- sage/algebras/quantum_groups/representations.py +591 -0
- sage/algebras/quantum_matrix_coordinate_algebra.py +1006 -0
- sage/algebras/quantum_oscillator.py +623 -0
- sage/algebras/quaternion_algebra.py +20 -0
- sage/algebras/quaternion_algebra_element.py +55 -0
- sage/algebras/rational_cherednik_algebra.py +525 -0
- sage/algebras/schur_algebra.py +670 -0
- sage/algebras/shuffle_algebra.py +1011 -0
- sage/algebras/splitting_algebra.py +779 -0
- sage/algebras/tensor_algebra.py +709 -0
- sage/algebras/yangian.py +1082 -0
- sage/algebras/yokonuma_hecke_algebra.py +1018 -0
- sage/all__sagemath_combinat.py +35 -0
- sage/combinat/SJT.py +255 -0
- sage/combinat/affine_permutation.py +2405 -0
- sage/combinat/algebraic_combinatorics.py +55 -0
- sage/combinat/all.py +53 -0
- sage/combinat/all__sagemath_combinat.py +195 -0
- sage/combinat/alternating_sign_matrix.py +2063 -0
- sage/combinat/baxter_permutations.py +346 -0
- sage/combinat/bijectionist.py +3220 -0
- sage/combinat/binary_recurrence_sequences.py +1180 -0
- sage/combinat/blob_algebra.py +685 -0
- sage/combinat/catalog_partitions.py +27 -0
- sage/combinat/chas/all.py +23 -0
- sage/combinat/chas/fsym.py +1180 -0
- sage/combinat/chas/wqsym.py +2601 -0
- sage/combinat/cluster_complex.py +326 -0
- sage/combinat/colored_permutations.py +2039 -0
- sage/combinat/colored_permutations_representations.py +964 -0
- sage/combinat/composition_signed.py +142 -0
- sage/combinat/composition_tableau.py +855 -0
- sage/combinat/constellation.py +1729 -0
- sage/combinat/core.py +751 -0
- sage/combinat/counting.py +12 -0
- sage/combinat/crystals/affine.py +742 -0
- sage/combinat/crystals/affine_factorization.py +518 -0
- sage/combinat/crystals/affinization.py +331 -0
- sage/combinat/crystals/alcove_path.py +2013 -0
- sage/combinat/crystals/all.py +22 -0
- sage/combinat/crystals/bkk_crystals.py +141 -0
- sage/combinat/crystals/catalog.py +115 -0
- sage/combinat/crystals/catalog_elementary_crystals.py +18 -0
- sage/combinat/crystals/catalog_infinity_crystals.py +33 -0
- sage/combinat/crystals/catalog_kirillov_reshetikhin.py +18 -0
- sage/combinat/crystals/crystals.py +257 -0
- sage/combinat/crystals/direct_sum.py +260 -0
- sage/combinat/crystals/elementary_crystals.py +1251 -0
- sage/combinat/crystals/fast_crystals.py +441 -0
- sage/combinat/crystals/fully_commutative_stable_grothendieck.py +1205 -0
- sage/combinat/crystals/generalized_young_walls.py +1076 -0
- sage/combinat/crystals/highest_weight_crystals.py +436 -0
- sage/combinat/crystals/induced_structure.py +695 -0
- sage/combinat/crystals/infinity_crystals.py +730 -0
- sage/combinat/crystals/kac_modules.py +863 -0
- sage/combinat/crystals/kirillov_reshetikhin.py +4196 -0
- sage/combinat/crystals/kyoto_path_model.py +497 -0
- sage/combinat/crystals/letters.cpython-314-x86_64-linux-musl.so +0 -0
- sage/combinat/crystals/letters.pxd +79 -0
- sage/combinat/crystals/letters.pyx +3056 -0
- sage/combinat/crystals/littelmann_path.py +1518 -0
- sage/combinat/crystals/monomial_crystals.py +1262 -0
- sage/combinat/crystals/multisegments.py +462 -0
- sage/combinat/crystals/mv_polytopes.py +467 -0
- sage/combinat/crystals/pbw_crystal.py +511 -0
- sage/combinat/crystals/pbw_datum.cpython-314-x86_64-linux-musl.so +0 -0
- sage/combinat/crystals/pbw_datum.pxd +4 -0
- sage/combinat/crystals/pbw_datum.pyx +487 -0
- sage/combinat/crystals/polyhedral_realization.py +372 -0
- sage/combinat/crystals/spins.cpython-314-x86_64-linux-musl.so +0 -0
- sage/combinat/crystals/spins.pxd +21 -0
- sage/combinat/crystals/spins.pyx +756 -0
- sage/combinat/crystals/star_crystal.py +290 -0
- sage/combinat/crystals/subcrystal.py +464 -0
- sage/combinat/crystals/tensor_product.py +1177 -0
- sage/combinat/crystals/tensor_product_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/combinat/crystals/tensor_product_element.pxd +35 -0
- sage/combinat/crystals/tensor_product_element.pyx +1870 -0
- sage/combinat/crystals/virtual_crystal.py +420 -0
- sage/combinat/cyclic_sieving_phenomenon.py +204 -0
- sage/combinat/debruijn_sequence.cpython-314-x86_64-linux-musl.so +0 -0
- sage/combinat/debruijn_sequence.pyx +355 -0
- sage/combinat/decorated_permutation.py +270 -0
- sage/combinat/degree_sequences.cpython-314-x86_64-linux-musl.so +0 -0
- sage/combinat/degree_sequences.pyx +588 -0
- sage/combinat/derangements.py +527 -0
- sage/combinat/descent_algebra.py +1008 -0
- sage/combinat/diagram.py +1551 -0
- sage/combinat/diagram_algebras.py +5886 -0
- sage/combinat/dyck_word.py +4349 -0
- sage/combinat/e_one_star.py +1623 -0
- sage/combinat/enumerated_sets.py +123 -0
- sage/combinat/expnums.cpython-314-x86_64-linux-musl.so +0 -0
- sage/combinat/expnums.pyx +148 -0
- sage/combinat/fast_vector_partitions.cpython-314-x86_64-linux-musl.so +0 -0
- sage/combinat/fast_vector_partitions.pyx +346 -0
- sage/combinat/fqsym.py +1977 -0
- sage/combinat/free_dendriform_algebra.py +954 -0
- sage/combinat/free_prelie_algebra.py +1141 -0
- sage/combinat/fully_commutative_elements.py +1077 -0
- sage/combinat/fully_packed_loop.py +1523 -0
- sage/combinat/gelfand_tsetlin_patterns.py +1409 -0
- sage/combinat/gray_codes.py +311 -0
- sage/combinat/grossman_larson_algebras.py +667 -0
- sage/combinat/growth.py +4352 -0
- sage/combinat/hall_polynomial.py +188 -0
- sage/combinat/hillman_grassl.py +866 -0
- sage/combinat/integer_matrices.py +329 -0
- sage/combinat/integer_vectors_mod_permgroup.py +1238 -0
- sage/combinat/k_tableau.py +4564 -0
- sage/combinat/kazhdan_lusztig.py +215 -0
- sage/combinat/key_polynomial.py +885 -0
- sage/combinat/knutson_tao_puzzles.py +2286 -0
- sage/combinat/lr_tableau.py +311 -0
- sage/combinat/matrices/all.py +24 -0
- sage/combinat/matrices/hadamard_matrix.py +3790 -0
- sage/combinat/matrices/latin.py +2912 -0
- sage/combinat/misc.py +401 -0
- sage/combinat/multiset_partition_into_sets_ordered.py +3541 -0
- sage/combinat/ncsf_qsym/all.py +21 -0
- sage/combinat/ncsf_qsym/combinatorics.py +317 -0
- sage/combinat/ncsf_qsym/generic_basis_code.py +1427 -0
- sage/combinat/ncsf_qsym/ncsf.py +5637 -0
- sage/combinat/ncsf_qsym/qsym.py +4053 -0
- sage/combinat/ncsf_qsym/tutorial.py +447 -0
- sage/combinat/ncsym/all.py +21 -0
- sage/combinat/ncsym/bases.py +855 -0
- sage/combinat/ncsym/dual.py +593 -0
- sage/combinat/ncsym/ncsym.py +2076 -0
- sage/combinat/necklace.py +551 -0
- sage/combinat/non_decreasing_parking_function.py +634 -0
- sage/combinat/nu_dyck_word.py +1474 -0
- sage/combinat/output.py +861 -0
- sage/combinat/parallelogram_polyomino.py +4326 -0
- sage/combinat/parking_functions.py +1602 -0
- sage/combinat/partition_algebra.py +1998 -0
- sage/combinat/partition_kleshchev.py +1982 -0
- sage/combinat/partition_shifting_algebras.py +584 -0
- sage/combinat/partition_tuple.py +3114 -0
- sage/combinat/path_tableaux/all.py +13 -0
- sage/combinat/path_tableaux/catalog.py +29 -0
- sage/combinat/path_tableaux/dyck_path.py +380 -0
- sage/combinat/path_tableaux/frieze.py +476 -0
- sage/combinat/path_tableaux/path_tableau.py +728 -0
- sage/combinat/path_tableaux/semistandard.py +510 -0
- sage/combinat/perfect_matching.py +779 -0
- sage/combinat/plane_partition.py +3300 -0
- sage/combinat/q_bernoulli.cpython-314-x86_64-linux-musl.so +0 -0
- sage/combinat/q_bernoulli.pyx +128 -0
- sage/combinat/quickref.py +81 -0
- sage/combinat/recognizable_series.py +2051 -0
- sage/combinat/regular_sequence.py +4316 -0
- sage/combinat/regular_sequence_bounded.py +543 -0
- sage/combinat/restricted_growth.py +81 -0
- sage/combinat/ribbon.py +20 -0
- sage/combinat/ribbon_shaped_tableau.py +489 -0
- sage/combinat/ribbon_tableau.py +1180 -0
- sage/combinat/rigged_configurations/all.py +46 -0
- sage/combinat/rigged_configurations/bij_abstract_class.py +548 -0
- sage/combinat/rigged_configurations/bij_infinity.py +370 -0
- sage/combinat/rigged_configurations/bij_type_A.py +163 -0
- sage/combinat/rigged_configurations/bij_type_A2_dual.py +338 -0
- sage/combinat/rigged_configurations/bij_type_A2_even.py +218 -0
- sage/combinat/rigged_configurations/bij_type_A2_odd.py +199 -0
- sage/combinat/rigged_configurations/bij_type_B.py +900 -0
- sage/combinat/rigged_configurations/bij_type_C.py +267 -0
- sage/combinat/rigged_configurations/bij_type_D.py +771 -0
- sage/combinat/rigged_configurations/bij_type_D_tri.py +392 -0
- sage/combinat/rigged_configurations/bij_type_D_twisted.py +576 -0
- sage/combinat/rigged_configurations/bij_type_E67.py +402 -0
- sage/combinat/rigged_configurations/bijection.py +143 -0
- sage/combinat/rigged_configurations/kleber_tree.py +1475 -0
- sage/combinat/rigged_configurations/kr_tableaux.py +1898 -0
- sage/combinat/rigged_configurations/rc_crystal.py +461 -0
- sage/combinat/rigged_configurations/rc_infinity.py +540 -0
- sage/combinat/rigged_configurations/rigged_configuration_element.py +2403 -0
- sage/combinat/rigged_configurations/rigged_configurations.py +1918 -0
- sage/combinat/rigged_configurations/rigged_partition.cpython-314-x86_64-linux-musl.so +0 -0
- sage/combinat/rigged_configurations/rigged_partition.pxd +15 -0
- sage/combinat/rigged_configurations/rigged_partition.pyx +680 -0
- sage/combinat/rigged_configurations/tensor_product_kr_tableaux.py +499 -0
- sage/combinat/rigged_configurations/tensor_product_kr_tableaux_element.py +428 -0
- sage/combinat/rsk.py +3438 -0
- sage/combinat/schubert_polynomial.py +508 -0
- sage/combinat/set_partition.py +3318 -0
- sage/combinat/set_partition_iterator.cpython-314-x86_64-linux-musl.so +0 -0
- sage/combinat/set_partition_iterator.pyx +136 -0
- sage/combinat/set_partition_ordered.py +1590 -0
- sage/combinat/sf/abreu_nigro.py +346 -0
- sage/combinat/sf/all.py +52 -0
- sage/combinat/sf/character.py +576 -0
- sage/combinat/sf/classical.py +319 -0
- sage/combinat/sf/dual.py +996 -0
- sage/combinat/sf/elementary.py +549 -0
- sage/combinat/sf/hall_littlewood.py +1028 -0
- sage/combinat/sf/hecke.py +336 -0
- sage/combinat/sf/homogeneous.py +464 -0
- sage/combinat/sf/jack.py +1428 -0
- sage/combinat/sf/k_dual.py +1458 -0
- sage/combinat/sf/kfpoly.py +447 -0
- sage/combinat/sf/llt.py +789 -0
- sage/combinat/sf/macdonald.py +2019 -0
- sage/combinat/sf/monomial.py +525 -0
- sage/combinat/sf/multiplicative.py +113 -0
- sage/combinat/sf/new_kschur.py +1786 -0
- sage/combinat/sf/ns_macdonald.py +964 -0
- sage/combinat/sf/orthogonal.py +246 -0
- sage/combinat/sf/orthotriang.py +355 -0
- sage/combinat/sf/powersum.py +963 -0
- sage/combinat/sf/schur.py +880 -0
- sage/combinat/sf/sf.py +1653 -0
- sage/combinat/sf/sfa.py +7053 -0
- sage/combinat/sf/symplectic.py +253 -0
- sage/combinat/sf/witt.py +721 -0
- sage/combinat/shifted_primed_tableau.py +2735 -0
- sage/combinat/shuffle.py +830 -0
- sage/combinat/sidon_sets.py +146 -0
- sage/combinat/similarity_class_type.py +1721 -0
- sage/combinat/sine_gordon.py +618 -0
- sage/combinat/six_vertex_model.py +784 -0
- sage/combinat/skew_partition.py +2053 -0
- sage/combinat/skew_tableau.py +2989 -0
- sage/combinat/sloane_functions.py +8935 -0
- sage/combinat/specht_module.py +1403 -0
- sage/combinat/species/all.py +48 -0
- sage/combinat/species/characteristic_species.py +321 -0
- sage/combinat/species/composition_species.py +273 -0
- sage/combinat/species/cycle_species.py +284 -0
- sage/combinat/species/empty_species.py +155 -0
- sage/combinat/species/functorial_composition_species.py +148 -0
- sage/combinat/species/generating_series.py +673 -0
- sage/combinat/species/library.py +148 -0
- sage/combinat/species/linear_order_species.py +169 -0
- sage/combinat/species/misc.py +83 -0
- sage/combinat/species/partition_species.py +290 -0
- sage/combinat/species/permutation_species.py +268 -0
- sage/combinat/species/product_species.py +423 -0
- sage/combinat/species/recursive_species.py +476 -0
- sage/combinat/species/set_species.py +192 -0
- sage/combinat/species/species.py +820 -0
- sage/combinat/species/structure.py +539 -0
- sage/combinat/species/subset_species.py +243 -0
- sage/combinat/species/sum_species.py +225 -0
- sage/combinat/subword.py +564 -0
- sage/combinat/subword_complex.py +2122 -0
- sage/combinat/subword_complex_c.cpython-314-x86_64-linux-musl.so +0 -0
- sage/combinat/subword_complex_c.pyx +119 -0
- sage/combinat/super_tableau.py +821 -0
- sage/combinat/superpartition.py +1154 -0
- sage/combinat/symmetric_group_algebra.py +3774 -0
- sage/combinat/symmetric_group_representations.py +1830 -0
- sage/combinat/t_sequences.py +877 -0
- sage/combinat/tableau.py +9506 -0
- sage/combinat/tableau_residues.py +860 -0
- sage/combinat/tableau_tuple.py +5353 -0
- sage/combinat/tiling.py +2432 -0
- sage/combinat/triangles_FHM.py +777 -0
- sage/combinat/tutorial.py +1857 -0
- sage/combinat/vector_partition.py +337 -0
- sage/combinat/words/abstract_word.py +1722 -0
- sage/combinat/words/all.py +59 -0
- sage/combinat/words/alphabet.py +268 -0
- sage/combinat/words/finite_word.py +7201 -0
- sage/combinat/words/infinite_word.py +113 -0
- sage/combinat/words/lyndon_word.py +652 -0
- sage/combinat/words/morphic.py +351 -0
- sage/combinat/words/morphism.py +3878 -0
- sage/combinat/words/paths.py +2932 -0
- sage/combinat/words/shuffle_product.py +278 -0
- sage/combinat/words/suffix_trees.py +1873 -0
- sage/combinat/words/word.py +769 -0
- sage/combinat/words/word_char.cpython-314-x86_64-linux-musl.so +0 -0
- sage/combinat/words/word_char.pyx +847 -0
- sage/combinat/words/word_datatypes.cpython-314-x86_64-linux-musl.so +0 -0
- sage/combinat/words/word_datatypes.pxd +4 -0
- sage/combinat/words/word_datatypes.pyx +1067 -0
- sage/combinat/words/word_generators.py +2026 -0
- sage/combinat/words/word_infinite_datatypes.py +1218 -0
- sage/combinat/words/word_options.py +99 -0
- sage/combinat/words/words.py +2396 -0
- sage/data_structures/all__sagemath_combinat.py +1 -0
- sage/databases/all__sagemath_combinat.py +13 -0
- sage/databases/findstat.py +4897 -0
- sage/databases/oeis.py +2058 -0
- sage/databases/sloane.py +393 -0
- sage/dynamics/all__sagemath_combinat.py +14 -0
- sage/dynamics/cellular_automata/all.py +7 -0
- sage/dynamics/cellular_automata/catalog.py +34 -0
- sage/dynamics/cellular_automata/elementary.py +612 -0
- sage/dynamics/cellular_automata/glca.py +477 -0
- sage/dynamics/cellular_automata/solitons.py +1463 -0
- sage/dynamics/finite_dynamical_system.py +1249 -0
- sage/dynamics/finite_dynamical_system_catalog.py +382 -0
- sage/games/all.py +7 -0
- sage/games/hexad.py +704 -0
- sage/games/quantumino.py +591 -0
- sage/games/sudoku.py +889 -0
- sage/games/sudoku_backtrack.cpython-314-x86_64-linux-musl.so +0 -0
- sage/games/sudoku_backtrack.pyx +189 -0
- sage/groups/all__sagemath_combinat.py +1 -0
- sage/groups/indexed_free_group.py +489 -0
- sage/libs/all__sagemath_combinat.py +6 -0
- sage/libs/lrcalc/__init__.py +1 -0
- sage/libs/lrcalc/lrcalc.py +525 -0
- sage/libs/symmetrica/__init__.py +7 -0
- sage/libs/symmetrica/all.py +101 -0
- sage/libs/symmetrica/kostka.pxi +168 -0
- sage/libs/symmetrica/part.pxi +193 -0
- sage/libs/symmetrica/plet.pxi +42 -0
- sage/libs/symmetrica/sab.pxi +196 -0
- sage/libs/symmetrica/sb.pxi +332 -0
- sage/libs/symmetrica/sc.pxi +192 -0
- sage/libs/symmetrica/schur.pxi +956 -0
- sage/libs/symmetrica/symmetrica.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/symmetrica/symmetrica.pxi +1172 -0
- sage/libs/symmetrica/symmetrica.pyx +39 -0
- sage/monoids/all.py +13 -0
- sage/monoids/automatic_semigroup.py +1054 -0
- sage/monoids/free_abelian_monoid.py +315 -0
- sage/monoids/free_abelian_monoid_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/monoids/free_abelian_monoid_element.pxd +16 -0
- sage/monoids/free_abelian_monoid_element.pyx +397 -0
- sage/monoids/free_monoid.py +335 -0
- sage/monoids/free_monoid_element.py +431 -0
- sage/monoids/hecke_monoid.py +65 -0
- sage/monoids/string_monoid.py +817 -0
- sage/monoids/string_monoid_element.py +547 -0
- sage/monoids/string_ops.py +143 -0
- sage/monoids/trace_monoid.py +972 -0
- sage/rings/all__sagemath_combinat.py +2 -0
- sage/sat/all.py +4 -0
- sage/sat/boolean_polynomials.py +405 -0
- sage/sat/converters/__init__.py +6 -0
- sage/sat/converters/anf2cnf.py +14 -0
- sage/sat/converters/polybori.py +611 -0
- sage/sat/solvers/__init__.py +5 -0
- sage/sat/solvers/cryptominisat.py +287 -0
- sage/sat/solvers/dimacs.py +783 -0
- sage/sat/solvers/picosat.py +228 -0
- sage/sat/solvers/sat_lp.py +156 -0
- sage/sat/solvers/satsolver.cpython-314-x86_64-linux-musl.so +0 -0
- sage/sat/solvers/satsolver.pxd +3 -0
- 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
|