passagemath-combinat 10.6.42__cp314-cp314t-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- passagemath_combinat/__init__.py +3 -0
- passagemath_combinat-10.6.42.dist-info/DELVEWHEEL +2 -0
- passagemath_combinat-10.6.42.dist-info/METADATA +160 -0
- passagemath_combinat-10.6.42.dist-info/RECORD +401 -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-10-3a5f019e2510aeaad918cab2b57a689d.dll +0 -0
- passagemath_combinat.libs/libsymmetrica-3-7dcf900932804d0df5fd0919b4668720.dll +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 +44 -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.cp314t-win_amd64.pyd +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.cp314t-win_amd64.pyd +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.cp314t-win_amd64.pyd +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.cp314t-win_amd64.pyd +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.cp314t-win_amd64.pyd +0 -0
- sage/combinat/debruijn_sequence.pyx +355 -0
- sage/combinat/decorated_permutation.py +270 -0
- sage/combinat/degree_sequences.cp314t-win_amd64.pyd +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.cp314t-win_amd64.pyd +0 -0
- sage/combinat/expnums.pyx +148 -0
- sage/combinat/fast_vector_partitions.cp314t-win_amd64.pyd +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.cp314t-win_amd64.pyd +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.cp314t-win_amd64.pyd +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.cp314t-win_amd64.pyd +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.cp314t-win_amd64.pyd +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.cp314t-win_amd64.pyd +0 -0
- sage/combinat/words/word_char.pyx +847 -0
- sage/combinat/words/word_datatypes.cp314t-win_amd64.pyd +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.cp314t-win_amd64.pyd +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.cp314t-win_amd64.pyd +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.cp314t-win_amd64.pyd +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.cp314t-win_amd64.pyd +0 -0
- sage/sat/solvers/satsolver.pxd +3 -0
- sage/sat/solvers/satsolver.pyx +405 -0
|
@@ -0,0 +1,618 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-combinat
|
|
2
|
+
# sage.doctest: needs sage.rings.real_mpfr sage.symbolic
|
|
3
|
+
r"""
|
|
4
|
+
sine-Gordon Y-system plotter
|
|
5
|
+
|
|
6
|
+
This class builds the triangulations associated to sine-Gordon and reduced
|
|
7
|
+
sine-Gordon Y-systems as constructed in [NS]_.
|
|
8
|
+
|
|
9
|
+
AUTHORS:
|
|
10
|
+
|
|
11
|
+
- Salvatore Stella (2014-07-18): initial version
|
|
12
|
+
|
|
13
|
+
EXAMPLES:
|
|
14
|
+
|
|
15
|
+
A reduced sine-Gordon example with 3 generations::
|
|
16
|
+
|
|
17
|
+
sage: Y = SineGordonYsystem('A',(6,4,3)); Y
|
|
18
|
+
A sine-Gordon Y-system of type A with defining integer tuple (6, 4, 3)
|
|
19
|
+
sage: Y.plot() #not tested
|
|
20
|
+
|
|
21
|
+
The same integer tuple but for the non-reduced case::
|
|
22
|
+
|
|
23
|
+
sage: Y = SineGordonYsystem('D',(6,4,3)); Y
|
|
24
|
+
A sine-Gordon Y-system of type D with defining integer tuple (6, 4, 3)
|
|
25
|
+
sage: Y.plot() #not tested
|
|
26
|
+
|
|
27
|
+
.. TODO::
|
|
28
|
+
|
|
29
|
+
The code for plotting is extremely slow.
|
|
30
|
+
|
|
31
|
+
REFERENCES:
|
|
32
|
+
|
|
33
|
+
.. [NS] \T. Nakanishi, S. Stella, Wonder of sine-Gordon Y-systems,
|
|
34
|
+
to appear in Trans. Amer. Math. Soc., :arxiv:`1212.6853`
|
|
35
|
+
"""
|
|
36
|
+
# ****************************************************************************
|
|
37
|
+
# Copyright (C) 2014 Salvatore Stella <sstella@ncsu.edu>
|
|
38
|
+
#
|
|
39
|
+
# This program is free software: you can redistribute it and/or modify
|
|
40
|
+
# it under the terms of the GNU General Public License as published by
|
|
41
|
+
# the Free Software Foundation, either version 2 of the License, or
|
|
42
|
+
# (at your option) any later version.
|
|
43
|
+
# https://www.gnu.org/licenses/
|
|
44
|
+
# ****************************************************************************
|
|
45
|
+
|
|
46
|
+
from sage.structure.sage_object import SageObject
|
|
47
|
+
|
|
48
|
+
from sage.rings.integer_ring import ZZ
|
|
49
|
+
from sage.rings.real_mpfr import RR
|
|
50
|
+
from sage.rings.semirings.non_negative_integer_semiring import NN
|
|
51
|
+
from sage.functions.trig import cos, sin
|
|
52
|
+
from sage.misc.lazy_import import lazy_import
|
|
53
|
+
from sage.symbolic.constants import pi, I
|
|
54
|
+
from sage.functions.log import exp
|
|
55
|
+
from sage.functions.other import ceil
|
|
56
|
+
from sage.misc.flatten import flatten
|
|
57
|
+
from sage.symbolic.ring import SR
|
|
58
|
+
from sage.functions.other import real_part, imag_part
|
|
59
|
+
from sage.misc.cachefunc import cached_method
|
|
60
|
+
lazy_import("sage.plot.plot", "parametric_plot")
|
|
61
|
+
lazy_import("sage.plot.graphics", "Graphics")
|
|
62
|
+
lazy_import("sage.plot.polygon", "polygon2d")
|
|
63
|
+
lazy_import("sage.plot.circle", "circle")
|
|
64
|
+
lazy_import("sage.plot.bezier_path", "bezier_path")
|
|
65
|
+
lazy_import("sage.plot.point", "point")
|
|
66
|
+
lazy_import("sage.plot.line", "line")
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class SineGordonYsystem(SageObject):
|
|
70
|
+
r"""
|
|
71
|
+
A class to model a (reduced) sine-Gordon Y-system.
|
|
72
|
+
|
|
73
|
+
Note that the generations, together with all integer tuples, in this
|
|
74
|
+
implementation are numbered from 0 while in [NS]_ they are numbered from 1
|
|
75
|
+
|
|
76
|
+
INPUT:
|
|
77
|
+
|
|
78
|
+
- ``X`` -- the type of the Y-system to construct (either 'A' or 'D')
|
|
79
|
+
- ``na`` -- the tuple of positive integers defining the Y-system
|
|
80
|
+
with ``na[0] > 2``
|
|
81
|
+
|
|
82
|
+
See [NS]_
|
|
83
|
+
|
|
84
|
+
EXAMPLES::
|
|
85
|
+
|
|
86
|
+
sage: Y = SineGordonYsystem('A',(6,4,3)); Y
|
|
87
|
+
A sine-Gordon Y-system of type A with defining integer tuple (6, 4, 3)
|
|
88
|
+
sage: Y.intervals()
|
|
89
|
+
(((0, 0, 'R'),),
|
|
90
|
+
((0, 17, 'L'),
|
|
91
|
+
(17, 34, 'L'),
|
|
92
|
+
...
|
|
93
|
+
(104, 105, 'R'),
|
|
94
|
+
(105, 0, 'R')))
|
|
95
|
+
sage: Y.triangulation()
|
|
96
|
+
((17, 89),
|
|
97
|
+
(17, 72),
|
|
98
|
+
(34, 72),
|
|
99
|
+
...
|
|
100
|
+
(102, 105),
|
|
101
|
+
(103, 105))
|
|
102
|
+
sage: Y.plot() #not tested
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
def __init__(self, X, na):
|
|
106
|
+
"""
|
|
107
|
+
TESTS::
|
|
108
|
+
|
|
109
|
+
sage: Y = SineGordonYsystem('A',(6,4,3)); Y # indirect doctest
|
|
110
|
+
A sine-Gordon Y-system of type A with defining integer tuple
|
|
111
|
+
(6, 4, 3)
|
|
112
|
+
|
|
113
|
+
sage: SineGordonYsystem('E',(6,4,3))
|
|
114
|
+
Traceback (most recent call last):
|
|
115
|
+
...
|
|
116
|
+
ValueError: the type must be either 'A' or 'D'
|
|
117
|
+
sage: SineGordonYsystem('A',(2,4,3))
|
|
118
|
+
Traceback (most recent call last):
|
|
119
|
+
...
|
|
120
|
+
ValueError: the first integer in the defining sequence must be
|
|
121
|
+
greater than 2
|
|
122
|
+
sage: SineGordonYsystem('A',(6,-4,3))
|
|
123
|
+
Traceback (most recent call last):
|
|
124
|
+
...
|
|
125
|
+
ValueError: the defining sequence must contain only positive
|
|
126
|
+
integers
|
|
127
|
+
sage: SineGordonYsystem('A',(3,))
|
|
128
|
+
Traceback (most recent call last):
|
|
129
|
+
...
|
|
130
|
+
ValueError: the integer sequence (3,) in type 'A' is not allowed
|
|
131
|
+
as input
|
|
132
|
+
"""
|
|
133
|
+
if X not in ['A', 'D']:
|
|
134
|
+
raise ValueError("the type must be either 'A' or 'D'")
|
|
135
|
+
self._type = X
|
|
136
|
+
if na[0] <= 2:
|
|
137
|
+
raise ValueError("the first integer in the defining sequence "
|
|
138
|
+
"must be greater than 2")
|
|
139
|
+
if any(x not in NN for x in na):
|
|
140
|
+
raise ValueError("the defining sequence must contain only "
|
|
141
|
+
"positive integers")
|
|
142
|
+
self._na = tuple(na)
|
|
143
|
+
if self._na == (3,) and self._type == 'A':
|
|
144
|
+
raise ValueError("the integer sequence (3,) in type 'A'"
|
|
145
|
+
" is not allowed as input")
|
|
146
|
+
self._F = len(self._na)
|
|
147
|
+
|
|
148
|
+
def _repr_(self):
|
|
149
|
+
"""
|
|
150
|
+
Return the string representation of ``self``.
|
|
151
|
+
|
|
152
|
+
TESTS::
|
|
153
|
+
|
|
154
|
+
sage: Y = SineGordonYsystem('A',(6,4,3)); Y # indirect doctest
|
|
155
|
+
A sine-Gordon Y-system of type A with defining integer tuple
|
|
156
|
+
(6, 4, 3)
|
|
157
|
+
sage: Y = SineGordonYsystem('D',(6,4,3)); Y # indirect doctest
|
|
158
|
+
A sine-Gordon Y-system of type D with defining integer tuple
|
|
159
|
+
(6, 4, 3)
|
|
160
|
+
"""
|
|
161
|
+
msg = "A sine-Gordon Y-system of type {}"
|
|
162
|
+
msg += " with defining integer tuple {}"
|
|
163
|
+
return msg.format(self._type, self._na)
|
|
164
|
+
|
|
165
|
+
def type(self):
|
|
166
|
+
r"""
|
|
167
|
+
Return the type of ``self``.
|
|
168
|
+
|
|
169
|
+
EXAMPLES::
|
|
170
|
+
|
|
171
|
+
sage: Y = SineGordonYsystem('A',(6,4,3))
|
|
172
|
+
sage: Y.type()
|
|
173
|
+
'A'
|
|
174
|
+
"""
|
|
175
|
+
return self._type
|
|
176
|
+
|
|
177
|
+
def F(self):
|
|
178
|
+
r"""
|
|
179
|
+
Return the number of generations in ``self``.
|
|
180
|
+
|
|
181
|
+
EXAMPLES::
|
|
182
|
+
|
|
183
|
+
sage: Y = SineGordonYsystem('A',(6,4,3))
|
|
184
|
+
sage: Y.F()
|
|
185
|
+
3
|
|
186
|
+
"""
|
|
187
|
+
return self._F
|
|
188
|
+
|
|
189
|
+
def na(self):
|
|
190
|
+
r"""
|
|
191
|
+
Return the sequence of the integers `n_a` defining ``self``.
|
|
192
|
+
|
|
193
|
+
EXAMPLES::
|
|
194
|
+
|
|
195
|
+
sage: Y = SineGordonYsystem('A',(6,4,3))
|
|
196
|
+
sage: Y.na()
|
|
197
|
+
(6, 4, 3)
|
|
198
|
+
"""
|
|
199
|
+
return self._na
|
|
200
|
+
|
|
201
|
+
@cached_method
|
|
202
|
+
def rk(self):
|
|
203
|
+
r"""
|
|
204
|
+
Return the sequence of integers ``r^{(k)}``, i.e. the width of
|
|
205
|
+
an interval of type 'L' or 'R' in the ``k``-th generation.
|
|
206
|
+
|
|
207
|
+
EXAMPLES::
|
|
208
|
+
|
|
209
|
+
sage: Y = SineGordonYsystem('A',(6,4,3))
|
|
210
|
+
sage: Y.rk()
|
|
211
|
+
(106, 17, 4)
|
|
212
|
+
"""
|
|
213
|
+
na = self._na
|
|
214
|
+
F = self._F
|
|
215
|
+
rk = [na[F - 1] + 1]
|
|
216
|
+
if F > 1:
|
|
217
|
+
rk.append(na[F - 2] * na[F - 1] + na[F - 2] + 1)
|
|
218
|
+
for k in range(2, F):
|
|
219
|
+
rk.append(na[F - k - 1] * rk[k - 1] + rk[k - 2])
|
|
220
|
+
rk.reverse()
|
|
221
|
+
return tuple(rk)
|
|
222
|
+
|
|
223
|
+
@cached_method
|
|
224
|
+
def pa(self):
|
|
225
|
+
r"""
|
|
226
|
+
Return the sequence of integers ``p_a``, i.e. the total number of
|
|
227
|
+
intervals of types 'NL' and 'NR' in the ``(a+1)``-th generation.
|
|
228
|
+
|
|
229
|
+
EXAMPLES::
|
|
230
|
+
|
|
231
|
+
sage: Y = SineGordonYsystem('A',(6,4,3))
|
|
232
|
+
sage: Y.pa()
|
|
233
|
+
(1, 6, 25)
|
|
234
|
+
"""
|
|
235
|
+
na = self._na
|
|
236
|
+
F = self._F
|
|
237
|
+
pa = [1]
|
|
238
|
+
if F > 1:
|
|
239
|
+
pa.append(na[0])
|
|
240
|
+
for k in range(1, F - 1):
|
|
241
|
+
pa.append(na[k] * pa[k] + pa[k - 1])
|
|
242
|
+
return tuple(pa)
|
|
243
|
+
|
|
244
|
+
@cached_method
|
|
245
|
+
def qa(self):
|
|
246
|
+
r"""
|
|
247
|
+
Return the sequence of integers ``q_a``, i.e. the total number of
|
|
248
|
+
intervals of types 'L' and 'R' in the ``(a+1)``-th generation.
|
|
249
|
+
|
|
250
|
+
EXAMPLES::
|
|
251
|
+
|
|
252
|
+
sage: Y = SineGordonYsystem('A',(6,4,3))
|
|
253
|
+
sage: Y.qa()
|
|
254
|
+
(6, 25, 81)
|
|
255
|
+
"""
|
|
256
|
+
na = self._na
|
|
257
|
+
F = self._F
|
|
258
|
+
qa = [na[0]]
|
|
259
|
+
if F > 1:
|
|
260
|
+
qa.append(na[1] * qa[0] + 1)
|
|
261
|
+
for k in range(2, F):
|
|
262
|
+
qa.append(na[k] * qa[k - 1] + qa[k - 2])
|
|
263
|
+
return tuple(qa)
|
|
264
|
+
|
|
265
|
+
@cached_method
|
|
266
|
+
def r(self):
|
|
267
|
+
r"""
|
|
268
|
+
Return the number of vertices in the polygon realizing ``self``.
|
|
269
|
+
|
|
270
|
+
EXAMPLES::
|
|
271
|
+
|
|
272
|
+
sage: Y = SineGordonYsystem('A',(6,4,3))
|
|
273
|
+
sage: Y.r()
|
|
274
|
+
106
|
|
275
|
+
"""
|
|
276
|
+
return self.rk()[0]
|
|
277
|
+
|
|
278
|
+
@cached_method
|
|
279
|
+
def vertices(self):
|
|
280
|
+
r"""
|
|
281
|
+
Return the vertices of the polygon realizing ``self`` as the ring of
|
|
282
|
+
integers modulo ``self.r()``.
|
|
283
|
+
|
|
284
|
+
EXAMPLES::
|
|
285
|
+
|
|
286
|
+
sage: Y = SineGordonYsystem('A',(6,4,3))
|
|
287
|
+
sage: Y.vertices()
|
|
288
|
+
Ring of integers modulo 106
|
|
289
|
+
"""
|
|
290
|
+
return ZZ.quotient(self.r())
|
|
291
|
+
|
|
292
|
+
@cached_method
|
|
293
|
+
def triangulation(self):
|
|
294
|
+
r"""
|
|
295
|
+
Return the initial triangulation of the polygon realizing
|
|
296
|
+
``self`` as a tuple of pairs of vertices.
|
|
297
|
+
|
|
298
|
+
.. WARNING::
|
|
299
|
+
|
|
300
|
+
In type 'D' the returned triangulation does NOT contain the two
|
|
301
|
+
radii.
|
|
302
|
+
|
|
303
|
+
ALGORITHM:
|
|
304
|
+
|
|
305
|
+
We implement the four cases described by Figure 14 in [NS]_.
|
|
306
|
+
|
|
307
|
+
EXAMPLES::
|
|
308
|
+
|
|
309
|
+
sage: Y = SineGordonYsystem('A',(6,4,3))
|
|
310
|
+
sage: Y.triangulation()
|
|
311
|
+
((17, 89),
|
|
312
|
+
(17, 72),
|
|
313
|
+
...
|
|
314
|
+
(102, 105),
|
|
315
|
+
(103, 105))
|
|
316
|
+
"""
|
|
317
|
+
rk = self.rk() + (1, 1)
|
|
318
|
+
na = self.na()
|
|
319
|
+
vert = self.vertices()
|
|
320
|
+
triangulation = []
|
|
321
|
+
intervals = self.intervals()
|
|
322
|
+
for a in range(self.F()):
|
|
323
|
+
for (first, last, typ) in intervals[a]:
|
|
324
|
+
if first - last in [vert(1), vert(-1)]:
|
|
325
|
+
continue
|
|
326
|
+
if typ == "L":
|
|
327
|
+
left = True
|
|
328
|
+
if na[a] % 2 == 0:
|
|
329
|
+
last_cw = first + vert(na[a] / 2 * rk[a + 1])
|
|
330
|
+
last_ccw = last - vert(na[a] / 2 * rk[a + 1])
|
|
331
|
+
else:
|
|
332
|
+
last_cw = first + vert((na[a] + 1) / 2 * rk[a + 1])
|
|
333
|
+
last_ccw = last - vert((na[a] - 1) / 2 * rk[a + 1])
|
|
334
|
+
elif typ == "R":
|
|
335
|
+
left = False
|
|
336
|
+
if na[a] % 2 == 0:
|
|
337
|
+
last_cw = first + vert(na[a] / 2 * rk[a + 1])
|
|
338
|
+
last_ccw = last - vert(na[a] / 2 * rk[a + 1])
|
|
339
|
+
else:
|
|
340
|
+
last_cw = first + vert((na[a] - 1) / 2 * rk[a + 1])
|
|
341
|
+
last_ccw = last - vert((na[a] + 1) / 2 * rk[a + 1])
|
|
342
|
+
else:
|
|
343
|
+
continue
|
|
344
|
+
if first == last:
|
|
345
|
+
# this happens only when the interval is the whole disk
|
|
346
|
+
first = first + vert(rk[a + 1])
|
|
347
|
+
last = last - vert(rk[a + 1])
|
|
348
|
+
edge = (first, last)
|
|
349
|
+
triangulation.append(edge)
|
|
350
|
+
done = False
|
|
351
|
+
while not done:
|
|
352
|
+
if left:
|
|
353
|
+
edge = (edge[0] + vert(rk[a + 1]), edge[1])
|
|
354
|
+
else:
|
|
355
|
+
edge = (edge[0], edge[1] - vert(rk[a + 1]))
|
|
356
|
+
left = not left
|
|
357
|
+
if (edge[1] >= last_ccw and edge[0] < last_cw) or (edge[1] > last_ccw and edge[0] <= last_cw):
|
|
358
|
+
triangulation.append(edge)
|
|
359
|
+
else:
|
|
360
|
+
done = True
|
|
361
|
+
if self.type() == 'D':
|
|
362
|
+
triangulation.append((vert(0), vert(rk[0] - rk[1])))
|
|
363
|
+
return tuple(triangulation)
|
|
364
|
+
|
|
365
|
+
@cached_method
|
|
366
|
+
def intervals(self):
|
|
367
|
+
r"""
|
|
368
|
+
Return, divided by generation, the list of intervals used to construct
|
|
369
|
+
the initial triangulation.
|
|
370
|
+
|
|
371
|
+
Each such interval is a triple ``(p, q, X)`` where ``p`` and
|
|
372
|
+
``q`` are the two extremal vertices of the interval and ``X``
|
|
373
|
+
is the type of the interval (one of 'L', 'R', 'NL', 'NR').
|
|
374
|
+
|
|
375
|
+
ALGORITHM:
|
|
376
|
+
|
|
377
|
+
The algorithm used here is the one described in section 5.1 of [NS]_.
|
|
378
|
+
The only difference is that we get rid of the special case of the first
|
|
379
|
+
generation by treating the whole disk as a type 'R' interval.
|
|
380
|
+
|
|
381
|
+
EXAMPLES::
|
|
382
|
+
|
|
383
|
+
sage: Y = SineGordonYsystem('A',(6,4,3))
|
|
384
|
+
sage: Y.intervals()
|
|
385
|
+
(((0, 0, 'R'),),
|
|
386
|
+
((0, 17, 'L'),
|
|
387
|
+
(17, 34, 'L'),
|
|
388
|
+
...
|
|
389
|
+
(104, 105, 'R'),
|
|
390
|
+
(105, 0, 'R')))
|
|
391
|
+
"""
|
|
392
|
+
rk = self.rk() + (1, 1)
|
|
393
|
+
na = self.na()
|
|
394
|
+
vert = self.vertices()
|
|
395
|
+
intervals = [[(vert(0), vert(0), "R")]]
|
|
396
|
+
for a in range(self.F()):
|
|
397
|
+
new_intervals = []
|
|
398
|
+
if na[a] % 2 == 0:
|
|
399
|
+
for (first, last, typ) in intervals[a]:
|
|
400
|
+
if typ == "NR":
|
|
401
|
+
new_intervals.append((first, last, "R"))
|
|
402
|
+
elif typ == "NL":
|
|
403
|
+
new_intervals.append((first, last, "L"))
|
|
404
|
+
else:
|
|
405
|
+
last_cw = first + vert(na[a] / 2 * rk[a + 1])
|
|
406
|
+
last_ccw = vert(last_cw + rk[a + 2])
|
|
407
|
+
x = first
|
|
408
|
+
while x < last_cw:
|
|
409
|
+
new_intervals.append((vert(x), vert(x + rk[a + 1]), "L"))
|
|
410
|
+
x = vert(x + rk[a + 1])
|
|
411
|
+
if typ == "L":
|
|
412
|
+
new_intervals.append((last_cw, last_ccw, "NL"))
|
|
413
|
+
else:
|
|
414
|
+
new_intervals.append((last_cw, last_ccw, "NR"))
|
|
415
|
+
x = last_ccw
|
|
416
|
+
while x != last:
|
|
417
|
+
new_intervals.append((vert(x), vert(x + rk[a + 1]), "R"))
|
|
418
|
+
x = vert(x + rk[a + 1])
|
|
419
|
+
else:
|
|
420
|
+
for (first, last, typ) in intervals[a]:
|
|
421
|
+
if typ == "NR":
|
|
422
|
+
new_intervals.append((first, last, "R"))
|
|
423
|
+
elif typ == "NL":
|
|
424
|
+
new_intervals.append((first, last, "L"))
|
|
425
|
+
else:
|
|
426
|
+
if typ == "L":
|
|
427
|
+
last_cw = first + vert((na[a] + 1) / 2 * rk[a + 1])
|
|
428
|
+
else:
|
|
429
|
+
last_cw = first + vert((na[a] - 1) / 2 * rk[a + 1])
|
|
430
|
+
last_ccw = vert(last_cw + rk[a + 2])
|
|
431
|
+
x = first
|
|
432
|
+
while x < last_cw:
|
|
433
|
+
new_intervals.append((vert(x), vert(x + rk[a + 1]), "L"))
|
|
434
|
+
x = vert(x + rk[a + 1])
|
|
435
|
+
if typ == "L":
|
|
436
|
+
new_intervals.append((last_cw, last_ccw, "NR"))
|
|
437
|
+
else:
|
|
438
|
+
new_intervals.append((last_cw, last_ccw, "NL"))
|
|
439
|
+
x = last_ccw
|
|
440
|
+
while x != last:
|
|
441
|
+
new_intervals.append((vert(x), vert(x + rk[a + 1]), "R"))
|
|
442
|
+
x = vert(x + rk[a + 1])
|
|
443
|
+
intervals.append(new_intervals)
|
|
444
|
+
return tuple(map(tuple, intervals))
|
|
445
|
+
|
|
446
|
+
def plot(self, **kwds):
|
|
447
|
+
r"""
|
|
448
|
+
Plot the initial triangulation associated to ``self``.
|
|
449
|
+
|
|
450
|
+
INPUT:
|
|
451
|
+
|
|
452
|
+
- ``radius`` -- the radius of the disk; by default the length of
|
|
453
|
+
the circle is the number of vertices
|
|
454
|
+
- ``points_color`` -- the color of the vertices; default 'black'
|
|
455
|
+
- ``points_size`` -- the size of the vertices; default 7
|
|
456
|
+
- ``triangulation_color`` -- the color of the arcs; default 'black'
|
|
457
|
+
- ``triangulation_thickness`` -- the thickness of the arcs; default 0.5
|
|
458
|
+
- ``shading_color`` -- the color of the shading used on neuter
|
|
459
|
+
intervals; default 'lightgray'
|
|
460
|
+
- ``reflections_color`` -- the color of the reflection axes; default
|
|
461
|
+
'blue'
|
|
462
|
+
- ``reflections_thickness`` -- the thickness of the reflection axes;
|
|
463
|
+
default 1
|
|
464
|
+
|
|
465
|
+
EXAMPLES::
|
|
466
|
+
|
|
467
|
+
sage: Y = SineGordonYsystem('A',(6,4,3))
|
|
468
|
+
sage: Y.plot() # long time (2s) # needs sage.plot
|
|
469
|
+
Graphics object consisting of 219 graphics primitives
|
|
470
|
+
"""
|
|
471
|
+
# Set up plotting options
|
|
472
|
+
if 'radius' in kwds:
|
|
473
|
+
radius = kwds['radius']
|
|
474
|
+
else:
|
|
475
|
+
radius = ceil(self.r() / (2 * pi))
|
|
476
|
+
points_opts = {}
|
|
477
|
+
if 'points_color' in kwds:
|
|
478
|
+
points_opts['color'] = kwds['points_color']
|
|
479
|
+
else:
|
|
480
|
+
points_opts['color'] = 'black'
|
|
481
|
+
if 'points_size' in kwds:
|
|
482
|
+
points_opts['size'] = kwds['points_size']
|
|
483
|
+
else:
|
|
484
|
+
points_opts['size'] = 7
|
|
485
|
+
triangulation_opts = {}
|
|
486
|
+
if 'triangulation_color' in kwds:
|
|
487
|
+
triangulation_opts['color'] = kwds['triangulation_color']
|
|
488
|
+
else:
|
|
489
|
+
triangulation_opts['color'] = 'black'
|
|
490
|
+
if 'triangulation_thickness' in kwds:
|
|
491
|
+
triangulation_opts['thickness'] = kwds['triangulation_thickness']
|
|
492
|
+
else:
|
|
493
|
+
triangulation_opts['thickness'] = 0.5
|
|
494
|
+
shading_opts = {}
|
|
495
|
+
if 'shading_color' in kwds:
|
|
496
|
+
shading_opts['color'] = kwds['shading_color']
|
|
497
|
+
else:
|
|
498
|
+
shading_opts['color'] = 'lightgray'
|
|
499
|
+
reflections_opts = {}
|
|
500
|
+
if 'reflections_color' in kwds:
|
|
501
|
+
reflections_opts['color'] = kwds['reflections_color']
|
|
502
|
+
else:
|
|
503
|
+
reflections_opts['color'] = 'blue'
|
|
504
|
+
if 'reflections_thickness' in kwds:
|
|
505
|
+
reflections_opts['thickness'] = kwds['reflections_thickness']
|
|
506
|
+
else:
|
|
507
|
+
reflections_opts['thickness'] = 1
|
|
508
|
+
# Helper functions
|
|
509
|
+
|
|
510
|
+
def triangle(x):
|
|
511
|
+
(a, b) = sorted(x[:2])
|
|
512
|
+
for p in self.vertices():
|
|
513
|
+
if (p, a) in self.triangulation() or (a, p) in self.triangulation():
|
|
514
|
+
if (p, b) in self.triangulation() or (b, p) in self.triangulation():
|
|
515
|
+
if p < a or p > b:
|
|
516
|
+
return sorted((a, b, p))
|
|
517
|
+
|
|
518
|
+
def plot_arc(radius, p, q, **opts):
|
|
519
|
+
# TODO: THIS SHOULD USE THE EXISTING PLOT OF ARCS!
|
|
520
|
+
# plot the arc from p to q differently depending on the type of self
|
|
521
|
+
p = ZZ(p)
|
|
522
|
+
q = ZZ(q)
|
|
523
|
+
t = SR.var('t')
|
|
524
|
+
if p - q in [1, -1]:
|
|
525
|
+
def f(t):
|
|
526
|
+
return (radius * cos(t), radius * sin(t))
|
|
527
|
+
(p, q) = sorted([p, q])
|
|
528
|
+
angle_p = vertex_to_angle(p)
|
|
529
|
+
angle_q = vertex_to_angle(q)
|
|
530
|
+
return parametric_plot(f(t), (t, angle_q, angle_p), **opts)
|
|
531
|
+
if self.type() == 'A':
|
|
532
|
+
angle_p = vertex_to_angle(p)
|
|
533
|
+
angle_q = vertex_to_angle(q)
|
|
534
|
+
if angle_p < angle_q:
|
|
535
|
+
angle_p += 2 * pi
|
|
536
|
+
internal_angle = angle_p - angle_q
|
|
537
|
+
if internal_angle > pi:
|
|
538
|
+
(angle_p, angle_q) = (angle_q + 2 * pi, angle_p)
|
|
539
|
+
internal_angle = angle_p - angle_q
|
|
540
|
+
angle_center = (angle_p + angle_q) / 2
|
|
541
|
+
hypotenuse = radius / cos(internal_angle / 2)
|
|
542
|
+
radius_arc = hypotenuse * sin(internal_angle / 2)
|
|
543
|
+
center = (hypotenuse * cos(angle_center),
|
|
544
|
+
hypotenuse * sin(angle_center))
|
|
545
|
+
center_angle_p = angle_p + pi / 2
|
|
546
|
+
center_angle_q = angle_q + 3 * pi / 2
|
|
547
|
+
|
|
548
|
+
def f(t):
|
|
549
|
+
return (radius_arc * cos(t) + center[0],
|
|
550
|
+
radius_arc * sin(t) + center[1])
|
|
551
|
+
return parametric_plot(f(t), (t, center_angle_p,
|
|
552
|
+
center_angle_q), **opts)
|
|
553
|
+
elif self.type() == 'D':
|
|
554
|
+
if p >= q:
|
|
555
|
+
q += self.r()
|
|
556
|
+
px = -2 * pi * p / self.r() + pi / 2
|
|
557
|
+
qx = -2 * pi * q / self.r() + pi / 2
|
|
558
|
+
arc_radius = (px - qx) / 2
|
|
559
|
+
arc_center = qx + arc_radius
|
|
560
|
+
|
|
561
|
+
def f(t):
|
|
562
|
+
return exp(I * ((cos(t) + I * sin(t)) *
|
|
563
|
+
arc_radius + arc_center)) * radius
|
|
564
|
+
return parametric_plot((real_part(f(t)), imag_part(f(t))),
|
|
565
|
+
(t, 0, pi), **opts)
|
|
566
|
+
|
|
567
|
+
def vertex_to_angle(v):
|
|
568
|
+
# v==0 corresponds to pi/2
|
|
569
|
+
return -2 * pi * RR(v) / self.r() + 5 * pi / 2
|
|
570
|
+
|
|
571
|
+
# Begin plotting
|
|
572
|
+
P = Graphics()
|
|
573
|
+
# Shade neuter intervals
|
|
574
|
+
neuter_intervals = [x for x in flatten(self.intervals()[:-1],
|
|
575
|
+
max_level=1)
|
|
576
|
+
if x[2] in ["NR", "NL"]]
|
|
577
|
+
shaded_triangles = map(triangle, neuter_intervals)
|
|
578
|
+
for (p, q, r) in shaded_triangles:
|
|
579
|
+
points = list(plot_arc(radius, p, q)[0])
|
|
580
|
+
points += list(plot_arc(radius, q, r)[0])
|
|
581
|
+
points += list(reversed(plot_arc(radius, p, r)[0]))
|
|
582
|
+
P += polygon2d(points, **shading_opts)
|
|
583
|
+
# Disk boundary
|
|
584
|
+
P += circle((0, 0), radius, **triangulation_opts)
|
|
585
|
+
# Triangulation
|
|
586
|
+
for (p, q) in self.triangulation():
|
|
587
|
+
P += plot_arc(radius, p, q, **triangulation_opts)
|
|
588
|
+
if self.type() == 'D':
|
|
589
|
+
s = radius / 50.0
|
|
590
|
+
P += polygon2d([(s, 5 * s), (s, 7 * s),
|
|
591
|
+
(3 * s, 5 * s), (3 * s, 7 * s)],
|
|
592
|
+
color=triangulation_opts['color'])
|
|
593
|
+
P += bezier_path([[(0, 0), (2 * s, 1 * s), (2 * s, 6 * s)],
|
|
594
|
+
[(2 * s, 10 * s), (s, 20 * s)],
|
|
595
|
+
[(0, 30 * s), (0, radius)]],
|
|
596
|
+
**triangulation_opts)
|
|
597
|
+
P += bezier_path([[(0, 0), (-2 * s, 1 * s), (-2 * s, 6 * s)],
|
|
598
|
+
[(-2 * s, 10 * s), (-s, 20 * s)],
|
|
599
|
+
[(0, 30 * s), (0, radius)]],
|
|
600
|
+
**triangulation_opts)
|
|
601
|
+
P += point((0, 0), zorder=len(P), **points_opts)
|
|
602
|
+
# Vertices
|
|
603
|
+
v_points = [(radius * cos(vertex_to_angle(x)),
|
|
604
|
+
radius * sin(vertex_to_angle(x)))
|
|
605
|
+
for x in self.vertices()]
|
|
606
|
+
for coords in v_points:
|
|
607
|
+
P += point(coords, zorder=len(P), **points_opts)
|
|
608
|
+
# Reflection axes
|
|
609
|
+
P += line([(0, 1.1 * radius), (0, -1.1 * radius)],
|
|
610
|
+
zorder=len(P), **reflections_opts)
|
|
611
|
+
axis_angle = vertex_to_angle(-0.5 * (self.rk() + (1, 1))[1])
|
|
612
|
+
(a, b) = (1.1 * radius * cos(axis_angle),
|
|
613
|
+
1.1 * radius * sin(axis_angle))
|
|
614
|
+
P += line([(a, b), (-a, -b)], zorder=len(P), **reflections_opts)
|
|
615
|
+
# Wrap up
|
|
616
|
+
P.set_aspect_ratio(1)
|
|
617
|
+
P.axes(False)
|
|
618
|
+
return P
|