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,584 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-combinat
|
|
2
|
+
# sage.doctest: needs sage.combinat sage.modules
|
|
3
|
+
r"""
|
|
4
|
+
Partition shifting algebras
|
|
5
|
+
|
|
6
|
+
This module contains families of operators that act on partitions or,
|
|
7
|
+
more generally, integer sequences. In particular, this includes Young's
|
|
8
|
+
raising operators `R_{ij}`, which act on integer sequences by adding `1`
|
|
9
|
+
to the `i`-th entry and subtracting `1` to the `j`-th entry. A special
|
|
10
|
+
case is acting on partitions.
|
|
11
|
+
|
|
12
|
+
AUTHORS:
|
|
13
|
+
|
|
14
|
+
- Matthew Lancellotti, George H. Seelinger (2018): initial version
|
|
15
|
+
"""
|
|
16
|
+
# ****************************************************************************
|
|
17
|
+
# Copyright (C) 2018 Matthew Lancellotti <mvlancellotti@gmail.com>
|
|
18
|
+
# George H. Seelinger <ghseeli@gmail.com>
|
|
19
|
+
#
|
|
20
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
21
|
+
# https://www.gnu.org/licenses/
|
|
22
|
+
# ****************************************************************************
|
|
23
|
+
from sage.combinat.free_module import CombinatorialFreeModule
|
|
24
|
+
from sage.categories.sets_cat import Sets
|
|
25
|
+
from sage.categories.algebras import Algebras
|
|
26
|
+
from sage.structure.parent import Parent
|
|
27
|
+
from sage.combinat.composition import Composition
|
|
28
|
+
from sage.combinat.partition import _Partitions, Partition
|
|
29
|
+
from sage.combinat.sf.sf import SymmetricFunctions
|
|
30
|
+
from sage.misc.fast_methods import Singleton
|
|
31
|
+
from sage.misc.cachefunc import cached_method
|
|
32
|
+
from sage.rings.rational_field import QQ
|
|
33
|
+
from sage.rings.semirings.non_negative_integer_semiring import NonNegativeIntegerSemiring
|
|
34
|
+
from sage.rings.integer_ring import ZZ
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class ShiftingSequenceSpace(Singleton, Parent):
|
|
38
|
+
r"""
|
|
39
|
+
A helper for :class:`ShiftingOperatorAlgebra` that contains all
|
|
40
|
+
tuples with entries in `\ZZ` of finite support with no trailing `0`'s.
|
|
41
|
+
|
|
42
|
+
EXAMPLES::
|
|
43
|
+
|
|
44
|
+
sage: from sage.combinat.partition_shifting_algebras import ShiftingSequenceSpace
|
|
45
|
+
sage: S = ShiftingSequenceSpace()
|
|
46
|
+
sage: (1, -1) in S
|
|
47
|
+
True
|
|
48
|
+
sage: (1, -1, 0, 9) in S
|
|
49
|
+
True
|
|
50
|
+
sage: [1, -1] in S
|
|
51
|
+
False
|
|
52
|
+
sage: (0.5, 1) in S
|
|
53
|
+
False
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
def __init__(self):
|
|
57
|
+
r"""
|
|
58
|
+
Initialize ``self``.
|
|
59
|
+
|
|
60
|
+
EXAMPLES::
|
|
61
|
+
|
|
62
|
+
sage: from sage.combinat.partition_shifting_algebras import ShiftingSequenceSpace
|
|
63
|
+
sage: S = ShiftingSequenceSpace()
|
|
64
|
+
"""
|
|
65
|
+
Parent.__init__(self, facade=(tuple,),
|
|
66
|
+
category=Sets().Infinite().Facade())
|
|
67
|
+
|
|
68
|
+
def __contains__(self, seq):
|
|
69
|
+
r"""
|
|
70
|
+
Return ``True`` if and only if ``seq`` is a valid shifting sequence.
|
|
71
|
+
|
|
72
|
+
EXAMPLES::
|
|
73
|
+
|
|
74
|
+
sage: from sage.combinat.partition_shifting_algebras import ShiftingSequenceSpace
|
|
75
|
+
sage: S = ShiftingSequenceSpace()
|
|
76
|
+
sage: (1, -1) in S
|
|
77
|
+
True
|
|
78
|
+
sage: (1, -1, 0, 9) in S
|
|
79
|
+
True
|
|
80
|
+
sage: (1, -1, 0) in S
|
|
81
|
+
False
|
|
82
|
+
sage: () in S
|
|
83
|
+
True
|
|
84
|
+
sage: [1, -1] in S
|
|
85
|
+
False
|
|
86
|
+
sage: (0.5, 1) in S
|
|
87
|
+
False
|
|
88
|
+
"""
|
|
89
|
+
return (isinstance(seq, tuple) and all(i in ZZ for i in seq)
|
|
90
|
+
and (not seq or seq[-1]))
|
|
91
|
+
|
|
92
|
+
def check(self, seq):
|
|
93
|
+
r"""
|
|
94
|
+
Verify that ``seq`` is a valid shifting sequence.
|
|
95
|
+
|
|
96
|
+
If it is not, raise a :exc:`ValueError`.
|
|
97
|
+
|
|
98
|
+
EXAMPLES::
|
|
99
|
+
|
|
100
|
+
sage: from sage.combinat.partition_shifting_algebras import ShiftingSequenceSpace
|
|
101
|
+
sage: S = ShiftingSequenceSpace()
|
|
102
|
+
sage: S.check((1, -1))
|
|
103
|
+
sage: S.check((1, -1, 0, 9))
|
|
104
|
+
sage: S.check([1, -1])
|
|
105
|
+
Traceback (most recent call last):
|
|
106
|
+
...
|
|
107
|
+
ValueError: invalid index [1, -1]
|
|
108
|
+
sage: S.check((0.5, 1))
|
|
109
|
+
Traceback (most recent call last):
|
|
110
|
+
...
|
|
111
|
+
ValueError: invalid index (0.500000000000000, 1)
|
|
112
|
+
"""
|
|
113
|
+
if not self.__contains__(seq):
|
|
114
|
+
raise ValueError('invalid index {}'.format(seq))
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class ShiftingOperatorAlgebra(CombinatorialFreeModule):
|
|
118
|
+
r"""
|
|
119
|
+
An algebra of shifting operators.
|
|
120
|
+
|
|
121
|
+
Let `R` be a commutative ring. The algebra of shifting operators
|
|
122
|
+
is isomorphic as an `R`-algebra to the Laurent polynomial ring
|
|
123
|
+
`R[x_1^\pm, x_2^\pm, x_3^\pm, \ldots]`. Moreover, the monomials of
|
|
124
|
+
the shifting operator algebra act on any integer sequence `\lambda
|
|
125
|
+
= (\lambda_1, \lambda_2, \ldots, \lambda_{\ell})` as follows. Let
|
|
126
|
+
`S` be our algebra of shifting operators. Then, for any monomial
|
|
127
|
+
`s = x_1^{a_1}x_2^{a_2} \cdots x_r^{a_r} \in S` where `a_i \in
|
|
128
|
+
\ZZ` and `r \geq \ell`, we get that `s.\lambda = (\lambda_1
|
|
129
|
+
+ a_1, \lambda_2 + a_2,\ldots,\lambda_r+a_r)` where we pad
|
|
130
|
+
`\lambda` with `r-\ell` zeros. In particular, we can recover
|
|
131
|
+
Young's raising operator, `R_{ij}`, for `i < j`, acting on
|
|
132
|
+
partitions by having `\frac{x_i}{x_j}` act on a partition
|
|
133
|
+
`\lambda`.
|
|
134
|
+
|
|
135
|
+
One can extend the action of these shifting operators to a basis
|
|
136
|
+
of symmetric functions, but at the expense of no longer actually
|
|
137
|
+
having a well-defined operator. Formally, to extend the action of
|
|
138
|
+
the shifting operators on a symmetric function basis `B =
|
|
139
|
+
\{b_{\lambda}\}_{\lambda}`, we define an `R`-module homomorphism
|
|
140
|
+
`\phi : R[x_1^\pm, x_2^\pm, \ldots] \to B`. Then we compute
|
|
141
|
+
`x_1^{a_1} \cdots x_r^{a_r}.b_\lambda` by first computing
|
|
142
|
+
`(x_1^{a_1} \cdots x_r^{a_r})x_1^{\lambda_1} \cdots
|
|
143
|
+
x_\ell^{\lambda_\ell}` and then applying `\phi` to the result. For
|
|
144
|
+
examples of what this looks like with specific bases, see below.
|
|
145
|
+
|
|
146
|
+
This implementation is consistent with how many references work
|
|
147
|
+
formally with raising operators. For instance, see exposition
|
|
148
|
+
surrounding [BMPS2018]_ Equation (4.1).
|
|
149
|
+
|
|
150
|
+
We follow the following convention for creating elements: ``S(1,
|
|
151
|
+
0, -1, 2)`` is the shifting operator that raises the first part by
|
|
152
|
+
`1`, lowers the third part by `1`, and raises the fourth part by
|
|
153
|
+
`2`.
|
|
154
|
+
|
|
155
|
+
In addition to acting on partitions (or any integer sequence), the
|
|
156
|
+
shifting operators can also act on symmetric functions in a basis
|
|
157
|
+
`B` when a conversion to `B` has been registered, preferably using
|
|
158
|
+
:meth:`build_and_register_conversion`.
|
|
159
|
+
|
|
160
|
+
For a definition of raising operators, see [BMPS2018]_ Definition
|
|
161
|
+
2.1. See :meth:`ij` to create operators using the notation in
|
|
162
|
+
[BMPS2018]_.
|
|
163
|
+
|
|
164
|
+
INPUT:
|
|
165
|
+
|
|
166
|
+
- ``base_ring`` -- (default: ``QQ['t']``) the base ring
|
|
167
|
+
|
|
168
|
+
- ``prefix`` -- (default: ``'S'``) the label for the shifting operators
|
|
169
|
+
|
|
170
|
+
EXAMPLES::
|
|
171
|
+
|
|
172
|
+
sage: S = ShiftingOperatorAlgebra()
|
|
173
|
+
|
|
174
|
+
sage: elm = S[1, -1, 2]; elm
|
|
175
|
+
S(1, -1, 2)
|
|
176
|
+
sage: elm([5, 4])
|
|
177
|
+
[([6, 3, 2], 1)]
|
|
178
|
+
|
|
179
|
+
The shifting operator monomials can act on a complete homogeneous symmetric
|
|
180
|
+
function or a Schur function::
|
|
181
|
+
|
|
182
|
+
sage: s = SymmetricFunctions(QQ['t']).s()
|
|
183
|
+
sage: h = SymmetricFunctions(QQ['t']).h()
|
|
184
|
+
|
|
185
|
+
sage: elm(s[5, 4])
|
|
186
|
+
s[6, 3, 2]
|
|
187
|
+
sage: elm(h[5, 4])
|
|
188
|
+
h[6, 3, 2]
|
|
189
|
+
|
|
190
|
+
sage: S[1, -1](s[5, 4])
|
|
191
|
+
s[6, 3]
|
|
192
|
+
sage: S[1, -1](h[5, 4])
|
|
193
|
+
h[6, 3]
|
|
194
|
+
|
|
195
|
+
In fact, we can extend this action by linearity::
|
|
196
|
+
|
|
197
|
+
sage: elm = (1 - S[1,-1]) * (1 - S[4])
|
|
198
|
+
sage: elm == S([]) - S([1, -1]) - S([4]) + S([5, -1])
|
|
199
|
+
True
|
|
200
|
+
sage: elm(s[2, 2, 1])
|
|
201
|
+
s[2, 2, 1] - s[3, 1, 1] - s[6, 2, 1] + s[7, 1, 1]
|
|
202
|
+
|
|
203
|
+
sage: elm = (1 - S[1,-1]) * (1 - S[0,1,-1])
|
|
204
|
+
sage: elm == 1 - S[0,1,-1] - S[1,-1] + S[1,0,-1]
|
|
205
|
+
True
|
|
206
|
+
sage: elm(s[2, 2, 1])
|
|
207
|
+
s[2, 2, 1] - s[3, 1, 1] + s[3, 2]
|
|
208
|
+
|
|
209
|
+
The algebra also comes equipped with homomorphisms to various
|
|
210
|
+
symmetric function bases; these homomorphisms are how the action of
|
|
211
|
+
``S`` on the specific symmetric function bases is implemented::
|
|
212
|
+
|
|
213
|
+
sage: elm = S([3,1,2]); elm
|
|
214
|
+
S(3, 1, 2)
|
|
215
|
+
sage: h(elm)
|
|
216
|
+
h[3, 2, 1]
|
|
217
|
+
sage: s(elm)
|
|
218
|
+
0
|
|
219
|
+
|
|
220
|
+
However, not all homomorphisms are equivalent, so the action is basis
|
|
221
|
+
dependent::
|
|
222
|
+
|
|
223
|
+
sage: elm = S([3,2,1]); elm
|
|
224
|
+
S(3, 2, 1)
|
|
225
|
+
sage: h(elm)
|
|
226
|
+
h[3, 2, 1]
|
|
227
|
+
sage: s(elm)
|
|
228
|
+
s[3, 2, 1]
|
|
229
|
+
sage: s(elm) == s(h(elm))
|
|
230
|
+
False
|
|
231
|
+
|
|
232
|
+
We can also use raising operators to implement the Jacobi-Trudi identity::
|
|
233
|
+
|
|
234
|
+
sage: op = (1-S[(1,-1)]) * (1-S[(1,0,-1)]) * (1-S[(0,1,-1)])
|
|
235
|
+
sage: s(op(h[3,2,1]))
|
|
236
|
+
s[3, 2, 1]
|
|
237
|
+
"""
|
|
238
|
+
|
|
239
|
+
def __init__(self, base_ring=QQ['t'], prefix='S'):
|
|
240
|
+
r"""
|
|
241
|
+
Initialize ``self``.
|
|
242
|
+
|
|
243
|
+
EXAMPLES::
|
|
244
|
+
|
|
245
|
+
sage: S = ShiftingOperatorAlgebra(QQ['t'])
|
|
246
|
+
sage: TestSuite(S).run()
|
|
247
|
+
"""
|
|
248
|
+
indices = ShiftingSequenceSpace()
|
|
249
|
+
cat = Algebras(base_ring).WithBasis()
|
|
250
|
+
CombinatorialFreeModule.__init__(self, base_ring, indices,
|
|
251
|
+
prefix=prefix,
|
|
252
|
+
bracket=False, category=cat)
|
|
253
|
+
|
|
254
|
+
# Setup default conversions
|
|
255
|
+
sym = SymmetricFunctions(base_ring)
|
|
256
|
+
self._sym_h = sym.h()
|
|
257
|
+
self._sym_s = sym.s()
|
|
258
|
+
self._sym_h.register_conversion(self.module_morphism(self._supp_to_h, codomain=self._sym_h))
|
|
259
|
+
self._sym_s.register_conversion(self.module_morphism(self._supp_to_s, codomain=self._sym_s))
|
|
260
|
+
|
|
261
|
+
def _repr_(self):
|
|
262
|
+
r"""
|
|
263
|
+
Return a string describing ``self``.
|
|
264
|
+
|
|
265
|
+
EXAMPLES::
|
|
266
|
+
|
|
267
|
+
sage: S = ShiftingOperatorAlgebra()
|
|
268
|
+
sage: S
|
|
269
|
+
Shifting Operator Algebra over Univariate Polynomial Ring in t
|
|
270
|
+
over Rational Field
|
|
271
|
+
"""
|
|
272
|
+
return "Shifting Operator Algebra over {}".format(self.base_ring())
|
|
273
|
+
|
|
274
|
+
def __getitem__(self, seq):
|
|
275
|
+
r"""
|
|
276
|
+
Return the shifting operator whose index is ``seq``.
|
|
277
|
+
|
|
278
|
+
This method is only for basis indices.
|
|
279
|
+
|
|
280
|
+
EXAMPLES::
|
|
281
|
+
|
|
282
|
+
sage: S = ShiftingOperatorAlgebra()
|
|
283
|
+
sage: S[1, 1, -9]
|
|
284
|
+
S(1, 1, -9)
|
|
285
|
+
sage: S[(1, 1, -9)]
|
|
286
|
+
S(1, 1, -9)
|
|
287
|
+
sage: S[5]
|
|
288
|
+
S(5,)
|
|
289
|
+
"""
|
|
290
|
+
if not isinstance(seq, tuple):
|
|
291
|
+
if seq in ZZ:
|
|
292
|
+
seq = (seq,)
|
|
293
|
+
else:
|
|
294
|
+
seq = tuple(seq)
|
|
295
|
+
return self._element_constructor_(seq)
|
|
296
|
+
|
|
297
|
+
def _prepare_seq(self, seq):
|
|
298
|
+
r"""
|
|
299
|
+
Standardize the input ``seq`` to be a basis element of ``self``.
|
|
300
|
+
|
|
301
|
+
EXAMPLES::
|
|
302
|
+
|
|
303
|
+
sage: S = ShiftingOperatorAlgebra()
|
|
304
|
+
sage: S._prepare_seq([0, 2, 0])
|
|
305
|
+
(0, 2)
|
|
306
|
+
sage: S._prepare_seq((0, 0, 0, 0))
|
|
307
|
+
()
|
|
308
|
+
sage: S._prepare_seq(Partition([5,2,2,1]))
|
|
309
|
+
(5, 2, 2, 1)
|
|
310
|
+
"""
|
|
311
|
+
seq = tuple(seq)
|
|
312
|
+
index = len(seq) - 1
|
|
313
|
+
while index >= 0 and seq[index] == 0:
|
|
314
|
+
index -= 1
|
|
315
|
+
seq = seq[:index + 1]
|
|
316
|
+
self._indices.check(seq)
|
|
317
|
+
return seq
|
|
318
|
+
|
|
319
|
+
def _element_constructor_(self, seq):
|
|
320
|
+
r"""
|
|
321
|
+
Return the shifting operator whose index is ``seq``.
|
|
322
|
+
|
|
323
|
+
EXAMPLES::
|
|
324
|
+
|
|
325
|
+
sage: S = ShiftingOperatorAlgebra()
|
|
326
|
+
sage: S._element_constructor_([1, 1, -9])
|
|
327
|
+
S(1, 1, -9)
|
|
328
|
+
sage: S[1, 1, -9]
|
|
329
|
+
S(1, 1, -9)
|
|
330
|
+
sage: S[0, 1, 0]
|
|
331
|
+
S(0, 1)
|
|
332
|
+
"""
|
|
333
|
+
if seq in self.base_ring():
|
|
334
|
+
return self.term(self.one_basis(), self.base_ring()(seq))
|
|
335
|
+
return self.monomial(self._prepare_seq(seq))
|
|
336
|
+
|
|
337
|
+
def product_on_basis(self, x, y):
|
|
338
|
+
r"""
|
|
339
|
+
Return the product of basis elements indexed by ``x`` and ``y``.
|
|
340
|
+
|
|
341
|
+
EXAMPLES::
|
|
342
|
+
|
|
343
|
+
sage: S = ShiftingOperatorAlgebra()
|
|
344
|
+
sage: S.product_on_basis((0, 5, 2), (3, 2, -2, 5))
|
|
345
|
+
S(3, 7, 0, 5)
|
|
346
|
+
sage: S.product_on_basis((1, -2, 0, 3, -6), (-1, 2, 2))
|
|
347
|
+
S(0, 0, 2, 3, -6)
|
|
348
|
+
sage: S.product_on_basis((1, -2, -2), (-1, 2, 2))
|
|
349
|
+
S()
|
|
350
|
+
"""
|
|
351
|
+
# Make x have the longer length
|
|
352
|
+
if len(x) < len(y):
|
|
353
|
+
x, y = y, x
|
|
354
|
+
x = list(x) # Make a mutable copy
|
|
355
|
+
for i, val in enumerate(y):
|
|
356
|
+
x[i] += val
|
|
357
|
+
# strip trailing 0's
|
|
358
|
+
index = len(x) - 1
|
|
359
|
+
while index >= 0 and x[index] == 0:
|
|
360
|
+
index -= 1
|
|
361
|
+
return self.monomial(tuple(x[:index + 1]))
|
|
362
|
+
|
|
363
|
+
@cached_method
|
|
364
|
+
def one_basis(self):
|
|
365
|
+
"""
|
|
366
|
+
Return the index of the basis element for `1`.
|
|
367
|
+
|
|
368
|
+
EXAMPLES::
|
|
369
|
+
|
|
370
|
+
sage: S = ShiftingOperatorAlgebra()
|
|
371
|
+
sage: S.one_basis()
|
|
372
|
+
()
|
|
373
|
+
"""
|
|
374
|
+
return ()
|
|
375
|
+
|
|
376
|
+
def _supp_to_h(self, supp):
|
|
377
|
+
r"""
|
|
378
|
+
This is a helper function that is not meant to be called directly.
|
|
379
|
+
|
|
380
|
+
Given the support of an element
|
|
381
|
+
`x_1^{\gamma_1} x_2^{\gamma_2} \cdots x_\ell^{\gamma_\ell}` in the
|
|
382
|
+
``ShiftingOperatorAlgebra`` and a
|
|
383
|
+
symmetric function algebra basis `b` generated by
|
|
384
|
+
`\{b_1, b_2, b_3,\ldots\}`, return the element
|
|
385
|
+
`b_{\gamma_1} b_{\gamma_2} \cdots b_{\gamma_\ell}` where `b_0 = 1` and
|
|
386
|
+
`b_{-n} = 0` for all positive
|
|
387
|
+
integers `n`. The canonical example for `b` in this case would be `h`.
|
|
388
|
+
|
|
389
|
+
EXAMPLES::
|
|
390
|
+
|
|
391
|
+
sage: S = ShiftingOperatorAlgebra(QQ)
|
|
392
|
+
sage: h = SymmetricFunctions(QQ).h()
|
|
393
|
+
sage: S._supp_to_h(S([3,2,1]).support_of_term())
|
|
394
|
+
h[3, 2, 1]
|
|
395
|
+
sage: S._supp_to_h(S([2,3,1]).support_of_term())
|
|
396
|
+
h[3, 2, 1]
|
|
397
|
+
sage: S._supp_to_h(S([2,3,-1]).support_of_term()) == h.zero()
|
|
398
|
+
True
|
|
399
|
+
sage: S._supp_to_h(S([2,3,0]).support_of_term())
|
|
400
|
+
h[3, 2]
|
|
401
|
+
"""
|
|
402
|
+
gamma = sorted(supp, reverse=True)
|
|
403
|
+
if gamma in _Partitions:
|
|
404
|
+
return self._sym_h(gamma)
|
|
405
|
+
else:
|
|
406
|
+
return self._sym_h.zero()
|
|
407
|
+
|
|
408
|
+
def _supp_to_s(self, gamma):
|
|
409
|
+
r"""
|
|
410
|
+
This is a helper function that is not meant to be called directly.
|
|
411
|
+
|
|
412
|
+
Given the support of an element `x_1^{\gamma_1} x_2^{\gamma_2} \cdots
|
|
413
|
+
x_\ell^{\gamma_\ell}` in the ``ShiftingOperatorAlgebra``, return
|
|
414
|
+
the appropriate `s_\gamma` in the Schur basis using
|
|
415
|
+
"Schur function straightening" in [BMPS2018]_ Proposition 4.1.
|
|
416
|
+
|
|
417
|
+
EXAMPLES::
|
|
418
|
+
|
|
419
|
+
sage: S = ShiftingOperatorAlgebra(QQ)
|
|
420
|
+
sage: s = SymmetricFunctions(QQ).s()
|
|
421
|
+
sage: S._supp_to_s(S([3,2,1]).support_of_term())
|
|
422
|
+
s[3, 2, 1]
|
|
423
|
+
sage: S._supp_to_s(S([2,3,1]).support_of_term())
|
|
424
|
+
0
|
|
425
|
+
sage: S._supp_to_s(S([2,4,-1,1]).support_of_term())
|
|
426
|
+
s[3, 3]
|
|
427
|
+
sage: S._supp_to_s(S([3,2,0]).support_of_term())
|
|
428
|
+
s[3, 2]
|
|
429
|
+
"""
|
|
430
|
+
def number_of_noninversions(lis):
|
|
431
|
+
return sum(1 for i, val in enumerate(lis)
|
|
432
|
+
for j in range(i + 1, len(lis))
|
|
433
|
+
if val < lis[j]) # i < j is already enforced
|
|
434
|
+
|
|
435
|
+
rho = list(range(len(gamma) - 1, -1, -1))
|
|
436
|
+
combined = [g + r for g, r in zip(gamma, rho)]
|
|
437
|
+
if len(set(combined)) == len(combined) and all(e >= 0
|
|
438
|
+
for e in combined):
|
|
439
|
+
sign = (-1) ** number_of_noninversions(combined)
|
|
440
|
+
sort_combined = sorted(combined, reverse=True)
|
|
441
|
+
new_gamma = [sc - r for sc, r in zip(sort_combined, rho)]
|
|
442
|
+
return sign * self._sym_s(_Partitions(new_gamma))
|
|
443
|
+
else:
|
|
444
|
+
return self._sym_s.zero()
|
|
445
|
+
|
|
446
|
+
def build_and_register_conversion(self, support_map, codomain):
|
|
447
|
+
r"""
|
|
448
|
+
Build a module homomorphism from a map sending integer sequences to
|
|
449
|
+
``codomain`` and registers the result into Sage's conversion model.
|
|
450
|
+
|
|
451
|
+
The intended use is to define a morphism from
|
|
452
|
+
``self`` to a basis `B` of symmetric functions that will be used by
|
|
453
|
+
:class:`ShiftingOperatorAlgebra` to define the action of the
|
|
454
|
+
operators on `B`.
|
|
455
|
+
|
|
456
|
+
.. NOTE::
|
|
457
|
+
|
|
458
|
+
The actions on the complete homogeneous symmetric functions and
|
|
459
|
+
on the Schur functions by morphisms are already registered.
|
|
460
|
+
|
|
461
|
+
.. WARNING::
|
|
462
|
+
|
|
463
|
+
Because :class:`ShiftingOperatorAlgebra` inherits from
|
|
464
|
+
:class:`UniqueRepresentation`, once you register a conversion, this
|
|
465
|
+
will apply to all instances of :class:`ShiftingOperatorAlgebra`
|
|
466
|
+
over the same base ring with the same prefix.
|
|
467
|
+
|
|
468
|
+
INPUT:
|
|
469
|
+
|
|
470
|
+
- ``support_map`` -- a map from integer sequences to ``codomain``
|
|
471
|
+
|
|
472
|
+
- ``codomain`` -- the codomain of ``support_map``, usually a basis
|
|
473
|
+
of symmetric functions
|
|
474
|
+
|
|
475
|
+
EXAMPLES::
|
|
476
|
+
|
|
477
|
+
sage: S = ShiftingOperatorAlgebra(QQ)
|
|
478
|
+
sage: sym = SymmetricFunctions(QQ)
|
|
479
|
+
sage: p = sym.p()
|
|
480
|
+
sage: zero_map = lambda part: p.zero()
|
|
481
|
+
sage: S.build_and_register_conversion(zero_map, p)
|
|
482
|
+
sage: p(2*S([1,0,-1]) + S([2,1,0]) - 3*S([0,1,3]))
|
|
483
|
+
0
|
|
484
|
+
sage: op = S((1, -1))
|
|
485
|
+
sage: op(2*p[4,3] + 5*p[2,2] + 7*p[2]) == p.zero()
|
|
486
|
+
True
|
|
487
|
+
|
|
488
|
+
For a more illustrative example, we can implement a simple
|
|
489
|
+
(but not mathematically justified!) conversion on the monomial basis::
|
|
490
|
+
|
|
491
|
+
sage: S = ShiftingOperatorAlgebra(QQ)
|
|
492
|
+
sage: sym = SymmetricFunctions(QQ)
|
|
493
|
+
sage: m = sym.m()
|
|
494
|
+
sage: def supp_map(gamma):
|
|
495
|
+
....: gsort = sorted(gamma, reverse=True)
|
|
496
|
+
....: return m(gsort) if gsort in Partitions() else m.zero()
|
|
497
|
+
sage: S.build_and_register_conversion(supp_map, m)
|
|
498
|
+
sage: op = S.ij(0, 1)
|
|
499
|
+
sage: op(2*m[4,3] + 5*m[2,2] + 7*m[2]) == 2*m[5, 2] + 5*m[3, 1]
|
|
500
|
+
True
|
|
501
|
+
"""
|
|
502
|
+
module_morphism = self.module_morphism(support_map,
|
|
503
|
+
codomain=codomain)
|
|
504
|
+
codomain.register_conversion(module_morphism)
|
|
505
|
+
|
|
506
|
+
def ij(self, i, j):
|
|
507
|
+
r"""
|
|
508
|
+
Return the raising operator `R_{ij}` as notated in [BMPS2018]_ Definition 2.1.
|
|
509
|
+
|
|
510
|
+
Shorthand element constructor that allows you to create raising
|
|
511
|
+
operators using the familiar `R_{ij}` notation found in
|
|
512
|
+
[BMPS2018]_ Definition 2.1, with the exception that indices
|
|
513
|
+
here are 0-based, not 1-based.
|
|
514
|
+
|
|
515
|
+
EXAMPLES:
|
|
516
|
+
|
|
517
|
+
Create the raising operator which raises part 0 and lowers part 2
|
|
518
|
+
(indices are 0-based)::
|
|
519
|
+
|
|
520
|
+
sage: R = ShiftingOperatorAlgebra()
|
|
521
|
+
sage: R.ij(0, 2)
|
|
522
|
+
S(1, 0, -1)
|
|
523
|
+
"""
|
|
524
|
+
if i not in NonNegativeIntegerSemiring():
|
|
525
|
+
raise ValueError('i (={}) must be a natural number'.format(i))
|
|
526
|
+
if j not in NonNegativeIntegerSemiring():
|
|
527
|
+
raise ValueError('j (={}) must be a natural number'.format(j))
|
|
528
|
+
if not i < j:
|
|
529
|
+
raise ValueError('index j (={j}) must be greater than index i (={i})'.format(i=i, j=j))
|
|
530
|
+
seq = [0] * (max(i, j) + 1)
|
|
531
|
+
seq[i] = 1
|
|
532
|
+
seq[j] = -1
|
|
533
|
+
return self._element_constructor_(seq)
|
|
534
|
+
|
|
535
|
+
class Element(CombinatorialFreeModule.Element):
|
|
536
|
+
r"""
|
|
537
|
+
An element of a :class:`ShiftingOperatorAlgebra`.
|
|
538
|
+
"""
|
|
539
|
+
|
|
540
|
+
def __call__(self, operand):
|
|
541
|
+
r"""
|
|
542
|
+
Call method for shifting sequence operators to act on objects.
|
|
543
|
+
|
|
544
|
+
EXAMPLES::
|
|
545
|
+
|
|
546
|
+
sage: S = ShiftingOperatorAlgebra(QQ)
|
|
547
|
+
sage: op = S([1,1]) + 2*S([0,1,0,1])
|
|
548
|
+
sage: sorted(op([1,1,1,1])) == sorted([([2,2,1,1], 1), ([1,2,1,2], 2)])
|
|
549
|
+
True
|
|
550
|
+
sage: sorted(op(Partition([1,1,1,1]))) == sorted([([2,2,1,1], 1), ([1,2,1,2], 2)])
|
|
551
|
+
True
|
|
552
|
+
sage: sym = SymmetricFunctions(QQ)
|
|
553
|
+
sage: h = sym.h()
|
|
554
|
+
sage: op(h[1,1,1,1])
|
|
555
|
+
3*h[2, 2, 1, 1]
|
|
556
|
+
sage: s = sym.s()
|
|
557
|
+
sage: op(s[1,1,1,1])
|
|
558
|
+
s[2, 2, 1, 1]
|
|
559
|
+
sage: e = sym.e()
|
|
560
|
+
sage: sorted(op(e[1,1,1,1])) == sorted([([2,2,1,1], 1), ([1,2,1,2], 2)])
|
|
561
|
+
True
|
|
562
|
+
"""
|
|
563
|
+
P = self.parent()
|
|
564
|
+
if isinstance(operand, (list, tuple, Composition, Partition)):
|
|
565
|
+
def add_lists(x, y):
|
|
566
|
+
# Make x have the longer length
|
|
567
|
+
if len(x) < len(y):
|
|
568
|
+
x, y = y, x
|
|
569
|
+
x = list(x) # Make a mutable copy
|
|
570
|
+
for i, val in enumerate(y):
|
|
571
|
+
x[i] += val
|
|
572
|
+
return x
|
|
573
|
+
return [(add_lists(index, operand), coeff)
|
|
574
|
+
for index, coeff in self]
|
|
575
|
+
|
|
576
|
+
R = self.base_ring()
|
|
577
|
+
lift_operand = P._from_dict({P._prepare_seq(p): R(c)
|
|
578
|
+
for p, c in operand}, coerce=False)
|
|
579
|
+
result = self * lift_operand
|
|
580
|
+
operand_parent = operand.parent()
|
|
581
|
+
try:
|
|
582
|
+
return operand_parent(result)
|
|
583
|
+
except TypeError:
|
|
584
|
+
return [(list(index), coeff) for index, coeff in result]
|