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
sage/combinat/sf/dual.py
ADDED
|
@@ -0,0 +1,996 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-combinat
|
|
2
|
+
# sage.doctest: needs sage.combinat sage.modules
|
|
3
|
+
"""
|
|
4
|
+
Generic dual bases symmetric functions
|
|
5
|
+
"""
|
|
6
|
+
#*****************************************************************************
|
|
7
|
+
# Copyright (C) 2007 Mike Hansen <mhansen@gmail.com>
|
|
8
|
+
# 2012 Mike Zabrocki <mike.zabrocki@gmail.com>
|
|
9
|
+
#
|
|
10
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
11
|
+
#
|
|
12
|
+
# This code is distributed in the hope that it will be useful,
|
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
15
|
+
# General Public License for more details.
|
|
16
|
+
#
|
|
17
|
+
# The full text of the GPL is available at:
|
|
18
|
+
#
|
|
19
|
+
# https://www.gnu.org/licenses/
|
|
20
|
+
#*****************************************************************************
|
|
21
|
+
import sage.combinat.partition
|
|
22
|
+
import sage.data_structures.blas_dict as blas
|
|
23
|
+
from sage.categories.homset import Hom
|
|
24
|
+
from sage.categories.morphism import SetMorphism
|
|
25
|
+
from sage.matrix.constructor import matrix
|
|
26
|
+
|
|
27
|
+
from . import classical
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class SymmetricFunctionAlgebra_dual(classical.SymmetricFunctionAlgebra_classical):
|
|
31
|
+
@staticmethod
|
|
32
|
+
def __classcall__(cls, dual_basis, scalar, scalar_name='', basis_name=None, prefix=None):
|
|
33
|
+
"""
|
|
34
|
+
Normalize the arguments.
|
|
35
|
+
|
|
36
|
+
TESTS::
|
|
37
|
+
|
|
38
|
+
sage: w = SymmetricFunctions(QQ).w()
|
|
39
|
+
sage: B1 = w.dual_basis()
|
|
40
|
+
sage: B2 = w.dual_basis(prefix='d_w')
|
|
41
|
+
sage: B1 is B2
|
|
42
|
+
True
|
|
43
|
+
"""
|
|
44
|
+
if prefix is None:
|
|
45
|
+
prefix = 'd_'+dual_basis.prefix()
|
|
46
|
+
return super().__classcall__(cls, dual_basis, scalar, scalar_name, basis_name, prefix)
|
|
47
|
+
|
|
48
|
+
def __init__(self, dual_basis, scalar, scalar_name, basis_name, prefix):
|
|
49
|
+
r"""
|
|
50
|
+
Generic dual basis of a basis of symmetric functions.
|
|
51
|
+
|
|
52
|
+
INPUT:
|
|
53
|
+
|
|
54
|
+
- ``dual_basis`` -- a basis of the ring of symmetric functions
|
|
55
|
+
|
|
56
|
+
- ``scalar`` -- a function `z` on partitions which determines the
|
|
57
|
+
scalar product on the power sum basis by
|
|
58
|
+
`\langle p_{\mu}, p_{\mu} \rangle = z(\mu)`. (Independently on the
|
|
59
|
+
function chosen, the power sum basis will always be orthogonal; the
|
|
60
|
+
function ``scalar`` only determines the norms of the basis elements.)
|
|
61
|
+
This defaults to the function ``zee`` defined in
|
|
62
|
+
``sage.combinat.sf.sfa``, that is, the function is defined by:
|
|
63
|
+
|
|
64
|
+
.. MATH::
|
|
65
|
+
|
|
66
|
+
\lambda \mapsto \prod_{i = 1}^\infty m_i(\lambda)!
|
|
67
|
+
i^{m_i(\lambda)}`,
|
|
68
|
+
|
|
69
|
+
where `m_i(\lambda)` means the number of times `i` appears in
|
|
70
|
+
`\lambda`. This default function gives the standard Hall scalar
|
|
71
|
+
product on the ring of symmetric functions.
|
|
72
|
+
|
|
73
|
+
- ``scalar_name`` -- (default: the empty string) a string giving a
|
|
74
|
+
description of the scalar product specified by the parameter
|
|
75
|
+
``scalar``
|
|
76
|
+
|
|
77
|
+
- ``basis_name`` -- (optional) a string to serve as name for the basis
|
|
78
|
+
to be generated (such as "forgotten" in "the forgotten basis"); don't
|
|
79
|
+
set it to any of the already existing basis names (such as
|
|
80
|
+
``homogeneous``, ``monomial``, ``forgotten``, etc.).
|
|
81
|
+
|
|
82
|
+
- ``prefix`` -- (default: ``'d'`` and the prefix for ``dual_basis``)
|
|
83
|
+
a string to use as the symbol for the basis
|
|
84
|
+
|
|
85
|
+
OUTPUT:
|
|
86
|
+
|
|
87
|
+
The basis of the ring of symmetric functions dual to the basis
|
|
88
|
+
``dual_basis`` with respect to the scalar product determined
|
|
89
|
+
by ``scalar``.
|
|
90
|
+
|
|
91
|
+
EXAMPLES::
|
|
92
|
+
|
|
93
|
+
sage: e = SymmetricFunctions(QQ).e()
|
|
94
|
+
sage: f = e.dual_basis(prefix='m', basis_name="Forgotten symmetric functions"); f
|
|
95
|
+
Symmetric Functions over Rational Field in the Forgotten symmetric functions basis
|
|
96
|
+
sage: TestSuite(f).run(elements=[f[1,1]+2*f[2], f[1]+3*f[1,1]]) # needs lrcalc_python
|
|
97
|
+
sage: TestSuite(f).run() # long time (11s on sage.math, 2011) # needs lrcalc_python
|
|
98
|
+
|
|
99
|
+
This class defines canonical coercions between ``self`` and
|
|
100
|
+
``self^*``, as follow:
|
|
101
|
+
|
|
102
|
+
Lookup for the canonical isomorphism from ``self`` to `P`
|
|
103
|
+
(=powersum), and build the adjoint isomorphism from `P^*` to
|
|
104
|
+
``self^*``. Since `P` is self-adjoint for this scalar product,
|
|
105
|
+
derive an isomorphism from `P` to ``self^*``, and by composition
|
|
106
|
+
with the above get an isomorphism from ``self`` to ``self^*`` (and
|
|
107
|
+
similarly for the isomorphism ``self^*`` to ``self``).
|
|
108
|
+
|
|
109
|
+
This should be striped down to just (auto?) defining canonical
|
|
110
|
+
isomorphism by adjunction (as in MuPAD-Combinat), and let
|
|
111
|
+
the coercion handle the rest.
|
|
112
|
+
|
|
113
|
+
Inversions may not be possible if the base ring is not a field::
|
|
114
|
+
|
|
115
|
+
sage: m = SymmetricFunctions(ZZ).m()
|
|
116
|
+
sage: h = m.dual_basis(lambda x: 1)
|
|
117
|
+
sage: h[2,1]
|
|
118
|
+
Traceback (most recent call last):
|
|
119
|
+
...
|
|
120
|
+
TypeError: no conversion of this rational to integer
|
|
121
|
+
|
|
122
|
+
By transitivity, this defines indirect coercions to and from all other bases::
|
|
123
|
+
|
|
124
|
+
sage: s = SymmetricFunctions(QQ['t'].fraction_field()).s()
|
|
125
|
+
sage: t = QQ['t'].fraction_field().gen()
|
|
126
|
+
sage: zee_hl = lambda x: x.centralizer_size(t=t)
|
|
127
|
+
sage: S = s.dual_basis(zee_hl)
|
|
128
|
+
sage: S(s([2,1]))
|
|
129
|
+
(-t/(t^5-2*t^4+t^3-t^2+2*t-1))*d_s[1, 1, 1] + ((-t^2-1)/(t^5-2*t^4+t^3-t^2+2*t-1))*d_s[2, 1] + (-t/(t^5-2*t^4+t^3-t^2+2*t-1))*d_s[3]
|
|
130
|
+
|
|
131
|
+
TESTS:
|
|
132
|
+
|
|
133
|
+
Regression test for :issue:`12489`. This issue improving
|
|
134
|
+
equality test revealed that the conversion back from the dual
|
|
135
|
+
basis did not strip cancelled terms from the dictionary::
|
|
136
|
+
|
|
137
|
+
sage: y = e[1, 1, 1, 1] - 2*e[2, 1, 1] + e[2, 2]
|
|
138
|
+
sage: sorted(f.element_class(f, dual = y))
|
|
139
|
+
[([1, 1, 1, 1], 6), ([2, 1, 1], 2), ([2, 2], 1)]
|
|
140
|
+
"""
|
|
141
|
+
self._dual_basis = dual_basis
|
|
142
|
+
self._scalar = scalar
|
|
143
|
+
self._scalar_name = scalar_name
|
|
144
|
+
|
|
145
|
+
# Set up the cache
|
|
146
|
+
|
|
147
|
+
# cache for the coordinates of the elements
|
|
148
|
+
# of ``dual_basis`` with respect to ``self``
|
|
149
|
+
self._to_self_cache = {}
|
|
150
|
+
# cache for the coordinates of the elements
|
|
151
|
+
# of ``self`` with respect to ``dual_basis``
|
|
152
|
+
self._from_self_cache = {}
|
|
153
|
+
# cache for transition matrices which contain the coordinates of
|
|
154
|
+
# the elements of ``dual_basis`` with respect to ``self``
|
|
155
|
+
self._transition_matrices = {}
|
|
156
|
+
# cache for transition matrices which contain the coordinates of
|
|
157
|
+
# the elements of ``self`` with respect to ``dual_basis``
|
|
158
|
+
self._inverse_transition_matrices = {}
|
|
159
|
+
|
|
160
|
+
scalar_target = scalar(sage.combinat.partition.Partition([1])).parent()
|
|
161
|
+
scalar_target = (scalar_target.one()*dual_basis.base_ring().one()).parent()
|
|
162
|
+
|
|
163
|
+
self._sym = sage.combinat.sf.sf.SymmetricFunctions(scalar_target)
|
|
164
|
+
self._p = self._sym.power()
|
|
165
|
+
|
|
166
|
+
classical.SymmetricFunctionAlgebra_classical.__init__(self, self._sym,
|
|
167
|
+
basis_name=basis_name,
|
|
168
|
+
prefix=prefix)
|
|
169
|
+
|
|
170
|
+
# temporary until Hom(GradedHopfAlgebrasWithBasis work better)
|
|
171
|
+
category = sage.categories.all.ModulesWithBasis(self.base_ring())
|
|
172
|
+
self.register_coercion(SetMorphism(Hom(self._dual_basis, self, category), self._dual_to_self))
|
|
173
|
+
self._dual_basis.register_coercion(SetMorphism(Hom(self, self._dual_basis, category), self._self_to_dual))
|
|
174
|
+
|
|
175
|
+
def construction(self):
|
|
176
|
+
"""
|
|
177
|
+
Return a pair ``(F, R)``, where ``F`` is a
|
|
178
|
+
:class:`SymmetricFunctionsFunctor` and `R` is a ring, such
|
|
179
|
+
that ``F(R)`` returns ``self``.
|
|
180
|
+
|
|
181
|
+
EXAMPLES::
|
|
182
|
+
|
|
183
|
+
sage: w = SymmetricFunctions(ZZ).witt()
|
|
184
|
+
sage: w.dual_basis().construction()
|
|
185
|
+
(SymmetricFunctionsFunctor[dual Witt], Integer Ring)
|
|
186
|
+
"""
|
|
187
|
+
return DualBasisFunctor(self), self.base_ring()
|
|
188
|
+
|
|
189
|
+
def _dual_to_self(self, x):
|
|
190
|
+
"""
|
|
191
|
+
Coerce an element of the dual of ``self`` canonically into ``self``.
|
|
192
|
+
|
|
193
|
+
INPUT:
|
|
194
|
+
|
|
195
|
+
- ``x`` -- an element in the dual basis of ``self``
|
|
196
|
+
|
|
197
|
+
OUTPUT: ``x`` expressed in the basis ``self``
|
|
198
|
+
|
|
199
|
+
EXAMPLES::
|
|
200
|
+
|
|
201
|
+
sage: m = SymmetricFunctions(QQ).monomial()
|
|
202
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
203
|
+
sage: h = m.dual_basis(scalar=zee)
|
|
204
|
+
sage: h._dual_to_self(m([2,1]) + 3*m[1,1,1])
|
|
205
|
+
d_m[1, 1, 1] - d_m[2, 1]
|
|
206
|
+
sage: hh = m.realization_of().h()
|
|
207
|
+
sage: h._dual_to_self(m(hh([2,2,2])))
|
|
208
|
+
d_m[2, 2, 2]
|
|
209
|
+
|
|
210
|
+
:: Note that the result is not correct if ``x`` is not an element of the
|
|
211
|
+
dual basis of ``self``
|
|
212
|
+
|
|
213
|
+
sage: h._dual_to_self(m([2,1]))
|
|
214
|
+
-2*d_m[1, 1, 1] + 5*d_m[2, 1] - 3*d_m[3]
|
|
215
|
+
sage: h._dual_to_self(hh([2,1]))
|
|
216
|
+
-2*d_m[1, 1, 1] + 5*d_m[2, 1] - 3*d_m[3]
|
|
217
|
+
|
|
218
|
+
This is for internal use only. Please use instead::
|
|
219
|
+
|
|
220
|
+
sage: h(m([2,1]) + 3*m[1,1,1])
|
|
221
|
+
d_m[1, 1, 1] - d_m[2, 1]
|
|
222
|
+
"""
|
|
223
|
+
return self._element_class(self, dual=x)
|
|
224
|
+
|
|
225
|
+
def _self_to_dual(self, x):
|
|
226
|
+
"""
|
|
227
|
+
Coerce an element of ``self`` canonically into the dual.
|
|
228
|
+
|
|
229
|
+
INPUT:
|
|
230
|
+
|
|
231
|
+
- ``x`` -- an element of ``self``
|
|
232
|
+
|
|
233
|
+
OUTPUT: ``x`` expressed in the dual basis
|
|
234
|
+
|
|
235
|
+
EXAMPLES::
|
|
236
|
+
|
|
237
|
+
sage: m = SymmetricFunctions(QQ).monomial()
|
|
238
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
239
|
+
sage: h = m.dual_basis(scalar=zee)
|
|
240
|
+
sage: h._self_to_dual(h([2,1]) + 3*h[1,1,1])
|
|
241
|
+
21*m[1, 1, 1] + 11*m[2, 1] + 4*m[3]
|
|
242
|
+
|
|
243
|
+
This is for internal use only. Please use instead::
|
|
244
|
+
|
|
245
|
+
sage: m(h([2,1]) + 3*h[1,1,1])
|
|
246
|
+
21*m[1, 1, 1] + 11*m[2, 1] + 4*m[3]
|
|
247
|
+
|
|
248
|
+
or::
|
|
249
|
+
|
|
250
|
+
sage: (h([2,1]) + 3*h[1,1,1]).dual()
|
|
251
|
+
21*m[1, 1, 1] + 11*m[2, 1] + 4*m[3]
|
|
252
|
+
"""
|
|
253
|
+
return x.dual()
|
|
254
|
+
|
|
255
|
+
def _dual_basis_default(self):
|
|
256
|
+
"""
|
|
257
|
+
Return the default value for ``self.dual_basis()``.
|
|
258
|
+
|
|
259
|
+
This returns the basis ``self`` has been built from by
|
|
260
|
+
duality.
|
|
261
|
+
|
|
262
|
+
.. WARNING::
|
|
263
|
+
|
|
264
|
+
This is not necessarily the dual basis for the standard
|
|
265
|
+
(Hall) scalar product!
|
|
266
|
+
|
|
267
|
+
EXAMPLES::
|
|
268
|
+
|
|
269
|
+
sage: m = SymmetricFunctions(QQ).monomial()
|
|
270
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
271
|
+
sage: h = m.dual_basis(scalar=zee)
|
|
272
|
+
sage: h.dual_basis()
|
|
273
|
+
Symmetric Functions over Rational Field in the monomial basis
|
|
274
|
+
sage: m2 = h.dual_basis(zee, prefix='m2')
|
|
275
|
+
sage: m([2])^2
|
|
276
|
+
2*m[2, 2] + m[4]
|
|
277
|
+
sage: m2([2])^2
|
|
278
|
+
2*m2[2, 2] + m2[4]
|
|
279
|
+
|
|
280
|
+
TESTS::
|
|
281
|
+
|
|
282
|
+
sage: h.dual_basis() is h._dual_basis_default()
|
|
283
|
+
True
|
|
284
|
+
"""
|
|
285
|
+
return self._dual_basis
|
|
286
|
+
|
|
287
|
+
def basis_name(self):
|
|
288
|
+
r"""
|
|
289
|
+
Return the name of the basis of ``self``.
|
|
290
|
+
|
|
291
|
+
This is used for output and, for the classical bases of
|
|
292
|
+
symmetric functions, to connect this basis with :ref:`Symmetrica <spkg_symmetrica>`.
|
|
293
|
+
|
|
294
|
+
EXAMPLES::
|
|
295
|
+
|
|
296
|
+
sage: Sym = SymmetricFunctions(QQ)
|
|
297
|
+
sage: f = Sym.f()
|
|
298
|
+
sage: f.basis_name()
|
|
299
|
+
'forgotten'
|
|
300
|
+
"""
|
|
301
|
+
if self._basis_name is None:
|
|
302
|
+
return "dual " + self._dual_basis.basis_name()
|
|
303
|
+
return self._basis_name
|
|
304
|
+
|
|
305
|
+
def _repr_(self):
|
|
306
|
+
"""
|
|
307
|
+
Representation of ``self``.
|
|
308
|
+
|
|
309
|
+
OUTPUT: string description of ``self``
|
|
310
|
+
|
|
311
|
+
EXAMPLES::
|
|
312
|
+
|
|
313
|
+
sage: m = SymmetricFunctions(QQ).monomial()
|
|
314
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
315
|
+
sage: h = m.dual_basis(scalar=zee); h #indirect doctests
|
|
316
|
+
Dual basis to Symmetric Functions over Rational Field in the monomial basis
|
|
317
|
+
sage: h = m.dual_basis(scalar=zee, scalar_name='Hall scalar product'); h #indirect doctest
|
|
318
|
+
Dual basis to Symmetric Functions over Rational Field in the monomial basis with respect to the Hall scalar product
|
|
319
|
+
"""
|
|
320
|
+
if self._basis_name is not None:
|
|
321
|
+
return super()._repr_()
|
|
322
|
+
if self._scalar_name:
|
|
323
|
+
return "Dual basis to %s" % self._dual_basis + " with respect to the " + self._scalar_name
|
|
324
|
+
return "Dual basis to %s" % self._dual_basis
|
|
325
|
+
|
|
326
|
+
def _precompute(self, n):
|
|
327
|
+
"""
|
|
328
|
+
Compute the transition matrices between ``self`` and its dual basis for
|
|
329
|
+
the homogeneous component of size `n`. The result is not returned,
|
|
330
|
+
but stored in the cache.
|
|
331
|
+
|
|
332
|
+
INPUT:
|
|
333
|
+
|
|
334
|
+
- ``n`` -- nonnegative integer
|
|
335
|
+
|
|
336
|
+
EXAMPLES::
|
|
337
|
+
|
|
338
|
+
sage: e = SymmetricFunctions(QQ['t']).elementary()
|
|
339
|
+
sage: f = e.dual_basis()
|
|
340
|
+
sage: f._precompute(0)
|
|
341
|
+
sage: f._precompute(1)
|
|
342
|
+
sage: f._precompute(2)
|
|
343
|
+
sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())]
|
|
344
|
+
sage: l(f._to_self_cache) # note: this may depend on possible previous computations!
|
|
345
|
+
[([], [([], 1)]), ([1], [([1], 1)]), ([1, 1], [([1, 1], 2), ([2], 1)]), ([2], [([1, 1], 1), ([2], 1)])]
|
|
346
|
+
sage: l(f._from_self_cache)
|
|
347
|
+
[([], [([], 1)]), ([1], [([1], 1)]), ([1, 1], [([1, 1], 1), ([2], -1)]), ([2], [([1, 1], -1), ([2], 2)])]
|
|
348
|
+
sage: f._transition_matrices[2]
|
|
349
|
+
[1 1]
|
|
350
|
+
[1 2]
|
|
351
|
+
sage: f._inverse_transition_matrices[2]
|
|
352
|
+
[ 2 -1]
|
|
353
|
+
[-1 1]
|
|
354
|
+
"""
|
|
355
|
+
base_ring = self.base_ring()
|
|
356
|
+
zero = base_ring.zero()
|
|
357
|
+
|
|
358
|
+
# Handle the n == 0 and n == 1 cases separately
|
|
359
|
+
if n == 0 or n == 1:
|
|
360
|
+
part = sage.combinat.partition.Partition([1]*n)
|
|
361
|
+
self._to_self_cache[ part ] = { part: base_ring.one() }
|
|
362
|
+
self._from_self_cache[ part ] = { part: base_ring.one() }
|
|
363
|
+
self._transition_matrices[n] = matrix(base_ring, [[1]])
|
|
364
|
+
self._inverse_transition_matrices[n] = matrix(base_ring, [[1]])
|
|
365
|
+
return
|
|
366
|
+
|
|
367
|
+
partitions_n = sage.combinat.partition.Partitions_n(n).list()
|
|
368
|
+
|
|
369
|
+
# We now get separated into two cases, depending on whether we can
|
|
370
|
+
# use the power-sum basis to compute the matrix, or we have to use
|
|
371
|
+
# the Schur basis.
|
|
372
|
+
|
|
373
|
+
from sage.rings.rational_field import RationalField
|
|
374
|
+
if (not base_ring.has_coerce_map_from(RationalField())) and self._scalar == sage.combinat.sf.sfa.zee:
|
|
375
|
+
# This is the case when (due to the base ring not being a
|
|
376
|
+
# \QQ-algebra) we cannot use the power-sum basis,
|
|
377
|
+
# but (due to zee being the standard zee function) we can
|
|
378
|
+
# use the Schur basis.
|
|
379
|
+
|
|
380
|
+
schur = self._sym.schur()
|
|
381
|
+
|
|
382
|
+
# Get all the basis elements of the n^th homogeneous component
|
|
383
|
+
# of the dual basis and express them in the Schur basis
|
|
384
|
+
d = {}
|
|
385
|
+
for part in partitions_n:
|
|
386
|
+
d[part] = schur(self._dual_basis(part))._monomial_coefficients
|
|
387
|
+
|
|
388
|
+
# This contains the data for the transition matrix from the
|
|
389
|
+
# dual basis to self.
|
|
390
|
+
transition_matrix_n = matrix(base_ring, len(partitions_n), len(partitions_n))
|
|
391
|
+
|
|
392
|
+
# This first section calculates how the basis elements of the
|
|
393
|
+
# dual basis are expressed in terms of self's basis.
|
|
394
|
+
|
|
395
|
+
# For every partition p of size n, compute self(p) in
|
|
396
|
+
# terms of the dual basis using the scalar product.
|
|
397
|
+
i = 0
|
|
398
|
+
for s_part in partitions_n:
|
|
399
|
+
# s_part corresponds to self(dual_basis(part))
|
|
400
|
+
# s_mcs corresponds to self(dual_basis(part))._monomial_coefficients
|
|
401
|
+
s_mcs = {}
|
|
402
|
+
|
|
403
|
+
# We need to compute the scalar product of d[s_part] and
|
|
404
|
+
# all of the d[p_part]'s
|
|
405
|
+
j = 0
|
|
406
|
+
for p_part in partitions_n:
|
|
407
|
+
# Compute the scalar product of d[s_part] and d[p_part]
|
|
408
|
+
sp = zero
|
|
409
|
+
for ds_part in d[s_part]:
|
|
410
|
+
if ds_part in d[p_part]:
|
|
411
|
+
sp += d[s_part][ds_part]*d[p_part][ds_part]
|
|
412
|
+
if sp != zero:
|
|
413
|
+
s_mcs[p_part] = sp
|
|
414
|
+
transition_matrix_n[i,j] = sp
|
|
415
|
+
|
|
416
|
+
j += 1
|
|
417
|
+
|
|
418
|
+
self._to_self_cache[ s_part ] = s_mcs
|
|
419
|
+
i += 1
|
|
420
|
+
|
|
421
|
+
else:
|
|
422
|
+
# Now the other case. Note that just being in this case doesn't
|
|
423
|
+
# guarantee that we can use the power-sum basis, but we can at
|
|
424
|
+
# least try.
|
|
425
|
+
|
|
426
|
+
# Get all the basis elements of the n^th homogeneous component
|
|
427
|
+
# of the dual basis and express them in the power-sum basis
|
|
428
|
+
d = {}
|
|
429
|
+
for part in partitions_n:
|
|
430
|
+
d[part] = self._p(self._dual_basis(part))._monomial_coefficients
|
|
431
|
+
|
|
432
|
+
# This contains the data for the transition matrix from the
|
|
433
|
+
# dual basis to self.
|
|
434
|
+
transition_matrix_n = matrix(base_ring, len(partitions_n), len(partitions_n))
|
|
435
|
+
|
|
436
|
+
# This first section calculates how the basis elements of the
|
|
437
|
+
# dual basis are expressed in terms of self's basis.
|
|
438
|
+
|
|
439
|
+
# For every partition p of size n, compute self(p) in
|
|
440
|
+
# terms of the dual basis using the scalar product.
|
|
441
|
+
i = 0
|
|
442
|
+
for s_part in partitions_n:
|
|
443
|
+
# s_part corresponds to self(dual_basis(part))
|
|
444
|
+
# s_mcs corresponds to self(dual_basis(part))._monomial_coefficients
|
|
445
|
+
s_mcs = {}
|
|
446
|
+
|
|
447
|
+
# We need to compute the scalar product of d[s_part] and
|
|
448
|
+
# all of the d[p_part]'s
|
|
449
|
+
j = 0
|
|
450
|
+
for p_part in partitions_n:
|
|
451
|
+
# Compute the scalar product of d[s_part] and d[p_part]
|
|
452
|
+
sp = zero
|
|
453
|
+
for ds_part in d[s_part]:
|
|
454
|
+
if ds_part in d[p_part]:
|
|
455
|
+
sp += d[s_part][ds_part]*d[p_part][ds_part]*self._scalar(ds_part)
|
|
456
|
+
if sp != zero:
|
|
457
|
+
s_mcs[p_part] = sp
|
|
458
|
+
transition_matrix_n[i,j] = sp
|
|
459
|
+
|
|
460
|
+
j += 1
|
|
461
|
+
|
|
462
|
+
self._to_self_cache[ s_part ] = s_mcs
|
|
463
|
+
i += 1
|
|
464
|
+
|
|
465
|
+
# Save the transition matrix
|
|
466
|
+
self._transition_matrices[n] = transition_matrix_n
|
|
467
|
+
|
|
468
|
+
# This second section calculates how the basis elements of
|
|
469
|
+
# self expand in terms of the dual basis. We do this by
|
|
470
|
+
# computing the inverse of the matrix obtained above.
|
|
471
|
+
inverse_transition = ~transition_matrix_n
|
|
472
|
+
|
|
473
|
+
for i in range(len(partitions_n)):
|
|
474
|
+
d_mcs = {}
|
|
475
|
+
for j in range(len(partitions_n)):
|
|
476
|
+
if inverse_transition[i,j] != zero:
|
|
477
|
+
d_mcs[ partitions_n[j] ] = inverse_transition[i,j]
|
|
478
|
+
|
|
479
|
+
self._from_self_cache[ partitions_n[i] ] = d_mcs
|
|
480
|
+
|
|
481
|
+
self._inverse_transition_matrices[n] = inverse_transition
|
|
482
|
+
|
|
483
|
+
def transition_matrix(self, basis, n):
|
|
484
|
+
r"""
|
|
485
|
+
Return the transition matrix between the `n`-th homogeneous components
|
|
486
|
+
of ``self`` and ``basis``.
|
|
487
|
+
|
|
488
|
+
INPUT:
|
|
489
|
+
|
|
490
|
+
- ``basis`` -- a target basis of the ring of symmetric functions
|
|
491
|
+
- ``n`` -- nonnegative integer
|
|
492
|
+
|
|
493
|
+
OUTPUT:
|
|
494
|
+
|
|
495
|
+
- A transition matrix from ``self`` to ``basis`` for the elements
|
|
496
|
+
of degree ``n``. The indexing order of the rows and
|
|
497
|
+
columns is the order of ``Partitions(n)``.
|
|
498
|
+
|
|
499
|
+
EXAMPLES::
|
|
500
|
+
|
|
501
|
+
sage: Sym = SymmetricFunctions(QQ)
|
|
502
|
+
sage: s = Sym.schur()
|
|
503
|
+
sage: e = Sym.elementary()
|
|
504
|
+
sage: f = e.dual_basis()
|
|
505
|
+
sage: f.transition_matrix(s, 5)
|
|
506
|
+
[ 1 -1 0 1 0 -1 1]
|
|
507
|
+
[-2 1 1 -1 -1 1 0]
|
|
508
|
+
[-2 2 -1 -1 1 0 0]
|
|
509
|
+
[ 3 -1 -1 1 0 0 0]
|
|
510
|
+
[ 3 -2 1 0 0 0 0]
|
|
511
|
+
[-4 1 0 0 0 0 0]
|
|
512
|
+
[ 1 0 0 0 0 0 0]
|
|
513
|
+
sage: Partitions(5).list()
|
|
514
|
+
[[5], [4, 1], [3, 2], [3, 1, 1], [2, 2, 1], [2, 1, 1, 1], [1, 1, 1, 1, 1]]
|
|
515
|
+
sage: s(f[2,2,1])
|
|
516
|
+
s[3, 2] - 2*s[4, 1] + 3*s[5]
|
|
517
|
+
sage: e.transition_matrix(s, 5).inverse().transpose()
|
|
518
|
+
[ 1 -1 0 1 0 -1 1]
|
|
519
|
+
[-2 1 1 -1 -1 1 0]
|
|
520
|
+
[-2 2 -1 -1 1 0 0]
|
|
521
|
+
[ 3 -1 -1 1 0 0 0]
|
|
522
|
+
[ 3 -2 1 0 0 0 0]
|
|
523
|
+
[-4 1 0 0 0 0 0]
|
|
524
|
+
[ 1 0 0 0 0 0 0]
|
|
525
|
+
"""
|
|
526
|
+
if n not in self._transition_matrices:
|
|
527
|
+
self._precompute(n)
|
|
528
|
+
|
|
529
|
+
if basis is self._dual_basis:
|
|
530
|
+
return self._inverse_transition_matrices[n]
|
|
531
|
+
else:
|
|
532
|
+
return self._inverse_transition_matrices[n]*self._dual_basis.transition_matrix(basis, n)
|
|
533
|
+
|
|
534
|
+
def product(self, left, right):
|
|
535
|
+
"""
|
|
536
|
+
Return product of ``left`` and ``right``.
|
|
537
|
+
|
|
538
|
+
Multiplication is done by performing the multiplication in the dual
|
|
539
|
+
basis of ``self`` and then converting back to ``self``.
|
|
540
|
+
|
|
541
|
+
INPUT:
|
|
542
|
+
|
|
543
|
+
- ``left``, ``right`` -- elements of ``self``
|
|
544
|
+
|
|
545
|
+
OUTPUT: the product of ``left`` and ``right`` in the basis ``self``
|
|
546
|
+
|
|
547
|
+
EXAMPLES::
|
|
548
|
+
|
|
549
|
+
sage: m = SymmetricFunctions(QQ).monomial()
|
|
550
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
551
|
+
sage: h = m.dual_basis(scalar=zee)
|
|
552
|
+
sage: a = h([2])
|
|
553
|
+
sage: b = a*a; b # indirect doctest
|
|
554
|
+
d_m[2, 2]
|
|
555
|
+
sage: b.dual()
|
|
556
|
+
6*m[1, 1, 1, 1] + 4*m[2, 1, 1] + 3*m[2, 2] + 2*m[3, 1] + m[4]
|
|
557
|
+
"""
|
|
558
|
+
# Do the multiplication in the dual basis
|
|
559
|
+
# and then convert back to self.
|
|
560
|
+
eclass = left.__class__
|
|
561
|
+
d_product = left.dual() * right.dual()
|
|
562
|
+
return eclass(self, dual=d_product)
|
|
563
|
+
|
|
564
|
+
class Element(classical.SymmetricFunctionAlgebra_classical.Element):
|
|
565
|
+
"""
|
|
566
|
+
An element in the dual basis.
|
|
567
|
+
|
|
568
|
+
INPUT:
|
|
569
|
+
|
|
570
|
+
At least one of the following must be specified. The one (if
|
|
571
|
+
any) which is not provided will be computed.
|
|
572
|
+
|
|
573
|
+
- ``dictionary`` -- an internal dictionary for the
|
|
574
|
+
monomials and coefficients of ``self``
|
|
575
|
+
|
|
576
|
+
- ``dual`` -- self as an element of the dual basis
|
|
577
|
+
"""
|
|
578
|
+
|
|
579
|
+
def __init__(self, A, dictionary=None, dual=None):
|
|
580
|
+
"""
|
|
581
|
+
Create an element of a dual basis.
|
|
582
|
+
|
|
583
|
+
TESTS::
|
|
584
|
+
|
|
585
|
+
sage: m = SymmetricFunctions(QQ).monomial()
|
|
586
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
587
|
+
sage: h = m.dual_basis(scalar=zee, prefix='h')
|
|
588
|
+
sage: a = h([2])
|
|
589
|
+
sage: ec = h._element_class
|
|
590
|
+
sage: ec(h, dual=m([2]))
|
|
591
|
+
-h[1, 1] + 2*h[2]
|
|
592
|
+
sage: h(m([2]))
|
|
593
|
+
-h[1, 1] + 2*h[2]
|
|
594
|
+
sage: h([2])
|
|
595
|
+
h[2]
|
|
596
|
+
sage: h([2])._dual
|
|
597
|
+
m[1, 1] + m[2]
|
|
598
|
+
sage: m(h([2]))
|
|
599
|
+
m[1, 1] + m[2]
|
|
600
|
+
"""
|
|
601
|
+
if dictionary is None and dual is None:
|
|
602
|
+
raise ValueError("you must specify either x or dual")
|
|
603
|
+
|
|
604
|
+
parent = A
|
|
605
|
+
base_ring = parent.base_ring()
|
|
606
|
+
zero = base_ring.zero()
|
|
607
|
+
|
|
608
|
+
if dual is None:
|
|
609
|
+
# We need to compute the dual
|
|
610
|
+
dual_dict = {}
|
|
611
|
+
from_self_cache = parent._from_self_cache
|
|
612
|
+
|
|
613
|
+
# Get the underlying dictionary for self
|
|
614
|
+
s_mcs = dictionary
|
|
615
|
+
|
|
616
|
+
# Make sure all the conversions from self to
|
|
617
|
+
# to the dual basis have been precomputed
|
|
618
|
+
for part in s_mcs:
|
|
619
|
+
if part not in from_self_cache:
|
|
620
|
+
parent._precompute(sum(part))
|
|
621
|
+
|
|
622
|
+
# Create the monomial coefficient dictionary from the
|
|
623
|
+
# the monomial coefficient dictionary of dual
|
|
624
|
+
for s_part in s_mcs:
|
|
625
|
+
from_dictionary = from_self_cache[s_part]
|
|
626
|
+
for part in from_dictionary:
|
|
627
|
+
dual_dict[ part ] = dual_dict.get(part, zero) + base_ring(s_mcs[s_part]*from_dictionary[part])
|
|
628
|
+
|
|
629
|
+
dual = parent._dual_basis._from_dict(dual_dict)
|
|
630
|
+
|
|
631
|
+
if dictionary is None:
|
|
632
|
+
# We need to compute the monomial coefficients dictionary
|
|
633
|
+
dictionary = {}
|
|
634
|
+
to_self_cache = parent._to_self_cache
|
|
635
|
+
|
|
636
|
+
# Get the underlying dictionary for the dual
|
|
637
|
+
d_mcs = dual._monomial_coefficients
|
|
638
|
+
|
|
639
|
+
# Make sure all the conversions from the dual basis
|
|
640
|
+
# to self have been precomputed
|
|
641
|
+
for part in d_mcs:
|
|
642
|
+
if part not in to_self_cache:
|
|
643
|
+
parent._precompute(sum(part))
|
|
644
|
+
|
|
645
|
+
# Create the monomial coefficient dictionary from the
|
|
646
|
+
# the monomial coefficient dictionary of dual
|
|
647
|
+
dictionary = blas.linear_combination( (to_self_cache[d_part], d_mcs[d_part]) for d_part in d_mcs)
|
|
648
|
+
|
|
649
|
+
# Initialize self
|
|
650
|
+
self._dual = dual
|
|
651
|
+
classical.SymmetricFunctionAlgebra_classical.Element.__init__(self, A, dictionary)
|
|
652
|
+
|
|
653
|
+
def dual(self):
|
|
654
|
+
"""
|
|
655
|
+
Return ``self`` in the dual basis.
|
|
656
|
+
|
|
657
|
+
OUTPUT:
|
|
658
|
+
|
|
659
|
+
- the element ``self`` expanded in the dual basis to ``self.parent()``
|
|
660
|
+
|
|
661
|
+
EXAMPLES::
|
|
662
|
+
|
|
663
|
+
sage: m = SymmetricFunctions(QQ).monomial()
|
|
664
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
665
|
+
sage: h = m.dual_basis(scalar=zee)
|
|
666
|
+
sage: a = h([2,1])
|
|
667
|
+
sage: a.parent()
|
|
668
|
+
Dual basis to Symmetric Functions over Rational Field in the monomial basis
|
|
669
|
+
sage: a.dual()
|
|
670
|
+
3*m[1, 1, 1] + 2*m[2, 1] + m[3]
|
|
671
|
+
"""
|
|
672
|
+
return self._dual
|
|
673
|
+
|
|
674
|
+
def omega(self):
|
|
675
|
+
r"""
|
|
676
|
+
Return the image of ``self`` under the omega automorphism.
|
|
677
|
+
|
|
678
|
+
The *omega automorphism* is defined to be the unique algebra
|
|
679
|
+
endomorphism `\omega` of the ring of symmetric functions that
|
|
680
|
+
satisfies `\omega(e_k) = h_k` for all positive integers `k`
|
|
681
|
+
(where `e_k` stands for the `k`-th elementary symmetric
|
|
682
|
+
function, and `h_k` stands for the `k`-th complete homogeneous
|
|
683
|
+
symmetric function). It furthermore is a Hopf algebra
|
|
684
|
+
endomorphism and an involution, and it is also known as the
|
|
685
|
+
*omega involution*. It sends the power-sum symmetric function
|
|
686
|
+
`p_k` to `(-1)^{k-1} p_k` for every positive integer `k`.
|
|
687
|
+
|
|
688
|
+
The images of some bases under the omega automorphism are given by
|
|
689
|
+
|
|
690
|
+
.. MATH::
|
|
691
|
+
|
|
692
|
+
\omega(e_{\lambda}) = h_{\lambda}, \qquad
|
|
693
|
+
\omega(h_{\lambda}) = e_{\lambda}, \qquad
|
|
694
|
+
\omega(p_{\lambda}) = (-1)^{|\lambda| - \ell(\lambda)}
|
|
695
|
+
p_{\lambda}, \qquad
|
|
696
|
+
\omega(s_{\lambda}) = s_{\lambda^{\prime}},
|
|
697
|
+
|
|
698
|
+
where `\lambda` is any partition, where `\ell(\lambda)` denotes
|
|
699
|
+
the length (:meth:`~sage.combinat.partition.Partition.length`)
|
|
700
|
+
of the partition `\lambda`, where `\lambda^{\prime}` denotes the
|
|
701
|
+
conjugate partition
|
|
702
|
+
(:meth:`~sage.combinat.partition.Partition.conjugate`) of
|
|
703
|
+
`\lambda`, and where the usual notations for bases are used
|
|
704
|
+
(`e` = elementary, `h` = complete homogeneous, `p` = powersum,
|
|
705
|
+
`s` = Schur).
|
|
706
|
+
|
|
707
|
+
:meth:`omega_involution` is a synonym for the :meth:`omega`
|
|
708
|
+
method.
|
|
709
|
+
|
|
710
|
+
OUTPUT: the result of applying omega to ``self``
|
|
711
|
+
|
|
712
|
+
EXAMPLES::
|
|
713
|
+
|
|
714
|
+
sage: m = SymmetricFunctions(QQ).monomial()
|
|
715
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
716
|
+
sage: h = m.dual_basis(zee)
|
|
717
|
+
sage: hh = SymmetricFunctions(QQ).homogeneous()
|
|
718
|
+
sage: hh([2,1]).omega()
|
|
719
|
+
h[1, 1, 1] - h[2, 1]
|
|
720
|
+
sage: h([2,1]).omega()
|
|
721
|
+
d_m[1, 1, 1] - d_m[2, 1]
|
|
722
|
+
"""
|
|
723
|
+
eclass = self.__class__
|
|
724
|
+
return eclass(self.parent(), dual=self._dual.omega() )
|
|
725
|
+
|
|
726
|
+
omega_involution = omega
|
|
727
|
+
|
|
728
|
+
def scalar(self, x):
|
|
729
|
+
"""
|
|
730
|
+
Return the standard scalar product of ``self`` and ``x``.
|
|
731
|
+
|
|
732
|
+
INPUT:
|
|
733
|
+
|
|
734
|
+
- ``x`` -- element of the symmetric functions
|
|
735
|
+
|
|
736
|
+
OUTPUT: the scalar product between ``x`` and ``self``
|
|
737
|
+
|
|
738
|
+
EXAMPLES::
|
|
739
|
+
|
|
740
|
+
sage: m = SymmetricFunctions(QQ).monomial()
|
|
741
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
742
|
+
sage: h = m.dual_basis(scalar=zee)
|
|
743
|
+
sage: a = h([2,1])
|
|
744
|
+
sage: a.scalar(a)
|
|
745
|
+
2
|
|
746
|
+
"""
|
|
747
|
+
return self._dual.scalar(x)
|
|
748
|
+
|
|
749
|
+
def scalar_hl(self, x):
|
|
750
|
+
"""
|
|
751
|
+
Return the Hall-Littlewood scalar product of ``self`` and ``x``.
|
|
752
|
+
|
|
753
|
+
INPUT:
|
|
754
|
+
|
|
755
|
+
- ``x`` -- element of the same dual basis as ``self``
|
|
756
|
+
|
|
757
|
+
OUTPUT: the Hall-Littlewood scalar product between ``x`` and ``self``
|
|
758
|
+
|
|
759
|
+
EXAMPLES::
|
|
760
|
+
|
|
761
|
+
sage: m = SymmetricFunctions(QQ).monomial()
|
|
762
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
763
|
+
sage: h = m.dual_basis(scalar=zee)
|
|
764
|
+
sage: a = h([2,1])
|
|
765
|
+
sage: a.scalar_hl(a)
|
|
766
|
+
(-t - 2)/(t^4 - 2*t^3 + 2*t - 1)
|
|
767
|
+
"""
|
|
768
|
+
return self._dual.scalar_hl(x)
|
|
769
|
+
|
|
770
|
+
def _add_(self, y):
|
|
771
|
+
"""
|
|
772
|
+
Add two elements in the dual basis.
|
|
773
|
+
|
|
774
|
+
INPUT:
|
|
775
|
+
|
|
776
|
+
- ``y`` -- element of the same dual basis as ``self``
|
|
777
|
+
|
|
778
|
+
OUTPUT: the sum of ``self`` and ``y``
|
|
779
|
+
|
|
780
|
+
EXAMPLES::
|
|
781
|
+
|
|
782
|
+
sage: m = SymmetricFunctions(QQ).monomial()
|
|
783
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
784
|
+
sage: h = m.dual_basis(zee)
|
|
785
|
+
sage: a = h([2,1])+h([3]); a # indirect doctest
|
|
786
|
+
d_m[2, 1] + d_m[3]
|
|
787
|
+
sage: h[2,1]._add_(h[3])
|
|
788
|
+
d_m[2, 1] + d_m[3]
|
|
789
|
+
sage: a.dual()
|
|
790
|
+
4*m[1, 1, 1] + 3*m[2, 1] + 2*m[3]
|
|
791
|
+
"""
|
|
792
|
+
eclass = self.__class__
|
|
793
|
+
return eclass(self.parent(), dual=(self.dual()+y.dual()))
|
|
794
|
+
|
|
795
|
+
def _neg_(self):
|
|
796
|
+
"""
|
|
797
|
+
Return the negative of ``self``.
|
|
798
|
+
|
|
799
|
+
EXAMPLES::
|
|
800
|
+
|
|
801
|
+
sage: m = SymmetricFunctions(QQ).monomial()
|
|
802
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
803
|
+
sage: h = m.dual_basis(zee)
|
|
804
|
+
sage: -h([2,1]) # indirect doctest
|
|
805
|
+
-d_m[2, 1]
|
|
806
|
+
"""
|
|
807
|
+
eclass = self.__class__
|
|
808
|
+
return eclass(self.parent(), dual=self.dual()._neg_())
|
|
809
|
+
|
|
810
|
+
def _sub_(self, y):
|
|
811
|
+
"""
|
|
812
|
+
Subtract two elements in the dual basis.
|
|
813
|
+
|
|
814
|
+
INPUT:
|
|
815
|
+
|
|
816
|
+
- ``y`` -- element of the same dual basis as ``self``
|
|
817
|
+
|
|
818
|
+
OUTPUT: the difference of ``self`` and ``y``
|
|
819
|
+
|
|
820
|
+
EXAMPLES::
|
|
821
|
+
|
|
822
|
+
sage: m = SymmetricFunctions(QQ).monomial()
|
|
823
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
824
|
+
sage: h = m.dual_basis(zee)
|
|
825
|
+
sage: h([2,1])-h([3]) # indirect doctest
|
|
826
|
+
d_m[2, 1] - d_m[3]
|
|
827
|
+
sage: h[2,1]._sub_(h[3])
|
|
828
|
+
d_m[2, 1] - d_m[3]
|
|
829
|
+
"""
|
|
830
|
+
eclass = self.__class__
|
|
831
|
+
return eclass(self.parent(), dual=(self.dual()-y.dual()))
|
|
832
|
+
|
|
833
|
+
def _div_(self, y):
|
|
834
|
+
"""
|
|
835
|
+
Divide an element ``self`` of the dual basis by ``y``.
|
|
836
|
+
|
|
837
|
+
INPUT:
|
|
838
|
+
|
|
839
|
+
- ``y`` -- element of base field
|
|
840
|
+
|
|
841
|
+
OUTPUT: the element ``self`` divided by ``y``
|
|
842
|
+
|
|
843
|
+
EXAMPLES::
|
|
844
|
+
|
|
845
|
+
sage: m = SymmetricFunctions(QQ).monomial()
|
|
846
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
847
|
+
sage: h = m.dual_basis(zee)
|
|
848
|
+
sage: a = h([2,1])+h([3])
|
|
849
|
+
sage: a/2 # indirect doctest
|
|
850
|
+
1/2*d_m[2, 1] + 1/2*d_m[3]
|
|
851
|
+
"""
|
|
852
|
+
return self*(~y)
|
|
853
|
+
|
|
854
|
+
def __invert__(self):
|
|
855
|
+
"""
|
|
856
|
+
Invert ``self`` (only possible if ``self`` is a scalar
|
|
857
|
+
multiple of `1` and we are working over a field).
|
|
858
|
+
|
|
859
|
+
OUTPUT: multiplicative inverse of ``self`` if possible
|
|
860
|
+
|
|
861
|
+
EXAMPLES::
|
|
862
|
+
|
|
863
|
+
sage: m = SymmetricFunctions(QQ).monomial()
|
|
864
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
865
|
+
sage: h = m.dual_basis(zee)
|
|
866
|
+
sage: a = h(2); a
|
|
867
|
+
2*d_m[]
|
|
868
|
+
sage: ~a
|
|
869
|
+
1/2*d_m[]
|
|
870
|
+
sage: a = 3*h[1]
|
|
871
|
+
sage: a.__invert__()
|
|
872
|
+
Traceback (most recent call last):
|
|
873
|
+
...
|
|
874
|
+
ValueError: cannot invert self (= 3*m[1])
|
|
875
|
+
"""
|
|
876
|
+
eclass = self.__class__
|
|
877
|
+
return eclass(self.parent(), dual=~self.dual())
|
|
878
|
+
|
|
879
|
+
def expand(self, n, alphabet='x'):
|
|
880
|
+
"""
|
|
881
|
+
Expand the symmetric function ``self`` as a symmetric polynomial
|
|
882
|
+
in ``n`` variables.
|
|
883
|
+
|
|
884
|
+
INPUT:
|
|
885
|
+
|
|
886
|
+
- ``n`` -- nonnegative integer
|
|
887
|
+
|
|
888
|
+
- ``alphabet`` -- (default: ``'x'``) a variable for the expansion
|
|
889
|
+
|
|
890
|
+
OUTPUT:
|
|
891
|
+
|
|
892
|
+
A monomial expansion of ``self`` in the `n` variables
|
|
893
|
+
labelled by ``alphabet``.
|
|
894
|
+
|
|
895
|
+
EXAMPLES::
|
|
896
|
+
|
|
897
|
+
sage: m = SymmetricFunctions(QQ).monomial()
|
|
898
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
899
|
+
sage: h = m.dual_basis(zee)
|
|
900
|
+
sage: a = h([2,1])+h([3])
|
|
901
|
+
sage: a.expand(2)
|
|
902
|
+
2*x0^3 + 3*x0^2*x1 + 3*x0*x1^2 + 2*x1^3
|
|
903
|
+
sage: a.dual().expand(2)
|
|
904
|
+
2*x0^3 + 3*x0^2*x1 + 3*x0*x1^2 + 2*x1^3
|
|
905
|
+
sage: a.expand(2,alphabet='y')
|
|
906
|
+
2*y0^3 + 3*y0^2*y1 + 3*y0*y1^2 + 2*y1^3
|
|
907
|
+
sage: a.expand(2,alphabet='x,y')
|
|
908
|
+
2*x^3 + 3*x^2*y + 3*x*y^2 + 2*y^3
|
|
909
|
+
sage: h([1]).expand(0)
|
|
910
|
+
0
|
|
911
|
+
sage: (3*h([])).expand(0)
|
|
912
|
+
3
|
|
913
|
+
"""
|
|
914
|
+
return self._dual.expand(n, alphabet)
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
from sage.combinat.sf.sfa import SymmetricFunctionsFunctor
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
class DualBasisFunctor(SymmetricFunctionsFunctor):
|
|
921
|
+
"""
|
|
922
|
+
A constructor for algebras of symmetric functions constructed by
|
|
923
|
+
duality.
|
|
924
|
+
|
|
925
|
+
EXAMPLES::
|
|
926
|
+
|
|
927
|
+
sage: w = SymmetricFunctions(ZZ).witt()
|
|
928
|
+
sage: w.dual_basis().construction()
|
|
929
|
+
(SymmetricFunctionsFunctor[dual Witt], Integer Ring)
|
|
930
|
+
"""
|
|
931
|
+
def __init__(self, basis):
|
|
932
|
+
r"""
|
|
933
|
+
Initialize the functor.
|
|
934
|
+
|
|
935
|
+
INPUT:
|
|
936
|
+
|
|
937
|
+
- ``basis`` -- the basis of the symmetric function algebra
|
|
938
|
+
|
|
939
|
+
TESTS::
|
|
940
|
+
|
|
941
|
+
sage: w = SymmetricFunctions(ZZ).witt()
|
|
942
|
+
sage: F = w.dual_basis().construction()[0]
|
|
943
|
+
sage: TestSuite(F).run()
|
|
944
|
+
"""
|
|
945
|
+
self._dual_basis = basis._dual_basis
|
|
946
|
+
self._basis_name = basis._basis_name
|
|
947
|
+
self._scalar = basis._scalar
|
|
948
|
+
self._scalar_name = basis._scalar_name
|
|
949
|
+
self._prefix = basis._prefix
|
|
950
|
+
super().__init__(basis, self._basis_name)
|
|
951
|
+
|
|
952
|
+
def _apply_functor(self, R):
|
|
953
|
+
"""
|
|
954
|
+
Apply the functor to an object of ``self``'s domain.
|
|
955
|
+
|
|
956
|
+
EXAMPLES::
|
|
957
|
+
|
|
958
|
+
sage: m = SymmetricFunctions(ZZ).monomial()
|
|
959
|
+
sage: zee = sage.combinat.sf.sfa.zee
|
|
960
|
+
sage: h = m.dual_basis(scalar=zee)
|
|
961
|
+
sage: F, R = h.construction() # indirect doctest
|
|
962
|
+
sage: F(QQ)
|
|
963
|
+
Dual basis to Symmetric Functions over Rational Field in the monomial basis
|
|
964
|
+
|
|
965
|
+
sage: b = m.dual_basis(scalar=zee).dual_basis(scalar=lambda x: 1)
|
|
966
|
+
sage: F, R = b.construction() # indirect doctest
|
|
967
|
+
sage: F(QQ)
|
|
968
|
+
Dual basis to Dual basis to Symmetric Functions over Rational Field in the monomial basis
|
|
969
|
+
"""
|
|
970
|
+
dual_basis = self._dual_basis.change_ring(R)
|
|
971
|
+
return self._basis(dual_basis, self._scalar, self._scalar_name,
|
|
972
|
+
self._basis_name, self._prefix)
|
|
973
|
+
|
|
974
|
+
def _repr_(self):
|
|
975
|
+
"""
|
|
976
|
+
Return a string representation of ``self``.
|
|
977
|
+
|
|
978
|
+
EXAMPLES::
|
|
979
|
+
|
|
980
|
+
sage: w = SymmetricFunctions(ZZ).witt()
|
|
981
|
+
sage: w.dual_basis().construction()
|
|
982
|
+
(SymmetricFunctionsFunctor[dual Witt], Integer Ring)
|
|
983
|
+
"""
|
|
984
|
+
if self._basis_name is None:
|
|
985
|
+
name = "dual " + self._dual_basis.basis_name()
|
|
986
|
+
else:
|
|
987
|
+
name = self._basis_name
|
|
988
|
+
return "SymmetricFunctionsFunctor[" + name + "]"
|
|
989
|
+
|
|
990
|
+
|
|
991
|
+
# Backward compatibility for unpickling
|
|
992
|
+
from sage.misc.persist import register_unpickle_override
|
|
993
|
+
|
|
994
|
+
register_unpickle_override('sage.combinat.sf.dual',
|
|
995
|
+
'SymmetricFunctionAlgebraElement_dual',
|
|
996
|
+
SymmetricFunctionAlgebra_dual.Element)
|