passagemath-modules 10.6.31__cp314-cp314-musllinux_1_2_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of passagemath-modules might be problematic. Click here for more details.
- passagemath_modules-10.6.31.dist-info/METADATA +281 -0
- passagemath_modules-10.6.31.dist-info/RECORD +808 -0
- passagemath_modules-10.6.31.dist-info/WHEEL +5 -0
- passagemath_modules-10.6.31.dist-info/top_level.txt +2 -0
- passagemath_modules.libs/libgcc_s-0cd532bd.so.1 +0 -0
- passagemath_modules.libs/libgfortran-2c33b284.so.5.0.0 +0 -0
- passagemath_modules.libs/libgmp-0e7fc84e.so.10.5.0 +0 -0
- passagemath_modules.libs/libgsl-42cda06f.so.28.0.0 +0 -0
- passagemath_modules.libs/libmpc-d8ebe4b5.so.3.3.1 +0 -0
- passagemath_modules.libs/libmpfr-aaecbfc0.so.6.2.1 +0 -0
- passagemath_modules.libs/libopenblasp-r0-905cb27d.3.29.so +0 -0
- passagemath_modules.libs/libquadmath-bb76a5fc.so.0.0.0 +0 -0
- sage/algebras/all__sagemath_modules.py +20 -0
- sage/algebras/catalog.py +148 -0
- sage/algebras/clifford_algebra.py +3107 -0
- sage/algebras/clifford_algebra_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/algebras/clifford_algebra_element.pxd +16 -0
- sage/algebras/clifford_algebra_element.pyx +997 -0
- sage/algebras/commutative_dga.py +4252 -0
- sage/algebras/exterior_algebra_groebner.cpython-314-x86_64-linux-musl.so +0 -0
- sage/algebras/exterior_algebra_groebner.pxd +55 -0
- sage/algebras/exterior_algebra_groebner.pyx +727 -0
- sage/algebras/finite_dimensional_algebras/all.py +2 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra.py +1029 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pxd +12 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pyx +706 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_ideal.py +196 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_morphism.py +255 -0
- sage/algebras/finite_gca.py +528 -0
- sage/algebras/group_algebra.py +232 -0
- sage/algebras/lie_algebras/abelian.py +197 -0
- sage/algebras/lie_algebras/affine_lie_algebra.py +1213 -0
- sage/algebras/lie_algebras/all.py +25 -0
- sage/algebras/lie_algebras/all__sagemath_modules.py +1 -0
- sage/algebras/lie_algebras/bch.py +177 -0
- sage/algebras/lie_algebras/bgg_dual_module.py +1184 -0
- sage/algebras/lie_algebras/bgg_resolution.py +232 -0
- sage/algebras/lie_algebras/center_uea.py +767 -0
- sage/algebras/lie_algebras/classical_lie_algebra.py +2516 -0
- sage/algebras/lie_algebras/examples.py +683 -0
- sage/algebras/lie_algebras/free_lie_algebra.py +973 -0
- sage/algebras/lie_algebras/heisenberg.py +820 -0
- sage/algebras/lie_algebras/lie_algebra.py +1562 -0
- sage/algebras/lie_algebras/lie_algebra_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/algebras/lie_algebras/lie_algebra_element.pxd +68 -0
- sage/algebras/lie_algebras/lie_algebra_element.pyx +2122 -0
- sage/algebras/lie_algebras/morphism.py +661 -0
- sage/algebras/lie_algebras/nilpotent_lie_algebra.py +457 -0
- sage/algebras/lie_algebras/onsager.py +1324 -0
- sage/algebras/lie_algebras/poincare_birkhoff_witt.py +816 -0
- sage/algebras/lie_algebras/quotient.py +462 -0
- sage/algebras/lie_algebras/rank_two_heisenberg_virasoro.py +355 -0
- sage/algebras/lie_algebras/representation.py +1040 -0
- sage/algebras/lie_algebras/structure_coefficients.py +459 -0
- sage/algebras/lie_algebras/subalgebra.py +967 -0
- sage/algebras/lie_algebras/symplectic_derivation.py +289 -0
- sage/algebras/lie_algebras/verma_module.py +1630 -0
- sage/algebras/lie_algebras/virasoro.py +1186 -0
- sage/algebras/octonion_algebra.cpython-314-x86_64-linux-musl.so +0 -0
- sage/algebras/octonion_algebra.pxd +20 -0
- sage/algebras/octonion_algebra.pyx +987 -0
- sage/algebras/orlik_solomon.py +907 -0
- sage/algebras/orlik_terao.py +779 -0
- sage/algebras/steenrod/all.py +7 -0
- sage/algebras/steenrod/steenrod_algebra.py +4258 -0
- sage/algebras/steenrod/steenrod_algebra_bases.py +1179 -0
- sage/algebras/steenrod/steenrod_algebra_misc.py +1167 -0
- sage/algebras/steenrod/steenrod_algebra_mult.py +954 -0
- sage/algebras/weyl_algebra.py +1126 -0
- sage/all__sagemath_modules.py +62 -0
- sage/calculus/all__sagemath_modules.py +19 -0
- sage/calculus/expr.py +205 -0
- sage/calculus/integration.cpython-314-x86_64-linux-musl.so +0 -0
- sage/calculus/integration.pyx +698 -0
- sage/calculus/interpolation.cpython-314-x86_64-linux-musl.so +0 -0
- sage/calculus/interpolation.pxd +13 -0
- sage/calculus/interpolation.pyx +387 -0
- sage/calculus/interpolators.cpython-314-x86_64-linux-musl.so +0 -0
- sage/calculus/interpolators.pyx +326 -0
- sage/calculus/ode.cpython-314-x86_64-linux-musl.so +0 -0
- sage/calculus/ode.pxd +5 -0
- sage/calculus/ode.pyx +610 -0
- sage/calculus/riemann.cpython-314-x86_64-linux-musl.so +0 -0
- sage/calculus/riemann.pyx +1521 -0
- sage/calculus/test_sympy.py +201 -0
- sage/calculus/transforms/all.py +7 -0
- sage/calculus/transforms/dft.py +844 -0
- sage/calculus/transforms/dwt.cpython-314-x86_64-linux-musl.so +0 -0
- sage/calculus/transforms/dwt.pxd +7 -0
- sage/calculus/transforms/dwt.pyx +160 -0
- sage/calculus/transforms/fft.cpython-314-x86_64-linux-musl.so +0 -0
- sage/calculus/transforms/fft.pxd +12 -0
- sage/calculus/transforms/fft.pyx +487 -0
- sage/calculus/wester.py +662 -0
- sage/coding/abstract_code.py +1108 -0
- sage/coding/ag_code.py +868 -0
- sage/coding/ag_code_decoders.cpython-314-x86_64-linux-musl.so +0 -0
- sage/coding/ag_code_decoders.pyx +2639 -0
- sage/coding/all.py +15 -0
- sage/coding/bch_code.py +494 -0
- sage/coding/binary_code.cpython-314-x86_64-linux-musl.so +0 -0
- sage/coding/binary_code.pxd +124 -0
- sage/coding/binary_code.pyx +4139 -0
- sage/coding/bounds_catalog.py +43 -0
- sage/coding/channel.py +819 -0
- sage/coding/channels_catalog.py +29 -0
- sage/coding/code_bounds.py +755 -0
- sage/coding/code_constructions.py +804 -0
- sage/coding/codes_catalog.py +111 -0
- sage/coding/cyclic_code.py +1329 -0
- sage/coding/databases.py +316 -0
- sage/coding/decoder.py +373 -0
- sage/coding/decoders_catalog.py +88 -0
- sage/coding/delsarte_bounds.py +709 -0
- sage/coding/encoder.py +390 -0
- sage/coding/encoders_catalog.py +64 -0
- sage/coding/extended_code.py +468 -0
- sage/coding/gabidulin_code.py +1058 -0
- sage/coding/golay_code.py +404 -0
- sage/coding/goppa_code.py +441 -0
- sage/coding/grs_code.py +2371 -0
- sage/coding/guava.py +107 -0
- sage/coding/guruswami_sudan/all.py +1 -0
- sage/coding/guruswami_sudan/gs_decoder.py +897 -0
- sage/coding/guruswami_sudan/interpolation.py +409 -0
- sage/coding/guruswami_sudan/utils.py +176 -0
- sage/coding/hamming_code.py +176 -0
- sage/coding/information_set_decoder.py +1032 -0
- sage/coding/kasami_codes.cpython-314-x86_64-linux-musl.so +0 -0
- sage/coding/kasami_codes.pyx +351 -0
- sage/coding/linear_code.py +3067 -0
- sage/coding/linear_code_no_metric.py +1354 -0
- sage/coding/linear_rank_metric.py +961 -0
- sage/coding/parity_check_code.py +353 -0
- sage/coding/punctured_code.py +719 -0
- sage/coding/reed_muller_code.py +999 -0
- sage/coding/self_dual_codes.py +942 -0
- sage/coding/source_coding/all.py +2 -0
- sage/coding/source_coding/huffman.py +553 -0
- sage/coding/subfield_subcode.py +423 -0
- sage/coding/two_weight_db.py +399 -0
- sage/combinat/all__sagemath_modules.py +7 -0
- sage/combinat/cartesian_product.py +347 -0
- sage/combinat/family.py +11 -0
- sage/combinat/free_module.py +1977 -0
- sage/combinat/root_system/all.py +147 -0
- sage/combinat/root_system/ambient_space.py +527 -0
- sage/combinat/root_system/associahedron.py +471 -0
- sage/combinat/root_system/braid_move_calculator.py +143 -0
- sage/combinat/root_system/braid_orbit.cpython-314-x86_64-linux-musl.so +0 -0
- sage/combinat/root_system/braid_orbit.pyx +144 -0
- sage/combinat/root_system/branching_rules.py +2301 -0
- sage/combinat/root_system/cartan_matrix.py +1245 -0
- sage/combinat/root_system/cartan_type.py +3069 -0
- sage/combinat/root_system/coxeter_group.py +162 -0
- sage/combinat/root_system/coxeter_matrix.py +1261 -0
- sage/combinat/root_system/coxeter_type.py +681 -0
- sage/combinat/root_system/dynkin_diagram.py +900 -0
- sage/combinat/root_system/extended_affine_weyl_group.py +2993 -0
- sage/combinat/root_system/fundamental_group.py +795 -0
- sage/combinat/root_system/hecke_algebra_representation.py +1203 -0
- sage/combinat/root_system/integrable_representations.py +1227 -0
- sage/combinat/root_system/non_symmetric_macdonald_polynomials.py +1965 -0
- sage/combinat/root_system/pieri_factors.py +1147 -0
- sage/combinat/root_system/plot.py +1615 -0
- sage/combinat/root_system/root_lattice_realization_algebras.py +1214 -0
- sage/combinat/root_system/root_lattice_realizations.py +4628 -0
- sage/combinat/root_system/root_space.py +487 -0
- sage/combinat/root_system/root_system.py +882 -0
- sage/combinat/root_system/type_A.py +348 -0
- sage/combinat/root_system/type_A_affine.py +227 -0
- sage/combinat/root_system/type_A_infinity.py +241 -0
- sage/combinat/root_system/type_B.py +347 -0
- sage/combinat/root_system/type_BC_affine.py +287 -0
- sage/combinat/root_system/type_B_affine.py +216 -0
- sage/combinat/root_system/type_C.py +317 -0
- sage/combinat/root_system/type_C_affine.py +188 -0
- sage/combinat/root_system/type_D.py +357 -0
- sage/combinat/root_system/type_D_affine.py +208 -0
- sage/combinat/root_system/type_E.py +641 -0
- sage/combinat/root_system/type_E_affine.py +231 -0
- sage/combinat/root_system/type_F.py +387 -0
- sage/combinat/root_system/type_F_affine.py +137 -0
- sage/combinat/root_system/type_G.py +293 -0
- sage/combinat/root_system/type_G_affine.py +132 -0
- sage/combinat/root_system/type_H.py +105 -0
- sage/combinat/root_system/type_I.py +110 -0
- sage/combinat/root_system/type_Q.py +150 -0
- sage/combinat/root_system/type_affine.py +509 -0
- sage/combinat/root_system/type_dual.py +704 -0
- sage/combinat/root_system/type_folded.py +301 -0
- sage/combinat/root_system/type_marked.py +748 -0
- sage/combinat/root_system/type_reducible.py +601 -0
- sage/combinat/root_system/type_relabel.py +730 -0
- sage/combinat/root_system/type_super_A.py +837 -0
- sage/combinat/root_system/weight_lattice_realizations.py +1188 -0
- sage/combinat/root_system/weight_space.py +639 -0
- sage/combinat/root_system/weyl_characters.py +2238 -0
- sage/crypto/__init__.py +4 -0
- sage/crypto/all.py +28 -0
- sage/crypto/block_cipher/all.py +7 -0
- sage/crypto/block_cipher/des.py +1065 -0
- sage/crypto/block_cipher/miniaes.py +2171 -0
- sage/crypto/block_cipher/present.py +909 -0
- sage/crypto/block_cipher/sdes.py +1527 -0
- sage/crypto/boolean_function.cpython-314-x86_64-linux-musl.so +0 -0
- sage/crypto/boolean_function.pxd +10 -0
- sage/crypto/boolean_function.pyx +1487 -0
- sage/crypto/cipher.py +78 -0
- sage/crypto/classical.py +3668 -0
- sage/crypto/classical_cipher.py +569 -0
- sage/crypto/cryptosystem.py +387 -0
- sage/crypto/key_exchange/all.py +7 -0
- sage/crypto/key_exchange/catalog.py +24 -0
- sage/crypto/key_exchange/diffie_hellman.py +323 -0
- sage/crypto/key_exchange/key_exchange_scheme.py +107 -0
- sage/crypto/lattice.py +312 -0
- sage/crypto/lfsr.py +295 -0
- sage/crypto/lwe.py +840 -0
- sage/crypto/mq/__init__.py +4 -0
- sage/crypto/mq/mpolynomialsystemgenerator.py +204 -0
- sage/crypto/mq/rijndael_gf.py +2345 -0
- sage/crypto/mq/sbox.py +7 -0
- sage/crypto/mq/sr.py +3344 -0
- sage/crypto/public_key/all.py +5 -0
- sage/crypto/public_key/blum_goldwasser.py +776 -0
- sage/crypto/sbox.cpython-314-x86_64-linux-musl.so +0 -0
- sage/crypto/sbox.pyx +2090 -0
- sage/crypto/sboxes.py +2090 -0
- sage/crypto/stream.py +390 -0
- sage/crypto/stream_cipher.py +297 -0
- sage/crypto/util.py +519 -0
- sage/ext/all__sagemath_modules.py +1 -0
- sage/ext/interpreters/__init__.py +1 -0
- sage/ext/interpreters/all__sagemath_modules.py +2 -0
- sage/ext/interpreters/wrapper_cc.cpython-314-x86_64-linux-musl.so +0 -0
- sage/ext/interpreters/wrapper_cc.pxd +30 -0
- sage/ext/interpreters/wrapper_cc.pyx +252 -0
- sage/ext/interpreters/wrapper_cdf.cpython-314-x86_64-linux-musl.so +0 -0
- sage/ext/interpreters/wrapper_cdf.pxd +26 -0
- sage/ext/interpreters/wrapper_cdf.pyx +245 -0
- sage/ext/interpreters/wrapper_rdf.cpython-314-x86_64-linux-musl.so +0 -0
- sage/ext/interpreters/wrapper_rdf.pxd +23 -0
- sage/ext/interpreters/wrapper_rdf.pyx +221 -0
- sage/ext/interpreters/wrapper_rr.cpython-314-x86_64-linux-musl.so +0 -0
- sage/ext/interpreters/wrapper_rr.pxd +28 -0
- sage/ext/interpreters/wrapper_rr.pyx +335 -0
- sage/geometry/all__sagemath_modules.py +5 -0
- sage/geometry/toric_lattice.py +1745 -0
- sage/geometry/toric_lattice_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/geometry/toric_lattice_element.pyx +432 -0
- sage/groups/abelian_gps/abelian_group.py +1925 -0
- sage/groups/abelian_gps/abelian_group_element.py +164 -0
- sage/groups/abelian_gps/all__sagemath_modules.py +5 -0
- sage/groups/abelian_gps/dual_abelian_group.py +421 -0
- sage/groups/abelian_gps/dual_abelian_group_element.py +179 -0
- sage/groups/abelian_gps/element_base.py +341 -0
- sage/groups/abelian_gps/values.py +488 -0
- sage/groups/additive_abelian/additive_abelian_group.py +476 -0
- sage/groups/additive_abelian/additive_abelian_wrapper.py +857 -0
- sage/groups/additive_abelian/all.py +4 -0
- sage/groups/additive_abelian/qmodnz.py +231 -0
- sage/groups/additive_abelian/qmodnz_element.py +349 -0
- sage/groups/affine_gps/affine_group.py +535 -0
- sage/groups/affine_gps/all.py +1 -0
- sage/groups/affine_gps/catalog.py +17 -0
- sage/groups/affine_gps/euclidean_group.py +246 -0
- sage/groups/affine_gps/group_element.py +562 -0
- sage/groups/all__sagemath_modules.py +12 -0
- sage/groups/galois_group.py +479 -0
- sage/groups/matrix_gps/all.py +4 -0
- sage/groups/matrix_gps/all__sagemath_modules.py +13 -0
- sage/groups/matrix_gps/catalog.py +26 -0
- sage/groups/matrix_gps/coxeter_group.py +927 -0
- sage/groups/matrix_gps/finitely_generated.py +487 -0
- sage/groups/matrix_gps/group_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/groups/matrix_gps/group_element.pxd +11 -0
- sage/groups/matrix_gps/group_element.pyx +431 -0
- sage/groups/matrix_gps/linear.py +440 -0
- sage/groups/matrix_gps/matrix_group.py +617 -0
- sage/groups/matrix_gps/named_group.py +296 -0
- sage/groups/matrix_gps/orthogonal.py +544 -0
- sage/groups/matrix_gps/symplectic.py +251 -0
- sage/groups/matrix_gps/unitary.py +436 -0
- sage/groups/misc_gps/all__sagemath_modules.py +1 -0
- sage/groups/misc_gps/argument_groups.py +1905 -0
- sage/groups/misc_gps/imaginary_groups.py +479 -0
- sage/groups/perm_gps/all__sagemath_modules.py +1 -0
- sage/groups/perm_gps/partn_ref/all__sagemath_modules.py +1 -0
- sage/groups/perm_gps/partn_ref/refinement_binary.cpython-314-x86_64-linux-musl.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_binary.pxd +41 -0
- sage/groups/perm_gps/partn_ref/refinement_binary.pyx +1167 -0
- sage/groups/perm_gps/partn_ref/refinement_matrices.cpython-314-x86_64-linux-musl.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_matrices.pxd +31 -0
- sage/groups/perm_gps/partn_ref/refinement_matrices.pyx +385 -0
- sage/homology/algebraic_topological_model.py +595 -0
- sage/homology/all.py +2 -0
- sage/homology/all__sagemath_modules.py +8 -0
- sage/homology/chain_complex.py +2148 -0
- sage/homology/chain_complex_homspace.py +165 -0
- sage/homology/chain_complex_morphism.py +629 -0
- sage/homology/chain_homotopy.py +604 -0
- sage/homology/chains.py +653 -0
- sage/homology/free_resolution.py +923 -0
- sage/homology/graded_resolution.py +567 -0
- sage/homology/hochschild_complex.py +756 -0
- sage/homology/homology_group.py +188 -0
- sage/homology/homology_morphism.py +422 -0
- sage/homology/homology_vector_space_with_basis.py +1454 -0
- sage/homology/koszul_complex.py +169 -0
- sage/homology/matrix_utils.py +205 -0
- sage/libs/all__sagemath_modules.py +1 -0
- sage/libs/gsl/__init__.py +1 -0
- sage/libs/gsl/airy.pxd +56 -0
- sage/libs/gsl/all.pxd +66 -0
- sage/libs/gsl/array.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/gsl/array.pxd +5 -0
- sage/libs/gsl/array.pyx +102 -0
- sage/libs/gsl/bessel.pxd +208 -0
- sage/libs/gsl/blas.pxd +116 -0
- sage/libs/gsl/blas_types.pxd +34 -0
- sage/libs/gsl/block.pxd +52 -0
- sage/libs/gsl/chebyshev.pxd +37 -0
- sage/libs/gsl/clausen.pxd +12 -0
- sage/libs/gsl/combination.pxd +47 -0
- sage/libs/gsl/complex.pxd +151 -0
- sage/libs/gsl/coulomb.pxd +30 -0
- sage/libs/gsl/coupling.pxd +21 -0
- sage/libs/gsl/dawson.pxd +12 -0
- sage/libs/gsl/debye.pxd +24 -0
- sage/libs/gsl/dilog.pxd +14 -0
- sage/libs/gsl/eigen.pxd +46 -0
- sage/libs/gsl/elementary.pxd +12 -0
- sage/libs/gsl/ellint.pxd +48 -0
- sage/libs/gsl/elljac.pxd +8 -0
- sage/libs/gsl/erf.pxd +32 -0
- sage/libs/gsl/errno.pxd +26 -0
- sage/libs/gsl/exp.pxd +44 -0
- sage/libs/gsl/expint.pxd +44 -0
- sage/libs/gsl/fermi_dirac.pxd +44 -0
- sage/libs/gsl/fft.pxd +121 -0
- sage/libs/gsl/fit.pxd +50 -0
- sage/libs/gsl/gamma.pxd +94 -0
- sage/libs/gsl/gegenbauer.pxd +26 -0
- sage/libs/gsl/histogram.pxd +176 -0
- sage/libs/gsl/hyperg.pxd +52 -0
- sage/libs/gsl/integration.pxd +69 -0
- sage/libs/gsl/interp.pxd +109 -0
- sage/libs/gsl/laguerre.pxd +24 -0
- sage/libs/gsl/lambert.pxd +16 -0
- sage/libs/gsl/legendre.pxd +90 -0
- sage/libs/gsl/linalg.pxd +185 -0
- sage/libs/gsl/log.pxd +26 -0
- sage/libs/gsl/math.pxd +43 -0
- sage/libs/gsl/matrix.pxd +143 -0
- sage/libs/gsl/matrix_complex.pxd +130 -0
- sage/libs/gsl/min.pxd +67 -0
- sage/libs/gsl/monte.pxd +56 -0
- sage/libs/gsl/ntuple.pxd +32 -0
- sage/libs/gsl/odeiv.pxd +70 -0
- sage/libs/gsl/permutation.pxd +78 -0
- sage/libs/gsl/poly.pxd +40 -0
- sage/libs/gsl/pow_int.pxd +12 -0
- sage/libs/gsl/psi.pxd +28 -0
- sage/libs/gsl/qrng.pxd +29 -0
- sage/libs/gsl/random.pxd +257 -0
- sage/libs/gsl/rng.pxd +100 -0
- sage/libs/gsl/roots.pxd +72 -0
- sage/libs/gsl/sort.pxd +36 -0
- sage/libs/gsl/statistics.pxd +59 -0
- sage/libs/gsl/sum.pxd +55 -0
- sage/libs/gsl/synchrotron.pxd +16 -0
- sage/libs/gsl/transport.pxd +24 -0
- sage/libs/gsl/trig.pxd +58 -0
- sage/libs/gsl/types.pxd +137 -0
- sage/libs/gsl/vector.pxd +101 -0
- sage/libs/gsl/vector_complex.pxd +83 -0
- sage/libs/gsl/wavelet.pxd +49 -0
- sage/libs/gsl/zeta.pxd +28 -0
- sage/libs/mpc/__init__.pxd +114 -0
- sage/libs/mpc/types.pxd +28 -0
- sage/libs/mpfr/__init__.pxd +299 -0
- sage/libs/mpfr/types.pxd +26 -0
- sage/libs/mpmath/__init__.py +1 -0
- sage/libs/mpmath/all.py +27 -0
- sage/libs/mpmath/all__sagemath_modules.py +1 -0
- sage/libs/mpmath/utils.cpython-314-x86_64-linux-musl.so +0 -0
- sage/libs/mpmath/utils.pxd +4 -0
- sage/libs/mpmath/utils.pyx +319 -0
- sage/matrix/action.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/action.pxd +26 -0
- sage/matrix/action.pyx +596 -0
- sage/matrix/all.py +9 -0
- sage/matrix/args.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/args.pxd +144 -0
- sage/matrix/args.pyx +1668 -0
- sage/matrix/benchmark.py +1258 -0
- sage/matrix/berlekamp_massey.py +95 -0
- sage/matrix/compute_J_ideal.py +926 -0
- sage/matrix/constructor.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/constructor.pyx +750 -0
- sage/matrix/docs.py +430 -0
- sage/matrix/echelon_matrix.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/echelon_matrix.pyx +155 -0
- sage/matrix/matrix.pxd +2 -0
- sage/matrix/matrix0.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix0.pxd +68 -0
- sage/matrix/matrix0.pyx +6324 -0
- sage/matrix/matrix1.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix1.pxd +8 -0
- sage/matrix/matrix1.pyx +2851 -0
- sage/matrix/matrix2.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix2.pxd +25 -0
- sage/matrix/matrix2.pyx +20181 -0
- sage/matrix/matrix_cdv.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_cdv.pxd +4 -0
- sage/matrix/matrix_cdv.pyx +93 -0
- sage/matrix/matrix_complex_double_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_complex_double_dense.pxd +5 -0
- sage/matrix/matrix_complex_double_dense.pyx +98 -0
- sage/matrix/matrix_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_dense.pxd +5 -0
- sage/matrix/matrix_dense.pyx +343 -0
- sage/matrix/matrix_domain_dense.pxd +5 -0
- sage/matrix/matrix_domain_sparse.pxd +5 -0
- sage/matrix/matrix_double_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_double_dense.pxd +7 -0
- sage/matrix/matrix_double_dense.pyx +3906 -0
- sage/matrix/matrix_double_sparse.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_double_sparse.pxd +6 -0
- sage/matrix/matrix_double_sparse.pyx +248 -0
- sage/matrix/matrix_generic_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_generic_dense.pxd +7 -0
- sage/matrix/matrix_generic_dense.pyx +354 -0
- sage/matrix/matrix_generic_sparse.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_generic_sparse.pxd +7 -0
- sage/matrix/matrix_generic_sparse.pyx +461 -0
- sage/matrix/matrix_laurent_mpolynomial_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_laurent_mpolynomial_dense.pxd +5 -0
- sage/matrix/matrix_laurent_mpolynomial_dense.pyx +115 -0
- sage/matrix/matrix_misc.py +313 -0
- sage/matrix/matrix_numpy_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_numpy_dense.pxd +14 -0
- sage/matrix/matrix_numpy_dense.pyx +450 -0
- sage/matrix/matrix_numpy_integer_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_numpy_integer_dense.pxd +7 -0
- sage/matrix/matrix_numpy_integer_dense.pyx +59 -0
- sage/matrix/matrix_polynomial_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_polynomial_dense.pxd +5 -0
- sage/matrix/matrix_polynomial_dense.pyx +5341 -0
- sage/matrix/matrix_real_double_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_real_double_dense.pxd +7 -0
- sage/matrix/matrix_real_double_dense.pyx +122 -0
- sage/matrix/matrix_space.py +2848 -0
- sage/matrix/matrix_sparse.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_sparse.pxd +5 -0
- sage/matrix/matrix_sparse.pyx +1222 -0
- sage/matrix/matrix_window.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/matrix_window.pxd +37 -0
- sage/matrix/matrix_window.pyx +242 -0
- sage/matrix/misc_mpfr.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/misc_mpfr.pyx +80 -0
- sage/matrix/operation_table.py +1182 -0
- sage/matrix/special.py +3666 -0
- sage/matrix/strassen.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matrix/strassen.pyx +851 -0
- sage/matrix/symplectic_basis.py +541 -0
- sage/matrix/template.pxd +6 -0
- sage/matrix/tests.py +71 -0
- sage/matroids/advanced.py +77 -0
- sage/matroids/all.py +13 -0
- sage/matroids/basis_exchange_matroid.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matroids/basis_exchange_matroid.pxd +96 -0
- sage/matroids/basis_exchange_matroid.pyx +2344 -0
- sage/matroids/basis_matroid.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matroids/basis_matroid.pxd +45 -0
- sage/matroids/basis_matroid.pyx +1217 -0
- sage/matroids/catalog.py +44 -0
- sage/matroids/chow_ring.py +473 -0
- sage/matroids/chow_ring_ideal.py +849 -0
- sage/matroids/circuit_closures_matroid.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matroids/circuit_closures_matroid.pxd +16 -0
- sage/matroids/circuit_closures_matroid.pyx +559 -0
- sage/matroids/circuits_matroid.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matroids/circuits_matroid.pxd +38 -0
- sage/matroids/circuits_matroid.pyx +947 -0
- sage/matroids/constructor.py +1086 -0
- sage/matroids/database_collections.py +365 -0
- sage/matroids/database_matroids.py +5338 -0
- sage/matroids/dual_matroid.py +583 -0
- sage/matroids/extension.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matroids/extension.pxd +34 -0
- sage/matroids/extension.pyx +519 -0
- sage/matroids/flats_matroid.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matroids/flats_matroid.pxd +28 -0
- sage/matroids/flats_matroid.pyx +715 -0
- sage/matroids/gammoid.py +600 -0
- sage/matroids/graphic_matroid.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matroids/graphic_matroid.pxd +39 -0
- sage/matroids/graphic_matroid.pyx +2024 -0
- sage/matroids/lean_matrix.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matroids/lean_matrix.pxd +126 -0
- sage/matroids/lean_matrix.pyx +3667 -0
- sage/matroids/linear_matroid.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matroids/linear_matroid.pxd +180 -0
- sage/matroids/linear_matroid.pyx +6649 -0
- sage/matroids/matroid.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matroids/matroid.pxd +243 -0
- sage/matroids/matroid.pyx +8759 -0
- sage/matroids/matroids_catalog.py +190 -0
- sage/matroids/matroids_plot_helpers.py +890 -0
- sage/matroids/minor_matroid.py +480 -0
- sage/matroids/minorfix.h +9 -0
- sage/matroids/named_matroids.py +5 -0
- sage/matroids/rank_matroid.py +268 -0
- sage/matroids/set_system.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matroids/set_system.pxd +38 -0
- sage/matroids/set_system.pyx +800 -0
- sage/matroids/transversal_matroid.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matroids/transversal_matroid.pxd +14 -0
- sage/matroids/transversal_matroid.pyx +893 -0
- sage/matroids/union_matroid.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matroids/union_matroid.pxd +20 -0
- sage/matroids/union_matroid.pyx +331 -0
- sage/matroids/unpickling.cpython-314-x86_64-linux-musl.so +0 -0
- sage/matroids/unpickling.pyx +843 -0
- sage/matroids/utilities.py +809 -0
- sage/misc/all__sagemath_modules.py +20 -0
- sage/misc/c3.cpython-314-x86_64-linux-musl.so +0 -0
- sage/misc/c3.pyx +238 -0
- sage/misc/compat.py +87 -0
- sage/misc/element_with_label.py +173 -0
- sage/misc/func_persist.py +79 -0
- sage/misc/pickle_old.cpython-314-x86_64-linux-musl.so +0 -0
- sage/misc/pickle_old.pyx +19 -0
- sage/misc/proof.py +7 -0
- sage/misc/replace_dot_all.py +472 -0
- sage/misc/sagedoc_conf.py +168 -0
- sage/misc/sphinxify.py +167 -0
- sage/misc/test_class_pickling.py +85 -0
- sage/modules/all.py +42 -0
- sage/modules/complex_double_vector.py +25 -0
- sage/modules/diamond_cutting.py +380 -0
- sage/modules/fg_pid/all.py +1 -0
- sage/modules/fg_pid/fgp_element.py +456 -0
- sage/modules/fg_pid/fgp_module.py +2091 -0
- sage/modules/fg_pid/fgp_morphism.py +550 -0
- sage/modules/filtered_vector_space.py +1271 -0
- sage/modules/finite_submodule_iter.cpython-314-x86_64-linux-musl.so +0 -0
- sage/modules/finite_submodule_iter.pxd +27 -0
- sage/modules/finite_submodule_iter.pyx +452 -0
- sage/modules/fp_graded/all.py +1 -0
- sage/modules/fp_graded/element.py +346 -0
- sage/modules/fp_graded/free_element.py +298 -0
- sage/modules/fp_graded/free_homspace.py +53 -0
- sage/modules/fp_graded/free_module.py +1060 -0
- sage/modules/fp_graded/free_morphism.py +217 -0
- sage/modules/fp_graded/homspace.py +563 -0
- sage/modules/fp_graded/module.py +1340 -0
- sage/modules/fp_graded/morphism.py +1990 -0
- sage/modules/fp_graded/steenrod/all.py +1 -0
- sage/modules/fp_graded/steenrod/homspace.py +65 -0
- sage/modules/fp_graded/steenrod/module.py +477 -0
- sage/modules/fp_graded/steenrod/morphism.py +404 -0
- sage/modules/fp_graded/steenrod/profile.py +241 -0
- sage/modules/free_module.py +8447 -0
- sage/modules/free_module_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/modules/free_module_element.pxd +22 -0
- sage/modules/free_module_element.pyx +5445 -0
- sage/modules/free_module_homspace.py +369 -0
- sage/modules/free_module_integer.py +896 -0
- sage/modules/free_module_morphism.py +823 -0
- sage/modules/free_module_pseudohomspace.py +352 -0
- sage/modules/free_module_pseudomorphism.py +578 -0
- sage/modules/free_quadratic_module.py +1706 -0
- sage/modules/free_quadratic_module_integer_symmetric.py +1790 -0
- sage/modules/matrix_morphism.py +1745 -0
- sage/modules/misc.py +103 -0
- sage/modules/module_functors.py +192 -0
- sage/modules/multi_filtered_vector_space.py +719 -0
- sage/modules/ore_module.py +2208 -0
- sage/modules/ore_module_element.py +178 -0
- sage/modules/ore_module_homspace.py +147 -0
- sage/modules/ore_module_morphism.py +968 -0
- sage/modules/quotient_module.py +699 -0
- sage/modules/real_double_vector.py +22 -0
- sage/modules/submodule.py +255 -0
- sage/modules/tensor_operations.py +567 -0
- sage/modules/torsion_quadratic_module.py +1352 -0
- sage/modules/tutorial_free_modules.py +248 -0
- sage/modules/vector_complex_double_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/modules/vector_complex_double_dense.pxd +6 -0
- sage/modules/vector_complex_double_dense.pyx +117 -0
- sage/modules/vector_double_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/modules/vector_double_dense.pxd +6 -0
- sage/modules/vector_double_dense.pyx +604 -0
- sage/modules/vector_integer_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/modules/vector_integer_dense.pxd +15 -0
- sage/modules/vector_integer_dense.pyx +361 -0
- sage/modules/vector_integer_sparse.cpython-314-x86_64-linux-musl.so +0 -0
- sage/modules/vector_integer_sparse.pxd +29 -0
- sage/modules/vector_integer_sparse.pyx +406 -0
- sage/modules/vector_modn_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/modules/vector_modn_dense.pxd +12 -0
- sage/modules/vector_modn_dense.pyx +394 -0
- sage/modules/vector_modn_sparse.cpython-314-x86_64-linux-musl.so +0 -0
- sage/modules/vector_modn_sparse.pxd +21 -0
- sage/modules/vector_modn_sparse.pyx +298 -0
- sage/modules/vector_numpy_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/modules/vector_numpy_dense.pxd +15 -0
- sage/modules/vector_numpy_dense.pyx +304 -0
- sage/modules/vector_numpy_integer_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/modules/vector_numpy_integer_dense.pxd +7 -0
- sage/modules/vector_numpy_integer_dense.pyx +54 -0
- sage/modules/vector_rational_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/modules/vector_rational_dense.pxd +15 -0
- sage/modules/vector_rational_dense.pyx +387 -0
- sage/modules/vector_rational_sparse.cpython-314-x86_64-linux-musl.so +0 -0
- sage/modules/vector_rational_sparse.pxd +30 -0
- sage/modules/vector_rational_sparse.pyx +413 -0
- sage/modules/vector_real_double_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/modules/vector_real_double_dense.pxd +6 -0
- sage/modules/vector_real_double_dense.pyx +126 -0
- sage/modules/vector_space_homspace.py +430 -0
- sage/modules/vector_space_morphism.py +989 -0
- sage/modules/with_basis/all.py +15 -0
- sage/modules/with_basis/cell_module.py +494 -0
- sage/modules/with_basis/indexed_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/modules/with_basis/indexed_element.pxd +13 -0
- sage/modules/with_basis/indexed_element.pyx +1058 -0
- sage/modules/with_basis/invariant.py +1075 -0
- sage/modules/with_basis/morphism.py +1636 -0
- sage/modules/with_basis/representation.py +2939 -0
- sage/modules/with_basis/subquotient.py +685 -0
- sage/numerical/all__sagemath_modules.py +6 -0
- sage/numerical/gauss_legendre.cpython-314-x86_64-linux-musl.so +0 -0
- sage/numerical/gauss_legendre.pyx +381 -0
- sage/numerical/optimize.py +910 -0
- sage/probability/all.py +10 -0
- sage/probability/probability_distribution.cpython-314-x86_64-linux-musl.so +0 -0
- sage/probability/probability_distribution.pyx +1242 -0
- sage/probability/random_variable.py +411 -0
- sage/quadratic_forms/all.py +4 -0
- sage/quadratic_forms/all__sagemath_modules.py +15 -0
- sage/quadratic_forms/binary_qf.py +2042 -0
- sage/quadratic_forms/bqf_class_group.py +748 -0
- sage/quadratic_forms/constructions.py +93 -0
- sage/quadratic_forms/count_local_2.cpython-314-x86_64-linux-musl.so +0 -0
- sage/quadratic_forms/count_local_2.pyx +365 -0
- sage/quadratic_forms/extras.py +195 -0
- sage/quadratic_forms/quadratic_form.py +1753 -0
- sage/quadratic_forms/quadratic_form__count_local_2.py +221 -0
- sage/quadratic_forms/quadratic_form__equivalence_testing.py +708 -0
- sage/quadratic_forms/quadratic_form__evaluate.cpython-314-x86_64-linux-musl.so +0 -0
- sage/quadratic_forms/quadratic_form__evaluate.pyx +139 -0
- sage/quadratic_forms/quadratic_form__local_density_congruence.py +977 -0
- sage/quadratic_forms/quadratic_form__local_field_invariants.py +1072 -0
- sage/quadratic_forms/quadratic_form__neighbors.py +424 -0
- sage/quadratic_forms/quadratic_form__reduction_theory.py +488 -0
- sage/quadratic_forms/quadratic_form__split_local_covering.py +416 -0
- sage/quadratic_forms/quadratic_form__ternary_Tornaria.py +657 -0
- sage/quadratic_forms/quadratic_form__theta.py +352 -0
- sage/quadratic_forms/quadratic_form__variable_substitutions.py +370 -0
- sage/quadratic_forms/random_quadraticform.py +209 -0
- sage/quadratic_forms/ternary.cpython-314-x86_64-linux-musl.so +0 -0
- sage/quadratic_forms/ternary.pyx +1154 -0
- sage/quadratic_forms/ternary_qf.py +2027 -0
- sage/rings/all__sagemath_modules.py +28 -0
- sage/rings/asymptotic/all__sagemath_modules.py +1 -0
- sage/rings/asymptotic/misc.py +1252 -0
- sage/rings/cc.py +4 -0
- sage/rings/cfinite_sequence.py +1306 -0
- sage/rings/complex_conversion.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/complex_conversion.pxd +8 -0
- sage/rings/complex_conversion.pyx +23 -0
- sage/rings/complex_double.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/complex_double.pxd +21 -0
- sage/rings/complex_double.pyx +2654 -0
- sage/rings/complex_mpc.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/complex_mpc.pxd +21 -0
- sage/rings/complex_mpc.pyx +2576 -0
- sage/rings/complex_mpfr.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/complex_mpfr.pxd +18 -0
- sage/rings/complex_mpfr.pyx +3602 -0
- sage/rings/derivation.py +2334 -0
- sage/rings/finite_rings/all__sagemath_modules.py +1 -0
- sage/rings/finite_rings/maps_finite_field.py +191 -0
- sage/rings/function_field/all__sagemath_modules.py +8 -0
- sage/rings/function_field/derivations.py +102 -0
- sage/rings/function_field/derivations_rational.py +132 -0
- sage/rings/function_field/differential.py +853 -0
- sage/rings/function_field/divisor.py +1107 -0
- sage/rings/function_field/drinfeld_modules/action.py +199 -0
- sage/rings/function_field/drinfeld_modules/all.py +1 -0
- sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py +673 -0
- sage/rings/function_field/drinfeld_modules/drinfeld_module.py +2087 -0
- sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py +1131 -0
- sage/rings/function_field/drinfeld_modules/homset.py +420 -0
- sage/rings/function_field/drinfeld_modules/morphism.py +820 -0
- sage/rings/function_field/hermite_form_polynomial.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/function_field/hermite_form_polynomial.pyx +188 -0
- sage/rings/function_field/khuri_makdisi.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/function_field/khuri_makdisi.pyx +935 -0
- sage/rings/invariants/all.py +4 -0
- sage/rings/invariants/invariant_theory.py +4597 -0
- sage/rings/invariants/reconstruction.py +395 -0
- sage/rings/polynomial/all__sagemath_modules.py +17 -0
- sage/rings/polynomial/integer_valued_polynomials.py +1230 -0
- sage/rings/polynomial/laurent_polynomial_mpair.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/polynomial/laurent_polynomial_mpair.pxd +15 -0
- sage/rings/polynomial/laurent_polynomial_mpair.pyx +2023 -0
- sage/rings/polynomial/ore_function_element.py +952 -0
- sage/rings/polynomial/ore_function_field.py +1028 -0
- sage/rings/polynomial/ore_polynomial_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/polynomial/ore_polynomial_element.pxd +48 -0
- sage/rings/polynomial/ore_polynomial_element.pyx +3145 -0
- sage/rings/polynomial/ore_polynomial_ring.py +1334 -0
- sage/rings/polynomial/polynomial_real_mpfr_dense.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/polynomial/polynomial_real_mpfr_dense.pyx +788 -0
- sage/rings/polynomial/q_integer_valued_polynomials.py +1264 -0
- sage/rings/polynomial/skew_polynomial_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/polynomial/skew_polynomial_element.pxd +9 -0
- sage/rings/polynomial/skew_polynomial_element.pyx +684 -0
- sage/rings/polynomial/skew_polynomial_finite_field.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/polynomial/skew_polynomial_finite_field.pxd +19 -0
- sage/rings/polynomial/skew_polynomial_finite_field.pyx +1093 -0
- sage/rings/polynomial/skew_polynomial_finite_order.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/polynomial/skew_polynomial_finite_order.pxd +10 -0
- sage/rings/polynomial/skew_polynomial_finite_order.pyx +567 -0
- sage/rings/polynomial/skew_polynomial_ring.py +908 -0
- sage/rings/real_double_element_gsl.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/real_double_element_gsl.pxd +8 -0
- sage/rings/real_double_element_gsl.pyx +794 -0
- sage/rings/real_field.py +58 -0
- sage/rings/real_mpfr.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/real_mpfr.pxd +29 -0
- sage/rings/real_mpfr.pyx +6122 -0
- sage/rings/ring_extension.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/ring_extension.pxd +42 -0
- sage/rings/ring_extension.pyx +2779 -0
- sage/rings/ring_extension_conversion.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/ring_extension_conversion.pxd +16 -0
- sage/rings/ring_extension_conversion.pyx +462 -0
- sage/rings/ring_extension_element.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/ring_extension_element.pxd +21 -0
- sage/rings/ring_extension_element.pyx +1635 -0
- sage/rings/ring_extension_homset.py +64 -0
- sage/rings/ring_extension_morphism.cpython-314-x86_64-linux-musl.so +0 -0
- sage/rings/ring_extension_morphism.pxd +35 -0
- sage/rings/ring_extension_morphism.pyx +920 -0
- sage/schemes/all__sagemath_modules.py +1 -0
- sage/schemes/projective/all__sagemath_modules.py +1 -0
- sage/schemes/projective/coherent_sheaf.py +300 -0
- sage/schemes/projective/cohomology.py +510 -0
- sage/stats/all.py +15 -0
- sage/stats/basic_stats.py +489 -0
- sage/stats/distributions/all.py +7 -0
- sage/stats/distributions/catalog.py +34 -0
- sage/stats/distributions/dgs.h +50 -0
- sage/stats/distributions/dgs.pxd +111 -0
- sage/stats/distributions/dgs_bern.h +400 -0
- sage/stats/distributions/dgs_gauss.h +614 -0
- sage/stats/distributions/dgs_misc.h +104 -0
- sage/stats/distributions/discrete_gaussian_integer.cpython-314-x86_64-linux-musl.so +0 -0
- sage/stats/distributions/discrete_gaussian_integer.pxd +14 -0
- sage/stats/distributions/discrete_gaussian_integer.pyx +498 -0
- sage/stats/distributions/discrete_gaussian_lattice.py +908 -0
- sage/stats/distributions/discrete_gaussian_polynomial.py +141 -0
- sage/stats/hmm/all.py +15 -0
- sage/stats/hmm/chmm.cpython-314-x86_64-linux-musl.so +0 -0
- sage/stats/hmm/chmm.pyx +1595 -0
- sage/stats/hmm/distributions.cpython-314-x86_64-linux-musl.so +0 -0
- sage/stats/hmm/distributions.pxd +29 -0
- sage/stats/hmm/distributions.pyx +531 -0
- sage/stats/hmm/hmm.cpython-314-x86_64-linux-musl.so +0 -0
- sage/stats/hmm/hmm.pxd +17 -0
- sage/stats/hmm/hmm.pyx +1388 -0
- sage/stats/hmm/util.cpython-314-x86_64-linux-musl.so +0 -0
- sage/stats/hmm/util.pxd +7 -0
- sage/stats/hmm/util.pyx +165 -0
- sage/stats/intlist.cpython-314-x86_64-linux-musl.so +0 -0
- sage/stats/intlist.pxd +14 -0
- sage/stats/intlist.pyx +588 -0
- sage/stats/r.py +49 -0
- sage/stats/time_series.cpython-314-x86_64-linux-musl.so +0 -0
- sage/stats/time_series.pxd +6 -0
- sage/stats/time_series.pyx +2546 -0
- sage/tensor/all.py +2 -0
- sage/tensor/modules/all.py +8 -0
- sage/tensor/modules/alternating_contr_tensor.py +761 -0
- sage/tensor/modules/comp.py +5598 -0
- sage/tensor/modules/ext_pow_free_module.py +824 -0
- sage/tensor/modules/finite_rank_free_module.py +3589 -0
- sage/tensor/modules/format_utilities.py +333 -0
- sage/tensor/modules/free_module_alt_form.py +858 -0
- sage/tensor/modules/free_module_automorphism.py +1207 -0
- sage/tensor/modules/free_module_basis.py +1074 -0
- sage/tensor/modules/free_module_element.py +284 -0
- sage/tensor/modules/free_module_homset.py +652 -0
- sage/tensor/modules/free_module_linear_group.py +564 -0
- sage/tensor/modules/free_module_morphism.py +1581 -0
- sage/tensor/modules/free_module_tensor.py +3289 -0
- sage/tensor/modules/reflexive_module.py +386 -0
- sage/tensor/modules/tensor_free_module.py +780 -0
- sage/tensor/modules/tensor_free_submodule.py +538 -0
- sage/tensor/modules/tensor_free_submodule_basis.py +140 -0
- sage/tensor/modules/tensor_with_indices.py +1043 -0
|
@@ -0,0 +1,1905 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-modules
|
|
2
|
+
r"""
|
|
3
|
+
Groups of elements representing (complex) arguments.
|
|
4
|
+
|
|
5
|
+
This includes
|
|
6
|
+
|
|
7
|
+
- :class:`RootsOfUnityGroup` (containing all roots of unity)
|
|
8
|
+
|
|
9
|
+
- :class:`UnitCircleGroup` (representing elements on the unit circle by
|
|
10
|
+
`e^{2\pi\cdot\mathit{exponent}}`)
|
|
11
|
+
|
|
12
|
+
- :class:`ArgumentByElementGroup` (whose elements are defined via
|
|
13
|
+
formal arguments by `e^{I\cdot\mathrm{arg}(\mathit{element})}`.
|
|
14
|
+
|
|
15
|
+
Use the factory :class:`ArgumentGroup` for creating such a group conveniently.
|
|
16
|
+
|
|
17
|
+
.. NOTE::
|
|
18
|
+
|
|
19
|
+
One main purpose of such groups is in an
|
|
20
|
+
:mod:`asymptotic ring's <sage.rings.asymptotic.asymptotic_ring>`
|
|
21
|
+
:mod:`growth group <sage.rings.asymptotic.growth_group>`
|
|
22
|
+
when an element like `z^n`
|
|
23
|
+
(for some constant `z`) is split into
|
|
24
|
+
`\lvert z \rvert^n \cdot e^{I\cdot \mathrm{arg}(z) n}`.
|
|
25
|
+
(Note that the first factor determines the growth of that product,
|
|
26
|
+
the second does not influence the growth.)
|
|
27
|
+
|
|
28
|
+
AUTHORS:
|
|
29
|
+
|
|
30
|
+
- Daniel Krenn (2018)
|
|
31
|
+
|
|
32
|
+
Classes and Methods
|
|
33
|
+
===================
|
|
34
|
+
"""
|
|
35
|
+
# ****************************************************************************
|
|
36
|
+
# Copyright (C) 2018 Daniel Krenn <dev@danielkrenn.at>
|
|
37
|
+
#
|
|
38
|
+
# This program is free software: you can redistribute it and/or modify
|
|
39
|
+
# it under the terms of the GNU General Public License as published by
|
|
40
|
+
# the Free Software Foundation, either version 2 of the License, or
|
|
41
|
+
# (at your option) any later version.
|
|
42
|
+
# https://www.gnu.org/licenses/
|
|
43
|
+
# ****************************************************************************
|
|
44
|
+
|
|
45
|
+
from sage.structure.element import MultiplicativeGroupElement
|
|
46
|
+
from sage.structure.factory import UniqueFactory
|
|
47
|
+
from sage.structure.parent import Parent
|
|
48
|
+
from sage.structure.richcmp import richcmp_by_eq_and_lt
|
|
49
|
+
from sage.structure.unique_representation import UniqueRepresentation
|
|
50
|
+
import sage.rings.abc
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class AbstractArgument(MultiplicativeGroupElement):
|
|
54
|
+
r"""
|
|
55
|
+
An element of :class:`AbstractArgumentGroup`. This abstract class
|
|
56
|
+
encapsulates an element of the parent's base, i.e. it can be seen
|
|
57
|
+
as a wrapper class.
|
|
58
|
+
|
|
59
|
+
INPUT:
|
|
60
|
+
|
|
61
|
+
- ``parent`` -- a SageMath parent
|
|
62
|
+
|
|
63
|
+
- ``element`` -- an element of parent's base
|
|
64
|
+
|
|
65
|
+
- ``normalize`` -- boolean (default: ``True``)
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
def __init__(self, parent, element, normalize=True):
|
|
69
|
+
r"""
|
|
70
|
+
See :class:`AbstractArgument` for more information.
|
|
71
|
+
|
|
72
|
+
TESTS::
|
|
73
|
+
|
|
74
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup, RootsOfUnityGroup
|
|
75
|
+
sage: C = UnitCircleGroup(RR)
|
|
76
|
+
sage: C(exponent=1/2) # indirect doctest
|
|
77
|
+
e^(2*pi*0.500000000000000)
|
|
78
|
+
sage: C(exponent=3/2)
|
|
79
|
+
e^(2*pi*0.500000000000000)
|
|
80
|
+
|
|
81
|
+
sage: U = RootsOfUnityGroup()
|
|
82
|
+
sage: U(exponent=0)
|
|
83
|
+
1
|
|
84
|
+
sage: U(exponent=1)
|
|
85
|
+
1
|
|
86
|
+
sage: U(exponent=2/3) == U(exponent=5/3)
|
|
87
|
+
True
|
|
88
|
+
"""
|
|
89
|
+
if parent is None:
|
|
90
|
+
raise ValueError('parent must be provided')
|
|
91
|
+
super().__init__(parent=parent)
|
|
92
|
+
|
|
93
|
+
try:
|
|
94
|
+
element = parent.base()(element)
|
|
95
|
+
except (TypeError, ValueError) as e:
|
|
96
|
+
from sage.rings.asymptotic.misc import combine_exceptions
|
|
97
|
+
from sage.structure.element import parent as parent_function
|
|
98
|
+
raise combine_exceptions(
|
|
99
|
+
ValueError(
|
|
100
|
+
'{} ({}) is not in {}'.format(element,
|
|
101
|
+
parent_function(element),
|
|
102
|
+
parent.base())),
|
|
103
|
+
e)
|
|
104
|
+
|
|
105
|
+
if normalize:
|
|
106
|
+
element = self._normalize_(element)
|
|
107
|
+
self._element_ = element
|
|
108
|
+
|
|
109
|
+
@staticmethod
|
|
110
|
+
def _normalize_(element):
|
|
111
|
+
r"""
|
|
112
|
+
Normalize the given element.
|
|
113
|
+
|
|
114
|
+
INPUT:
|
|
115
|
+
|
|
116
|
+
- ``element`` -- an element of the parent's base
|
|
117
|
+
|
|
118
|
+
OUTPUT: an element
|
|
119
|
+
|
|
120
|
+
TESTS::
|
|
121
|
+
|
|
122
|
+
sage: from sage.groups.misc_gps.argument_groups import AbstractArgument
|
|
123
|
+
sage: AbstractArgument._normalize_(3/2)
|
|
124
|
+
Traceback (most recent call last):
|
|
125
|
+
...
|
|
126
|
+
NotImplementedError: only implemented in concrete realizations
|
|
127
|
+
"""
|
|
128
|
+
raise NotImplementedError('only implemented in concrete realizations')
|
|
129
|
+
|
|
130
|
+
def __hash__(self):
|
|
131
|
+
r"""
|
|
132
|
+
Return a hash value of this argument.
|
|
133
|
+
|
|
134
|
+
TESTS::
|
|
135
|
+
|
|
136
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup
|
|
137
|
+
sage: C = UnitCircleGroup(RR)
|
|
138
|
+
sage: hash(C(exponent=1/3)) # indirect doctest, random
|
|
139
|
+
42
|
|
140
|
+
"""
|
|
141
|
+
return hash((self.parent(), self._element_))
|
|
142
|
+
|
|
143
|
+
def _symbolic_(self, R=None):
|
|
144
|
+
r"""
|
|
145
|
+
Return this argument as a symbolic expression.
|
|
146
|
+
|
|
147
|
+
INPUT:
|
|
148
|
+
|
|
149
|
+
- ``R`` -- (a subring of) the symbolic ring or ``None``.
|
|
150
|
+
The output will be an element of ``R``. If ``None``,
|
|
151
|
+
then the symbolic ring is used.
|
|
152
|
+
|
|
153
|
+
OUTPUT: a symbolic expression
|
|
154
|
+
|
|
155
|
+
EXAMPLES::
|
|
156
|
+
|
|
157
|
+
sage: from sage.groups.misc_gps.argument_groups import AbstractArgument
|
|
158
|
+
sage: class MyArgument(AbstractArgument):
|
|
159
|
+
....: @staticmethod
|
|
160
|
+
....: def _normalize_(element):
|
|
161
|
+
....: return element
|
|
162
|
+
sage: a = MyArgument(ZZ, -1)
|
|
163
|
+
sage: a._symbolic_()
|
|
164
|
+
Traceback (most recent call last):
|
|
165
|
+
...
|
|
166
|
+
NotImplementedError: only implemented in concrete realizations
|
|
167
|
+
"""
|
|
168
|
+
raise NotImplementedError('only implemented in concrete realizations')
|
|
169
|
+
|
|
170
|
+
_richcmp_ = richcmp_by_eq_and_lt("_eq_", "_lt_")
|
|
171
|
+
|
|
172
|
+
def _eq_(self, other):
|
|
173
|
+
r"""
|
|
174
|
+
Return whether this argument equals ``other``.
|
|
175
|
+
|
|
176
|
+
TESTS::
|
|
177
|
+
|
|
178
|
+
sage: from sage.groups.misc_gps.argument_groups import RootsOfUnityGroup
|
|
179
|
+
sage: U = RootsOfUnityGroup()
|
|
180
|
+
sage: U(exponent=0) == U(exponent=1)
|
|
181
|
+
True
|
|
182
|
+
sage: U(exponent=2/3) == U(exponent=5/3)
|
|
183
|
+
True
|
|
184
|
+
sage: U(exponent=2/3) == U(exponent=-2/3)
|
|
185
|
+
False
|
|
186
|
+
|
|
187
|
+
::
|
|
188
|
+
|
|
189
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentByElementGroup
|
|
190
|
+
sage: C = ArgumentByElementGroup(CC)
|
|
191
|
+
sage: C(I) == C(I) # needs sage.symbolic
|
|
192
|
+
True
|
|
193
|
+
|
|
194
|
+
As we do not have normalization in :class:`ArgumentByElement`,
|
|
195
|
+
then following, although equal, is not equal::
|
|
196
|
+
|
|
197
|
+
sage: C(I) == C(2*I) # needs sage.symbolic
|
|
198
|
+
False
|
|
199
|
+
"""
|
|
200
|
+
return self._element_ == other._element_
|
|
201
|
+
|
|
202
|
+
def _lt_(self, other):
|
|
203
|
+
r"""
|
|
204
|
+
Raise an error since points on the unit circle are not comparable.
|
|
205
|
+
|
|
206
|
+
TESTS::
|
|
207
|
+
|
|
208
|
+
sage: from sage.groups.misc_gps.argument_groups import RootsOfUnityGroup
|
|
209
|
+
sage: U = RootsOfUnityGroup()
|
|
210
|
+
sage: U(exponent=0) < U(exponent=0) # indirect doctest
|
|
211
|
+
Traceback (most recent call last):
|
|
212
|
+
...
|
|
213
|
+
RuntimeError: cannot decide '<' for the roots of unity 1 and 1
|
|
214
|
+
sage: U(exponent=0) < U(exponent=1/2) # indirect doctest
|
|
215
|
+
Traceback (most recent call last):
|
|
216
|
+
...
|
|
217
|
+
RuntimeError: cannot decide '<' for the roots of unity 1 and -1
|
|
218
|
+
sage: U(exponent=0) > U(exponent=1/2) # indirect doctest
|
|
219
|
+
Traceback (most recent call last):
|
|
220
|
+
...
|
|
221
|
+
RuntimeError: cannot decide '<' for the roots of unity -1 and 1
|
|
222
|
+
"""
|
|
223
|
+
raise RuntimeError("cannot decide '<' "
|
|
224
|
+
"for the roots of unity "
|
|
225
|
+
"{} and {}".format(self, other))
|
|
226
|
+
|
|
227
|
+
def _act_on_(self, other, is_left):
|
|
228
|
+
r"""
|
|
229
|
+
Return the action of this argument on ``other``.
|
|
230
|
+
|
|
231
|
+
TESTS::
|
|
232
|
+
|
|
233
|
+
sage: # needs sage.symbolic
|
|
234
|
+
sage: from sage.groups.misc_gps.argument_groups import RootsOfUnityGroup
|
|
235
|
+
sage: U = RootsOfUnityGroup()
|
|
236
|
+
sage: U(-1) * 4
|
|
237
|
+
-4
|
|
238
|
+
sage: _.parent()
|
|
239
|
+
Symbolic Ring
|
|
240
|
+
sage: 4 * U(-1)
|
|
241
|
+
-4
|
|
242
|
+
sage: _.parent()
|
|
243
|
+
Symbolic Ring
|
|
244
|
+
sage: P = Permutation([1,2,3])
|
|
245
|
+
sage: U(-1) * P
|
|
246
|
+
Traceback (most recent call last):
|
|
247
|
+
...
|
|
248
|
+
TypeError: -1 (Group of Roots of Unity) cannot
|
|
249
|
+
(left-)act on [1, 2, 3] (Standard permutations)
|
|
250
|
+
> *previous* TypeError: no canonical coercion from
|
|
251
|
+
Standard permutations to Symbolic Ring
|
|
252
|
+
|
|
253
|
+
::
|
|
254
|
+
|
|
255
|
+
sage: # needs sage.symbolic
|
|
256
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentByElementGroup
|
|
257
|
+
sage: C = ArgumentByElementGroup(SR)
|
|
258
|
+
sage: C(-1) * 4
|
|
259
|
+
-4
|
|
260
|
+
sage: _.parent()
|
|
261
|
+
Symbolic Ring
|
|
262
|
+
sage: 4 * C(-1)
|
|
263
|
+
-4
|
|
264
|
+
sage: _.parent()
|
|
265
|
+
Symbolic Ring
|
|
266
|
+
"""
|
|
267
|
+
from sage.rings.abc import SymbolicRing
|
|
268
|
+
|
|
269
|
+
P = other.parent()
|
|
270
|
+
if isinstance(P, SymbolicRing):
|
|
271
|
+
S = P
|
|
272
|
+
else:
|
|
273
|
+
from sage.symbolic.ring import SR as S
|
|
274
|
+
try:
|
|
275
|
+
other = S.coerce(other)
|
|
276
|
+
except (TypeError, ValueError) as e:
|
|
277
|
+
from sage.rings.asymptotic.misc import combine_exceptions
|
|
278
|
+
raise combine_exceptions(
|
|
279
|
+
TypeError('{} ({}) cannot ({}-)act on '
|
|
280
|
+
'{} ({})'.format(
|
|
281
|
+
self, self.parent(),
|
|
282
|
+
'left' if is_left else 'right',
|
|
283
|
+
other, P)),
|
|
284
|
+
e)
|
|
285
|
+
return self._symbolic_(S) * other
|
|
286
|
+
|
|
287
|
+
def __abs__(self):
|
|
288
|
+
r"""
|
|
289
|
+
Return the absolute value of this argument which equals `1`.
|
|
290
|
+
|
|
291
|
+
TESTS::
|
|
292
|
+
|
|
293
|
+
sage: from sage.groups.misc_gps.argument_groups import RootsOfUnityGroup
|
|
294
|
+
sage: U = RootsOfUnityGroup()
|
|
295
|
+
sage: abs(U(exponent=1/4)) # indirect doctest
|
|
296
|
+
1
|
|
297
|
+
sage: _.parent()
|
|
298
|
+
Integer Ring
|
|
299
|
+
"""
|
|
300
|
+
from sage.rings.integer_ring import ZZ
|
|
301
|
+
return ZZ.one()
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
class AbstractArgumentGroup(UniqueRepresentation, Parent):
|
|
305
|
+
r"""
|
|
306
|
+
A group whose elements represent (complex) arguments.
|
|
307
|
+
|
|
308
|
+
INPUT:
|
|
309
|
+
|
|
310
|
+
- ``base`` -- a SageMath parent
|
|
311
|
+
|
|
312
|
+
- ``category`` -- a category
|
|
313
|
+
"""
|
|
314
|
+
|
|
315
|
+
Element = AbstractArgument
|
|
316
|
+
|
|
317
|
+
@staticmethod
|
|
318
|
+
def __classcall__(cls, base, category=None):
|
|
319
|
+
r"""
|
|
320
|
+
See :class:`AbstractArgumentGroup` for more information.
|
|
321
|
+
|
|
322
|
+
TESTS:
|
|
323
|
+
|
|
324
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup
|
|
325
|
+
sage: UnitCircleGroup(RR).category() # indirect doctest
|
|
326
|
+
Category of commutative groups
|
|
327
|
+
"""
|
|
328
|
+
category = cls._determine_category_(category)
|
|
329
|
+
return super().__classcall__(cls, base, category)
|
|
330
|
+
|
|
331
|
+
@staticmethod
|
|
332
|
+
def _determine_category_(category):
|
|
333
|
+
r"""
|
|
334
|
+
Return the category of this argument group.
|
|
335
|
+
|
|
336
|
+
INPUT:
|
|
337
|
+
|
|
338
|
+
- ``category`` -- a category or ``None`` (in which case the output
|
|
339
|
+
equals ``category``)
|
|
340
|
+
|
|
341
|
+
OUTPUT: a category
|
|
342
|
+
|
|
343
|
+
EXAMPLES::
|
|
344
|
+
|
|
345
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup
|
|
346
|
+
sage: UnitCircleGroup._determine_category_(None)
|
|
347
|
+
Category of commutative groups
|
|
348
|
+
sage: UnitCircleGroup._determine_category_(Groups())
|
|
349
|
+
Category of groups
|
|
350
|
+
"""
|
|
351
|
+
if category is None:
|
|
352
|
+
from sage.categories.groups import Groups
|
|
353
|
+
category = Groups().Commutative()
|
|
354
|
+
return category
|
|
355
|
+
|
|
356
|
+
def __init__(self, base, category):
|
|
357
|
+
r"""
|
|
358
|
+
See :class:`AbstractArgumentGroup` for more information.
|
|
359
|
+
|
|
360
|
+
TESTS:
|
|
361
|
+
|
|
362
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup
|
|
363
|
+
sage: UnitCircleGroup(RR).base() # indirect doctest
|
|
364
|
+
Real Field with 53 bits of precision
|
|
365
|
+
"""
|
|
366
|
+
super().__init__(category=category, base=base)
|
|
367
|
+
|
|
368
|
+
def __hash__(self):
|
|
369
|
+
r"""
|
|
370
|
+
Return a hash value of this argument group.
|
|
371
|
+
|
|
372
|
+
TESTS::
|
|
373
|
+
|
|
374
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup
|
|
375
|
+
sage: hash(UnitCircleGroup(RR)) # indirect doctest, random
|
|
376
|
+
42
|
|
377
|
+
"""
|
|
378
|
+
return hash((self.__class__, self.base()))
|
|
379
|
+
|
|
380
|
+
def _an_element_(self):
|
|
381
|
+
r"""
|
|
382
|
+
Return an element of this argument group.
|
|
383
|
+
|
|
384
|
+
TESTS::
|
|
385
|
+
|
|
386
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup
|
|
387
|
+
sage: UnitCircleGroup(RR).an_element() # indirect doctest
|
|
388
|
+
e^(2*pi*0.000000000000000)
|
|
389
|
+
"""
|
|
390
|
+
return self.element_class(self, self.base().an_element())
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
class UnitCirclePoint(AbstractArgument):
|
|
394
|
+
r"""
|
|
395
|
+
An element of :class:`UnitCircleGroup`
|
|
396
|
+
which is `e^{2\pi\cdot\mathit{exponent}}`.
|
|
397
|
+
|
|
398
|
+
INPUT:
|
|
399
|
+
|
|
400
|
+
- ``parent`` -- a SageMath parent
|
|
401
|
+
|
|
402
|
+
- ``exponent`` -- a number (of a subset of the reals)
|
|
403
|
+
|
|
404
|
+
- ``normalize`` -- boolean (default: ``True``)
|
|
405
|
+
"""
|
|
406
|
+
|
|
407
|
+
@staticmethod
|
|
408
|
+
def _normalize_(exponent):
|
|
409
|
+
r"""
|
|
410
|
+
Normalize the given exponent so that it is in `[0,1)`.
|
|
411
|
+
|
|
412
|
+
INPUT:
|
|
413
|
+
|
|
414
|
+
- ``exponent`` -- an element of the parent's base
|
|
415
|
+
|
|
416
|
+
OUTPUT: an element
|
|
417
|
+
|
|
418
|
+
TESTS::
|
|
419
|
+
|
|
420
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCirclePoint
|
|
421
|
+
sage: UnitCirclePoint._normalize_(3/2)
|
|
422
|
+
1/2
|
|
423
|
+
"""
|
|
424
|
+
return exponent - exponent.floor()
|
|
425
|
+
|
|
426
|
+
@property
|
|
427
|
+
def exponent(self):
|
|
428
|
+
r"""
|
|
429
|
+
The exponent of this point on the unit circle.
|
|
430
|
+
|
|
431
|
+
EXAMPLES::
|
|
432
|
+
|
|
433
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup
|
|
434
|
+
sage: C = UnitCircleGroup(RR)
|
|
435
|
+
sage: C(exponent=4/3).exponent
|
|
436
|
+
0.333333333333333
|
|
437
|
+
"""
|
|
438
|
+
return self._element_
|
|
439
|
+
|
|
440
|
+
def _repr_(self):
|
|
441
|
+
r"""
|
|
442
|
+
Return a representation string of this point on the unit circle.
|
|
443
|
+
|
|
444
|
+
TESTS::
|
|
445
|
+
|
|
446
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup
|
|
447
|
+
sage: C = UnitCircleGroup(RR)
|
|
448
|
+
sage: C(exponent=1/3)
|
|
449
|
+
e^(2*pi*0.333333333333333)
|
|
450
|
+
"""
|
|
451
|
+
return 'e^(2*pi*{})'.format(self.exponent)
|
|
452
|
+
|
|
453
|
+
def _symbolic_(self, R=None):
|
|
454
|
+
r"""
|
|
455
|
+
Return this point on the unit circle as a symbolic expression.
|
|
456
|
+
|
|
457
|
+
INPUT:
|
|
458
|
+
|
|
459
|
+
- ``R`` -- (a subring of) the symbolic ring or ``None``.
|
|
460
|
+
The output will be an element of ``R``. If ``None``,
|
|
461
|
+
then the symbolic ring is used.
|
|
462
|
+
|
|
463
|
+
OUTPUT: a symbolic expression
|
|
464
|
+
|
|
465
|
+
EXAMPLES::
|
|
466
|
+
|
|
467
|
+
sage: # needs sage.symbolic
|
|
468
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup
|
|
469
|
+
sage: C = UnitCircleGroup(RR)
|
|
470
|
+
sage: C(exponent=1/4)._symbolic_()
|
|
471
|
+
e^(0.500000000000000*I*pi)
|
|
472
|
+
sage: _.parent()
|
|
473
|
+
Symbolic Ring
|
|
474
|
+
|
|
475
|
+
sage: # needs sage.symbolic
|
|
476
|
+
sage: from sage.groups.misc_gps.argument_groups import RootsOfUnityGroup
|
|
477
|
+
sage: U = RootsOfUnityGroup()
|
|
478
|
+
sage: U(exponent=1/4)._symbolic_()
|
|
479
|
+
I
|
|
480
|
+
sage: _.parent()
|
|
481
|
+
Symbolic Ring
|
|
482
|
+
"""
|
|
483
|
+
from sage.functions.log import exp
|
|
484
|
+
from sage.symbolic.ring import SR
|
|
485
|
+
|
|
486
|
+
if R is None:
|
|
487
|
+
R = SR
|
|
488
|
+
|
|
489
|
+
return exp(2 * R('pi') * R('I') * self.exponent)
|
|
490
|
+
|
|
491
|
+
def _mul_(self, other):
|
|
492
|
+
r"""
|
|
493
|
+
Return the product of this point on the unit circle and ``other``.
|
|
494
|
+
|
|
495
|
+
TESTS::
|
|
496
|
+
|
|
497
|
+
sage: # needs sage.symbolic
|
|
498
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup
|
|
499
|
+
sage: C = UnitCircleGroup(RR)
|
|
500
|
+
sage: C(exponent=0.3) * C(exponent=0.4)
|
|
501
|
+
e^(2*pi*0.700000000000000)
|
|
502
|
+
"""
|
|
503
|
+
P = self.parent()
|
|
504
|
+
return P.element_class(P, self.exponent + other.exponent)
|
|
505
|
+
|
|
506
|
+
def __pow__(self, exponent):
|
|
507
|
+
r"""
|
|
508
|
+
Return the power of this point on the unit circle
|
|
509
|
+
to the given ``exponent``.
|
|
510
|
+
|
|
511
|
+
TESTS::
|
|
512
|
+
|
|
513
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup, RootsOfUnityGroup
|
|
514
|
+
|
|
515
|
+
sage: C = UnitCircleGroup(RR)
|
|
516
|
+
sage: C(exponent=0.1)^2
|
|
517
|
+
e^(2*pi*0.200000000000000)
|
|
518
|
+
sage: _.parent()
|
|
519
|
+
Unit Circle Group with Exponents in
|
|
520
|
+
Real Field with 53 bits of precision modulo ZZ
|
|
521
|
+
sage: C(exponent=0.1)^QQ(2/1)
|
|
522
|
+
e^(2*pi*0.200000000000000)
|
|
523
|
+
sage: _.parent()
|
|
524
|
+
Unit Circle Group with Exponents in
|
|
525
|
+
Real Field with 53 bits of precision modulo ZZ
|
|
526
|
+
|
|
527
|
+
sage: U = RootsOfUnityGroup()
|
|
528
|
+
sage: a = U(exponent=1/7); a
|
|
529
|
+
zeta7
|
|
530
|
+
sage: a^(7/3)
|
|
531
|
+
zeta3
|
|
532
|
+
sage: _.parent()
|
|
533
|
+
Group of Roots of Unity
|
|
534
|
+
|
|
535
|
+
sage: U(exponent=1/3)^(0.25)
|
|
536
|
+
e^(2*pi*0.0833333333333333)
|
|
537
|
+
sage: _.parent()
|
|
538
|
+
Unit Circle Group with Exponents in
|
|
539
|
+
Real Field with 53 bits of precision modulo ZZ
|
|
540
|
+
|
|
541
|
+
sage: # needs sage.symbolic
|
|
542
|
+
sage: U(exponent=1/3)^x
|
|
543
|
+
(1/2*I*sqrt(3) - 1/2)^x
|
|
544
|
+
sage: U(exponent=1/2)^x
|
|
545
|
+
(-1)^x
|
|
546
|
+
sage: U(exponent=1/4)^x
|
|
547
|
+
I^x
|
|
548
|
+
sage: U(exponent=1/4)^SR(8)
|
|
549
|
+
1
|
|
550
|
+
"""
|
|
551
|
+
from sage.rings.abc import SymbolicRing
|
|
552
|
+
|
|
553
|
+
new_exponent = self.exponent * exponent
|
|
554
|
+
parent = new_exponent.parent()
|
|
555
|
+
if isinstance(new_exponent.parent(), SymbolicRing):
|
|
556
|
+
return self._symbolic_(parent) ** exponent
|
|
557
|
+
return self.parent()._create_element_in_extension_(new_exponent)
|
|
558
|
+
|
|
559
|
+
def __invert__(self):
|
|
560
|
+
r"""
|
|
561
|
+
Return the inverse of this point on the unit circle.
|
|
562
|
+
|
|
563
|
+
TESTS::
|
|
564
|
+
|
|
565
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup
|
|
566
|
+
sage: C = UnitCircleGroup(RR)
|
|
567
|
+
sage: ~C(exponent=0.4)
|
|
568
|
+
e^(2*pi*0.600000000000000)
|
|
569
|
+
sage: C(1) / C(exponent=0.4)
|
|
570
|
+
e^(2*pi*0.600000000000000)
|
|
571
|
+
sage: C(exponent=0) / C(exponent=0.42)
|
|
572
|
+
e^(2*pi*0.580000000000000)
|
|
573
|
+
"""
|
|
574
|
+
P = self.parent()
|
|
575
|
+
return P.element_class(P, -self.exponent)
|
|
576
|
+
|
|
577
|
+
def is_one(self):
|
|
578
|
+
r"""
|
|
579
|
+
Return whether this point on the unit circle is `1`.
|
|
580
|
+
|
|
581
|
+
EXAMPLES::
|
|
582
|
+
|
|
583
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup
|
|
584
|
+
sage: C = UnitCircleGroup(QQ)
|
|
585
|
+
sage: C(exponent=0).is_one()
|
|
586
|
+
True
|
|
587
|
+
sage: C(exponent=1/2).is_one()
|
|
588
|
+
False
|
|
589
|
+
sage: C(exponent=2/3).is_one()
|
|
590
|
+
False
|
|
591
|
+
sage: C(exponent=42).is_one()
|
|
592
|
+
True
|
|
593
|
+
"""
|
|
594
|
+
return self.exponent == 0
|
|
595
|
+
|
|
596
|
+
def is_minus_one(self):
|
|
597
|
+
r"""
|
|
598
|
+
Return whether this point on the unit circle is `-1`.
|
|
599
|
+
|
|
600
|
+
EXAMPLES::
|
|
601
|
+
|
|
602
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup
|
|
603
|
+
sage: C = UnitCircleGroup(QQ)
|
|
604
|
+
sage: C(exponent=0).is_minus_one()
|
|
605
|
+
False
|
|
606
|
+
sage: C(exponent=1/2).is_minus_one()
|
|
607
|
+
True
|
|
608
|
+
sage: C(exponent=2/3).is_minus_one()
|
|
609
|
+
False
|
|
610
|
+
"""
|
|
611
|
+
from sage.rings.rational_field import QQ
|
|
612
|
+
return self.exponent == QQ((1, 2))
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
class UnitCircleGroup(AbstractArgumentGroup):
|
|
616
|
+
r"""
|
|
617
|
+
A group of points on the unit circle. These points are
|
|
618
|
+
represented by `e^{2\pi\cdot\mathit{exponent}}`.
|
|
619
|
+
|
|
620
|
+
INPUT:
|
|
621
|
+
|
|
622
|
+
- ``base`` -- a SageMath parent representing a subset of the reals
|
|
623
|
+
|
|
624
|
+
- ``category`` -- a category
|
|
625
|
+
|
|
626
|
+
EXAMPLES::
|
|
627
|
+
|
|
628
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup
|
|
629
|
+
|
|
630
|
+
sage: R = UnitCircleGroup(RR); R
|
|
631
|
+
Unit Circle Group with Exponents in Real Field with 53 bits of precision modulo ZZ
|
|
632
|
+
sage: R(exponent=2.42)
|
|
633
|
+
e^(2*pi*0.420000000000000)
|
|
634
|
+
|
|
635
|
+
sage: Q = UnitCircleGroup(QQ); Q
|
|
636
|
+
Unit Circle Group with Exponents in Rational Field modulo ZZ
|
|
637
|
+
sage: Q(exponent=6/5)
|
|
638
|
+
e^(2*pi*1/5)
|
|
639
|
+
"""
|
|
640
|
+
|
|
641
|
+
Element = UnitCirclePoint
|
|
642
|
+
|
|
643
|
+
def _repr_(self):
|
|
644
|
+
r"""
|
|
645
|
+
Return a representation string of this unit circle group.
|
|
646
|
+
|
|
647
|
+
TESTS::
|
|
648
|
+
|
|
649
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup
|
|
650
|
+
sage: UnitCircleGroup(RR) # indirect doctest
|
|
651
|
+
Unit Circle Group with Exponents in Real Field with 53 bits of precision modulo ZZ
|
|
652
|
+
"""
|
|
653
|
+
return 'Unit Circle Group with Exponents in {} modulo ZZ'.format(self.base())
|
|
654
|
+
|
|
655
|
+
def _repr_short_(self):
|
|
656
|
+
r"""
|
|
657
|
+
Return a short representation string of this unit circle group.
|
|
658
|
+
|
|
659
|
+
TESTS::
|
|
660
|
+
|
|
661
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup
|
|
662
|
+
sage: UnitCircleGroup(RR)._repr_short_()
|
|
663
|
+
'UU_RR'
|
|
664
|
+
"""
|
|
665
|
+
from sage.rings.asymptotic.misc import parent_to_repr_short
|
|
666
|
+
s = parent_to_repr_short(self.base())
|
|
667
|
+
if ' ' in s:
|
|
668
|
+
s = '({})'.format(s)
|
|
669
|
+
return 'UU_{}'.format(s)
|
|
670
|
+
|
|
671
|
+
def _element_constructor_(self, data, exponent=None, **kwds):
|
|
672
|
+
r"""
|
|
673
|
+
Construct an element out of the given data.
|
|
674
|
+
|
|
675
|
+
INPUT:
|
|
676
|
+
|
|
677
|
+
- ``data`` -- an object
|
|
678
|
+
|
|
679
|
+
- ``exponent`` -- a number (of a subset of the reals) or ``None``
|
|
680
|
+
|
|
681
|
+
- ``kwds`` -- are passed on to element
|
|
682
|
+
|
|
683
|
+
OUTPUT: a :class:`UnitCirclePoint`
|
|
684
|
+
|
|
685
|
+
TESTS::
|
|
686
|
+
|
|
687
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup, RootsOfUnityGroup, SignGroup
|
|
688
|
+
sage: R = UnitCircleGroup(RR)
|
|
689
|
+
sage: R(exponent=1/2)
|
|
690
|
+
e^(2*pi*0.500000000000000)
|
|
691
|
+
|
|
692
|
+
sage: U = RootsOfUnityGroup()
|
|
693
|
+
sage: U(exponent=0)
|
|
694
|
+
1
|
|
695
|
+
sage: U(exponent=1)
|
|
696
|
+
1
|
|
697
|
+
sage: U(exponent=1/2)
|
|
698
|
+
-1
|
|
699
|
+
sage: U(exponent=1/4)
|
|
700
|
+
I
|
|
701
|
+
sage: U(exponent=1/3)
|
|
702
|
+
zeta3
|
|
703
|
+
|
|
704
|
+
sage: C.<z> = CyclotomicField(6) # needs sage.rings.number_field
|
|
705
|
+
sage: z, U(z) # needs sage.rings.number_field
|
|
706
|
+
(z, zeta6)
|
|
707
|
+
sage: z^2, U(z^2) # needs sage.rings.number_field
|
|
708
|
+
(z - 1, zeta3)
|
|
709
|
+
|
|
710
|
+
sage: U(ZZ(-1))
|
|
711
|
+
-1
|
|
712
|
+
sage: U(QQ(-1))
|
|
713
|
+
-1
|
|
714
|
+
sage: U(int(-1))
|
|
715
|
+
-1
|
|
716
|
+
|
|
717
|
+
sage: S = SignGroup()
|
|
718
|
+
sage: R(S(1))
|
|
719
|
+
e^(2*pi*0.000000000000000)
|
|
720
|
+
sage: R(S(-1))
|
|
721
|
+
e^(2*pi*0.500000000000000)
|
|
722
|
+
sage: U(S(1))
|
|
723
|
+
1
|
|
724
|
+
sage: U(S(-1))
|
|
725
|
+
-1
|
|
726
|
+
|
|
727
|
+
sage: R(U(exponent=1/3))
|
|
728
|
+
e^(2*pi*0.333333333333333)
|
|
729
|
+
|
|
730
|
+
sage: U(exponent=5/2, normalize=False)
|
|
731
|
+
zeta2^5
|
|
732
|
+
"""
|
|
733
|
+
from sage.groups.generic import discrete_log
|
|
734
|
+
import sage.rings.abc
|
|
735
|
+
from sage.rings.asymptotic.misc import combine_exceptions
|
|
736
|
+
from sage.rings.rational_field import QQ
|
|
737
|
+
|
|
738
|
+
if exponent is None:
|
|
739
|
+
if isinstance(data, int) and data == 0:
|
|
740
|
+
raise ValueError('no input specified')
|
|
741
|
+
|
|
742
|
+
elif isinstance(data, self.element_class):
|
|
743
|
+
if data.parent() == self:
|
|
744
|
+
return data
|
|
745
|
+
exponent = data.exponent
|
|
746
|
+
|
|
747
|
+
elif data == 1 or data == '1':
|
|
748
|
+
exponent = 0
|
|
749
|
+
|
|
750
|
+
elif data == -1 or data == '-1':
|
|
751
|
+
exponent = QQ((1, 2))
|
|
752
|
+
|
|
753
|
+
else:
|
|
754
|
+
try:
|
|
755
|
+
P = data.parent()
|
|
756
|
+
except AttributeError:
|
|
757
|
+
raise TypeError('{} is not in {}'.format(data, self))
|
|
758
|
+
|
|
759
|
+
if isinstance(P, SignGroup):
|
|
760
|
+
if data.is_one():
|
|
761
|
+
exponent = 0
|
|
762
|
+
elif data.is_minus_one():
|
|
763
|
+
exponent = QQ((1, 2))
|
|
764
|
+
|
|
765
|
+
elif isinstance(P, UnitCircleGroup):
|
|
766
|
+
exponent = data.exponent
|
|
767
|
+
|
|
768
|
+
elif isinstance(P, sage.rings.abc.NumberField_cyclotomic):
|
|
769
|
+
zeta = P.gen()
|
|
770
|
+
n = zeta.multiplicative_order()
|
|
771
|
+
try:
|
|
772
|
+
exponent = QQ(discrete_log(data, zeta)) / QQ(n)
|
|
773
|
+
except ValueError as e:
|
|
774
|
+
raise combine_exceptions(
|
|
775
|
+
ValueError('{} is not in {}'.format(data, self)), e)
|
|
776
|
+
|
|
777
|
+
if exponent is None:
|
|
778
|
+
raise ValueError('{} is not in {}'.format(data, self))
|
|
779
|
+
|
|
780
|
+
elif not isinstance(data, int) or data != 0:
|
|
781
|
+
raise ValueError('input is ambiguous: '
|
|
782
|
+
'{} as well as exponent={} '
|
|
783
|
+
'specified'.format(data, exponent))
|
|
784
|
+
|
|
785
|
+
return self.element_class(self, exponent, **kwds)
|
|
786
|
+
|
|
787
|
+
def _create_element_in_extension_(self, exponent):
|
|
788
|
+
r"""
|
|
789
|
+
Create an element in an extension of this unit circle group which
|
|
790
|
+
is chosen according to the input ``exponent``.
|
|
791
|
+
|
|
792
|
+
INPUT:
|
|
793
|
+
|
|
794
|
+
- ``exponent`` -- the element data
|
|
795
|
+
|
|
796
|
+
OUTPUT: an element
|
|
797
|
+
|
|
798
|
+
EXAMPLES::
|
|
799
|
+
|
|
800
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup, RootsOfUnityGroup
|
|
801
|
+
|
|
802
|
+
sage: C = UnitCircleGroup(QQ)
|
|
803
|
+
sage: C._create_element_in_extension_(2.12).parent() # needs sage.rings.number_field
|
|
804
|
+
Unit Circle Group with Exponents in
|
|
805
|
+
Real Field with 53 bits of precision modulo ZZ
|
|
806
|
+
|
|
807
|
+
sage: U = RootsOfUnityGroup()
|
|
808
|
+
sage: U._create_element_in_extension_(2.12).parent() # needs sage.rings.number_field
|
|
809
|
+
Unit Circle Group with Exponents in
|
|
810
|
+
Real Field with 53 bits of precision modulo ZZ
|
|
811
|
+
"""
|
|
812
|
+
if exponent.parent() is self.base():
|
|
813
|
+
parent = self
|
|
814
|
+
else:
|
|
815
|
+
parent = ArgumentGroup(exponents=exponent.parent())
|
|
816
|
+
return parent(exponent=exponent)
|
|
817
|
+
|
|
818
|
+
def _coerce_map_from_(self, R):
|
|
819
|
+
r"""
|
|
820
|
+
Return whether ``R`` coerces into this unit circle group.
|
|
821
|
+
|
|
822
|
+
INPUT:
|
|
823
|
+
|
|
824
|
+
- ``R`` -- a parent
|
|
825
|
+
|
|
826
|
+
OUTPUT: boolean
|
|
827
|
+
|
|
828
|
+
TESTS::
|
|
829
|
+
|
|
830
|
+
sage: from sage.groups.misc_gps.argument_groups import UnitCircleGroup, RootsOfUnityGroup, SignGroup
|
|
831
|
+
sage: R = UnitCircleGroup(RR)
|
|
832
|
+
sage: Q = UnitCircleGroup(QQ)
|
|
833
|
+
sage: U = RootsOfUnityGroup()
|
|
834
|
+
sage: S = SignGroup()
|
|
835
|
+
sage: for A in (S, U, Q, R): # indirect doctest
|
|
836
|
+
....: for B in (S, U, Q, R):
|
|
837
|
+
....: print('{} has {}coerce map from {}'.format(
|
|
838
|
+
....: A,
|
|
839
|
+
....: '' if A.has_coerce_map_from(B) else 'no ',
|
|
840
|
+
....: B))
|
|
841
|
+
Sign Group
|
|
842
|
+
has coerce map from
|
|
843
|
+
Sign Group
|
|
844
|
+
Sign Group
|
|
845
|
+
has no coerce map from
|
|
846
|
+
Group of Roots of Unity
|
|
847
|
+
Sign Group
|
|
848
|
+
has no coerce map from
|
|
849
|
+
Unit Circle Group with Exponents in Rational Field modulo ZZ
|
|
850
|
+
Sign Group
|
|
851
|
+
has no coerce map from
|
|
852
|
+
Unit Circle Group with Exponents in Real Field with 53 bits of precision modulo ZZ
|
|
853
|
+
Group of Roots of Unity
|
|
854
|
+
has coerce map from
|
|
855
|
+
Sign Group
|
|
856
|
+
Group of Roots of Unity
|
|
857
|
+
has coerce map from
|
|
858
|
+
Group of Roots of Unity
|
|
859
|
+
Group of Roots of Unity
|
|
860
|
+
has coerce map from
|
|
861
|
+
Unit Circle Group with Exponents in Rational Field modulo ZZ
|
|
862
|
+
Group of Roots of Unity
|
|
863
|
+
has no coerce map from
|
|
864
|
+
Unit Circle Group with Exponents in Real Field with 53 bits of precision modulo ZZ
|
|
865
|
+
Unit Circle Group with Exponents in Rational Field modulo ZZ
|
|
866
|
+
has coerce map from
|
|
867
|
+
Sign Group
|
|
868
|
+
Unit Circle Group with Exponents in Rational Field modulo ZZ
|
|
869
|
+
has coerce map from
|
|
870
|
+
Group of Roots of Unity
|
|
871
|
+
Unit Circle Group with Exponents in Rational Field modulo ZZ
|
|
872
|
+
has coerce map from
|
|
873
|
+
Unit Circle Group with Exponents in Rational Field modulo ZZ
|
|
874
|
+
Unit Circle Group with Exponents in Rational Field modulo ZZ
|
|
875
|
+
has no coerce map from
|
|
876
|
+
Unit Circle Group with Exponents in Real Field with 53 bits of precision modulo ZZ
|
|
877
|
+
Unit Circle Group with Exponents in Real Field with 53 bits of precision modulo ZZ
|
|
878
|
+
has coerce map from
|
|
879
|
+
Sign Group
|
|
880
|
+
Unit Circle Group with Exponents in Real Field with 53 bits of precision modulo ZZ
|
|
881
|
+
has coerce map from
|
|
882
|
+
Group of Roots of Unity
|
|
883
|
+
Unit Circle Group with Exponents in Real Field with 53 bits of precision modulo ZZ
|
|
884
|
+
has coerce map from
|
|
885
|
+
Unit Circle Group with Exponents in Rational Field modulo ZZ
|
|
886
|
+
Unit Circle Group with Exponents in Real Field with 53 bits of precision modulo ZZ
|
|
887
|
+
has coerce map from
|
|
888
|
+
Unit Circle Group with Exponents in Real Field with 53 bits of precision modulo ZZ
|
|
889
|
+
"""
|
|
890
|
+
if isinstance(R, UnitCircleGroup):
|
|
891
|
+
return self.base().has_coerce_map_from(R.base())
|
|
892
|
+
if isinstance(R, SignGroup):
|
|
893
|
+
return True
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
class RootOfUnity(UnitCirclePoint):
|
|
897
|
+
r"""
|
|
898
|
+
A root of unity (i.e. an element of :class:`RootsOfUnityGroup`)
|
|
899
|
+
which is `e^{2\pi\cdot\mathit{exponent}}` for a rational ``exponent``.
|
|
900
|
+
"""
|
|
901
|
+
|
|
902
|
+
def exponent_numerator(self):
|
|
903
|
+
r"""
|
|
904
|
+
Return the numerator of the rational quotient in `[0,1)`
|
|
905
|
+
representing the exponent of this root of unity.
|
|
906
|
+
|
|
907
|
+
EXAMPLES::
|
|
908
|
+
|
|
909
|
+
sage: from sage.groups.misc_gps.argument_groups import RootsOfUnityGroup
|
|
910
|
+
sage: U = RootsOfUnityGroup()
|
|
911
|
+
sage: a = U(exponent=2/3); a
|
|
912
|
+
zeta3^2
|
|
913
|
+
sage: a.exponent_numerator()
|
|
914
|
+
2
|
|
915
|
+
"""
|
|
916
|
+
return self.exponent.numerator()
|
|
917
|
+
|
|
918
|
+
def exponent_denominator(self):
|
|
919
|
+
r"""
|
|
920
|
+
Return the denominator of the rational quotient in `[0,1)`
|
|
921
|
+
representing the exponent of this root of unity.
|
|
922
|
+
|
|
923
|
+
EXAMPLES::
|
|
924
|
+
|
|
925
|
+
sage: from sage.groups.misc_gps.argument_groups import RootsOfUnityGroup
|
|
926
|
+
sage: U = RootsOfUnityGroup()
|
|
927
|
+
sage: a = U(exponent=2/3); a
|
|
928
|
+
zeta3^2
|
|
929
|
+
sage: a.exponent_denominator()
|
|
930
|
+
3
|
|
931
|
+
"""
|
|
932
|
+
return self.exponent.denominator()
|
|
933
|
+
|
|
934
|
+
def _repr_(self):
|
|
935
|
+
r"""
|
|
936
|
+
Return a representation string of this root of unity.
|
|
937
|
+
|
|
938
|
+
TESTS::
|
|
939
|
+
|
|
940
|
+
sage: from sage.groups.misc_gps.argument_groups import RootsOfUnityGroup
|
|
941
|
+
sage: U = RootsOfUnityGroup()
|
|
942
|
+
sage: U(exponent=0)
|
|
943
|
+
1
|
|
944
|
+
sage: U(exponent=1/2)
|
|
945
|
+
-1
|
|
946
|
+
sage: U(exponent=1/4)
|
|
947
|
+
I
|
|
948
|
+
sage: U(exponent=3/4)
|
|
949
|
+
-I
|
|
950
|
+
sage: U(exponent=1/3)
|
|
951
|
+
zeta3
|
|
952
|
+
sage: U(exponent=2/3)
|
|
953
|
+
zeta3^2
|
|
954
|
+
"""
|
|
955
|
+
from sage.rings.rational_field import QQ
|
|
956
|
+
if self.exponent == 0:
|
|
957
|
+
return '1'
|
|
958
|
+
if self.exponent == QQ((1, 2)):
|
|
959
|
+
return '-1'
|
|
960
|
+
if self.exponent == QQ((1, 4)):
|
|
961
|
+
return 'I'
|
|
962
|
+
if self.exponent == QQ((3, 4)):
|
|
963
|
+
return '-I'
|
|
964
|
+
num = self.exponent_numerator()
|
|
965
|
+
den = self.exponent_denominator()
|
|
966
|
+
zeta = 'zeta{}'.format(den)
|
|
967
|
+
if num == 1:
|
|
968
|
+
return zeta
|
|
969
|
+
return '{}^{}'.format(zeta, num)
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
class RootsOfUnityGroup(UnitCircleGroup):
|
|
973
|
+
r"""
|
|
974
|
+
The group of all roots of unity.
|
|
975
|
+
|
|
976
|
+
INPUT:
|
|
977
|
+
|
|
978
|
+
- ``category`` -- a category
|
|
979
|
+
|
|
980
|
+
This is a specialized :class:`UnitCircleGroup` with base `\QQ`.
|
|
981
|
+
|
|
982
|
+
EXAMPLES::
|
|
983
|
+
|
|
984
|
+
sage: from sage.groups.misc_gps.argument_groups import RootsOfUnityGroup
|
|
985
|
+
sage: U = RootsOfUnityGroup(); U
|
|
986
|
+
Group of Roots of Unity
|
|
987
|
+
sage: U(exponent=1/4)
|
|
988
|
+
I
|
|
989
|
+
"""
|
|
990
|
+
|
|
991
|
+
Element = RootOfUnity
|
|
992
|
+
|
|
993
|
+
@staticmethod
|
|
994
|
+
def __classcall__(cls, category=None):
|
|
995
|
+
r"""
|
|
996
|
+
See :class:`RootsOfUnityGroup` for more information.
|
|
997
|
+
|
|
998
|
+
TESTS:
|
|
999
|
+
|
|
1000
|
+
sage: from sage.groups.misc_gps.argument_groups import RootsOfUnityGroup
|
|
1001
|
+
sage: RootsOfUnityGroup().category() # indirect doctest
|
|
1002
|
+
Category of commutative groups
|
|
1003
|
+
"""
|
|
1004
|
+
category = cls._determine_category_(category)
|
|
1005
|
+
return super(AbstractArgumentGroup, cls).__classcall__(cls, category)
|
|
1006
|
+
|
|
1007
|
+
def __init__(self, category):
|
|
1008
|
+
r"""
|
|
1009
|
+
See :class:`RootsOfUnityGroup` for more information.
|
|
1010
|
+
|
|
1011
|
+
TESTS:
|
|
1012
|
+
|
|
1013
|
+
sage: from sage.groups.misc_gps.argument_groups import RootsOfUnityGroup
|
|
1014
|
+
sage: RootsOfUnityGroup().base() # indirect doctest
|
|
1015
|
+
Rational Field
|
|
1016
|
+
"""
|
|
1017
|
+
from sage.rings.rational_field import QQ
|
|
1018
|
+
super().__init__(base=QQ, category=category)
|
|
1019
|
+
|
|
1020
|
+
def _repr_(self):
|
|
1021
|
+
r"""
|
|
1022
|
+
Return a representation string of this roots of unity group.
|
|
1023
|
+
|
|
1024
|
+
TESTS:
|
|
1025
|
+
|
|
1026
|
+
sage: from sage.groups.misc_gps.argument_groups import RootsOfUnityGroup
|
|
1027
|
+
sage: RootsOfUnityGroup() # indirect doctest
|
|
1028
|
+
Group of Roots of Unity
|
|
1029
|
+
"""
|
|
1030
|
+
return 'Group of Roots of Unity'
|
|
1031
|
+
|
|
1032
|
+
def _repr_short_(self):
|
|
1033
|
+
r"""
|
|
1034
|
+
Return a short representation string of this roots of unity group.
|
|
1035
|
+
|
|
1036
|
+
TESTS:
|
|
1037
|
+
|
|
1038
|
+
sage: from sage.groups.misc_gps.argument_groups import RootsOfUnityGroup
|
|
1039
|
+
sage: RootsOfUnityGroup()._repr_short_()
|
|
1040
|
+
'UU'
|
|
1041
|
+
"""
|
|
1042
|
+
return 'UU'
|
|
1043
|
+
|
|
1044
|
+
|
|
1045
|
+
class ArgumentByElement(AbstractArgument):
|
|
1046
|
+
r"""
|
|
1047
|
+
An element of :class:`ArgumentByElementGroup`.
|
|
1048
|
+
|
|
1049
|
+
INPUT:
|
|
1050
|
+
|
|
1051
|
+
- ``parent`` -- a SageMath parent
|
|
1052
|
+
|
|
1053
|
+
- ``element`` -- a nonzero element of the parent's base
|
|
1054
|
+
|
|
1055
|
+
- ``normalize`` -- boolean (default: ``True``)
|
|
1056
|
+
"""
|
|
1057
|
+
|
|
1058
|
+
def __init__(self, parent, element, normalize=True):
|
|
1059
|
+
r"""
|
|
1060
|
+
See :class:`ArgumentByElement` for more information.
|
|
1061
|
+
|
|
1062
|
+
TESTS::
|
|
1063
|
+
|
|
1064
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentByElementGroup
|
|
1065
|
+
sage: C = ArgumentByElementGroup(CC)
|
|
1066
|
+
sage: C(1+2*I) # indirect doctest # needs sage.symbolic
|
|
1067
|
+
e^(I*arg(1.00000000000000 + 2.00000000000000*I))
|
|
1068
|
+
"""
|
|
1069
|
+
super().__init__(parent, element, normalize=normalize)
|
|
1070
|
+
if self._element_ == 0:
|
|
1071
|
+
raise ValueError('{} is not allowed'.format(element))
|
|
1072
|
+
|
|
1073
|
+
@staticmethod
|
|
1074
|
+
def _normalize_(element):
|
|
1075
|
+
r"""
|
|
1076
|
+
Normalize the given element.
|
|
1077
|
+
|
|
1078
|
+
This is the identity for :class:`ArgumentByElement`.
|
|
1079
|
+
|
|
1080
|
+
INPUT:
|
|
1081
|
+
|
|
1082
|
+
- ``element`` -- an element of the parent's base
|
|
1083
|
+
|
|
1084
|
+
OUTPUT: an element
|
|
1085
|
+
|
|
1086
|
+
TESTS::
|
|
1087
|
+
|
|
1088
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentByElement
|
|
1089
|
+
sage: ArgumentByElement._normalize_(3/2)
|
|
1090
|
+
3/2
|
|
1091
|
+
"""
|
|
1092
|
+
return element
|
|
1093
|
+
|
|
1094
|
+
def _repr_(self):
|
|
1095
|
+
r"""
|
|
1096
|
+
Return a representation string of this argument by element.
|
|
1097
|
+
|
|
1098
|
+
TESTS::
|
|
1099
|
+
|
|
1100
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentByElementGroup
|
|
1101
|
+
sage: C = ArgumentByElementGroup(CC)
|
|
1102
|
+
sage: C(2+3*I) # indirect doctest # needs sage.symbolic
|
|
1103
|
+
e^(I*arg(2.00000000000000 + 3.00000000000000*I))
|
|
1104
|
+
"""
|
|
1105
|
+
return 'e^(I*arg({}))'.format(self._element_)
|
|
1106
|
+
|
|
1107
|
+
def _symbolic_(self, R=None):
|
|
1108
|
+
r"""
|
|
1109
|
+
Return this argument by element as a symbolic expression.
|
|
1110
|
+
|
|
1111
|
+
INPUT:
|
|
1112
|
+
|
|
1113
|
+
- ``R`` -- (a subring of) the symbolic ring or ``None``.
|
|
1114
|
+
The output will be an element of ``R``. If ``None``,
|
|
1115
|
+
then the symbolic ring is used.
|
|
1116
|
+
|
|
1117
|
+
OUTPUT: a symbolic expression
|
|
1118
|
+
|
|
1119
|
+
EXAMPLES::
|
|
1120
|
+
|
|
1121
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentByElementGroup
|
|
1122
|
+
sage: C = ArgumentByElementGroup(ZZ)
|
|
1123
|
+
sage: C(-2)._symbolic_() # needs sage.symbolic
|
|
1124
|
+
-1
|
|
1125
|
+
sage: _.parent() # needs sage.symbolic
|
|
1126
|
+
Symbolic Ring
|
|
1127
|
+
"""
|
|
1128
|
+
from sage.functions.log import exp
|
|
1129
|
+
from sage.functions.other import arg
|
|
1130
|
+
from sage.symbolic.ring import SR
|
|
1131
|
+
|
|
1132
|
+
if R is None:
|
|
1133
|
+
R = SR
|
|
1134
|
+
|
|
1135
|
+
return exp(R('I') * arg(self._element_))
|
|
1136
|
+
|
|
1137
|
+
def _mul_(self, other):
|
|
1138
|
+
r"""
|
|
1139
|
+
Return the product of this argument by element with ``other``.
|
|
1140
|
+
|
|
1141
|
+
TESTS::
|
|
1142
|
+
|
|
1143
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentByElementGroup
|
|
1144
|
+
sage: C = ArgumentByElementGroup(CC)
|
|
1145
|
+
sage: C(I) * C(1 + I) # indirect doctest # needs sage.symbolic
|
|
1146
|
+
e^(I*arg(-1.00000000000000 + 1.00000000000000*I))
|
|
1147
|
+
"""
|
|
1148
|
+
P = self.parent()
|
|
1149
|
+
return P.element_class(P, self._element_ * other._element_)
|
|
1150
|
+
|
|
1151
|
+
def __pow__(self, exponent):
|
|
1152
|
+
r"""
|
|
1153
|
+
Return the power of this argument by element
|
|
1154
|
+
to the given ``exponent``.
|
|
1155
|
+
|
|
1156
|
+
TESTS::
|
|
1157
|
+
|
|
1158
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentByElementGroup
|
|
1159
|
+
|
|
1160
|
+
sage: # needs sage.symbolic
|
|
1161
|
+
sage: C = ArgumentByElementGroup(CC)
|
|
1162
|
+
sage: C(I)^5 # indirect doctest
|
|
1163
|
+
e^(I*arg(1.00000000000000*I))
|
|
1164
|
+
sage: _.parent()
|
|
1165
|
+
Unit Circle Group with Argument of Elements in
|
|
1166
|
+
Complex Field with 53 bits of precision
|
|
1167
|
+
sage: C(1+I)^3 # indirect doctest
|
|
1168
|
+
e^(I*arg(-2.00000000000000 + 2.00000000000000*I))
|
|
1169
|
+
sage: _.parent()
|
|
1170
|
+
Unit Circle Group with Argument of Elements in
|
|
1171
|
+
Complex Field with 53 bits of precision
|
|
1172
|
+
|
|
1173
|
+
sage: C = ArgumentByElementGroup(RR)
|
|
1174
|
+
sage: C(0.42)^CC(2.4)
|
|
1175
|
+
e^(I*arg(0.124680431591996))
|
|
1176
|
+
sage: _.parent()
|
|
1177
|
+
Unit Circle Group with Argument of Elements in
|
|
1178
|
+
Complex Field with 53 bits of precision
|
|
1179
|
+
|
|
1180
|
+
sage: # needs sage.symbolic
|
|
1181
|
+
sage: C = ArgumentByElementGroup(QQ)
|
|
1182
|
+
sage: a = C(-20)^x; a
|
|
1183
|
+
(-1)^x
|
|
1184
|
+
sage: a.parent()
|
|
1185
|
+
Symbolic Ring
|
|
1186
|
+
"""
|
|
1187
|
+
from sage.rings.abc import SymbolicRing
|
|
1188
|
+
|
|
1189
|
+
element = self._element_ ** exponent
|
|
1190
|
+
parent = element.parent()
|
|
1191
|
+
if isinstance(parent, SymbolicRing):
|
|
1192
|
+
return self._symbolic_(parent) ** exponent
|
|
1193
|
+
return self.parent()._create_element_in_extension_(element)
|
|
1194
|
+
|
|
1195
|
+
def __invert__(self):
|
|
1196
|
+
r"""
|
|
1197
|
+
Return the inverse of this argument by element.
|
|
1198
|
+
|
|
1199
|
+
TESTS::
|
|
1200
|
+
|
|
1201
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentByElementGroup
|
|
1202
|
+
sage: C = ArgumentByElementGroup(CC)
|
|
1203
|
+
sage: ~C(I) # indirect doctest # needs sage.symbolic
|
|
1204
|
+
e^(I*arg(-1.00000000000000*I))
|
|
1205
|
+
"""
|
|
1206
|
+
P = self.parent()
|
|
1207
|
+
return P.element_class(P, ~self._element_)
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
class ArgumentByElementGroup(AbstractArgumentGroup):
|
|
1211
|
+
r"""
|
|
1212
|
+
A group of (complex) arguments. The arguments are represented
|
|
1213
|
+
by a the formal argument of an element, i.e.,
|
|
1214
|
+
by `\mathrm{arg}(\mathit{element})`.
|
|
1215
|
+
|
|
1216
|
+
INPUT:
|
|
1217
|
+
|
|
1218
|
+
- ``base`` -- a SageMath parent representing a subset of the complex plane
|
|
1219
|
+
|
|
1220
|
+
- ``category`` -- a category
|
|
1221
|
+
|
|
1222
|
+
EXAMPLES::
|
|
1223
|
+
|
|
1224
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentByElementGroup
|
|
1225
|
+
sage: C = ArgumentByElementGroup(CC); C
|
|
1226
|
+
Unit Circle Group with Argument of Elements in
|
|
1227
|
+
Complex Field with 53 bits of precision
|
|
1228
|
+
sage: C(1 + 2*I) # needs sage.symbolic
|
|
1229
|
+
e^(I*arg(1.00000000000000 + 2.00000000000000*I))
|
|
1230
|
+
"""
|
|
1231
|
+
|
|
1232
|
+
Element = ArgumentByElement
|
|
1233
|
+
|
|
1234
|
+
def _repr_(self):
|
|
1235
|
+
r"""
|
|
1236
|
+
Return a representation string of this argument by element group.
|
|
1237
|
+
|
|
1238
|
+
TESTS::
|
|
1239
|
+
|
|
1240
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentByElementGroup
|
|
1241
|
+
sage: ArgumentByElementGroup(CC) # indirect doctest
|
|
1242
|
+
Unit Circle Group with Argument of Elements in
|
|
1243
|
+
Complex Field with 53 bits of precision
|
|
1244
|
+
"""
|
|
1245
|
+
return 'Unit Circle Group with Argument of Elements in {}'.format(self.base())
|
|
1246
|
+
|
|
1247
|
+
def _repr_short_(self):
|
|
1248
|
+
r"""
|
|
1249
|
+
Return a short representation string of this argument by element group.
|
|
1250
|
+
|
|
1251
|
+
TESTS::
|
|
1252
|
+
|
|
1253
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentByElementGroup
|
|
1254
|
+
sage: ArgumentByElementGroup(CC)._repr_short_()
|
|
1255
|
+
'Arg_CC'
|
|
1256
|
+
"""
|
|
1257
|
+
from sage.rings.asymptotic.misc import parent_to_repr_short, repr_op
|
|
1258
|
+
return repr_op('Arg', '_', parent_to_repr_short(self.base()))
|
|
1259
|
+
|
|
1260
|
+
def _element_constructor_(self, data, **kwds):
|
|
1261
|
+
r"""
|
|
1262
|
+
Construct an element out of the given data.
|
|
1263
|
+
|
|
1264
|
+
INPUT:
|
|
1265
|
+
|
|
1266
|
+
- ``data`` -- an object
|
|
1267
|
+
|
|
1268
|
+
- ``kwds`` -- are passed on to element
|
|
1269
|
+
|
|
1270
|
+
OUTPUT: a :class:`ArgumentByElement`
|
|
1271
|
+
|
|
1272
|
+
TESTS::
|
|
1273
|
+
|
|
1274
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentByElementGroup
|
|
1275
|
+
sage: C = ArgumentByElementGroup(CC)
|
|
1276
|
+
sage: C(1 + 2*I) # indirect doctest # needs sage.symbolic
|
|
1277
|
+
e^(I*arg(1.00000000000000 + 2.00000000000000*I))
|
|
1278
|
+
sage: C(1)
|
|
1279
|
+
e^(I*arg(1.00000000000000))
|
|
1280
|
+
sage: C(-1)
|
|
1281
|
+
e^(I*arg(-1.00000000000000))
|
|
1282
|
+
sage: C(ZZ(-1))
|
|
1283
|
+
e^(I*arg(-1.00000000000000))
|
|
1284
|
+
sage: C(QQ(-1))
|
|
1285
|
+
e^(I*arg(-1.00000000000000))
|
|
1286
|
+
sage: C(int(-1))
|
|
1287
|
+
e^(I*arg(-1.00000000000000))
|
|
1288
|
+
sage: C('-1')
|
|
1289
|
+
e^(I*arg(-1.00000000000000))
|
|
1290
|
+
|
|
1291
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1292
|
+
sage: S = SignGroup()
|
|
1293
|
+
sage: C(S(1))
|
|
1294
|
+
e^(I*arg(1.00000000000000))
|
|
1295
|
+
sage: C(S(-1))
|
|
1296
|
+
e^(I*arg(-1.00000000000000))
|
|
1297
|
+
"""
|
|
1298
|
+
from sage.structure.element import parent
|
|
1299
|
+
|
|
1300
|
+
if isinstance(data, int) and data == 0:
|
|
1301
|
+
raise ValueError('no input specified')
|
|
1302
|
+
|
|
1303
|
+
elif isinstance(data, self.element_class):
|
|
1304
|
+
if data.parent() == self:
|
|
1305
|
+
return data
|
|
1306
|
+
element = data._element_
|
|
1307
|
+
|
|
1308
|
+
elif data == '1':
|
|
1309
|
+
element = 1
|
|
1310
|
+
|
|
1311
|
+
elif data == '-1':
|
|
1312
|
+
element = -1
|
|
1313
|
+
|
|
1314
|
+
else:
|
|
1315
|
+
P = parent(data)
|
|
1316
|
+
|
|
1317
|
+
if isinstance(P, SignGroup):
|
|
1318
|
+
if data.is_one():
|
|
1319
|
+
element = 1
|
|
1320
|
+
elif data.is_minus_one():
|
|
1321
|
+
element = -1
|
|
1322
|
+
|
|
1323
|
+
else:
|
|
1324
|
+
element = data
|
|
1325
|
+
|
|
1326
|
+
return self.element_class(self, element, **kwds)
|
|
1327
|
+
|
|
1328
|
+
def _create_element_in_extension_(self, element):
|
|
1329
|
+
r"""
|
|
1330
|
+
Create an element in an extension of this
|
|
1331
|
+
argument by element group which
|
|
1332
|
+
is chosen according to the input ``element``.
|
|
1333
|
+
|
|
1334
|
+
INPUT:
|
|
1335
|
+
|
|
1336
|
+
- ``element`` -- the element data
|
|
1337
|
+
|
|
1338
|
+
OUTPUT: an element
|
|
1339
|
+
|
|
1340
|
+
EXAMPLES::
|
|
1341
|
+
|
|
1342
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentByElementGroup
|
|
1343
|
+
sage: C = ArgumentByElementGroup(ZZ)
|
|
1344
|
+
sage: C._create_element_in_extension_(2/3).parent()
|
|
1345
|
+
Unit Circle Group with Argument of Elements in
|
|
1346
|
+
Rational Field
|
|
1347
|
+
sage: C._create_element_in_extension_(0.23).parent()
|
|
1348
|
+
Unit Circle Group with Argument of Elements in
|
|
1349
|
+
Real Field with 53 bits of precision
|
|
1350
|
+
|
|
1351
|
+
sage: C = ArgumentByElementGroup(RR)
|
|
1352
|
+
sage: C._create_element_in_extension_(CC(0.23)).parent()
|
|
1353
|
+
Unit Circle Group with Argument of Elements in
|
|
1354
|
+
Complex Field with 53 bits of precision
|
|
1355
|
+
"""
|
|
1356
|
+
if element.parent() is self.base():
|
|
1357
|
+
parent = self
|
|
1358
|
+
else:
|
|
1359
|
+
parent = ArgumentByElementGroup(element.parent())
|
|
1360
|
+
return parent(element)
|
|
1361
|
+
|
|
1362
|
+
def _coerce_map_from_(self, R):
|
|
1363
|
+
r"""
|
|
1364
|
+
Return whether ``R`` coerces into this argument by element group.
|
|
1365
|
+
|
|
1366
|
+
INPUT:
|
|
1367
|
+
|
|
1368
|
+
- ``R`` -- a parent
|
|
1369
|
+
|
|
1370
|
+
OUTPUT: boolean
|
|
1371
|
+
|
|
1372
|
+
TESTS::
|
|
1373
|
+
|
|
1374
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentByElementGroup
|
|
1375
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1376
|
+
sage: C = ArgumentByElementGroup(ZZ)
|
|
1377
|
+
sage: S = SignGroup()
|
|
1378
|
+
sage: C.has_coerce_map_from(S) # indirect doctest
|
|
1379
|
+
True
|
|
1380
|
+
"""
|
|
1381
|
+
if isinstance(R, SignGroup):
|
|
1382
|
+
return True
|
|
1383
|
+
|
|
1384
|
+
|
|
1385
|
+
class Sign(AbstractArgument):
|
|
1386
|
+
r"""
|
|
1387
|
+
An element of :class:`SignGroup`.
|
|
1388
|
+
|
|
1389
|
+
INPUT:
|
|
1390
|
+
|
|
1391
|
+
- ``parent`` -- a SageMath parent
|
|
1392
|
+
|
|
1393
|
+
- ``element`` -- a nonzero element of the parent's base
|
|
1394
|
+
|
|
1395
|
+
- ``normalize`` -- boolean (default: ``True``)
|
|
1396
|
+
"""
|
|
1397
|
+
|
|
1398
|
+
def __init__(self, parent, element, normalize=True):
|
|
1399
|
+
r"""
|
|
1400
|
+
See :class:`Sign` for more information.
|
|
1401
|
+
|
|
1402
|
+
TESTS::
|
|
1403
|
+
|
|
1404
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1405
|
+
sage: S = SignGroup()
|
|
1406
|
+
sage: S.an_element() # indirect doctest
|
|
1407
|
+
-1
|
|
1408
|
+
"""
|
|
1409
|
+
super().__init__(parent, int(element), normalize=normalize)
|
|
1410
|
+
if self._element_ not in (-1, 1):
|
|
1411
|
+
raise ValueError('{} is not allowed '
|
|
1412
|
+
'(only -1 or 1 is)'.format(element))
|
|
1413
|
+
|
|
1414
|
+
@staticmethod
|
|
1415
|
+
def _normalize_(element):
|
|
1416
|
+
r"""
|
|
1417
|
+
Normalize the given element.
|
|
1418
|
+
|
|
1419
|
+
This is the identity for :class:`Sign`.
|
|
1420
|
+
|
|
1421
|
+
INPUT:
|
|
1422
|
+
|
|
1423
|
+
- ``element`` -- an element of the parent's base
|
|
1424
|
+
|
|
1425
|
+
OUTPUT: an element
|
|
1426
|
+
|
|
1427
|
+
TESTS::
|
|
1428
|
+
|
|
1429
|
+
sage: from sage.groups.misc_gps.argument_groups import Sign
|
|
1430
|
+
sage: Sign._normalize_(True)
|
|
1431
|
+
True
|
|
1432
|
+
"""
|
|
1433
|
+
return element
|
|
1434
|
+
|
|
1435
|
+
def _repr_(self):
|
|
1436
|
+
r"""
|
|
1437
|
+
Return a representation string of this sign.
|
|
1438
|
+
|
|
1439
|
+
TESTS::
|
|
1440
|
+
|
|
1441
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1442
|
+
sage: S = SignGroup()
|
|
1443
|
+
sage: S(1)
|
|
1444
|
+
1
|
|
1445
|
+
sage: S(-1)
|
|
1446
|
+
-1
|
|
1447
|
+
"""
|
|
1448
|
+
return repr(self._element_)
|
|
1449
|
+
|
|
1450
|
+
def _mul_(self, other):
|
|
1451
|
+
r"""
|
|
1452
|
+
Return the product of this sign with ``other``.
|
|
1453
|
+
|
|
1454
|
+
TESTS::
|
|
1455
|
+
|
|
1456
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1457
|
+
sage: S = SignGroup()
|
|
1458
|
+
sage: S(1) * S(-1) # indirect doctest
|
|
1459
|
+
-1
|
|
1460
|
+
"""
|
|
1461
|
+
P = self.parent()
|
|
1462
|
+
return P.element_class(P, self._element_ * other._element_)
|
|
1463
|
+
|
|
1464
|
+
def __pow__(self, exponent):
|
|
1465
|
+
r"""
|
|
1466
|
+
Return the power of this sign to the given ``exponent``.
|
|
1467
|
+
|
|
1468
|
+
TESTS::
|
|
1469
|
+
|
|
1470
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1471
|
+
sage: S = SignGroup()
|
|
1472
|
+
sage: S(-1)^4 # indirect doctest
|
|
1473
|
+
1
|
|
1474
|
+
sage: S(-1)^3 # indirect doctest
|
|
1475
|
+
-1
|
|
1476
|
+
|
|
1477
|
+
Check that the results may live in other parents too::
|
|
1478
|
+
|
|
1479
|
+
sage: # needs sage.symbolic
|
|
1480
|
+
sage: x = SR.var('x')
|
|
1481
|
+
sage: elem = S(-1)^x; elem # indirect doctest
|
|
1482
|
+
(-1)^x
|
|
1483
|
+
sage: elem.parent()
|
|
1484
|
+
Symbolic Ring
|
|
1485
|
+
|
|
1486
|
+
"""
|
|
1487
|
+
result = self._element_ ** exponent
|
|
1488
|
+
P = self.parent()
|
|
1489
|
+
try:
|
|
1490
|
+
return P.element_class(P, result)
|
|
1491
|
+
except (ValueError, TypeError):
|
|
1492
|
+
return result
|
|
1493
|
+
|
|
1494
|
+
def __invert__(self):
|
|
1495
|
+
r"""
|
|
1496
|
+
Return the inverse of this sign.
|
|
1497
|
+
|
|
1498
|
+
TESTS::
|
|
1499
|
+
|
|
1500
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1501
|
+
sage: S = SignGroup()
|
|
1502
|
+
sage: ~S(-1) # indirect doctest
|
|
1503
|
+
-1
|
|
1504
|
+
sage: _.parent()
|
|
1505
|
+
Sign Group
|
|
1506
|
+
"""
|
|
1507
|
+
return self
|
|
1508
|
+
|
|
1509
|
+
def _act_on_(self, other, is_left):
|
|
1510
|
+
r"""
|
|
1511
|
+
Return the action of this sign on ``other``.
|
|
1512
|
+
|
|
1513
|
+
TESTS::
|
|
1514
|
+
|
|
1515
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1516
|
+
sage: S = SignGroup()
|
|
1517
|
+
sage: S(-1) * 4
|
|
1518
|
+
-4
|
|
1519
|
+
sage: _.parent()
|
|
1520
|
+
Integer Ring
|
|
1521
|
+
sage: 4 * S(-1)
|
|
1522
|
+
-4
|
|
1523
|
+
sage: _.parent()
|
|
1524
|
+
Integer Ring
|
|
1525
|
+
|
|
1526
|
+
sage: S(-1) * ZZ(4)
|
|
1527
|
+
-4
|
|
1528
|
+
sage: _.parent()
|
|
1529
|
+
Integer Ring
|
|
1530
|
+
sage: S(-1) * int(4)
|
|
1531
|
+
-4
|
|
1532
|
+
sage: type(_)
|
|
1533
|
+
<class 'int'>
|
|
1534
|
+
sage: S(-1) * QQ(4)
|
|
1535
|
+
-4
|
|
1536
|
+
sage: _.parent()
|
|
1537
|
+
Rational Field
|
|
1538
|
+
sage: S(-1) * RR(4)
|
|
1539
|
+
-4.00000000000000
|
|
1540
|
+
sage: _.parent()
|
|
1541
|
+
Real Field with 53 bits of precision
|
|
1542
|
+
sage: S(-1) * CC(4)
|
|
1543
|
+
-4.00000000000000
|
|
1544
|
+
sage: _.parent()
|
|
1545
|
+
Complex Field with 53 bits of precision
|
|
1546
|
+
sage: S(-1) * SR.var('x') # needs sage.symbolic
|
|
1547
|
+
-x
|
|
1548
|
+
sage: _.parent() # needs sage.symbolic
|
|
1549
|
+
Symbolic Ring
|
|
1550
|
+
|
|
1551
|
+
::
|
|
1552
|
+
|
|
1553
|
+
sage: P = Permutation([1,2,3])
|
|
1554
|
+
sage: S(-1) * P
|
|
1555
|
+
Traceback (most recent call last):
|
|
1556
|
+
...
|
|
1557
|
+
TypeError: unsupported operand parent
|
|
1558
|
+
for unary -: 'Standard permutations'
|
|
1559
|
+
"""
|
|
1560
|
+
if self.is_one():
|
|
1561
|
+
return other
|
|
1562
|
+
if self.is_minus_one():
|
|
1563
|
+
return -other
|
|
1564
|
+
|
|
1565
|
+
def is_one(self):
|
|
1566
|
+
r"""
|
|
1567
|
+
Return whether this sign is `1`.
|
|
1568
|
+
|
|
1569
|
+
EXAMPLES::
|
|
1570
|
+
|
|
1571
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1572
|
+
sage: S = SignGroup()
|
|
1573
|
+
sage: S(-1).is_one()
|
|
1574
|
+
False
|
|
1575
|
+
sage: S(1).is_one()
|
|
1576
|
+
True
|
|
1577
|
+
"""
|
|
1578
|
+
return self._element_ == 1
|
|
1579
|
+
|
|
1580
|
+
def is_minus_one(self):
|
|
1581
|
+
r"""
|
|
1582
|
+
Return whether this sign is `-1`.
|
|
1583
|
+
|
|
1584
|
+
EXAMPLES::
|
|
1585
|
+
|
|
1586
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1587
|
+
sage: S = SignGroup()
|
|
1588
|
+
sage: S(1).is_minus_one()
|
|
1589
|
+
False
|
|
1590
|
+
sage: S(-1).is_minus_one()
|
|
1591
|
+
True
|
|
1592
|
+
"""
|
|
1593
|
+
return self._element_ == -1
|
|
1594
|
+
|
|
1595
|
+
|
|
1596
|
+
class SignGroup(AbstractArgumentGroup):
|
|
1597
|
+
r"""
|
|
1598
|
+
A group of the signs `-1` and `1`.
|
|
1599
|
+
|
|
1600
|
+
INPUT:
|
|
1601
|
+
|
|
1602
|
+
- ``category`` -- a category
|
|
1603
|
+
|
|
1604
|
+
EXAMPLES::
|
|
1605
|
+
|
|
1606
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1607
|
+
sage: S = SignGroup(); S
|
|
1608
|
+
Sign Group
|
|
1609
|
+
sage: S(-1)
|
|
1610
|
+
-1
|
|
1611
|
+
"""
|
|
1612
|
+
|
|
1613
|
+
Element = Sign
|
|
1614
|
+
|
|
1615
|
+
@staticmethod
|
|
1616
|
+
def __classcall__(cls, category=None):
|
|
1617
|
+
r"""
|
|
1618
|
+
See :class:`SignGroup` for more information.
|
|
1619
|
+
|
|
1620
|
+
TESTS:
|
|
1621
|
+
|
|
1622
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1623
|
+
sage: S = SignGroup()
|
|
1624
|
+
sage: S.category() # indirect doctest
|
|
1625
|
+
Category of finite commutative groups
|
|
1626
|
+
"""
|
|
1627
|
+
category = cls._determine_category_(category).Finite()
|
|
1628
|
+
return super(AbstractArgumentGroup, cls).__classcall__(
|
|
1629
|
+
cls, category)
|
|
1630
|
+
|
|
1631
|
+
def __init__(self, category):
|
|
1632
|
+
r"""
|
|
1633
|
+
See :class:`SignGroup` for more information.
|
|
1634
|
+
|
|
1635
|
+
TESTS:
|
|
1636
|
+
|
|
1637
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1638
|
+
sage: S = SignGroup()
|
|
1639
|
+
sage: S.base() # indirect doctest
|
|
1640
|
+
<class 'int'>
|
|
1641
|
+
"""
|
|
1642
|
+
super().__init__(base=int, category=category)
|
|
1643
|
+
|
|
1644
|
+
def _repr_(self):
|
|
1645
|
+
r"""
|
|
1646
|
+
Return a representation string of the sign group.
|
|
1647
|
+
|
|
1648
|
+
TESTS::
|
|
1649
|
+
|
|
1650
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1651
|
+
sage: SignGroup() # indirect doctest
|
|
1652
|
+
Sign Group
|
|
1653
|
+
"""
|
|
1654
|
+
return 'Sign Group'
|
|
1655
|
+
|
|
1656
|
+
def _repr_short_(self):
|
|
1657
|
+
r"""
|
|
1658
|
+
Return a short representation string of this sign group.
|
|
1659
|
+
|
|
1660
|
+
TESTS::
|
|
1661
|
+
|
|
1662
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1663
|
+
sage: S = SignGroup()
|
|
1664
|
+
sage: S._repr_short_()
|
|
1665
|
+
'Signs'
|
|
1666
|
+
"""
|
|
1667
|
+
return 'Signs'
|
|
1668
|
+
|
|
1669
|
+
def _an_element_(self):
|
|
1670
|
+
r"""
|
|
1671
|
+
Return a short representation string of this sign group.
|
|
1672
|
+
|
|
1673
|
+
TESTS::
|
|
1674
|
+
|
|
1675
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1676
|
+
sage: S = SignGroup()
|
|
1677
|
+
sage: S.an_element()
|
|
1678
|
+
-1
|
|
1679
|
+
"""
|
|
1680
|
+
return self.element_class(self, -1)
|
|
1681
|
+
|
|
1682
|
+
def _element_constructor_(self, data):
|
|
1683
|
+
r"""
|
|
1684
|
+
Construct an element out of the given data.
|
|
1685
|
+
|
|
1686
|
+
INPUT:
|
|
1687
|
+
|
|
1688
|
+
- ``data`` -- an object
|
|
1689
|
+
|
|
1690
|
+
OUTPUT: a :class:`Sign`
|
|
1691
|
+
|
|
1692
|
+
TESTS::
|
|
1693
|
+
|
|
1694
|
+
sage: from sage.groups.misc_gps.argument_groups import SignGroup
|
|
1695
|
+
sage: S = SignGroup()
|
|
1696
|
+
sage: S(1) # indirect doctest
|
|
1697
|
+
1
|
|
1698
|
+
sage: S(-1) # indirect doctest
|
|
1699
|
+
-1
|
|
1700
|
+
"""
|
|
1701
|
+
if isinstance(data, int) and data == 0:
|
|
1702
|
+
raise ValueError('no input specified')
|
|
1703
|
+
|
|
1704
|
+
elif isinstance(data, self.element_class):
|
|
1705
|
+
if data.parent() == self:
|
|
1706
|
+
return data
|
|
1707
|
+
element = data._element_
|
|
1708
|
+
|
|
1709
|
+
else:
|
|
1710
|
+
element = data
|
|
1711
|
+
|
|
1712
|
+
return self.element_class(self, element)
|
|
1713
|
+
|
|
1714
|
+
|
|
1715
|
+
class ArgumentGroupFactory(UniqueFactory):
|
|
1716
|
+
r"""
|
|
1717
|
+
A factory for creating argument groups.
|
|
1718
|
+
|
|
1719
|
+
INPUT:
|
|
1720
|
+
|
|
1721
|
+
- ``data`` -- an object
|
|
1722
|
+
|
|
1723
|
+
The factory will analyze ``data`` and interpret it as
|
|
1724
|
+
``specification`` or ``domain``.
|
|
1725
|
+
|
|
1726
|
+
- ``specification`` -- string
|
|
1727
|
+
|
|
1728
|
+
The following is possible:
|
|
1729
|
+
|
|
1730
|
+
- ``'Signs'`` give the :class:`SignGroup`
|
|
1731
|
+
|
|
1732
|
+
- ``'UU'`` give the :class:`RootsOfUnityGroup`
|
|
1733
|
+
|
|
1734
|
+
- ``'UU_P'``, where ``'P'`` is
|
|
1735
|
+
a string representing a SageMath parent which is interpreted as
|
|
1736
|
+
``exponents``
|
|
1737
|
+
|
|
1738
|
+
- ``'Arg_P'``, where ``'P'`` is
|
|
1739
|
+
a string representing a SageMath parent which is interpreted as
|
|
1740
|
+
``domain``
|
|
1741
|
+
|
|
1742
|
+
- ``domain`` -- a SageMath parent representing a subset of the complex plane;
|
|
1743
|
+
an instance of :class:`ArgumentByElementGroup` will be created with the given
|
|
1744
|
+
``domain``
|
|
1745
|
+
|
|
1746
|
+
- ``exponents`` -- a SageMath parent representing a subset of the reals;
|
|
1747
|
+
an instance of :class`UnitCircleGroup` will be created with the given
|
|
1748
|
+
``exponents``
|
|
1749
|
+
|
|
1750
|
+
Exactly one of ``data``, ``specification``, ``exponents`` has to be provided.
|
|
1751
|
+
|
|
1752
|
+
Further keyword parameters will be carried on to the initialization of
|
|
1753
|
+
the group.
|
|
1754
|
+
|
|
1755
|
+
EXAMPLES::
|
|
1756
|
+
|
|
1757
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentGroup
|
|
1758
|
+
|
|
1759
|
+
sage: ArgumentGroup('UU') # needs sage.rings.number_field
|
|
1760
|
+
Group of Roots of Unity
|
|
1761
|
+
|
|
1762
|
+
sage: # needs sage.rings.number_field
|
|
1763
|
+
sage: ArgumentGroup(ZZ)
|
|
1764
|
+
Sign Group
|
|
1765
|
+
sage: ArgumentGroup(QQ)
|
|
1766
|
+
Sign Group
|
|
1767
|
+
sage: ArgumentGroup('UU_QQ')
|
|
1768
|
+
Group of Roots of Unity
|
|
1769
|
+
sage: ArgumentGroup(AA)
|
|
1770
|
+
Sign Group
|
|
1771
|
+
|
|
1772
|
+
sage: ArgumentGroup(RR) # needs sage.rings.number_field
|
|
1773
|
+
Sign Group
|
|
1774
|
+
sage: ArgumentGroup('Arg_RR') # needs sage.rings.number_field
|
|
1775
|
+
Sign Group
|
|
1776
|
+
sage: ArgumentGroup(RIF) # needs sage.rings.real_interval_field
|
|
1777
|
+
Sign Group
|
|
1778
|
+
sage: ArgumentGroup(RBF) # needs sage.libs.flint
|
|
1779
|
+
Sign Group
|
|
1780
|
+
|
|
1781
|
+
sage: ArgumentGroup(CC) # needs sage.rings.number_field
|
|
1782
|
+
Unit Circle Group with Exponents in
|
|
1783
|
+
Real Field with 53 bits of precision modulo ZZ
|
|
1784
|
+
sage: ArgumentGroup('Arg_CC') # needs sage.rings.number_field
|
|
1785
|
+
Unit Circle Group with Exponents in
|
|
1786
|
+
Real Field with 53 bits of precision modulo ZZ
|
|
1787
|
+
sage: ArgumentGroup(CIF) # needs sage.rings.real_interval_field
|
|
1788
|
+
Unit Circle Group with Exponents in
|
|
1789
|
+
Real Interval Field with 53 bits of precision modulo ZZ
|
|
1790
|
+
sage: ArgumentGroup(CBF) # needs sage.libs.flint
|
|
1791
|
+
Unit Circle Group with Exponents in
|
|
1792
|
+
Real ball field with 53 bits of precision modulo ZZ
|
|
1793
|
+
|
|
1794
|
+
sage: ArgumentGroup(CyclotomicField(3)) # needs sage.rings.number_field
|
|
1795
|
+
Unit Circle Group with Argument of Elements in
|
|
1796
|
+
Cyclotomic Field of order 3 and degree 2
|
|
1797
|
+
"""
|
|
1798
|
+
def create_key_and_extra_args(self,
|
|
1799
|
+
data=None,
|
|
1800
|
+
specification=None,
|
|
1801
|
+
domain=None,
|
|
1802
|
+
exponents=None,
|
|
1803
|
+
**kwds):
|
|
1804
|
+
r"""
|
|
1805
|
+
Normalize the input.
|
|
1806
|
+
|
|
1807
|
+
See :class:`ArgumentGroupFactory` for a description and examples.
|
|
1808
|
+
|
|
1809
|
+
TESTS::
|
|
1810
|
+
|
|
1811
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentGroup
|
|
1812
|
+
|
|
1813
|
+
sage: # needs sage.rings.number_field
|
|
1814
|
+
sage: ArgumentGroup(specification='UU')
|
|
1815
|
+
Group of Roots of Unity
|
|
1816
|
+
sage: ArgumentGroup('UU') is ArgumentGroup(exponents=QQ) # indirect doctest
|
|
1817
|
+
True
|
|
1818
|
+
sage: ArgumentGroup('Arg_CC') is ArgumentGroup(exponents=RR) # indirect doctest
|
|
1819
|
+
True
|
|
1820
|
+
sage: ArgumentGroup('Arg_CC') is ArgumentGroup(domain=CC) # indirect doctest
|
|
1821
|
+
True
|
|
1822
|
+
"""
|
|
1823
|
+
from sage.rings.integer_ring import ZZ
|
|
1824
|
+
from sage.misc.misc import exactly_one_is_true
|
|
1825
|
+
from sage.rings.rational_field import QQ
|
|
1826
|
+
|
|
1827
|
+
try:
|
|
1828
|
+
from sage.rings.qqbar import AA
|
|
1829
|
+
except ImportError:
|
|
1830
|
+
AA = None
|
|
1831
|
+
|
|
1832
|
+
if not exactly_one_is_true(
|
|
1833
|
+
(data is not None,
|
|
1834
|
+
specification is not None,
|
|
1835
|
+
domain is not None,
|
|
1836
|
+
exponents is not None)):
|
|
1837
|
+
raise ValueError(
|
|
1838
|
+
'input ambiguous: ' +
|
|
1839
|
+
', '.join('{}={}'.format(s, v) for s, v in
|
|
1840
|
+
[('data', data), ('specification', specification),
|
|
1841
|
+
('domain', domain), ('exponents', exponents)]
|
|
1842
|
+
if v is not None))
|
|
1843
|
+
|
|
1844
|
+
if data is not None:
|
|
1845
|
+
if isinstance(data, str):
|
|
1846
|
+
specification = data
|
|
1847
|
+
else:
|
|
1848
|
+
domain = data
|
|
1849
|
+
|
|
1850
|
+
if specification is not None:
|
|
1851
|
+
if specification == 'UU':
|
|
1852
|
+
return (RootsOfUnityGroup, ()), kwds
|
|
1853
|
+
if specification == 'Signs':
|
|
1854
|
+
return (SignGroup, ()), kwds
|
|
1855
|
+
elif specification.startswith('UU_'):
|
|
1856
|
+
from sage.rings.asymptotic.misc import repr_short_to_parent
|
|
1857
|
+
exponents = repr_short_to_parent(specification[3:])
|
|
1858
|
+
elif specification.startswith('Arg_') or specification.startswith('arg_'):
|
|
1859
|
+
from sage.rings.asymptotic.misc import repr_short_to_parent
|
|
1860
|
+
domain = repr_short_to_parent(specification[4:])
|
|
1861
|
+
else:
|
|
1862
|
+
raise ValueError('unknown specification {}'.format(specification))
|
|
1863
|
+
|
|
1864
|
+
if domain is not None:
|
|
1865
|
+
if domain in (ZZ, QQ, AA) \
|
|
1866
|
+
or isinstance(domain, (sage.rings.abc.RealField,
|
|
1867
|
+
sage.rings.abc.RealIntervalField,
|
|
1868
|
+
sage.rings.abc.RealBallField)):
|
|
1869
|
+
return (SignGroup, ()), kwds
|
|
1870
|
+
elif isinstance(domain, (sage.rings.abc.ComplexField,
|
|
1871
|
+
sage.rings.abc.ComplexIntervalField,
|
|
1872
|
+
sage.rings.abc.ComplexBallField)):
|
|
1873
|
+
return (UnitCircleGroup, (domain._real_field(),)), kwds
|
|
1874
|
+
else:
|
|
1875
|
+
return (ArgumentByElementGroup, (domain,)), kwds
|
|
1876
|
+
|
|
1877
|
+
elif exponents is not None:
|
|
1878
|
+
if exponents == ZZ:
|
|
1879
|
+
return (SignGroup, ()), kwds
|
|
1880
|
+
elif exponents == QQ:
|
|
1881
|
+
return (RootsOfUnityGroup, ()), kwds
|
|
1882
|
+
else:
|
|
1883
|
+
return (UnitCircleGroup, (exponents,)), kwds
|
|
1884
|
+
|
|
1885
|
+
def create_object(self, version, key, **kwds):
|
|
1886
|
+
r"""
|
|
1887
|
+
Create an object from the given arguments.
|
|
1888
|
+
|
|
1889
|
+
TESTS::
|
|
1890
|
+
|
|
1891
|
+
sage: from sage.groups.misc_gps.argument_groups import ArgumentGroup
|
|
1892
|
+
sage: ArgumentGroup('UU') # indirect doctest # needs sage.rings.number_field
|
|
1893
|
+
Group of Roots of Unity
|
|
1894
|
+
"""
|
|
1895
|
+
cls, args = key
|
|
1896
|
+
return cls(*args, **kwds)
|
|
1897
|
+
|
|
1898
|
+
|
|
1899
|
+
ArgumentGroup = ArgumentGroupFactory('sage.groups.misc_gps.argument_groups.ArgumentGroup')
|
|
1900
|
+
r"""
|
|
1901
|
+
A factory for argument groups.
|
|
1902
|
+
|
|
1903
|
+
This is an instance of :class:`ArgumentGroupFactory` whose documentation
|
|
1904
|
+
provides more details.
|
|
1905
|
+
"""
|