passagemath-categories 10.6.32__cp314-cp314t-musllinux_1_2_aarch64.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_categories-10.6.32.dist-info/METADATA +156 -0
- passagemath_categories-10.6.32.dist-info/RECORD +719 -0
- passagemath_categories-10.6.32.dist-info/WHEEL +5 -0
- passagemath_categories-10.6.32.dist-info/top_level.txt +2 -0
- passagemath_categories.libs/libgcc_s-2d945d6c.so.1 +0 -0
- passagemath_categories.libs/libgmp-28992bcb.so.10.5.0 +0 -0
- passagemath_categories.libs/libstdc++-85f2cd6d.so.6.0.33 +0 -0
- sage/all__sagemath_categories.py +28 -0
- sage/arith/all.py +38 -0
- sage/arith/constants.pxd +27 -0
- sage/arith/functions.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/arith/functions.pxd +4 -0
- sage/arith/functions.pyx +221 -0
- sage/arith/misc.py +6552 -0
- sage/arith/multi_modular.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/arith/multi_modular.pxd +39 -0
- sage/arith/multi_modular.pyx +994 -0
- sage/arith/rational_reconstruction.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/arith/rational_reconstruction.pxd +4 -0
- sage/arith/rational_reconstruction.pyx +115 -0
- sage/arith/srange.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/arith/srange.pyx +571 -0
- sage/calculus/all__sagemath_categories.py +2 -0
- sage/calculus/functional.py +481 -0
- sage/calculus/functions.py +151 -0
- sage/categories/additive_groups.py +73 -0
- sage/categories/additive_magmas.py +1044 -0
- sage/categories/additive_monoids.py +114 -0
- sage/categories/additive_semigroups.py +184 -0
- sage/categories/affine_weyl_groups.py +238 -0
- sage/categories/algebra_ideals.py +95 -0
- sage/categories/algebra_modules.py +96 -0
- sage/categories/algebras.py +349 -0
- sage/categories/algebras_with_basis.py +377 -0
- sage/categories/all.py +160 -0
- sage/categories/aperiodic_semigroups.py +29 -0
- sage/categories/associative_algebras.py +47 -0
- sage/categories/bialgebras.py +101 -0
- sage/categories/bialgebras_with_basis.py +414 -0
- sage/categories/bimodules.py +206 -0
- sage/categories/chain_complexes.py +268 -0
- sage/categories/classical_crystals.py +480 -0
- sage/categories/coalgebras.py +405 -0
- sage/categories/coalgebras_with_basis.py +232 -0
- sage/categories/coercion_methods.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/categories/coercion_methods.pyx +52 -0
- sage/categories/commutative_additive_groups.py +104 -0
- sage/categories/commutative_additive_monoids.py +45 -0
- sage/categories/commutative_additive_semigroups.py +48 -0
- sage/categories/commutative_algebra_ideals.py +87 -0
- sage/categories/commutative_algebras.py +94 -0
- sage/categories/commutative_ring_ideals.py +58 -0
- sage/categories/commutative_rings.py +736 -0
- sage/categories/complete_discrete_valuation.py +293 -0
- sage/categories/complex_reflection_groups.py +145 -0
- sage/categories/complex_reflection_or_generalized_coxeter_groups.py +1249 -0
- sage/categories/coxeter_group_algebras.py +186 -0
- sage/categories/coxeter_groups.py +3402 -0
- sage/categories/crystals.py +2628 -0
- sage/categories/cw_complexes.py +216 -0
- sage/categories/dedekind_domains.py +137 -0
- sage/categories/discrete_valuation.py +325 -0
- sage/categories/distributive_magmas_and_additive_magmas.py +100 -0
- sage/categories/division_rings.py +114 -0
- sage/categories/domains.py +95 -0
- sage/categories/drinfeld_modules.py +789 -0
- sage/categories/dual.py +42 -0
- sage/categories/enumerated_sets.py +1146 -0
- sage/categories/euclidean_domains.py +271 -0
- sage/categories/examples/algebras_with_basis.py +102 -0
- sage/categories/examples/all.py +1 -0
- sage/categories/examples/commutative_additive_monoids.py +130 -0
- sage/categories/examples/commutative_additive_semigroups.py +199 -0
- sage/categories/examples/coxeter_groups.py +8 -0
- sage/categories/examples/crystals.py +236 -0
- sage/categories/examples/cw_complexes.py +163 -0
- sage/categories/examples/facade_sets.py +187 -0
- sage/categories/examples/filtered_algebras_with_basis.py +204 -0
- sage/categories/examples/filtered_modules_with_basis.py +154 -0
- sage/categories/examples/finite_coxeter_groups.py +252 -0
- sage/categories/examples/finite_dimensional_algebras_with_basis.py +148 -0
- sage/categories/examples/finite_dimensional_lie_algebras_with_basis.py +495 -0
- sage/categories/examples/finite_enumerated_sets.py +208 -0
- sage/categories/examples/finite_monoids.py +150 -0
- sage/categories/examples/finite_semigroups.py +190 -0
- sage/categories/examples/finite_weyl_groups.py +191 -0
- sage/categories/examples/graded_connected_hopf_algebras_with_basis.py +152 -0
- sage/categories/examples/graded_modules_with_basis.py +168 -0
- sage/categories/examples/graphs.py +122 -0
- sage/categories/examples/hopf_algebras_with_basis.py +145 -0
- sage/categories/examples/infinite_enumerated_sets.py +190 -0
- sage/categories/examples/lie_algebras.py +352 -0
- sage/categories/examples/lie_algebras_with_basis.py +196 -0
- sage/categories/examples/magmas.py +162 -0
- sage/categories/examples/manifolds.py +94 -0
- sage/categories/examples/monoids.py +144 -0
- sage/categories/examples/posets.py +178 -0
- sage/categories/examples/semigroups.py +580 -0
- sage/categories/examples/semigroups_cython.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/categories/examples/semigroups_cython.pyx +221 -0
- sage/categories/examples/semirings.py +249 -0
- sage/categories/examples/sets_cat.py +706 -0
- sage/categories/examples/sets_with_grading.py +101 -0
- sage/categories/examples/with_realizations.py +542 -0
- sage/categories/fields.py +991 -0
- sage/categories/filtered_algebras.py +63 -0
- sage/categories/filtered_algebras_with_basis.py +548 -0
- sage/categories/filtered_hopf_algebras_with_basis.py +138 -0
- sage/categories/filtered_modules.py +210 -0
- sage/categories/filtered_modules_with_basis.py +1209 -0
- sage/categories/finite_complex_reflection_groups.py +1506 -0
- sage/categories/finite_coxeter_groups.py +1138 -0
- sage/categories/finite_crystals.py +103 -0
- sage/categories/finite_dimensional_algebras_with_basis.py +1860 -0
- sage/categories/finite_dimensional_bialgebras_with_basis.py +33 -0
- sage/categories/finite_dimensional_coalgebras_with_basis.py +33 -0
- sage/categories/finite_dimensional_graded_lie_algebras_with_basis.py +231 -0
- sage/categories/finite_dimensional_hopf_algebras_with_basis.py +38 -0
- sage/categories/finite_dimensional_lie_algebras_with_basis.py +2774 -0
- sage/categories/finite_dimensional_modules_with_basis.py +1407 -0
- sage/categories/finite_dimensional_nilpotent_lie_algebras_with_basis.py +167 -0
- sage/categories/finite_dimensional_semisimple_algebras_with_basis.py +270 -0
- sage/categories/finite_enumerated_sets.py +769 -0
- sage/categories/finite_fields.py +252 -0
- sage/categories/finite_groups.py +256 -0
- sage/categories/finite_lattice_posets.py +242 -0
- sage/categories/finite_monoids.py +316 -0
- sage/categories/finite_permutation_groups.py +339 -0
- sage/categories/finite_posets.py +1994 -0
- sage/categories/finite_semigroups.py +136 -0
- sage/categories/finite_sets.py +93 -0
- sage/categories/finite_weyl_groups.py +39 -0
- sage/categories/finitely_generated_lambda_bracket_algebras.py +112 -0
- sage/categories/finitely_generated_lie_conformal_algebras.py +114 -0
- sage/categories/finitely_generated_magmas.py +57 -0
- sage/categories/finitely_generated_semigroups.py +214 -0
- sage/categories/function_fields.py +76 -0
- sage/categories/g_sets.py +77 -0
- sage/categories/gcd_domains.py +65 -0
- sage/categories/generalized_coxeter_groups.py +94 -0
- sage/categories/graded_algebras.py +85 -0
- sage/categories/graded_algebras_with_basis.py +258 -0
- sage/categories/graded_bialgebras.py +32 -0
- sage/categories/graded_bialgebras_with_basis.py +32 -0
- sage/categories/graded_coalgebras.py +65 -0
- sage/categories/graded_coalgebras_with_basis.py +51 -0
- sage/categories/graded_hopf_algebras.py +41 -0
- sage/categories/graded_hopf_algebras_with_basis.py +169 -0
- sage/categories/graded_lie_algebras.py +91 -0
- sage/categories/graded_lie_algebras_with_basis.py +44 -0
- sage/categories/graded_lie_conformal_algebras.py +74 -0
- sage/categories/graded_modules.py +133 -0
- sage/categories/graded_modules_with_basis.py +329 -0
- sage/categories/graphs.py +138 -0
- sage/categories/group_algebras.py +430 -0
- sage/categories/groupoid.py +94 -0
- sage/categories/groups.py +667 -0
- sage/categories/h_trivial_semigroups.py +64 -0
- sage/categories/hecke_modules.py +185 -0
- sage/categories/highest_weight_crystals.py +980 -0
- sage/categories/hopf_algebras.py +219 -0
- sage/categories/hopf_algebras_with_basis.py +309 -0
- sage/categories/infinite_enumerated_sets.py +115 -0
- sage/categories/integral_domains.py +203 -0
- sage/categories/j_trivial_semigroups.py +29 -0
- sage/categories/kac_moody_algebras.py +82 -0
- sage/categories/kahler_algebras.py +203 -0
- sage/categories/l_trivial_semigroups.py +63 -0
- sage/categories/lambda_bracket_algebras.py +280 -0
- sage/categories/lambda_bracket_algebras_with_basis.py +107 -0
- sage/categories/lattice_posets.py +89 -0
- sage/categories/left_modules.py +49 -0
- sage/categories/lie_algebras.py +1070 -0
- sage/categories/lie_algebras_with_basis.py +261 -0
- sage/categories/lie_conformal_algebras.py +350 -0
- sage/categories/lie_conformal_algebras_with_basis.py +147 -0
- sage/categories/lie_groups.py +73 -0
- sage/categories/loop_crystals.py +1290 -0
- sage/categories/magmas.py +1189 -0
- sage/categories/magmas_and_additive_magmas.py +149 -0
- sage/categories/magmatic_algebras.py +365 -0
- sage/categories/manifolds.py +352 -0
- sage/categories/matrix_algebras.py +40 -0
- sage/categories/metric_spaces.py +387 -0
- sage/categories/modular_abelian_varieties.py +78 -0
- sage/categories/modules.py +989 -0
- sage/categories/modules_with_basis.py +2794 -0
- sage/categories/monoid_algebras.py +38 -0
- sage/categories/monoids.py +739 -0
- sage/categories/noetherian_rings.py +87 -0
- sage/categories/number_fields.py +242 -0
- sage/categories/ore_modules.py +189 -0
- sage/categories/partially_ordered_monoids.py +49 -0
- sage/categories/permutation_groups.py +63 -0
- sage/categories/pointed_sets.py +42 -0
- sage/categories/polyhedra.py +74 -0
- sage/categories/poor_man_map.py +270 -0
- sage/categories/posets.py +722 -0
- sage/categories/principal_ideal_domains.py +270 -0
- sage/categories/quantum_group_representations.py +543 -0
- sage/categories/quotient_fields.py +728 -0
- sage/categories/r_trivial_semigroups.py +45 -0
- sage/categories/regular_crystals.py +898 -0
- sage/categories/regular_supercrystals.py +170 -0
- sage/categories/right_modules.py +49 -0
- sage/categories/ring_ideals.py +74 -0
- sage/categories/rings.py +1904 -0
- sage/categories/rngs.py +175 -0
- sage/categories/schemes.py +393 -0
- sage/categories/semigroups.py +1060 -0
- sage/categories/semirings.py +71 -0
- sage/categories/semisimple_algebras.py +114 -0
- sage/categories/sets_with_grading.py +235 -0
- sage/categories/shephard_groups.py +43 -0
- sage/categories/signed_tensor.py +120 -0
- sage/categories/simplicial_complexes.py +134 -0
- sage/categories/simplicial_sets.py +1206 -0
- sage/categories/super_algebras.py +149 -0
- sage/categories/super_algebras_with_basis.py +144 -0
- sage/categories/super_hopf_algebras_with_basis.py +126 -0
- sage/categories/super_lie_conformal_algebras.py +193 -0
- sage/categories/super_modules.py +229 -0
- sage/categories/super_modules_with_basis.py +193 -0
- sage/categories/supercommutative_algebras.py +99 -0
- sage/categories/supercrystals.py +406 -0
- sage/categories/tensor.py +110 -0
- sage/categories/topological_spaces.py +170 -0
- sage/categories/triangular_kac_moody_algebras.py +439 -0
- sage/categories/tutorial.py +58 -0
- sage/categories/unique_factorization_domains.py +318 -0
- sage/categories/unital_algebras.py +426 -0
- sage/categories/vector_bundles.py +159 -0
- sage/categories/vector_spaces.py +357 -0
- sage/categories/weyl_groups.py +853 -0
- sage/combinat/all__sagemath_categories.py +34 -0
- sage/combinat/backtrack.py +180 -0
- sage/combinat/combinat.py +2269 -0
- sage/combinat/combinat_cython.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/combinat/combinat_cython.pxd +6 -0
- sage/combinat/combinat_cython.pyx +390 -0
- sage/combinat/combination.py +796 -0
- sage/combinat/combinatorial_map.py +416 -0
- sage/combinat/composition.py +2192 -0
- sage/combinat/dlx.py +510 -0
- sage/combinat/integer_lists/__init__.py +7 -0
- sage/combinat/integer_lists/base.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/combinat/integer_lists/base.pxd +16 -0
- sage/combinat/integer_lists/base.pyx +713 -0
- sage/combinat/integer_lists/invlex.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/combinat/integer_lists/invlex.pxd +4 -0
- sage/combinat/integer_lists/invlex.pyx +1650 -0
- sage/combinat/integer_lists/lists.py +328 -0
- sage/combinat/integer_lists/nn.py +48 -0
- sage/combinat/integer_vector.py +1818 -0
- sage/combinat/integer_vector_weighted.py +413 -0
- sage/combinat/matrices/all__sagemath_categories.py +5 -0
- sage/combinat/matrices/dancing_links.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/combinat/matrices/dancing_links.pyx +1159 -0
- sage/combinat/matrices/dancing_links_c.h +380 -0
- sage/combinat/matrices/dlxcpp.py +136 -0
- sage/combinat/partition.py +10070 -0
- sage/combinat/partitions.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/combinat/partitions.pyx +743 -0
- sage/combinat/permutation.py +10168 -0
- sage/combinat/permutation_cython.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/combinat/permutation_cython.pxd +11 -0
- sage/combinat/permutation_cython.pyx +407 -0
- sage/combinat/q_analogues.py +1090 -0
- sage/combinat/ranker.py +268 -0
- sage/combinat/subset.py +1561 -0
- sage/combinat/subsets_hereditary.py +202 -0
- sage/combinat/subsets_pairwise.py +184 -0
- sage/combinat/tools.py +63 -0
- sage/combinat/tuple.py +348 -0
- sage/data_structures/all.py +2 -0
- sage/data_structures/all__sagemath_categories.py +2 -0
- sage/data_structures/binary_matrix.pxd +138 -0
- sage/data_structures/binary_search.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/data_structures/binary_search.pxd +3 -0
- sage/data_structures/binary_search.pyx +66 -0
- sage/data_structures/bitset.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/data_structures/bitset.pxd +40 -0
- sage/data_structures/bitset.pyx +2385 -0
- sage/data_structures/bitset_base.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/data_structures/bitset_base.pxd +926 -0
- sage/data_structures/bitset_base.pyx +117 -0
- sage/data_structures/bitset_intrinsics.h +487 -0
- sage/data_structures/blas_dict.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/data_structures/blas_dict.pxd +12 -0
- sage/data_structures/blas_dict.pyx +469 -0
- sage/data_structures/list_of_pairs.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/data_structures/list_of_pairs.pxd +16 -0
- sage/data_structures/list_of_pairs.pyx +122 -0
- sage/data_structures/mutable_poset.py +3312 -0
- sage/data_structures/pairing_heap.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/data_structures/pairing_heap.h +346 -0
- sage/data_structures/pairing_heap.pxd +88 -0
- sage/data_structures/pairing_heap.pyx +1464 -0
- sage/data_structures/sparse_bitset.pxd +62 -0
- sage/data_structures/stream.py +5070 -0
- sage/databases/all__sagemath_categories.py +7 -0
- sage/databases/sql_db.py +2236 -0
- sage/ext/all__sagemath_categories.py +3 -0
- sage/ext/fast_callable.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/ext/fast_callable.pxd +4 -0
- sage/ext/fast_callable.pyx +2746 -0
- sage/ext/fast_eval.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/ext/fast_eval.pxd +1 -0
- sage/ext/fast_eval.pyx +102 -0
- sage/ext/interpreters/__init__.py +1 -0
- sage/ext/interpreters/all__sagemath_categories.py +2 -0
- sage/ext/interpreters/wrapper_el.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/ext/interpreters/wrapper_el.pxd +18 -0
- sage/ext/interpreters/wrapper_el.pyx +148 -0
- sage/ext/interpreters/wrapper_py.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/ext/interpreters/wrapper_py.pxd +17 -0
- sage/ext/interpreters/wrapper_py.pyx +133 -0
- sage/functions/airy.py +937 -0
- sage/functions/all.py +97 -0
- sage/functions/bessel.py +2102 -0
- sage/functions/error.py +784 -0
- sage/functions/exp_integral.py +1529 -0
- sage/functions/gamma.py +1087 -0
- sage/functions/generalized.py +672 -0
- sage/functions/hyperbolic.py +747 -0
- sage/functions/hypergeometric.py +1156 -0
- sage/functions/jacobi.py +1705 -0
- sage/functions/log.py +1402 -0
- sage/functions/min_max.py +338 -0
- sage/functions/orthogonal_polys.py +3106 -0
- sage/functions/other.py +2303 -0
- sage/functions/piecewise.py +1505 -0
- sage/functions/prime_pi.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/functions/prime_pi.pyx +262 -0
- sage/functions/special.py +1212 -0
- sage/functions/spike_function.py +278 -0
- sage/functions/transcendental.py +690 -0
- sage/functions/trig.py +1062 -0
- sage/functions/wigner.py +726 -0
- sage/geometry/abc.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/geometry/abc.pyx +82 -0
- sage/geometry/all__sagemath_categories.py +1 -0
- sage/groups/all__sagemath_categories.py +11 -0
- sage/groups/generic.py +1733 -0
- sage/groups/groups_catalog.py +113 -0
- sage/groups/perm_gps/all__sagemath_categories.py +1 -0
- sage/groups/perm_gps/partn_ref/all.py +1 -0
- sage/groups/perm_gps/partn_ref/all__sagemath_categories.py +1 -0
- sage/groups/perm_gps/partn_ref/automorphism_group_canonical_label.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/groups/perm_gps/partn_ref/automorphism_group_canonical_label.pxd +52 -0
- sage/groups/perm_gps/partn_ref/automorphism_group_canonical_label.pyx +906 -0
- sage/groups/perm_gps/partn_ref/canonical_augmentation.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/groups/perm_gps/partn_ref/canonical_augmentation.pxd +85 -0
- sage/groups/perm_gps/partn_ref/canonical_augmentation.pyx +534 -0
- sage/groups/perm_gps/partn_ref/data_structures.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/groups/perm_gps/partn_ref/data_structures.pxd +576 -0
- sage/groups/perm_gps/partn_ref/data_structures.pyx +1792 -0
- sage/groups/perm_gps/partn_ref/double_coset.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/groups/perm_gps/partn_ref/double_coset.pxd +45 -0
- sage/groups/perm_gps/partn_ref/double_coset.pyx +739 -0
- sage/groups/perm_gps/partn_ref/refinement_lists.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_lists.pxd +18 -0
- sage/groups/perm_gps/partn_ref/refinement_lists.pyx +82 -0
- sage/groups/perm_gps/partn_ref/refinement_python.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_python.pxd +16 -0
- sage/groups/perm_gps/partn_ref/refinement_python.pyx +564 -0
- sage/groups/perm_gps/partn_ref/refinement_sets.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_sets.pxd +60 -0
- sage/groups/perm_gps/partn_ref/refinement_sets.pyx +858 -0
- sage/interfaces/abc.py +140 -0
- sage/interfaces/all.py +58 -0
- sage/interfaces/all__sagemath_categories.py +1 -0
- sage/interfaces/expect.py +1643 -0
- sage/interfaces/interface.py +1682 -0
- sage/interfaces/process.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/interfaces/process.pxd +5 -0
- sage/interfaces/process.pyx +288 -0
- sage/interfaces/quit.py +167 -0
- sage/interfaces/sage0.py +604 -0
- sage/interfaces/sagespawn.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/interfaces/sagespawn.pyx +308 -0
- sage/interfaces/tab_completion.py +101 -0
- sage/misc/all__sagemath_categories.py +78 -0
- sage/misc/allocator.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/misc/allocator.pxd +6 -0
- sage/misc/allocator.pyx +47 -0
- sage/misc/binary_tree.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/misc/binary_tree.pxd +29 -0
- sage/misc/binary_tree.pyx +537 -0
- sage/misc/callable_dict.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/misc/callable_dict.pyx +89 -0
- sage/misc/citation.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/misc/citation.pyx +159 -0
- sage/misc/converting_dict.py +293 -0
- sage/misc/defaults.py +129 -0
- sage/misc/derivative.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/misc/derivative.pyx +223 -0
- sage/misc/functional.py +2005 -0
- sage/misc/html.py +589 -0
- sage/misc/latex.py +2673 -0
- sage/misc/latex_macros.py +236 -0
- sage/misc/latex_standalone.py +1833 -0
- sage/misc/map_threaded.py +38 -0
- sage/misc/mathml.py +76 -0
- sage/misc/method_decorator.py +88 -0
- sage/misc/mrange.py +755 -0
- sage/misc/multireplace.py +41 -0
- sage/misc/object_multiplexer.py +92 -0
- sage/misc/parser.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/misc/parser.pyx +1107 -0
- sage/misc/random_testing.py +264 -0
- sage/misc/rest_index_of_methods.py +377 -0
- sage/misc/search.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/misc/search.pxd +2 -0
- sage/misc/search.pyx +68 -0
- sage/misc/stopgap.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/misc/stopgap.pyx +95 -0
- sage/misc/table.py +853 -0
- sage/monoids/all__sagemath_categories.py +1 -0
- sage/monoids/indexed_free_monoid.py +1071 -0
- sage/monoids/monoid.py +82 -0
- sage/numerical/all__sagemath_categories.py +1 -0
- sage/numerical/backends/all__sagemath_categories.py +1 -0
- sage/numerical/backends/generic_backend.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/numerical/backends/generic_backend.pxd +61 -0
- sage/numerical/backends/generic_backend.pyx +1893 -0
- sage/numerical/backends/generic_sdp_backend.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/numerical/backends/generic_sdp_backend.pxd +38 -0
- sage/numerical/backends/generic_sdp_backend.pyx +755 -0
- sage/parallel/all.py +6 -0
- sage/parallel/decorate.py +575 -0
- sage/parallel/map_reduce.py +1997 -0
- sage/parallel/multiprocessing_sage.py +76 -0
- sage/parallel/ncpus.py +35 -0
- sage/parallel/parallelism.py +364 -0
- sage/parallel/reference.py +47 -0
- sage/parallel/use_fork.py +333 -0
- sage/rings/abc.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/abc.pxd +31 -0
- sage/rings/abc.pyx +526 -0
- sage/rings/algebraic_closure_finite_field.py +1154 -0
- sage/rings/all__sagemath_categories.py +91 -0
- sage/rings/big_oh.py +227 -0
- sage/rings/continued_fraction.py +2754 -0
- sage/rings/continued_fraction_gosper.py +220 -0
- sage/rings/factorint.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/factorint.pyx +295 -0
- sage/rings/fast_arith.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/fast_arith.pxd +21 -0
- sage/rings/fast_arith.pyx +535 -0
- sage/rings/finite_rings/all__sagemath_categories.py +9 -0
- sage/rings/finite_rings/conway_polynomials.py +542 -0
- sage/rings/finite_rings/element_base.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/finite_rings/element_base.pxd +12 -0
- sage/rings/finite_rings/element_base.pyx +1176 -0
- sage/rings/finite_rings/finite_field_base.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/finite_rings/finite_field_base.pxd +7 -0
- sage/rings/finite_rings/finite_field_base.pyx +2171 -0
- sage/rings/finite_rings/finite_field_constructor.py +827 -0
- sage/rings/finite_rings/finite_field_prime_modn.py +372 -0
- sage/rings/finite_rings/galois_group.py +154 -0
- sage/rings/finite_rings/hom_finite_field.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/finite_rings/hom_finite_field.pxd +23 -0
- sage/rings/finite_rings/hom_finite_field.pyx +856 -0
- sage/rings/finite_rings/hom_prime_finite_field.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/finite_rings/hom_prime_finite_field.pxd +15 -0
- sage/rings/finite_rings/hom_prime_finite_field.pyx +164 -0
- sage/rings/finite_rings/homset.py +357 -0
- sage/rings/finite_rings/integer_mod.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/finite_rings/integer_mod.pxd +56 -0
- sage/rings/finite_rings/integer_mod.pyx +4586 -0
- sage/rings/finite_rings/integer_mod_limits.h +11 -0
- sage/rings/finite_rings/integer_mod_ring.py +2044 -0
- sage/rings/finite_rings/residue_field.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/finite_rings/residue_field.pxd +30 -0
- sage/rings/finite_rings/residue_field.pyx +1811 -0
- sage/rings/finite_rings/stdint.pxd +19 -0
- sage/rings/fraction_field.py +1452 -0
- sage/rings/fraction_field_element.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/fraction_field_element.pyx +1357 -0
- sage/rings/function_field/all.py +7 -0
- sage/rings/function_field/all__sagemath_categories.py +2 -0
- sage/rings/function_field/constructor.py +218 -0
- sage/rings/function_field/element.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/function_field/element.pxd +11 -0
- sage/rings/function_field/element.pyx +1008 -0
- sage/rings/function_field/element_rational.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/function_field/element_rational.pyx +513 -0
- sage/rings/function_field/extensions.py +230 -0
- sage/rings/function_field/function_field.py +1468 -0
- sage/rings/function_field/function_field_rational.py +1005 -0
- sage/rings/function_field/ideal.py +1155 -0
- sage/rings/function_field/ideal_rational.py +629 -0
- sage/rings/function_field/jacobian_base.py +826 -0
- sage/rings/function_field/jacobian_hess.py +1053 -0
- sage/rings/function_field/jacobian_khuri_makdisi.py +1027 -0
- sage/rings/function_field/maps.py +1039 -0
- sage/rings/function_field/order.py +281 -0
- sage/rings/function_field/order_basis.py +586 -0
- sage/rings/function_field/order_rational.py +576 -0
- sage/rings/function_field/place.py +426 -0
- sage/rings/function_field/place_rational.py +181 -0
- sage/rings/generic.py +320 -0
- sage/rings/homset.py +332 -0
- sage/rings/ideal.py +1885 -0
- sage/rings/ideal_monoid.py +215 -0
- sage/rings/infinity.py +1890 -0
- sage/rings/integer.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/integer.pxd +45 -0
- sage/rings/integer.pyx +7874 -0
- sage/rings/integer_ring.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/integer_ring.pxd +8 -0
- sage/rings/integer_ring.pyx +1693 -0
- sage/rings/laurent_series_ring.py +931 -0
- sage/rings/laurent_series_ring_element.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/laurent_series_ring_element.pxd +11 -0
- sage/rings/laurent_series_ring_element.pyx +1927 -0
- sage/rings/lazy_series.py +7815 -0
- sage/rings/lazy_series_ring.py +4356 -0
- sage/rings/localization.py +1043 -0
- sage/rings/morphism.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/morphism.pxd +39 -0
- sage/rings/morphism.pyx +3299 -0
- sage/rings/multi_power_series_ring.py +1145 -0
- sage/rings/multi_power_series_ring_element.py +2184 -0
- sage/rings/noncommutative_ideals.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/noncommutative_ideals.pyx +423 -0
- sage/rings/number_field/all__sagemath_categories.py +1 -0
- sage/rings/number_field/number_field_base.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/number_field/number_field_base.pxd +8 -0
- sage/rings/number_field/number_field_base.pyx +507 -0
- sage/rings/number_field/number_field_element_base.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/number_field/number_field_element_base.pxd +6 -0
- sage/rings/number_field/number_field_element_base.pyx +36 -0
- sage/rings/number_field/number_field_ideal.py +3550 -0
- sage/rings/padics/all__sagemath_categories.py +4 -0
- sage/rings/padics/local_generic.py +1670 -0
- sage/rings/padics/local_generic_element.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/padics/local_generic_element.pxd +5 -0
- sage/rings/padics/local_generic_element.pyx +1017 -0
- sage/rings/padics/misc.py +256 -0
- sage/rings/padics/padic_generic.py +1911 -0
- sage/rings/padics/pow_computer.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/padics/pow_computer.pxd +38 -0
- sage/rings/padics/pow_computer.pyx +671 -0
- sage/rings/padics/precision_error.py +24 -0
- sage/rings/polynomial/all__sagemath_categories.py +25 -0
- sage/rings/polynomial/commutative_polynomial.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/commutative_polynomial.pxd +6 -0
- sage/rings/polynomial/commutative_polynomial.pyx +24 -0
- sage/rings/polynomial/cyclotomic.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/cyclotomic.pyx +404 -0
- sage/rings/polynomial/flatten.py +711 -0
- sage/rings/polynomial/ideal.py +102 -0
- sage/rings/polynomial/infinite_polynomial_element.py +1768 -0
- sage/rings/polynomial/infinite_polynomial_ring.py +1653 -0
- sage/rings/polynomial/laurent_polynomial.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/laurent_polynomial.pxd +18 -0
- sage/rings/polynomial/laurent_polynomial.pyx +2190 -0
- sage/rings/polynomial/laurent_polynomial_ideal.py +590 -0
- sage/rings/polynomial/laurent_polynomial_ring.py +832 -0
- sage/rings/polynomial/laurent_polynomial_ring_base.py +708 -0
- sage/rings/polynomial/multi_polynomial.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/multi_polynomial.pxd +12 -0
- sage/rings/polynomial/multi_polynomial.pyx +3082 -0
- sage/rings/polynomial/multi_polynomial_element.py +2570 -0
- sage/rings/polynomial/multi_polynomial_ideal.py +5771 -0
- sage/rings/polynomial/multi_polynomial_ring.py +947 -0
- sage/rings/polynomial/multi_polynomial_ring_base.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/multi_polynomial_ring_base.pxd +15 -0
- sage/rings/polynomial/multi_polynomial_ring_base.pyx +1855 -0
- sage/rings/polynomial/multi_polynomial_sequence.py +2204 -0
- sage/rings/polynomial/polydict.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/polydict.pxd +45 -0
- sage/rings/polynomial/polydict.pyx +2701 -0
- sage/rings/polynomial/polynomial_compiled.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/polynomial_compiled.pxd +59 -0
- sage/rings/polynomial/polynomial_compiled.pyx +509 -0
- sage/rings/polynomial/polynomial_element.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/polynomial_element.pxd +64 -0
- sage/rings/polynomial/polynomial_element.pyx +13255 -0
- sage/rings/polynomial/polynomial_element_generic.py +1637 -0
- sage/rings/polynomial/polynomial_fateman.py +97 -0
- sage/rings/polynomial/polynomial_quotient_ring.py +2465 -0
- sage/rings/polynomial/polynomial_quotient_ring_element.py +779 -0
- sage/rings/polynomial/polynomial_ring.py +3784 -0
- sage/rings/polynomial/polynomial_ring_constructor.py +1051 -0
- sage/rings/polynomial/polynomial_ring_homomorphism.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/polynomial_ring_homomorphism.pxd +5 -0
- sage/rings/polynomial/polynomial_ring_homomorphism.pyx +121 -0
- sage/rings/polynomial/polynomial_singular_interface.py +549 -0
- sage/rings/polynomial/symmetric_ideal.py +989 -0
- sage/rings/polynomial/symmetric_reduction.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/symmetric_reduction.pxd +8 -0
- sage/rings/polynomial/symmetric_reduction.pyx +669 -0
- sage/rings/polynomial/term_order.py +2279 -0
- sage/rings/polynomial/toy_buchberger.py +449 -0
- sage/rings/polynomial/toy_d_basis.py +387 -0
- sage/rings/polynomial/toy_variety.py +362 -0
- sage/rings/power_series_mpoly.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/power_series_mpoly.pxd +9 -0
- sage/rings/power_series_mpoly.pyx +161 -0
- sage/rings/power_series_poly.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/power_series_poly.pxd +10 -0
- sage/rings/power_series_poly.pyx +1317 -0
- sage/rings/power_series_ring.py +1441 -0
- sage/rings/power_series_ring_element.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/power_series_ring_element.pxd +12 -0
- sage/rings/power_series_ring_element.pyx +3028 -0
- sage/rings/puiseux_series_ring.py +487 -0
- sage/rings/puiseux_series_ring_element.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/puiseux_series_ring_element.pxd +7 -0
- sage/rings/puiseux_series_ring_element.pyx +1055 -0
- sage/rings/qqbar_decorators.py +167 -0
- sage/rings/quotient_ring.py +1598 -0
- sage/rings/quotient_ring_element.py +979 -0
- sage/rings/rational.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/rational.pxd +20 -0
- sage/rings/rational.pyx +4284 -0
- sage/rings/rational_field.py +1730 -0
- sage/rings/real_double.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/real_double.pxd +16 -0
- sage/rings/real_double.pyx +2218 -0
- sage/rings/real_lazy.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/real_lazy.pxd +30 -0
- sage/rings/real_lazy.pyx +1773 -0
- sage/rings/ring.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/ring.pxd +30 -0
- sage/rings/ring.pyx +850 -0
- sage/rings/semirings/all.py +3 -0
- sage/rings/semirings/non_negative_integer_semiring.py +107 -0
- sage/rings/semirings/tropical_mpolynomial.py +972 -0
- sage/rings/semirings/tropical_polynomial.py +997 -0
- sage/rings/semirings/tropical_semiring.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/semirings/tropical_semiring.pyx +676 -0
- sage/rings/semirings/tropical_variety.py +1701 -0
- sage/rings/sum_of_squares.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/sum_of_squares.pxd +3 -0
- sage/rings/sum_of_squares.pyx +336 -0
- sage/rings/tests.py +504 -0
- sage/schemes/affine/affine_homset.py +508 -0
- sage/schemes/affine/affine_morphism.py +1574 -0
- sage/schemes/affine/affine_point.py +460 -0
- sage/schemes/affine/affine_rational_point.py +308 -0
- sage/schemes/affine/affine_space.py +1264 -0
- sage/schemes/affine/affine_subscheme.py +592 -0
- sage/schemes/affine/all.py +25 -0
- sage/schemes/all__sagemath_categories.py +5 -0
- sage/schemes/generic/algebraic_scheme.py +2092 -0
- sage/schemes/generic/all.py +5 -0
- sage/schemes/generic/ambient_space.py +400 -0
- sage/schemes/generic/divisor.py +465 -0
- sage/schemes/generic/divisor_group.py +313 -0
- sage/schemes/generic/glue.py +84 -0
- sage/schemes/generic/homset.py +820 -0
- sage/schemes/generic/hypersurface.py +234 -0
- sage/schemes/generic/morphism.py +2107 -0
- sage/schemes/generic/point.py +237 -0
- sage/schemes/generic/scheme.py +1190 -0
- sage/schemes/generic/spec.py +199 -0
- sage/schemes/product_projective/all.py +6 -0
- sage/schemes/product_projective/homset.py +236 -0
- sage/schemes/product_projective/morphism.py +517 -0
- sage/schemes/product_projective/point.py +568 -0
- sage/schemes/product_projective/rational_point.py +550 -0
- sage/schemes/product_projective/space.py +1301 -0
- sage/schemes/product_projective/subscheme.py +466 -0
- sage/schemes/projective/all.py +24 -0
- sage/schemes/projective/proj_bdd_height.py +453 -0
- sage/schemes/projective/projective_homset.py +718 -0
- sage/schemes/projective/projective_morphism.py +2792 -0
- sage/schemes/projective/projective_point.py +1484 -0
- sage/schemes/projective/projective_rational_point.py +569 -0
- sage/schemes/projective/projective_space.py +2571 -0
- sage/schemes/projective/projective_subscheme.py +1574 -0
- sage/sets/all.py +17 -0
- sage/sets/cartesian_product.py +376 -0
- sage/sets/condition_set.py +525 -0
- sage/sets/disjoint_set.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/sets/disjoint_set.pxd +36 -0
- sage/sets/disjoint_set.pyx +998 -0
- sage/sets/disjoint_union_enumerated_sets.py +625 -0
- sage/sets/family.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/sets/family.pxd +12 -0
- sage/sets/family.pyx +1556 -0
- sage/sets/finite_enumerated_set.py +406 -0
- sage/sets/finite_set_map_cy.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/sets/finite_set_map_cy.pxd +34 -0
- sage/sets/finite_set_map_cy.pyx +708 -0
- sage/sets/finite_set_maps.py +591 -0
- sage/sets/image_set.py +448 -0
- sage/sets/integer_range.py +829 -0
- sage/sets/non_negative_integers.py +241 -0
- sage/sets/positive_integers.py +93 -0
- sage/sets/primes.py +188 -0
- sage/sets/real_set.py +2760 -0
- sage/sets/recursively_enumerated_set.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/sets/recursively_enumerated_set.pxd +31 -0
- sage/sets/recursively_enumerated_set.pyx +2082 -0
- sage/sets/set.py +2083 -0
- sage/sets/set_from_iterator.py +1021 -0
- sage/sets/totally_ordered_finite_set.py +329 -0
- sage/symbolic/all__sagemath_categories.py +1 -0
- sage/symbolic/function.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/symbolic/function.pxd +29 -0
- sage/symbolic/function.pyx +1488 -0
- sage/symbolic/symbols.py +56 -0
- sage/tests/all__sagemath_categories.py +1 -0
- sage/tests/cython.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/tests/cython.pyx +37 -0
- sage/tests/stl_vector.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/tests/stl_vector.pyx +171 -0
- sage/typeset/all.py +6 -0
- sage/typeset/ascii_art.py +295 -0
- sage/typeset/character_art.py +789 -0
- sage/typeset/character_art_factory.py +572 -0
- sage/typeset/symbols.py +334 -0
- sage/typeset/unicode_art.py +183 -0
- sage/typeset/unicode_characters.py +101 -0
|
@@ -0,0 +1,1060 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-categories
|
|
2
|
+
r"""
|
|
3
|
+
Semigroups
|
|
4
|
+
"""
|
|
5
|
+
#*****************************************************************************
|
|
6
|
+
# Copyright (C) 2005 David Kohel <kohel@maths.usyd.edu>
|
|
7
|
+
# William Stein <wstein@math.ucsd.edu>
|
|
8
|
+
# 2008 Teresa Gomez-Diaz (CNRS) <Teresa.Gomez-Diaz@univ-mlv.fr>
|
|
9
|
+
# 2008-2009 Florent Hivert <florent.hivert at univ-rouen.fr>
|
|
10
|
+
# 2008-2015 Nicolas M. Thiery <nthiery at users.sf.net>
|
|
11
|
+
#
|
|
12
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
13
|
+
# http://www.gnu.org/licenses/
|
|
14
|
+
#******************************************************************************
|
|
15
|
+
|
|
16
|
+
from sage.misc.abstract_method import abstract_method
|
|
17
|
+
from sage.misc.cachefunc import cached_method
|
|
18
|
+
from sage.misc.lazy_import import LazyImport
|
|
19
|
+
from sage.categories.category_with_axiom import CategoryWithAxiom, all_axioms
|
|
20
|
+
from sage.categories.algebra_functor import AlgebrasCategory
|
|
21
|
+
from sage.categories.subquotients import SubquotientsCategory
|
|
22
|
+
from sage.categories.cartesian_product import CartesianProductsCategory
|
|
23
|
+
from sage.categories.quotients import QuotientsCategory
|
|
24
|
+
from sage.categories.magmas import Magmas
|
|
25
|
+
from sage.arith.power import generic_power
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
all_axioms += ("HTrivial", "Aperiodic", "LTrivial", "RTrivial", "JTrivial")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class Semigroups(CategoryWithAxiom):
|
|
32
|
+
"""
|
|
33
|
+
The category of (multiplicative) semigroups.
|
|
34
|
+
|
|
35
|
+
A *semigroup* is an associative :class:`magma <Magmas>`, that is a
|
|
36
|
+
set endowed with a multiplicative binary operation `*` which is
|
|
37
|
+
associative (see :wikipedia:`Semigroup`).
|
|
38
|
+
|
|
39
|
+
The operation `*` is not required to have a neutral element. A
|
|
40
|
+
semigroup for which such an element exists is a :class:`monoid
|
|
41
|
+
<sage.categories.monoids.Monoids>`.
|
|
42
|
+
|
|
43
|
+
EXAMPLES::
|
|
44
|
+
|
|
45
|
+
sage: C = Semigroups(); C
|
|
46
|
+
Category of semigroups
|
|
47
|
+
sage: C.super_categories()
|
|
48
|
+
[Category of magmas]
|
|
49
|
+
sage: C.all_super_categories()
|
|
50
|
+
[Category of semigroups, Category of magmas,
|
|
51
|
+
Category of sets, Category of sets with partial maps, Category of objects]
|
|
52
|
+
sage: C.axioms()
|
|
53
|
+
frozenset({'Associative'})
|
|
54
|
+
sage: C.example()
|
|
55
|
+
An example of a semigroup: the left zero semigroup
|
|
56
|
+
|
|
57
|
+
TESTS::
|
|
58
|
+
|
|
59
|
+
sage: TestSuite(C).run()
|
|
60
|
+
"""
|
|
61
|
+
_base_category_class_and_axiom = (Magmas, "Associative")
|
|
62
|
+
|
|
63
|
+
def example(self, choice='leftzero', **kwds):
|
|
64
|
+
r"""
|
|
65
|
+
Return an example of a semigroup, as per
|
|
66
|
+
:meth:`Category.example()
|
|
67
|
+
<sage.categories.category.Category.example>`.
|
|
68
|
+
|
|
69
|
+
INPUT:
|
|
70
|
+
|
|
71
|
+
- ``choice`` -- string (default: ``'leftzero'``); can be either 'leftzero'
|
|
72
|
+
for the left zero semigroup, or 'free' for the free semigroup
|
|
73
|
+
- ``**kwds`` -- keyword arguments passed onto the constructor for the
|
|
74
|
+
chosen semigroup
|
|
75
|
+
|
|
76
|
+
EXAMPLES::
|
|
77
|
+
|
|
78
|
+
sage: Semigroups().example(choice='leftzero')
|
|
79
|
+
An example of a semigroup: the left zero semigroup
|
|
80
|
+
sage: Semigroups().example(choice='free')
|
|
81
|
+
An example of a semigroup: the free semigroup generated by ('a', 'b', 'c', 'd')
|
|
82
|
+
sage: Semigroups().example(choice='free', alphabet=('a','b'))
|
|
83
|
+
An example of a semigroup: the free semigroup generated by ('a', 'b')
|
|
84
|
+
"""
|
|
85
|
+
import sage.categories.examples.semigroups as examples
|
|
86
|
+
if choice == "leftzero":
|
|
87
|
+
return examples.LeftZeroSemigroup(**kwds)
|
|
88
|
+
else:
|
|
89
|
+
return examples.FreeSemigroup(**kwds)
|
|
90
|
+
|
|
91
|
+
class ParentMethods:
|
|
92
|
+
|
|
93
|
+
def _test_associativity(self, **options):
|
|
94
|
+
r"""
|
|
95
|
+
Test associativity for (not necessarily all) elements of this
|
|
96
|
+
semigroup.
|
|
97
|
+
|
|
98
|
+
INPUT:
|
|
99
|
+
|
|
100
|
+
- ``options`` -- any keyword arguments accepted by :meth:`_tester`
|
|
101
|
+
|
|
102
|
+
EXAMPLES:
|
|
103
|
+
|
|
104
|
+
By default, this method tests only the elements returned by
|
|
105
|
+
``self.some_elements()``::
|
|
106
|
+
|
|
107
|
+
sage: L = Semigroups().example(choice='leftzero')
|
|
108
|
+
sage: L._test_associativity()
|
|
109
|
+
|
|
110
|
+
However, the elements tested can be customized with the
|
|
111
|
+
``elements`` keyword argument::
|
|
112
|
+
|
|
113
|
+
sage: L._test_associativity(elements = (L(1), L(2), L(3)))
|
|
114
|
+
|
|
115
|
+
See the documentation for :class:`TestSuite` for more information.
|
|
116
|
+
"""
|
|
117
|
+
tester = self._tester(**options)
|
|
118
|
+
S = tester.some_elements()
|
|
119
|
+
from sage.misc.misc import some_tuples
|
|
120
|
+
for x, y, z in some_tuples(S, 3, tester._max_runs):
|
|
121
|
+
tester.assertEqual((x * y) * z, x * (y * z))
|
|
122
|
+
|
|
123
|
+
@abstract_method(optional=True)
|
|
124
|
+
def semigroup_generators(self):
|
|
125
|
+
"""
|
|
126
|
+
Return distinguished semigroup generators for ``self``.
|
|
127
|
+
|
|
128
|
+
OUTPUT: a family
|
|
129
|
+
|
|
130
|
+
This method is optional.
|
|
131
|
+
|
|
132
|
+
EXAMPLES::
|
|
133
|
+
|
|
134
|
+
sage: S = Semigroups().example("free"); S
|
|
135
|
+
An example of a semigroup: the free semigroup generated by ('a', 'b', 'c', 'd')
|
|
136
|
+
sage: S.semigroup_generators()
|
|
137
|
+
Family ('a', 'b', 'c', 'd')
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
def magma_generators(self):
|
|
141
|
+
"""
|
|
142
|
+
An alias for :meth:`semigroup_generators`.
|
|
143
|
+
|
|
144
|
+
EXAMPLES::
|
|
145
|
+
|
|
146
|
+
sage: S = Semigroups().example("free"); S
|
|
147
|
+
An example of a semigroup: the free semigroup generated by ('a', 'b', 'c', 'd')
|
|
148
|
+
sage: S.magma_generators()
|
|
149
|
+
Family ('a', 'b', 'c', 'd')
|
|
150
|
+
sage: S.semigroup_generators()
|
|
151
|
+
Family ('a', 'b', 'c', 'd')
|
|
152
|
+
"""
|
|
153
|
+
return self.semigroup_generators()
|
|
154
|
+
|
|
155
|
+
def prod(self, args):
|
|
156
|
+
r"""
|
|
157
|
+
Return the product of the list of elements ``args``
|
|
158
|
+
inside ``self``.
|
|
159
|
+
|
|
160
|
+
EXAMPLES::
|
|
161
|
+
|
|
162
|
+
sage: S = Semigroups().example("free")
|
|
163
|
+
sage: S.prod([S('a'), S('b'), S('c')])
|
|
164
|
+
'abc'
|
|
165
|
+
sage: S.prod([])
|
|
166
|
+
Traceback (most recent call last):
|
|
167
|
+
...
|
|
168
|
+
AssertionError: Cannot compute an empty product in a semigroup
|
|
169
|
+
"""
|
|
170
|
+
from sage.misc.misc_c import prod
|
|
171
|
+
assert len(args) > 0, "Cannot compute an empty product in a semigroup"
|
|
172
|
+
return prod(args[1:], args[0])
|
|
173
|
+
|
|
174
|
+
def cayley_graph(self, side='right', simple=False, elements=None,
|
|
175
|
+
generators=None, connecting_set=None):
|
|
176
|
+
r"""
|
|
177
|
+
Return the Cayley graph for this finite semigroup.
|
|
178
|
+
|
|
179
|
+
INPUT:
|
|
180
|
+
|
|
181
|
+
- ``side`` -- ``'left'``, ``'right'``, or ``'twosided'``:
|
|
182
|
+
the side on which the generators act (default: ``'right'``)
|
|
183
|
+
- ``simple`` -- boolean (default: ``False``); if ``True``, returns
|
|
184
|
+
a simple graph (no loops, no labels, no multiple edges)
|
|
185
|
+
- ``generators`` -- list; tuple, or family of elements
|
|
186
|
+
of ``self`` (default: ``self.semigroup_generators()``)
|
|
187
|
+
- ``connecting_set`` -- alias for ``generators``; deprecated
|
|
188
|
+
- ``elements`` -- list (or iterable) of elements of ``self``
|
|
189
|
+
|
|
190
|
+
OUTPUT: :class:`DiGraph`
|
|
191
|
+
|
|
192
|
+
EXAMPLES:
|
|
193
|
+
|
|
194
|
+
We start with the (right) Cayley graphs of some classical groups::
|
|
195
|
+
|
|
196
|
+
sage: # needs sage.graphs sage.groups
|
|
197
|
+
sage: D4 = DihedralGroup(4); D4
|
|
198
|
+
Dihedral group of order 8 as a permutation group
|
|
199
|
+
sage: G = D4.cayley_graph()
|
|
200
|
+
sage: show(G, color_by_label=True, edge_labels=True) # needs sage.plot
|
|
201
|
+
sage: A5 = AlternatingGroup(5); A5
|
|
202
|
+
Alternating group of order 5!/2 as a permutation group
|
|
203
|
+
sage: G = A5.cayley_graph()
|
|
204
|
+
sage: G.show3d(color_by_label=True, edge_size=0.01, # needs sage.plot
|
|
205
|
+
....: edge_size2=0.02, vertex_size=0.03)
|
|
206
|
+
sage: G.show3d(vertex_size=0.03, # long time (less than a minute), needs sage.plot
|
|
207
|
+
....: edge_size=0.01, edge_size2=0.02,
|
|
208
|
+
....: vertex_colors={(1,1,1): G.vertices(sort=True)},
|
|
209
|
+
....: bgcolor=(0,0,0), color_by_label=True,
|
|
210
|
+
....: xres=700, yres=700, iterations=200)
|
|
211
|
+
sage: G.num_edges()
|
|
212
|
+
120
|
|
213
|
+
|
|
214
|
+
sage: # needs sage.combinat sage.graphs sage.groups
|
|
215
|
+
sage: w = WeylGroup(['A', 3])
|
|
216
|
+
sage: d = w.cayley_graph(); d
|
|
217
|
+
Digraph on 24 vertices
|
|
218
|
+
sage: d.show3d(color_by_label=True, edge_size=0.01, vertex_size=0.03) # needs sage.plot
|
|
219
|
+
|
|
220
|
+
Alternative generators may be specified::
|
|
221
|
+
|
|
222
|
+
sage: # needs sage.graphs sage.groups
|
|
223
|
+
sage: G = A5.cayley_graph(generators=[A5.gens()[0]])
|
|
224
|
+
sage: G.num_edges()
|
|
225
|
+
60
|
|
226
|
+
sage: g = PermutationGroup([(i + 1, j + 1)
|
|
227
|
+
....: for i in range(5)
|
|
228
|
+
....: for j in range(5) if j != i])
|
|
229
|
+
sage: g.cayley_graph(generators=[(1,2), (2,3)])
|
|
230
|
+
Digraph on 120 vertices
|
|
231
|
+
|
|
232
|
+
If ``elements`` is specified, then only the subgraph
|
|
233
|
+
induced and those elements is returned. Here we use it to
|
|
234
|
+
display the Cayley graph of the free monoid truncated on
|
|
235
|
+
the elements of length at most 3::
|
|
236
|
+
|
|
237
|
+
sage: # needs sage.combinat sage.graphs
|
|
238
|
+
sage: M = Monoids().example(); M
|
|
239
|
+
An example of a monoid:
|
|
240
|
+
the free monoid generated by ('a', 'b', 'c', 'd')
|
|
241
|
+
sage: elements = [M.prod(w)
|
|
242
|
+
....: for w in sum((list(Words(M.semigroup_generators(), k))
|
|
243
|
+
....: for k in range(4)), [])]
|
|
244
|
+
sage: G = M.cayley_graph(elements=elements)
|
|
245
|
+
sage: G.num_verts(), G.num_edges()
|
|
246
|
+
(85, 84)
|
|
247
|
+
sage: G.show3d(color_by_label=True, edge_size=0.001, vertex_size=0.01) # needs sage.plot
|
|
248
|
+
|
|
249
|
+
We now illustrate the ``side`` and ``simple`` options on
|
|
250
|
+
a semigroup::
|
|
251
|
+
|
|
252
|
+
sage: S = FiniteSemigroups().example(alphabet=('a', 'b'))
|
|
253
|
+
sage: g = S.cayley_graph(simple=True) # needs sage.graphs
|
|
254
|
+
sage: g.vertices(sort=True) # needs sage.graphs
|
|
255
|
+
['a', 'ab', 'b', 'ba']
|
|
256
|
+
sage: g.edges(sort=True) # needs sage.graphs
|
|
257
|
+
[('a', 'ab', None), ('b', 'ba', None)]
|
|
258
|
+
|
|
259
|
+
::
|
|
260
|
+
|
|
261
|
+
sage: g = S.cayley_graph(side='left', simple=True) # needs sage.graphs
|
|
262
|
+
sage: g.vertices(sort=True) # needs sage.graphs
|
|
263
|
+
['a', 'ab', 'b', 'ba']
|
|
264
|
+
sage: g.edges(sort=True) # needs sage.graphs
|
|
265
|
+
[('a', 'ba', None), ('ab', 'ba', None), ('b', 'ab', None),
|
|
266
|
+
('ba', 'ab', None)]
|
|
267
|
+
|
|
268
|
+
::
|
|
269
|
+
|
|
270
|
+
sage: g = S.cayley_graph(side='twosided', simple=True) # needs sage.graphs
|
|
271
|
+
sage: g.vertices(sort=True) # needs sage.graphs
|
|
272
|
+
['a', 'ab', 'b', 'ba']
|
|
273
|
+
sage: g.edges(sort=True) # needs sage.graphs
|
|
274
|
+
[('a', 'ab', None), ('a', 'ba', None), ('ab', 'ba', None),
|
|
275
|
+
('b', 'ab', None), ('b', 'ba', None), ('ba', 'ab', None)]
|
|
276
|
+
|
|
277
|
+
::
|
|
278
|
+
|
|
279
|
+
sage: g = S.cayley_graph(side='twosided') # needs sage.graphs
|
|
280
|
+
sage: g.vertices(sort=True) # needs sage.graphs
|
|
281
|
+
['a', 'ab', 'b', 'ba']
|
|
282
|
+
sage: g.edges(sort=True) # needs sage.graphs
|
|
283
|
+
[('a', 'a', (0, 'left')), ('a', 'a', (0, 'right')), ('a', 'ab', (1, 'right')), ('a', 'ba', (1, 'left')), ('ab', 'ab', (0, 'left')), ('ab', 'ab', (0, 'right')), ('ab', 'ab', (1, 'right')), ('ab', 'ba', (1, 'left')), ('b', 'ab', (0, 'left')), ('b', 'b', (1, 'left')), ('b', 'b', (1, 'right')), ('b', 'ba', (0, 'right')), ('ba', 'ab', (0, 'left')), ('ba', 'ba', (0, 'right')), ('ba', 'ba', (1, 'left')), ('ba', 'ba', (1, 'right'))]
|
|
284
|
+
|
|
285
|
+
::
|
|
286
|
+
|
|
287
|
+
sage: s1 = SymmetricGroup(1); s = s1.cayley_graph() # needs sage.graphs sage.groups
|
|
288
|
+
sage: s.vertices(sort=False) # needs sage.graphs sage.groups
|
|
289
|
+
[()]
|
|
290
|
+
|
|
291
|
+
TESTS::
|
|
292
|
+
|
|
293
|
+
sage: SymmetricGroup(2).cayley_graph(side='both') # needs sage.graphs sage.groups
|
|
294
|
+
Traceback (most recent call last):
|
|
295
|
+
...
|
|
296
|
+
ValueError: option 'side' must be 'left', 'right' or 'twosided'
|
|
297
|
+
|
|
298
|
+
.. TODO::
|
|
299
|
+
|
|
300
|
+
- Add more options for constructing subgraphs of the
|
|
301
|
+
Cayley graph, handling the standard use cases when
|
|
302
|
+
exploring large/infinite semigroups (a predicate,
|
|
303
|
+
generators of an ideal, a maximal length in term of the
|
|
304
|
+
generators)
|
|
305
|
+
|
|
306
|
+
- Specify good default layout/plot/latex options in the graph
|
|
307
|
+
|
|
308
|
+
- Generalize to combinatorial modules with module generators / operators
|
|
309
|
+
|
|
310
|
+
AUTHORS:
|
|
311
|
+
|
|
312
|
+
- Bobby Moretti (2007-08-10)
|
|
313
|
+
- Robert Miller (2008-05-01): editing
|
|
314
|
+
- Nicolas M. Thiery (2008-12): extension to semigroups,
|
|
315
|
+
``side``, ``simple``, and ``elements`` options, ...
|
|
316
|
+
"""
|
|
317
|
+
from sage.graphs.digraph import DiGraph
|
|
318
|
+
from .monoids import Monoids
|
|
319
|
+
from .groups import Groups
|
|
320
|
+
if side not in ["left", "right", "twosided"]:
|
|
321
|
+
raise ValueError("option 'side' must be 'left', 'right' or 'twosided'")
|
|
322
|
+
if elements is None:
|
|
323
|
+
assert self.is_finite(), "elements should be specified for infinite semigroups"
|
|
324
|
+
elements = self
|
|
325
|
+
else:
|
|
326
|
+
elements = set(elements)
|
|
327
|
+
if simple or self in Groups():
|
|
328
|
+
result = DiGraph()
|
|
329
|
+
else:
|
|
330
|
+
result = DiGraph(multiedges=True, loops=True)
|
|
331
|
+
result.add_vertices(elements)
|
|
332
|
+
|
|
333
|
+
if connecting_set is not None:
|
|
334
|
+
generators = connecting_set
|
|
335
|
+
if generators is None:
|
|
336
|
+
if self in Monoids and hasattr(self, "monoid_generators"):
|
|
337
|
+
generators = self.monoid_generators()
|
|
338
|
+
else:
|
|
339
|
+
generators = self.semigroup_generators()
|
|
340
|
+
if isinstance(generators, (list, tuple)):
|
|
341
|
+
generators = {self(g): self(g) for g in generators}
|
|
342
|
+
left = (side == "left" or side == "twosided")
|
|
343
|
+
right = (side == "right" or side == "twosided")
|
|
344
|
+
|
|
345
|
+
def add_edge(source, target, label, side_label):
|
|
346
|
+
"""
|
|
347
|
+
Skips edges whose targets are not in elements
|
|
348
|
+
Return an appropriate edge given the options
|
|
349
|
+
"""
|
|
350
|
+
if (elements is not self and target not in elements):
|
|
351
|
+
return
|
|
352
|
+
if simple:
|
|
353
|
+
if source != target:
|
|
354
|
+
result.add_edge([source, target])
|
|
355
|
+
elif side == "twosided":
|
|
356
|
+
result.add_edge([source, target, (label, side_label)])
|
|
357
|
+
else:
|
|
358
|
+
result.add_edge([source, target, label])
|
|
359
|
+
for x in elements:
|
|
360
|
+
for i in generators.keys():
|
|
361
|
+
if left:
|
|
362
|
+
add_edge(x, generators[i] * x, i, "left" )
|
|
363
|
+
if right:
|
|
364
|
+
add_edge(x, x * generators[i], i, "right")
|
|
365
|
+
return result
|
|
366
|
+
|
|
367
|
+
def subsemigroup(self, generators, one=None, category=None):
|
|
368
|
+
r"""
|
|
369
|
+
Return the multiplicative subsemigroup generated by ``generators``.
|
|
370
|
+
|
|
371
|
+
INPUT:
|
|
372
|
+
|
|
373
|
+
- ``generators`` -- a finite family of elements of
|
|
374
|
+
``self``, or a list, iterable, ... that can be converted
|
|
375
|
+
into one (see :class:`Family`).
|
|
376
|
+
|
|
377
|
+
- ``one`` -- a unit for the subsemigroup, or ``None``
|
|
378
|
+
|
|
379
|
+
- ``category`` -- a category
|
|
380
|
+
|
|
381
|
+
This implementation lazily constructs all the elements of
|
|
382
|
+
the semigroup, and the right Cayley graph relations
|
|
383
|
+
between them, and uses the latter as an automaton.
|
|
384
|
+
|
|
385
|
+
See :class:`~sage.sets.monoids.AutomaticSemigroup` for details.
|
|
386
|
+
|
|
387
|
+
EXAMPLES::
|
|
388
|
+
|
|
389
|
+
sage: R = IntegerModRing(15)
|
|
390
|
+
sage: M = R.subsemigroup([R(3), R(5)]); M # needs sage.combinat
|
|
391
|
+
A subsemigroup of (Ring of integers modulo 15) with 2 generators
|
|
392
|
+
sage: M.list() # needs sage.combinat
|
|
393
|
+
[3, 5, 9, 0, 10, 12, 6]
|
|
394
|
+
|
|
395
|
+
By default, `M` is just in the category of subsemigroups::
|
|
396
|
+
|
|
397
|
+
sage: M in Semigroups().Subobjects() # needs sage.combinat
|
|
398
|
+
True
|
|
399
|
+
|
|
400
|
+
In the following example, we specify that `M` is a
|
|
401
|
+
submonoid of the finite monoid `R` (it shares the same
|
|
402
|
+
unit), and a group by itself::
|
|
403
|
+
|
|
404
|
+
sage: M = R.subsemigroup([R(-1)], # needs sage.combinat
|
|
405
|
+
....: category=Monoids().Finite().Subobjects() & Groups()); M
|
|
406
|
+
A submonoid of (Ring of integers modulo 15) with 1 generators
|
|
407
|
+
sage: M.list() # needs sage.combinat
|
|
408
|
+
[1, 14]
|
|
409
|
+
sage: M.one() # needs sage.combinat
|
|
410
|
+
1
|
|
411
|
+
|
|
412
|
+
In the following example, `M` is a group; however, its unit
|
|
413
|
+
does not coincide with that of `R`, so `M` is only a
|
|
414
|
+
subsemigroup, and we need to specify its unit explicitly::
|
|
415
|
+
|
|
416
|
+
sage: M = R.subsemigroup([R(5)], # needs sage.combinat
|
|
417
|
+
....: category=Semigroups().Finite().Subobjects() & Groups()); M
|
|
418
|
+
Traceback (most recent call last):
|
|
419
|
+
...
|
|
420
|
+
ValueError: For a monoid which is just a subsemigroup,
|
|
421
|
+
the unit should be specified
|
|
422
|
+
|
|
423
|
+
sage: # needs sage.combinat sage.groups
|
|
424
|
+
sage: M = R.subsemigroup([R(5)], one=R(10),
|
|
425
|
+
....: category=Semigroups().Finite().Subobjects() & Groups()); M
|
|
426
|
+
A subsemigroup of (Ring of integers modulo 15) with 1 generators
|
|
427
|
+
sage: M in Groups()
|
|
428
|
+
True
|
|
429
|
+
sage: M.list()
|
|
430
|
+
[10, 5]
|
|
431
|
+
sage: M.one()
|
|
432
|
+
10
|
|
433
|
+
|
|
434
|
+
TESTS::
|
|
435
|
+
|
|
436
|
+
sage: TestSuite(M).run() # needs sage.combinat
|
|
437
|
+
"""
|
|
438
|
+
from sage.monoids.automatic_semigroup import AutomaticSemigroup
|
|
439
|
+
return AutomaticSemigroup(generators, ambient=self, one=one,
|
|
440
|
+
category=category)
|
|
441
|
+
|
|
442
|
+
def trivial_representation(self, base_ring=None, side='twosided'):
|
|
443
|
+
r"""
|
|
444
|
+
Return the trivial representation of ``self`` over ``base_ring``.
|
|
445
|
+
|
|
446
|
+
INPUT:
|
|
447
|
+
|
|
448
|
+
- ``base_ring`` -- (optional) the base ring; the default is `\ZZ`
|
|
449
|
+
- ``side`` -- ignored
|
|
450
|
+
|
|
451
|
+
EXAMPLES::
|
|
452
|
+
|
|
453
|
+
sage: G = groups.permutation.Dihedral(4) # needs sage.groups
|
|
454
|
+
sage: G.trivial_representation() # needs sage.groups sage.modules
|
|
455
|
+
Trivial representation of Dihedral group of order 8
|
|
456
|
+
as a permutation group over Integer Ring
|
|
457
|
+
"""
|
|
458
|
+
if base_ring is None:
|
|
459
|
+
from sage.rings.integer_ring import ZZ
|
|
460
|
+
base_ring = ZZ
|
|
461
|
+
from sage.modules.with_basis.representation import TrivialRepresentation
|
|
462
|
+
return TrivialRepresentation(self, base_ring)
|
|
463
|
+
|
|
464
|
+
def regular_representation(self, base_ring=None, side='left'):
|
|
465
|
+
"""
|
|
466
|
+
Return the regular representation of ``self`` over ``base_ring``.
|
|
467
|
+
|
|
468
|
+
- ``side`` -- (default: ``'left'``) whether this is the
|
|
469
|
+
``'left'`` or ``'right'`` regular representation
|
|
470
|
+
|
|
471
|
+
EXAMPLES::
|
|
472
|
+
|
|
473
|
+
sage: G = groups.permutation.Dihedral(4) # needs sage.groups
|
|
474
|
+
sage: G.regular_representation() # needs sage.groups sage.modules
|
|
475
|
+
Left Regular Representation of Dihedral group of order 8
|
|
476
|
+
as a permutation group over Integer Ring
|
|
477
|
+
"""
|
|
478
|
+
if base_ring is None:
|
|
479
|
+
from sage.rings.integer_ring import ZZ
|
|
480
|
+
base_ring = ZZ
|
|
481
|
+
from sage.modules.with_basis.representation import RegularRepresentation
|
|
482
|
+
return RegularRepresentation(self, base_ring, side)
|
|
483
|
+
|
|
484
|
+
def representation(self, module, on_basis, side='left', *args, **kwargs):
|
|
485
|
+
r"""
|
|
486
|
+
Return a representation of ``self`` on ``module`` with
|
|
487
|
+
the action given by ``on_basis``.
|
|
488
|
+
|
|
489
|
+
INPUT:
|
|
490
|
+
|
|
491
|
+
- ``module`` -- a module with a basis
|
|
492
|
+
- ``on_basis`` -- function which takes as input ``g``, ``m``, where
|
|
493
|
+
``g`` is an element of the semigroup and ``m`` is an element of the
|
|
494
|
+
indexing set for the basis, and returns the result of ``g`` acting
|
|
495
|
+
on ``m``
|
|
496
|
+
- ``side`` -- (default: ``'left'``) whether this is a
|
|
497
|
+
``'left'`` or ``'right'`` representation
|
|
498
|
+
|
|
499
|
+
EXAMPLES::
|
|
500
|
+
|
|
501
|
+
sage: # needs sage.groups sage.modules
|
|
502
|
+
sage: G = CyclicPermutationGroup(3)
|
|
503
|
+
sage: M = algebras.Exterior(QQ, 'x', 3)
|
|
504
|
+
sage: def on_basis(g, m): # cyclically permute generators
|
|
505
|
+
....: return M.prod([M.monomial(FrozenBitset([g(j+1)-1])) for j in m])
|
|
506
|
+
sage: from sage.categories.algebras import Algebras
|
|
507
|
+
sage: R = G.representation(M, on_basis, category=Algebras(QQ).WithBasis().FiniteDimensional())
|
|
508
|
+
sage: R
|
|
509
|
+
Representation of Cyclic group of order 3 as a permutation group
|
|
510
|
+
indexed by Subsets of {0,1,...,2} over Rational Field
|
|
511
|
+
"""
|
|
512
|
+
from sage.modules.with_basis.representation import Representation
|
|
513
|
+
return Representation(self, module, on_basis, side, *args, **kwargs)
|
|
514
|
+
|
|
515
|
+
class ElementMethods:
|
|
516
|
+
|
|
517
|
+
def _pow_int(self, n):
|
|
518
|
+
"""
|
|
519
|
+
Return ``self`` to the `n`-th power.
|
|
520
|
+
|
|
521
|
+
INPUT:
|
|
522
|
+
|
|
523
|
+
- ``n`` -- positive integer
|
|
524
|
+
|
|
525
|
+
EXAMPLES::
|
|
526
|
+
|
|
527
|
+
sage: S = Semigroups().example("leftzero")
|
|
528
|
+
sage: x = S("x")
|
|
529
|
+
sage: x^1, x^2, x^3, x^4, x^5
|
|
530
|
+
('x', 'x', 'x', 'x', 'x')
|
|
531
|
+
sage: x^0
|
|
532
|
+
Traceback (most recent call last):
|
|
533
|
+
...
|
|
534
|
+
ArithmeticError: only positive powers are supported in a semigroup
|
|
535
|
+
|
|
536
|
+
TESTS::
|
|
537
|
+
|
|
538
|
+
sage: x._pow_int(17)
|
|
539
|
+
'x'
|
|
540
|
+
"""
|
|
541
|
+
if n <= 0:
|
|
542
|
+
raise ArithmeticError("only positive powers are supported in a semigroup")
|
|
543
|
+
return generic_power(self, n)
|
|
544
|
+
|
|
545
|
+
class SubcategoryMethods:
|
|
546
|
+
|
|
547
|
+
@cached_method
|
|
548
|
+
def LTrivial(self):
|
|
549
|
+
r"""
|
|
550
|
+
Return the full subcategory of the `L`-trivial objects of ``self``.
|
|
551
|
+
|
|
552
|
+
Let `S` be (multiplicative) :class:`semigroup <Semigroups>`.
|
|
553
|
+
The `L`-*preorder* `\leq_L` on `S` is defined by:
|
|
554
|
+
|
|
555
|
+
.. MATH::
|
|
556
|
+
|
|
557
|
+
x\leq_L y \qquad \Longleftrightarrow \qquad x \in Sy
|
|
558
|
+
|
|
559
|
+
The `L`-*classes* are the equivalence classes for the
|
|
560
|
+
associated equivalence relation. The semigroup `S` is
|
|
561
|
+
`L`-*trivial* if all its `L`-classes are trivial (that is
|
|
562
|
+
of cardinality `1`), or equivalently if the `L`-preorder is
|
|
563
|
+
in fact a partial order.
|
|
564
|
+
|
|
565
|
+
EXAMPLES::
|
|
566
|
+
|
|
567
|
+
sage: C = Semigroups().LTrivial(); C
|
|
568
|
+
Category of l trivial semigroups
|
|
569
|
+
|
|
570
|
+
A `L`-trivial semigroup is `H`-trivial::
|
|
571
|
+
|
|
572
|
+
sage: sorted(C.axioms())
|
|
573
|
+
['Associative', 'HTrivial', 'LTrivial']
|
|
574
|
+
|
|
575
|
+
.. SEEALSO::
|
|
576
|
+
|
|
577
|
+
- :wikipedia:`Green%27s_relations`
|
|
578
|
+
- :class:`Semigroups.SubcategoryMethods.RTrivial`
|
|
579
|
+
- :class:`Semigroups.SubcategoryMethods.JTrivial`
|
|
580
|
+
- :class:`Semigroups.SubcategoryMethods.HTrivial`
|
|
581
|
+
|
|
582
|
+
TESTS::
|
|
583
|
+
|
|
584
|
+
sage: TestSuite(C).run()
|
|
585
|
+
sage: Rings().LTrivial.__module__
|
|
586
|
+
'sage.categories.semigroups'
|
|
587
|
+
sage: C # todo: not implemented
|
|
588
|
+
Category of L-trivial semigroups
|
|
589
|
+
"""
|
|
590
|
+
return self._with_axiom('LTrivial')
|
|
591
|
+
|
|
592
|
+
@cached_method
|
|
593
|
+
def RTrivial(self):
|
|
594
|
+
r"""
|
|
595
|
+
Return the full subcategory of the `R`-trivial objects of ``self``.
|
|
596
|
+
|
|
597
|
+
Let `S` be (multiplicative) :class:`semigroup <Semigroups>`.
|
|
598
|
+
The `R`-*preorder* `\leq_R` on `S` is defined by:
|
|
599
|
+
|
|
600
|
+
.. MATH::
|
|
601
|
+
|
|
602
|
+
x\leq_R y \qquad \Longleftrightarrow \qquad x \in yS
|
|
603
|
+
|
|
604
|
+
The `R`-*classes* are the equivalence classes for the
|
|
605
|
+
associated equivalence relation. The semigroup `S` is
|
|
606
|
+
`R`-*trivial* if all its `R`-classes are trivial (that is
|
|
607
|
+
of cardinality `1`), or equivalently if the `R`-preorder is
|
|
608
|
+
in fact a partial order.
|
|
609
|
+
|
|
610
|
+
EXAMPLES::
|
|
611
|
+
|
|
612
|
+
sage: C = Semigroups().RTrivial(); C
|
|
613
|
+
Category of r trivial semigroups
|
|
614
|
+
|
|
615
|
+
An `R`-trivial semigroup is `H`-trivial::
|
|
616
|
+
|
|
617
|
+
sage: sorted(C.axioms())
|
|
618
|
+
['Associative', 'HTrivial', 'RTrivial']
|
|
619
|
+
|
|
620
|
+
.. SEEALSO::
|
|
621
|
+
|
|
622
|
+
- :wikipedia:`Green%27s_relations`
|
|
623
|
+
- :class:`Semigroups.SubcategoryMethods.LTrivial`
|
|
624
|
+
- :class:`Semigroups.SubcategoryMethods.JTrivial`
|
|
625
|
+
- :class:`Semigroups.SubcategoryMethods.HTrivial`
|
|
626
|
+
|
|
627
|
+
TESTS::
|
|
628
|
+
|
|
629
|
+
sage: TestSuite(C).run()
|
|
630
|
+
sage: Rings().RTrivial.__module__
|
|
631
|
+
'sage.categories.semigroups'
|
|
632
|
+
sage: C # todo: not implemented
|
|
633
|
+
Category of R-trivial semigroups
|
|
634
|
+
"""
|
|
635
|
+
return self._with_axiom('RTrivial')
|
|
636
|
+
|
|
637
|
+
@cached_method
|
|
638
|
+
def JTrivial(self):
|
|
639
|
+
r"""
|
|
640
|
+
Return the full subcategory of the `J`-trivial objects of ``self``.
|
|
641
|
+
|
|
642
|
+
Let `S` be (multiplicative) :class:`semigroup <Semigroups>`.
|
|
643
|
+
The `J`-*preorder* `\leq_J` on `S` is defined by:
|
|
644
|
+
|
|
645
|
+
.. MATH::
|
|
646
|
+
|
|
647
|
+
x\leq_J y \qquad \Longleftrightarrow \qquad x \in SyS
|
|
648
|
+
|
|
649
|
+
The `J`-*classes* are the equivalence classes for the
|
|
650
|
+
associated equivalence relation. The semigroup `S` is
|
|
651
|
+
`J`-*trivial* if all its `J`-classes are trivial (that is
|
|
652
|
+
of cardinality `1`), or equivalently if the `J`-preorder is
|
|
653
|
+
in fact a partial order.
|
|
654
|
+
|
|
655
|
+
EXAMPLES::
|
|
656
|
+
|
|
657
|
+
sage: C = Semigroups().JTrivial(); C
|
|
658
|
+
Category of j trivial semigroups
|
|
659
|
+
|
|
660
|
+
A semigroup is `J`-trivial if and only if it is
|
|
661
|
+
`L`-trivial and `R`-trivial::
|
|
662
|
+
|
|
663
|
+
sage: sorted(C.axioms())
|
|
664
|
+
['Associative', 'HTrivial', 'JTrivial', 'LTrivial', 'RTrivial']
|
|
665
|
+
sage: Semigroups().LTrivial().RTrivial()
|
|
666
|
+
Category of j trivial semigroups
|
|
667
|
+
|
|
668
|
+
For a commutative semigroup, all three axioms are
|
|
669
|
+
equivalent::
|
|
670
|
+
|
|
671
|
+
sage: Semigroups().Commutative().LTrivial()
|
|
672
|
+
Category of commutative j trivial semigroups
|
|
673
|
+
sage: Semigroups().Commutative().RTrivial()
|
|
674
|
+
Category of commutative j trivial semigroups
|
|
675
|
+
|
|
676
|
+
.. SEEALSO::
|
|
677
|
+
|
|
678
|
+
- :wikipedia:`Green%27s_relations`
|
|
679
|
+
- :class:`Semigroups.SubcategoryMethods.LTrivial`
|
|
680
|
+
- :class:`Semigroups.SubcategoryMethods.RTrivial`
|
|
681
|
+
- :class:`Semigroups.SubcategoryMethods.HTrivial`
|
|
682
|
+
|
|
683
|
+
TESTS::
|
|
684
|
+
|
|
685
|
+
sage: TestSuite(C).run()
|
|
686
|
+
sage: Rings().JTrivial.__module__
|
|
687
|
+
'sage.categories.semigroups'
|
|
688
|
+
sage: C # todo: not implemented
|
|
689
|
+
Category of J-trivial semigroups
|
|
690
|
+
"""
|
|
691
|
+
return self._with_axiom('JTrivial')
|
|
692
|
+
|
|
693
|
+
@cached_method
|
|
694
|
+
def HTrivial(self):
|
|
695
|
+
r"""
|
|
696
|
+
Return the full subcategory of the `H`-trivial objects of ``self``.
|
|
697
|
+
|
|
698
|
+
Let `S` be (multiplicative) :class:`semigroup <Semigroups>`.
|
|
699
|
+
Two elements of `S` are in the same `H`-class if they are
|
|
700
|
+
in the same `L`-class and in the same `R`-class.
|
|
701
|
+
|
|
702
|
+
The semigroup `S` is `H`-*trivial* if all its `H`-classes
|
|
703
|
+
are trivial (that is of cardinality `1`).
|
|
704
|
+
|
|
705
|
+
EXAMPLES::
|
|
706
|
+
|
|
707
|
+
sage: C = Semigroups().HTrivial(); C
|
|
708
|
+
Category of h trivial semigroups
|
|
709
|
+
sage: Semigroups().HTrivial().Finite().example()
|
|
710
|
+
NotImplemented
|
|
711
|
+
|
|
712
|
+
.. SEEALSO::
|
|
713
|
+
|
|
714
|
+
- :wikipedia:`Green%27s_relations`
|
|
715
|
+
- :class:`Semigroups.SubcategoryMethods.RTrivial`
|
|
716
|
+
- :class:`Semigroups.SubcategoryMethods.LTrivial`
|
|
717
|
+
- :class:`Semigroups.SubcategoryMethods.JTrivial`
|
|
718
|
+
- :class:`Semigroups.SubcategoryMethods.Aperiodic`
|
|
719
|
+
|
|
720
|
+
TESTS::
|
|
721
|
+
|
|
722
|
+
sage: TestSuite(C).run()
|
|
723
|
+
sage: Rings().HTrivial.__module__
|
|
724
|
+
'sage.categories.semigroups'
|
|
725
|
+
sage: C # todo: not implemented
|
|
726
|
+
Category of H-trivial semigroups
|
|
727
|
+
"""
|
|
728
|
+
return self._with_axiom('HTrivial')
|
|
729
|
+
|
|
730
|
+
@cached_method
|
|
731
|
+
def Aperiodic(self):
|
|
732
|
+
r"""
|
|
733
|
+
Return the full subcategory of the aperiodic objects of ``self``.
|
|
734
|
+
|
|
735
|
+
A (multiplicative) :class:`semigroup <Semigroups>` `S` is
|
|
736
|
+
*aperiodic* if for any element `s\in S`, the sequence
|
|
737
|
+
`s,s^2,s^3,...` eventually stabilizes.
|
|
738
|
+
|
|
739
|
+
In terms of variety, this can be described by the equation
|
|
740
|
+
`s^\omega s = s`.
|
|
741
|
+
|
|
742
|
+
EXAMPLES::
|
|
743
|
+
|
|
744
|
+
sage: Semigroups().Aperiodic()
|
|
745
|
+
Category of aperiodic semigroups
|
|
746
|
+
|
|
747
|
+
An aperiodic semigroup is `H`-trivial::
|
|
748
|
+
|
|
749
|
+
sage: Semigroups().Aperiodic().axioms()
|
|
750
|
+
frozenset({'Aperiodic', 'Associative', 'HTrivial'})
|
|
751
|
+
|
|
752
|
+
In the finite case, the two notions coincide::
|
|
753
|
+
|
|
754
|
+
sage: Semigroups().Aperiodic().Finite() is Semigroups().HTrivial().Finite()
|
|
755
|
+
True
|
|
756
|
+
|
|
757
|
+
TESTS::
|
|
758
|
+
|
|
759
|
+
sage: C = Monoids().Aperiodic().Finite()
|
|
760
|
+
sage: TestSuite(C).run()
|
|
761
|
+
|
|
762
|
+
.. SEEALSO::
|
|
763
|
+
|
|
764
|
+
- :wikipedia:`Aperiodic_semigroup`
|
|
765
|
+
- :class:`Semigroups.SubcategoryMethods.RTrivial`
|
|
766
|
+
- :class:`Semigroups.SubcategoryMethods.LTrivial`
|
|
767
|
+
- :class:`Semigroups.SubcategoryMethods.JTrivial`
|
|
768
|
+
- :class:`Semigroups.SubcategoryMethods.Aperiodic`
|
|
769
|
+
|
|
770
|
+
TESTS::
|
|
771
|
+
|
|
772
|
+
sage: TestSuite(C).run()
|
|
773
|
+
sage: Rings().Aperiodic.__module__
|
|
774
|
+
'sage.categories.semigroups'
|
|
775
|
+
"""
|
|
776
|
+
return self._with_axiom('Aperiodic')
|
|
777
|
+
|
|
778
|
+
Finite = LazyImport('sage.categories.finite_semigroups', 'FiniteSemigroups', at_startup=True)
|
|
779
|
+
FinitelyGeneratedAsMagma = LazyImport('sage.categories.finitely_generated_semigroups', 'FinitelyGeneratedSemigroups')
|
|
780
|
+
Unital = LazyImport('sage.categories.monoids', 'Monoids', at_startup=True)
|
|
781
|
+
LTrivial = LazyImport('sage.categories.l_trivial_semigroups', 'LTrivialSemigroups')
|
|
782
|
+
RTrivial = LazyImport('sage.categories.r_trivial_semigroups', 'RTrivialSemigroups')
|
|
783
|
+
JTrivial = LazyImport('sage.categories.j_trivial_semigroups', 'JTrivialSemigroups')
|
|
784
|
+
HTrivial = LazyImport('sage.categories.h_trivial_semigroups', 'HTrivialSemigroups')
|
|
785
|
+
Aperiodic = LazyImport('sage.categories.aperiodic_semigroups', 'AperiodicSemigroups')
|
|
786
|
+
|
|
787
|
+
#######################################
|
|
788
|
+
class Subquotients(SubquotientsCategory):
|
|
789
|
+
r"""
|
|
790
|
+
The category of subquotient semi-groups.
|
|
791
|
+
|
|
792
|
+
EXAMPLES::
|
|
793
|
+
|
|
794
|
+
sage: Semigroups().Subquotients().all_super_categories()
|
|
795
|
+
[Category of subquotients of semigroups,
|
|
796
|
+
Category of semigroups,
|
|
797
|
+
Category of subquotients of magmas,
|
|
798
|
+
Category of magmas,
|
|
799
|
+
Category of subquotients of sets,
|
|
800
|
+
Category of sets,
|
|
801
|
+
Category of sets with partial maps,
|
|
802
|
+
Category of objects]
|
|
803
|
+
|
|
804
|
+
[Category of subquotients of semigroups,
|
|
805
|
+
Category of semigroups,
|
|
806
|
+
Category of subquotients of magmas,
|
|
807
|
+
Category of magmas,
|
|
808
|
+
Category of subquotients of sets,
|
|
809
|
+
Category of sets,
|
|
810
|
+
Category of sets with partial maps,
|
|
811
|
+
Category of objects]
|
|
812
|
+
"""
|
|
813
|
+
|
|
814
|
+
def example(self):
|
|
815
|
+
"""
|
|
816
|
+
Return an example of subquotient of a semigroup, as per
|
|
817
|
+
:meth:`Category.example()
|
|
818
|
+
<sage.categories.category.Category.example>`.
|
|
819
|
+
|
|
820
|
+
EXAMPLES::
|
|
821
|
+
|
|
822
|
+
sage: Semigroups().Subquotients().example()
|
|
823
|
+
An example of a (sub)quotient semigroup: a quotient of the left zero semigroup
|
|
824
|
+
"""
|
|
825
|
+
from sage.categories.examples.semigroups import QuotientOfLeftZeroSemigroup
|
|
826
|
+
return QuotientOfLeftZeroSemigroup(category=self.Subquotients())
|
|
827
|
+
|
|
828
|
+
class Quotients(QuotientsCategory):
|
|
829
|
+
|
|
830
|
+
def example(self):
|
|
831
|
+
r"""
|
|
832
|
+
Return an example of quotient of a semigroup, as per
|
|
833
|
+
:meth:`Category.example()
|
|
834
|
+
<sage.categories.category.Category.example>`.
|
|
835
|
+
|
|
836
|
+
EXAMPLES::
|
|
837
|
+
|
|
838
|
+
sage: Semigroups().Quotients().example()
|
|
839
|
+
An example of a (sub)quotient semigroup: a quotient of the left zero semigroup
|
|
840
|
+
"""
|
|
841
|
+
from sage.categories.examples.semigroups import QuotientOfLeftZeroSemigroup
|
|
842
|
+
return QuotientOfLeftZeroSemigroup()
|
|
843
|
+
|
|
844
|
+
class ParentMethods:
|
|
845
|
+
|
|
846
|
+
def semigroup_generators(self):
|
|
847
|
+
r"""
|
|
848
|
+
Return semigroup generators for ``self`` by
|
|
849
|
+
retracting the semigroup generators of the ambient
|
|
850
|
+
semigroup.
|
|
851
|
+
|
|
852
|
+
EXAMPLES::
|
|
853
|
+
|
|
854
|
+
sage: S = FiniteSemigroups().Quotients().example().semigroup_generators() # todo: not implemented
|
|
855
|
+
"""
|
|
856
|
+
return self.ambient().semigroup_generators().map(self.retract)
|
|
857
|
+
|
|
858
|
+
class CartesianProducts(CartesianProductsCategory):
|
|
859
|
+
|
|
860
|
+
def extra_super_categories(self):
|
|
861
|
+
"""
|
|
862
|
+
Implement the fact that a Cartesian product of semigroups is a
|
|
863
|
+
semigroup.
|
|
864
|
+
|
|
865
|
+
EXAMPLES::
|
|
866
|
+
|
|
867
|
+
sage: Semigroups().CartesianProducts().extra_super_categories()
|
|
868
|
+
[Category of semigroups]
|
|
869
|
+
sage: Semigroups().CartesianProducts().super_categories()
|
|
870
|
+
[Category of semigroups, Category of Cartesian products of magmas]
|
|
871
|
+
"""
|
|
872
|
+
return [Semigroups()]
|
|
873
|
+
|
|
874
|
+
class Algebras(AlgebrasCategory):
|
|
875
|
+
"""
|
|
876
|
+
TESTS::
|
|
877
|
+
|
|
878
|
+
sage: TestSuite(Semigroups().Algebras(QQ)).run()
|
|
879
|
+
sage: TestSuite(Semigroups().Finite().Algebras(QQ)).run()
|
|
880
|
+
"""
|
|
881
|
+
|
|
882
|
+
def extra_super_categories(self):
|
|
883
|
+
"""
|
|
884
|
+
Implement the fact that the algebra of a semigroup is indeed
|
|
885
|
+
a (not necessarily unital) algebra.
|
|
886
|
+
|
|
887
|
+
EXAMPLES::
|
|
888
|
+
|
|
889
|
+
sage: Semigroups().Algebras(QQ).extra_super_categories()
|
|
890
|
+
[Category of semigroups]
|
|
891
|
+
sage: Semigroups().Algebras(QQ).super_categories()
|
|
892
|
+
[Category of associative algebras over Rational Field,
|
|
893
|
+
Category of magma algebras over Rational Field]
|
|
894
|
+
"""
|
|
895
|
+
return [Semigroups()]
|
|
896
|
+
|
|
897
|
+
class ParentMethods:
|
|
898
|
+
|
|
899
|
+
@cached_method
|
|
900
|
+
def algebra_generators(self):
|
|
901
|
+
r"""
|
|
902
|
+
The generators of this algebra, as per
|
|
903
|
+
:meth:`MagmaticAlgebras.ParentMethods.algebra_generators()
|
|
904
|
+
<.magmatic_algebras.MagmaticAlgebras.ParentMethods.algebra_generators>`.
|
|
905
|
+
|
|
906
|
+
They correspond to the generators of the semigroup.
|
|
907
|
+
|
|
908
|
+
EXAMPLES::
|
|
909
|
+
|
|
910
|
+
sage: M = FiniteSemigroups().example(); M
|
|
911
|
+
An example of a finite semigroup:
|
|
912
|
+
the left regular band generated by ('a', 'b', 'c', 'd')
|
|
913
|
+
sage: M.semigroup_generators()
|
|
914
|
+
Family ('a', 'b', 'c', 'd')
|
|
915
|
+
sage: M.algebra(ZZ).algebra_generators() # needs sage.modules
|
|
916
|
+
Family (B['a'], B['b'], B['c'], B['d'])
|
|
917
|
+
"""
|
|
918
|
+
return self.basis().keys().semigroup_generators().map(self.monomial)
|
|
919
|
+
|
|
920
|
+
# Once there will be some guarantee on the consistency between
|
|
921
|
+
# gens / monoid/group/*_generators, these methods could possibly
|
|
922
|
+
# be removed in favor of aliases gens -> xxx_generators in
|
|
923
|
+
# the Algebras.FinitelyGenerated hierarchy
|
|
924
|
+
def gens(self) -> tuple:
|
|
925
|
+
r"""
|
|
926
|
+
Return the generators of ``self``.
|
|
927
|
+
|
|
928
|
+
EXAMPLES::
|
|
929
|
+
|
|
930
|
+
sage: a, b = SL2Z.algebra(ZZ).gens(); a, b # needs sage.groups sage.modular sage.modules
|
|
931
|
+
([ 0 -1]
|
|
932
|
+
[ 1 0],
|
|
933
|
+
[1 1]
|
|
934
|
+
[0 1])
|
|
935
|
+
sage: 2*a + b # needs sage.groups sage.modular sage.modules
|
|
936
|
+
2*[ 0 -1]
|
|
937
|
+
[ 1 0]
|
|
938
|
+
+
|
|
939
|
+
[1 1]
|
|
940
|
+
[0 1]
|
|
941
|
+
"""
|
|
942
|
+
return tuple(self.monomial(g) for g in self.basis().keys().gens())
|
|
943
|
+
|
|
944
|
+
def ngens(self):
|
|
945
|
+
r"""
|
|
946
|
+
Return the number of generators of ``self``.
|
|
947
|
+
|
|
948
|
+
EXAMPLES::
|
|
949
|
+
|
|
950
|
+
sage: SL2Z.algebra(ZZ).ngens() # needs sage.groups sage.modular sage.modules
|
|
951
|
+
2
|
|
952
|
+
sage: DihedralGroup(4).algebra(RR).ngens() # needs sage.groups sage.modules
|
|
953
|
+
2
|
|
954
|
+
"""
|
|
955
|
+
return self.basis().keys().ngens()
|
|
956
|
+
|
|
957
|
+
def gen(self, i=0):
|
|
958
|
+
r"""
|
|
959
|
+
Return the ``i``-th generator of ``self``.
|
|
960
|
+
|
|
961
|
+
EXAMPLES::
|
|
962
|
+
|
|
963
|
+
sage: A = GL(3, GF(7)).algebra(ZZ) # needs sage.modules
|
|
964
|
+
sage: A.gen(0) # needs sage.groups sage.libs.pari sage.modules
|
|
965
|
+
[3 0 0]
|
|
966
|
+
[0 1 0]
|
|
967
|
+
[0 0 1]
|
|
968
|
+
"""
|
|
969
|
+
return self.monomial(self.basis().keys().gen(i))
|
|
970
|
+
|
|
971
|
+
def product_on_basis(self, g1, g2):
|
|
972
|
+
r"""
|
|
973
|
+
Product, on basis elements, as per
|
|
974
|
+
:meth:`MagmaticAlgebras.WithBasis.ParentMethods.product_on_basis()
|
|
975
|
+
<.magmatic_algebras.MagmaticAlgebras.WithBasis.ParentMethods.product_on_basis>`.
|
|
976
|
+
|
|
977
|
+
The product of two basis elements is induced by the
|
|
978
|
+
product of the corresponding elements of the group.
|
|
979
|
+
|
|
980
|
+
EXAMPLES::
|
|
981
|
+
|
|
982
|
+
sage: S = FiniteSemigroups().example(); S
|
|
983
|
+
An example of a finite semigroup:
|
|
984
|
+
the left regular band generated by ('a', 'b', 'c', 'd')
|
|
985
|
+
sage: A = S.algebra(QQ) # needs sage.modules
|
|
986
|
+
sage: a, b, c, d = A.algebra_generators() # needs sage.modules
|
|
987
|
+
sage: a * b + b * d * c * d # needs sage.modules
|
|
988
|
+
B['ab'] + B['bdc']
|
|
989
|
+
"""
|
|
990
|
+
return self.monomial(g1 * g2)
|
|
991
|
+
|
|
992
|
+
def trivial_representation(self, side='twosided'):
|
|
993
|
+
"""
|
|
994
|
+
Return the trivial representation of ``self``.
|
|
995
|
+
|
|
996
|
+
INPUT:
|
|
997
|
+
|
|
998
|
+
- ``side`` -- ignored
|
|
999
|
+
|
|
1000
|
+
EXAMPLES::
|
|
1001
|
+
|
|
1002
|
+
sage: # needs sage.groups
|
|
1003
|
+
sage: G = groups.permutation.Dihedral(4)
|
|
1004
|
+
sage: A = G.algebra(QQ) # needs sage.modules
|
|
1005
|
+
sage: V = A.trivial_representation() # needs sage.modules
|
|
1006
|
+
sage: V == G.trivial_representation(QQ) # needs sage.modules
|
|
1007
|
+
True
|
|
1008
|
+
"""
|
|
1009
|
+
S = self.basis().keys()
|
|
1010
|
+
return S.trivial_representation(self.base_ring())
|
|
1011
|
+
|
|
1012
|
+
def regular_representation(self, side='left'):
|
|
1013
|
+
"""
|
|
1014
|
+
Return the regular representation of ``self``.
|
|
1015
|
+
|
|
1016
|
+
INPUT:
|
|
1017
|
+
|
|
1018
|
+
- ``side`` -- (default: ``'left'``) whether this is the
|
|
1019
|
+
``'left'`` or ``'right'`` regular representation
|
|
1020
|
+
|
|
1021
|
+
EXAMPLES::
|
|
1022
|
+
|
|
1023
|
+
sage: # needs sage.groups
|
|
1024
|
+
sage: G = groups.permutation.Dihedral(4)
|
|
1025
|
+
sage: A = G.algebra(QQ) # needs sage.modules
|
|
1026
|
+
sage: V = A.regular_representation() # needs sage.modules
|
|
1027
|
+
sage: V == G.regular_representation(QQ) # needs sage.modules
|
|
1028
|
+
True
|
|
1029
|
+
"""
|
|
1030
|
+
S = self.basis().keys()
|
|
1031
|
+
return S.regular_representation(self.base_ring(), side)
|
|
1032
|
+
|
|
1033
|
+
def representation(self, module, on_basis, side='left', *args, **kwargs):
|
|
1034
|
+
r"""
|
|
1035
|
+
Return a representation of ``self`` on ``module`` with
|
|
1036
|
+
the action of the semigroup given by ``on_basis``.
|
|
1037
|
+
|
|
1038
|
+
INPUT:
|
|
1039
|
+
|
|
1040
|
+
- ``module`` -- a module with a basis
|
|
1041
|
+
- ``on_basis`` -- function which takes as input ``g``, ``m``, where
|
|
1042
|
+
``g`` is an element of the semigroup and ``m`` is an element of the
|
|
1043
|
+
indexing set for the basis, and returns the result of ``g`` acting
|
|
1044
|
+
on ``m``
|
|
1045
|
+
- ``side`` -- (default: ``'left'``) whether this is a
|
|
1046
|
+
``'left'`` or ``'right'`` representation
|
|
1047
|
+
|
|
1048
|
+
EXAMPLES::
|
|
1049
|
+
|
|
1050
|
+
sage: # needs sage.groups sage.modules
|
|
1051
|
+
sage: G = groups.permutation.Dihedral(5)
|
|
1052
|
+
sage: CFM = CombinatorialFreeModule(GF(2), [1, 2, 3, 4, 5])
|
|
1053
|
+
sage: A = G.algebra(GF(2))
|
|
1054
|
+
sage: R = A.representation(CFM, lambda g, i: CFM.basis()[g(i)], side='right')
|
|
1055
|
+
sage: R
|
|
1056
|
+
Representation of Dihedral group of order 10 as a permutation
|
|
1057
|
+
group indexed by {1, 2, 3, 4, 5} over Finite Field of size 2
|
|
1058
|
+
"""
|
|
1059
|
+
from sage.modules.with_basis.representation import Representation
|
|
1060
|
+
return Representation(self.group(), module, on_basis, side, *args, **kwargs)
|