passagemath-modules 10.5.32__cp310-cp310-macosx_14_0_arm64.whl → 10.6.20__cp310-cp310-macosx_14_0_arm64.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.5.32.dist-info → passagemath_modules-10.6.20.dist-info}/METADATA +51 -46
- {passagemath_modules-10.5.32.dist-info → passagemath_modules-10.6.20.dist-info}/RECORD +333 -323
- {passagemath_modules-10.5.32.dist-info → passagemath_modules-10.6.20.dist-info}/WHEEL +1 -1
- passagemath_modules.dylibs/libgcc_s.1.1.dylib +0 -0
- passagemath_modules.dylibs/libgfortran.5.dylib +0 -0
- passagemath_modules.dylibs/libgsl.28.dylib +0 -0
- passagemath_modules.dylibs/libmpc.3.dylib +0 -0
- passagemath_modules.dylibs/libopenblasp-r0.3.29.dylib +0 -0
- passagemath_modules.dylibs/libquadmath.0.dylib +0 -0
- sage/algebras/clifford_algebra.py +2 -2
- sage/algebras/clifford_algebra_element.cpython-310-darwin.so +0 -0
- sage/algebras/clifford_algebra_element.pyx +4 -2
- sage/algebras/exterior_algebra_groebner.cpython-310-darwin.so +0 -0
- sage/algebras/exterior_algebra_groebner.pyx +2 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra.py +83 -5
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.cpython-310-darwin.so +0 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pxd +2 -0
- sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pyx +28 -3
- sage/algebras/finite_gca.py +1 -1
- sage/algebras/lie_algebras/bgg_dual_module.py +18 -11
- sage/algebras/lie_algebras/classical_lie_algebra.py +3 -3
- sage/algebras/lie_algebras/examples.py +2 -2
- sage/algebras/lie_algebras/free_lie_algebra.py +1 -1
- sage/algebras/lie_algebras/heisenberg.py +4 -4
- sage/algebras/lie_algebras/lie_algebra.py +1 -1
- sage/algebras/lie_algebras/lie_algebra_element.cpython-310-darwin.so +0 -0
- sage/algebras/lie_algebras/lie_algebra_element.pyx +65 -28
- sage/algebras/lie_algebras/quotient.py +40 -29
- sage/algebras/lie_algebras/subalgebra.py +76 -53
- sage/algebras/lie_algebras/verma_module.py +1 -3
- sage/algebras/octonion_algebra.cpython-310-darwin.so +0 -0
- sage/algebras/octonion_algebra.pyx +1 -1
- sage/algebras/orlik_solomon.py +4 -4
- sage/algebras/orlik_terao.py +4 -4
- sage/algebras/steenrod/steenrod_algebra.py +37 -30
- sage/algebras/steenrod/steenrod_algebra_bases.py +2 -2
- sage/algebras/steenrod/steenrod_algebra_misc.py +4 -4
- sage/algebras/steenrod/steenrod_algebra_mult.py +2 -2
- sage/all__sagemath_modules.py +1 -0
- sage/calculus/integration.cpython-310-darwin.so +0 -0
- sage/calculus/integration.pyx +6 -5
- sage/calculus/interpolation.cpython-310-darwin.so +0 -0
- sage/calculus/interpolators.cpython-310-darwin.so +0 -0
- sage/calculus/ode.cpython-310-darwin.so +0 -0
- sage/calculus/ode.pxd +2 -2
- sage/calculus/ode.pyx +6 -4
- sage/calculus/riemann.cpython-310-darwin.so +0 -0
- sage/calculus/riemann.pyx +68 -48
- sage/calculus/transforms/dwt.cpython-310-darwin.so +0 -0
- sage/calculus/transforms/fft.cpython-310-darwin.so +0 -0
- sage/coding/ag_code_decoders.cpython-310-darwin.so +0 -0
- sage/coding/ag_code_decoders.pyx +31 -31
- sage/coding/binary_code.cpython-310-darwin.so +0 -0
- sage/coding/binary_code.pxd +6 -6
- sage/coding/binary_code.pyx +212 -173
- sage/coding/guruswami_sudan/utils.py +3 -5
- sage/coding/kasami_codes.cpython-310-darwin.so +0 -0
- sage/coding/kasami_codes.pyx +20 -24
- sage/coding/linear_code.py +2 -2
- sage/coding/linear_code_no_metric.py +5 -5
- sage/coding/linear_rank_metric.py +81 -19
- sage/combinat/cartesian_product.py +1 -1
- sage/combinat/free_module.py +22 -2
- sage/combinat/root_system/all.py +1 -1
- sage/combinat/root_system/ambient_space.py +1 -1
- sage/combinat/root_system/associahedron.py +4 -4
- sage/combinat/root_system/braid_move_calculator.py +2 -2
- sage/combinat/root_system/braid_orbit.cpython-310-darwin.so +0 -0
- sage/combinat/root_system/braid_orbit.pyx +1 -1
- sage/combinat/root_system/branching_rules.py +3 -3
- sage/combinat/root_system/cartan_type.py +14 -14
- sage/combinat/root_system/coxeter_group.py +3 -3
- sage/combinat/root_system/coxeter_matrix.py +1 -1
- sage/combinat/root_system/coxeter_type.py +12 -1
- sage/combinat/root_system/extended_affine_weyl_group.py +9 -9
- sage/combinat/root_system/fundamental_group.py +3 -5
- sage/combinat/root_system/hecke_algebra_representation.py +1 -1
- sage/combinat/root_system/integrable_representations.py +1 -1
- sage/combinat/root_system/pieri_factors.py +3 -3
- sage/combinat/root_system/root_lattice_realization_algebras.py +1 -1
- sage/combinat/root_system/root_lattice_realizations.py +1 -1
- sage/combinat/root_system/type_folded.py +3 -3
- sage/combinat/root_system/type_reducible.py +8 -7
- sage/combinat/root_system/type_super_A.py +2 -2
- sage/combinat/root_system/weight_lattice_realizations.py +9 -8
- sage/combinat/root_system/weyl_characters.py +2 -2
- sage/crypto/__init__.py +1 -0
- sage/crypto/block_cipher/des.py +1 -1
- sage/crypto/block_cipher/miniaes.py +3 -3
- sage/crypto/block_cipher/present.py +3 -3
- sage/crypto/block_cipher/sdes.py +3 -3
- sage/crypto/boolean_function.cpython-310-darwin.so +0 -0
- sage/crypto/boolean_function.pyx +22 -23
- sage/crypto/key_exchange/diffie_hellman.py +4 -9
- sage/crypto/mq/sr.py +1 -1
- sage/crypto/public_key/blum_goldwasser.py +3 -3
- sage/crypto/sbox.cpython-310-darwin.so +0 -0
- sage/crypto/sbox.pyx +1 -1
- sage/crypto/sboxes.py +22 -0
- sage/crypto/util.py +4 -6
- sage/ext/interpreters/__init__.py +1 -1
- sage/ext/interpreters/all__sagemath_modules.py +1 -1
- sage/ext/interpreters/wrapper_cc.cpython-310-darwin.so +0 -0
- sage/ext/interpreters/wrapper_cc.pxd +5 -5
- sage/ext/interpreters/wrapper_cc.pyx +1 -1
- sage/ext/interpreters/wrapper_cdf.cpython-310-darwin.so +0 -0
- sage/ext/interpreters/wrapper_cdf.pxd +5 -7
- sage/ext/interpreters/wrapper_cdf.pyx +4 -10
- sage/ext/interpreters/wrapper_rdf.cpython-310-darwin.so +0 -0
- sage/ext/interpreters/wrapper_rdf.pxd +1 -1
- sage/ext/interpreters/wrapper_rdf.pyx +1 -1
- sage/ext/interpreters/wrapper_rr.cpython-310-darwin.so +0 -0
- sage/ext/interpreters/wrapper_rr.pxd +5 -5
- sage/ext/interpreters/wrapper_rr.pyx +1 -2
- sage/geometry/toric_lattice.py +3 -3
- sage/geometry/toric_lattice_element.cpython-310-darwin.so +0 -0
- sage/groups/additive_abelian/additive_abelian_group.py +1 -1
- sage/groups/additive_abelian/qmodnz.py +4 -4
- sage/groups/matrix_gps/coxeter_group.py +17 -4
- sage/groups/matrix_gps/group_element.cpython-310-darwin.so +0 -0
- sage/groups/misc_gps/argument_groups.py +2 -2
- sage/groups/misc_gps/imaginary_groups.py +4 -4
- sage/groups/perm_gps/partn_ref/refinement_binary.cpython-310-darwin.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_matrices.cpython-310-darwin.so +0 -0
- sage/homology/chain_complex.py +0 -2
- sage/homology/hochschild_complex.py +3 -3
- sage/homology/homology_morphism.py +6 -6
- sage/homology/homology_vector_space_with_basis.py +1 -1
- sage/libs/gsl/array.cpython-310-darwin.so +0 -0
- sage/libs/mpmath/utils.cpython-310-darwin.so +0 -0
- sage/matrix/action.cpython-310-darwin.so +0 -0
- sage/matrix/args.cpython-310-darwin.so +0 -0
- sage/matrix/args.pyx +25 -10
- sage/matrix/benchmark.py +8 -4
- sage/matrix/compute_J_ideal.py +2 -2
- sage/matrix/constructor.cpython-310-darwin.so +0 -0
- sage/matrix/echelon_matrix.cpython-310-darwin.so +0 -0
- sage/matrix/echelon_matrix.pyx +1 -1
- sage/matrix/matrix0.cpython-310-darwin.so +0 -0
- sage/matrix/matrix0.pxd +3 -3
- sage/matrix/matrix0.pyx +7 -5
- sage/matrix/matrix1.cpython-310-darwin.so +0 -0
- sage/matrix/matrix1.pyx +87 -48
- sage/matrix/matrix2.cpython-310-darwin.so +0 -0
- sage/matrix/matrix2.pxd +3 -3
- sage/matrix/matrix2.pyx +1261 -63
- sage/matrix/matrix_cdv.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_complex_double_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_complex_double_dense.pyx +1 -1
- sage/matrix/matrix_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_dense.pyx +2 -3
- sage/matrix/matrix_double_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_double_dense.pyx +11 -5
- sage/matrix/matrix_double_sparse.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_generic_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_generic_sparse.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_generic_sparse.pyx +1 -1
- sage/matrix/matrix_laurent_mpolynomial_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_numpy_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_numpy_integer_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_polynomial_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_polynomial_dense.pyx +952 -261
- sage/matrix/matrix_real_double_dense.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_sparse.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_sparse.pyx +6 -7
- sage/matrix/matrix_window.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_window.pyx +2 -2
- sage/matrix/misc_mpfr.cpython-310-darwin.so +0 -0
- sage/matrix/operation_table.py +0 -2
- sage/matrix/special.py +5 -1
- sage/matrix/strassen.cpython-310-darwin.so +0 -0
- sage/matrix/strassen.pyx +1 -1
- sage/matroids/basis_exchange_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/basis_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/chow_ring.py +68 -65
- sage/matroids/chow_ring_ideal.py +41 -38
- sage/matroids/circuit_closures_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/circuits_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/database_matroids.py +16 -5
- sage/matroids/dual_matroid.py +2 -2
- sage/matroids/extension.cpython-310-darwin.so +0 -0
- sage/matroids/flats_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/gammoid.py +1 -1
- sage/matroids/graphic_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/graphic_matroid.pyx +3 -3
- sage/matroids/lean_matrix.cpython-310-darwin.so +0 -0
- sage/matroids/lean_matrix.pyx +22 -22
- sage/matroids/linear_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/linear_matroid.pyx +13 -13
- sage/matroids/matroid.cpython-310-darwin.so +0 -0
- sage/matroids/matroid.pyx +15 -15
- sage/matroids/matroids_plot_helpers.py +48 -46
- sage/matroids/minor_matroid.py +2 -2
- sage/matroids/set_system.cpython-310-darwin.so +0 -0
- sage/matroids/transversal_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/transversal_matroid.pyx +3 -3
- sage/matroids/union_matroid.cpython-310-darwin.so +0 -0
- sage/matroids/union_matroid.pyx +3 -0
- sage/matroids/unpickling.cpython-310-darwin.so +0 -0
- sage/matroids/utilities.py +2 -2
- sage/misc/c3.cpython-310-darwin.so +0 -0
- sage/misc/compat.py +1 -2
- sage/misc/pickle_old.cpython-310-darwin.so +0 -0
- sage/modules/diamond_cutting.py +117 -30
- sage/modules/fg_pid/fgp_module.py +3 -3
- sage/modules/filtered_vector_space.py +4 -4
- sage/modules/finite_submodule_iter.cpython-310-darwin.so +0 -0
- sage/modules/fp_graded/free_module.py +2 -2
- sage/modules/fp_graded/module.py +2 -2
- sage/modules/fp_graded/morphism.py +4 -4
- sage/modules/fp_graded/steenrod/morphism.py +1 -1
- sage/modules/free_module.py +162 -26
- sage/modules/free_module_element.cpython-310-darwin.so +0 -0
- sage/modules/free_module_element.pyx +4 -4
- sage/modules/free_module_integer.py +2 -2
- sage/modules/free_module_morphism.py +3 -3
- sage/modules/free_module_pseudohomspace.py +352 -0
- sage/modules/free_module_pseudomorphism.py +578 -0
- sage/modules/free_quadratic_module_integer_symmetric.py +24 -13
- sage/modules/matrix_morphism.py +9 -9
- sage/modules/multi_filtered_vector_space.py +4 -4
- 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 +11 -1
- sage/modules/submodule.py +1 -1
- sage/modules/torsion_quadratic_module.py +1 -1
- sage/modules/vector_complex_double_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_double_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_integer_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_integer_sparse.cpython-310-darwin.so +0 -0
- sage/modules/vector_integer_sparse.pyx +4 -4
- sage/modules/vector_modn_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_modn_sparse.cpython-310-darwin.so +0 -0
- sage/modules/vector_numpy_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_numpy_integer_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_rational_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_rational_dense.pyx +1 -1
- sage/modules/vector_rational_sparse.cpython-310-darwin.so +0 -0
- sage/modules/vector_rational_sparse.pyx +5 -5
- sage/modules/vector_real_double_dense.cpython-310-darwin.so +0 -0
- sage/modules/vector_space_morphism.py +2 -2
- sage/modules/with_basis/cell_module.py +17 -0
- sage/modules/with_basis/indexed_element.cpython-310-darwin.so +0 -0
- sage/modules/with_basis/indexed_element.pyx +1 -1
- sage/modules/with_basis/invariant.py +1 -1
- sage/modules/with_basis/representation.py +0 -1
- sage/modules/with_basis/subquotient.py +2 -2
- sage/numerical/gauss_legendre.cpython-310-darwin.so +0 -0
- sage/probability/probability_distribution.cpython-310-darwin.so +0 -0
- sage/quadratic_forms/binary_qf.py +11 -11
- sage/quadratic_forms/bqf_class_group.py +26 -92
- sage/quadratic_forms/count_local_2.cpython-310-darwin.so +0 -0
- sage/quadratic_forms/extras.py +1 -1
- sage/quadratic_forms/quadratic_form.py +5 -4
- sage/quadratic_forms/quadratic_form__equivalence_testing.py +7 -4
- sage/quadratic_forms/quadratic_form__evaluate.cpython-310-darwin.so +0 -0
- sage/quadratic_forms/quadratic_form__local_field_invariants.py +10 -10
- sage/quadratic_forms/quadratic_form__ternary_Tornaria.py +2 -2
- sage/quadratic_forms/ternary.cpython-310-darwin.so +0 -0
- sage/quadratic_forms/ternary_qf.py +50 -83
- sage/rings/cfinite_sequence.py +16 -17
- sage/rings/complex_conversion.cpython-310-darwin.so +0 -0
- sage/rings/complex_double.cpython-310-darwin.so +0 -0
- sage/rings/complex_double.pxd +1 -0
- sage/rings/complex_double.pyx +37 -32
- sage/rings/complex_mpc.cpython-310-darwin.so +0 -0
- sage/rings/complex_mpc.pyx +27 -23
- sage/rings/complex_mpfr.cpython-310-darwin.so +0 -0
- sage/rings/complex_mpfr.pyx +11 -11
- sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py +277 -21
- sage/rings/function_field/drinfeld_modules/drinfeld_module.py +10 -1
- sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py +1 -1
- sage/rings/function_field/drinfeld_modules/homset.py +1 -2
- sage/rings/function_field/drinfeld_modules/morphism.py +2 -2
- sage/rings/function_field/hermite_form_polynomial.cpython-310-darwin.so +0 -0
- sage/rings/function_field/khuri_makdisi.cpython-310-darwin.so +0 -0
- sage/rings/function_field/khuri_makdisi.pyx +27 -25
- sage/rings/invariants/invariant_theory.py +61 -60
- sage/rings/invariants/reconstruction.py +8 -8
- sage/rings/polynomial/laurent_polynomial_mpair.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/ore_function_element.py +1 -1
- sage/rings/polynomial/ore_polynomial_element.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/ore_polynomial_element.pyx +8 -8
- sage/rings/polynomial/ore_polynomial_ring.py +134 -17
- sage/rings/polynomial/polynomial_real_mpfr_dense.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/skew_polynomial_element.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/skew_polynomial_finite_field.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/skew_polynomial_finite_field.pyx +3 -4
- sage/rings/polynomial/skew_polynomial_finite_order.cpython-310-darwin.so +0 -0
- sage/rings/polynomial/skew_polynomial_finite_order.pyx +2 -5
- sage/rings/real_double_element_gsl.cpython-310-darwin.so +0 -0
- sage/rings/real_mpfr.cpython-310-darwin.so +0 -0
- sage/rings/real_mpfr.pyx +25 -7
- sage/rings/ring_extension.cpython-310-darwin.so +0 -0
- sage/rings/ring_extension.pyx +4 -2
- sage/rings/ring_extension_conversion.cpython-310-darwin.so +0 -0
- sage/rings/ring_extension_element.cpython-310-darwin.so +0 -0
- sage/rings/ring_extension_element.pyx +42 -0
- sage/rings/ring_extension_morphism.cpython-310-darwin.so +0 -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/basic_stats.py +17 -15
- sage/stats/distributions/dgs_misc.h +11 -4
- sage/stats/distributions/discrete_gaussian_integer.cpython-310-darwin.so +0 -0
- sage/stats/distributions/discrete_gaussian_integer.pyx +9 -7
- sage/stats/hmm/chmm.cpython-310-darwin.so +0 -0
- sage/stats/hmm/chmm.pyx +13 -13
- sage/stats/hmm/distributions.cpython-310-darwin.so +0 -0
- sage/stats/hmm/distributions.pxd +3 -3
- sage/stats/hmm/distributions.pyx +3 -3
- sage/stats/hmm/hmm.cpython-310-darwin.so +0 -0
- sage/stats/hmm/hmm.pxd +3 -3
- sage/stats/hmm/hmm.pyx +6 -6
- sage/stats/hmm/util.cpython-310-darwin.so +0 -0
- sage/stats/hmm/util.pyx +6 -6
- sage/stats/intlist.cpython-310-darwin.so +0 -0
- sage/stats/intlist.pxd +3 -3
- sage/stats/time_series.cpython-310-darwin.so +0 -0
- sage/tensor/modules/alternating_contr_tensor.py +3 -3
- sage/tensor/modules/comp.py +3 -3
- sage/tensor/modules/ext_pow_free_module.py +3 -3
- sage/tensor/modules/format_utilities.py +3 -3
- sage/tensor/modules/free_module_linear_group.py +3 -3
- sage/tensor/modules/free_module_morphism.py +0 -1
- sage/tensor/modules/tensor_free_module.py +3 -3
- sage/tensor/modules/tensor_free_submodule.py +1 -1
- sage/tensor/modules/tensor_free_submodule_basis.py +1 -1
- sage/tensor/modules/tensor_with_indices.py +5 -5
- passagemath_modules.dylibs/libopenblas_armv8p-r0.3.28.dylib +0 -0
- {passagemath_modules-10.5.32.dist-info → passagemath_modules-10.6.20.dist-info}/top_level.txt +0 -0
sage/crypto/util.py
CHANGED
|
@@ -12,21 +12,19 @@ AUTHORS:
|
|
|
12
12
|
``is_blum_prime``, ``least_significant_bits``, ``random_blum_prime``.
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
# ***************************************************************************
|
|
16
16
|
# Copyright (c) 2009, 2010 Minh Van Nguyen <nguyenminh2@gmail.com>
|
|
17
17
|
#
|
|
18
18
|
# This program is free software: you can redistribute it and/or modify
|
|
19
19
|
# it under the terms of the GNU General Public License as published by
|
|
20
20
|
# the Free Software Foundation, either version 2 of the License, or
|
|
21
21
|
# (at your option) any later version.
|
|
22
|
-
#
|
|
23
|
-
|
|
22
|
+
# https://www.gnu.org/licenses/
|
|
23
|
+
# ***************************************************************************
|
|
24
24
|
|
|
25
|
-
from sage.arith.functions import lcm
|
|
26
25
|
from sage.arith.misc import is_prime, primes, random_prime
|
|
27
26
|
from sage.misc.lazy_import import lazy_import
|
|
28
27
|
from sage.rings.finite_rings.integer_mod import Mod as mod
|
|
29
|
-
from sage.rings.integer import Integer
|
|
30
28
|
|
|
31
29
|
lazy_import('sage.arith.misc', ('carmichael_lambda'), deprecation=34719)
|
|
32
30
|
lazy_import('sage.monoids.string_monoid', 'BinaryStrings')
|
|
@@ -259,7 +257,7 @@ def bin_to_ascii(B):
|
|
|
259
257
|
return "".join(A)
|
|
260
258
|
|
|
261
259
|
|
|
262
|
-
def has_blum_prime(lbound, ubound):
|
|
260
|
+
def has_blum_prime(lbound, ubound) -> bool:
|
|
263
261
|
r"""
|
|
264
262
|
Determine whether or not there is a Blum prime within the specified closed
|
|
265
263
|
interval.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
# Automatically generated by /private/var/folders/
|
|
1
|
+
# Automatically generated by /private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/build-env-dhl06n4x/lib/python3.10/site-packages/sage_setup/autogen/interpreters/internal/generator.py. Do not edit!
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-modules
|
|
2
|
-
# Automatically generated by /private/var/folders/
|
|
2
|
+
# Automatically generated by /private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/build-env-dhl06n4x/lib/python3.10/site-packages/sage_setup/autogen/interpreters/internal/generator.py. Do not edit!
|
|
Binary file
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-modules
|
|
2
|
-
# Automatically generated by /private/var/folders/
|
|
3
|
-
|
|
4
|
-
from cpython.ref cimport PyObject
|
|
5
|
-
|
|
6
|
-
from sage.ext.fast_callable cimport Wrapper
|
|
2
|
+
# Automatically generated by /private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/build-env-dhl06n4x/lib/python3.10/site-packages/sage_setup/autogen/interpreters/internal/generator.py. Do not edit!
|
|
7
3
|
|
|
8
4
|
from sage.rings.real_mpfr cimport RealNumber
|
|
9
5
|
from sage.libs.mpfr cimport *
|
|
10
6
|
from sage.rings.complex_mpfr cimport ComplexNumber
|
|
11
7
|
from sage.libs.mpc cimport *
|
|
12
8
|
|
|
9
|
+
from cpython.ref cimport PyObject
|
|
10
|
+
|
|
11
|
+
from sage.ext.fast_callable cimport Wrapper
|
|
12
|
+
|
|
13
13
|
cdef class Wrapper_cc(Wrapper):
|
|
14
14
|
cdef object domain
|
|
15
15
|
cdef ComplexNumber domain_element
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-modules
|
|
2
|
-
# Automatically generated by /private/var/folders/
|
|
2
|
+
# Automatically generated by /private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/build-env-dhl06n4x/lib/python3.10/site-packages/sage_setup/autogen/interpreters/internal/generator.py. Do not edit!
|
|
3
3
|
# distutils: libraries = mpfr mpc gmp
|
|
4
4
|
|
|
5
5
|
cdef public bint cc_py_call_helper(object domain, object fn,
|
|
Binary file
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-modules
|
|
2
|
-
# Automatically generated by /private/var/folders/
|
|
2
|
+
# Automatically generated by /private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/build-env-dhl06n4x/lib/python3.10/site-packages/sage_setup/autogen/interpreters/internal/generator.py. Do not edit!
|
|
3
|
+
|
|
4
|
+
# distutils: language = c++
|
|
5
|
+
cimport libcpp.complex
|
|
6
|
+
ctypedef libcpp.complex.complex[double] double_complex
|
|
3
7
|
|
|
4
8
|
from cpython.ref cimport PyObject
|
|
5
9
|
|
|
6
10
|
from sage.ext.fast_callable cimport Wrapper
|
|
7
11
|
|
|
8
|
-
# We need the type double_complex to work around
|
|
9
|
-
# http://trac.cython.org/ticket/869
|
|
10
|
-
# so this is a bit hackish.
|
|
11
|
-
cdef extern from "complex.h":
|
|
12
|
-
ctypedef double double_complex "double complex"
|
|
13
|
-
|
|
14
12
|
cdef class Wrapper_cdf(Wrapper):
|
|
15
13
|
cdef int _n_args
|
|
16
14
|
cdef double_complex* _args
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-modules
|
|
2
|
-
# Automatically generated by /private/var/folders/
|
|
2
|
+
# Automatically generated by /private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/build-env-dhl06n4x/lib/python3.10/site-packages/sage_setup/autogen/interpreters/internal/generator.py. Do not edit!
|
|
3
3
|
from sage.libs.gsl.complex cimport *
|
|
4
4
|
from sage.rings.complex_double cimport ComplexDoubleElement
|
|
5
5
|
import sage.rings.complex_double
|
|
6
6
|
cdef object CDF = sage.rings.complex_double.CDF
|
|
7
7
|
|
|
8
|
-
cdef extern from "complex.h":
|
|
9
|
-
cdef double creal(double_complex)
|
|
10
|
-
cdef double cimag(double_complex)
|
|
11
|
-
cdef double_complex _Complex_I
|
|
12
|
-
|
|
13
8
|
cdef inline double_complex CDE_to_dz(zz) noexcept:
|
|
14
9
|
cdef ComplexDoubleElement z = <ComplexDoubleElement>(zz if isinstance(zz, ComplexDoubleElement) else CDF(zz))
|
|
15
|
-
return GSL_REAL(z._complex)
|
|
10
|
+
return double_complex(GSL_REAL(z._complex), GSL_IMAG(z._complex))
|
|
16
11
|
|
|
17
12
|
cdef inline ComplexDoubleElement dz_to_CDE(double_complex dz):
|
|
18
13
|
cdef ComplexDoubleElement z = <ComplexDoubleElement>ComplexDoubleElement.__new__(ComplexDoubleElement)
|
|
19
|
-
GSL_SET_COMPLEX(&z._complex,
|
|
14
|
+
GSL_SET_COMPLEX(&z._complex, dz.real(), dz.imag())
|
|
20
15
|
return z
|
|
21
16
|
|
|
22
17
|
cdef public bint cdf_py_call_helper(object fn,
|
|
@@ -36,7 +31,6 @@ cdef public bint cdf_py_call_helper(object fn,
|
|
|
36
31
|
return 1
|
|
37
32
|
|
|
38
33
|
|
|
39
|
-
|
|
40
34
|
from cpython.ref cimport PyObject
|
|
41
35
|
cdef extern from "Python.h":
|
|
42
36
|
void Py_DECREF(PyObject *o)
|
|
@@ -59,7 +53,7 @@ cdef extern from "interp_cdf.c":
|
|
|
59
53
|
double_complex* constants,
|
|
60
54
|
PyObject** py_constants,
|
|
61
55
|
double_complex* stack,
|
|
62
|
-
int* code) except
|
|
56
|
+
int* code) except *
|
|
63
57
|
|
|
64
58
|
cdef class Wrapper_cdf(Wrapper):
|
|
65
59
|
# attributes are declared in corresponding .pxd file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-modules
|
|
2
|
-
# Automatically generated by /private/var/folders/
|
|
2
|
+
# Automatically generated by /private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/build-env-dhl06n4x/lib/python3.10/site-packages/sage_setup/autogen/interpreters/internal/generator.py. Do not edit!
|
|
3
3
|
|
|
4
4
|
from cpython.ref cimport PyObject
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-modules
|
|
2
|
-
# Automatically generated by /private/var/folders/
|
|
2
|
+
# Automatically generated by /private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/build-env-dhl06n4x/lib/python3.10/site-packages/sage_setup/autogen/interpreters/internal/generator.py. Do not edit!
|
|
3
3
|
cimport sage.libs.gsl.math # Add dependency on GSL
|
|
4
4
|
|
|
5
5
|
from cpython.ref cimport PyObject
|
|
Binary file
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-modules
|
|
2
|
-
# Automatically generated by /private/var/folders/
|
|
3
|
-
|
|
4
|
-
from cpython.ref cimport PyObject
|
|
5
|
-
|
|
6
|
-
from sage.ext.fast_callable cimport Wrapper
|
|
2
|
+
# Automatically generated by /private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/build-env-dhl06n4x/lib/python3.10/site-packages/sage_setup/autogen/interpreters/internal/generator.py. Do not edit!
|
|
7
3
|
|
|
8
4
|
from sage.rings.real_mpfr cimport RealField_class, RealNumber
|
|
9
5
|
from sage.libs.mpfr cimport *
|
|
10
6
|
|
|
11
7
|
|
|
8
|
+
from cpython.ref cimport PyObject
|
|
9
|
+
|
|
10
|
+
from sage.ext.fast_callable cimport Wrapper
|
|
11
|
+
|
|
12
12
|
cdef class Wrapper_rr(Wrapper):
|
|
13
13
|
cdef RealField_class domain
|
|
14
14
|
cdef int _n_args
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-modules
|
|
2
|
-
# Automatically generated by /private/var/folders/
|
|
2
|
+
# Automatically generated by /private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/build-env-dhl06n4x/lib/python3.10/site-packages/sage_setup/autogen/interpreters/internal/generator.py. Do not edit!
|
|
3
3
|
cdef public bint rr_py_call_helper(object domain, object fn,
|
|
4
4
|
int n_args,
|
|
5
5
|
mpfr_t* args, mpfr_t retval) except 0:
|
|
@@ -15,7 +15,6 @@ cdef public bint rr_py_call_helper(object domain, object fn,
|
|
|
15
15
|
return 1
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
from cpython.ref cimport PyObject
|
|
20
19
|
cdef extern from "Python.h":
|
|
21
20
|
void Py_DECREF(PyObject *o)
|
sage/geometry/toric_lattice.py
CHANGED
|
@@ -1057,7 +1057,7 @@ class ToricLattice_ambient(ToricLattice_generic, FreeModule_ambient_pid):
|
|
|
1057
1057
|
EXAMPLES::
|
|
1058
1058
|
|
|
1059
1059
|
sage: N = ToricLattice(3)
|
|
1060
|
-
sage: N.plot() # needs sage.plot
|
|
1060
|
+
sage: N.plot() # needs sage.geometry.polyhedron sage.plot
|
|
1061
1061
|
Graphics3d Object
|
|
1062
1062
|
"""
|
|
1063
1063
|
if "show_lattice" not in options:
|
|
@@ -1188,12 +1188,12 @@ class ToricLattice_sublattice_with_basis(ToricLattice_generic,
|
|
|
1188
1188
|
|
|
1189
1189
|
sage: N = ToricLattice(3)
|
|
1190
1190
|
sage: sublattice = N.submodule_with_basis([(1,1,0), (3,2,1)])
|
|
1191
|
-
sage: sublattice.plot() # needs sage.plot
|
|
1191
|
+
sage: sublattice.plot() # needs sage.geometry.polyhedron sage.plot
|
|
1192
1192
|
Graphics3d Object
|
|
1193
1193
|
|
|
1194
1194
|
Now we plot both the ambient lattice and its sublattice::
|
|
1195
1195
|
|
|
1196
|
-
sage: N.plot() + sublattice.plot(point_color='red') # needs sage.plot
|
|
1196
|
+
sage: N.plot() + sublattice.plot(point_color='red') # needs sage.geometry.polyhedron sage.plot
|
|
1197
1197
|
Graphics3d Object
|
|
1198
1198
|
"""
|
|
1199
1199
|
if "show_lattice" not in options:
|
|
Binary file
|
|
@@ -70,7 +70,7 @@ class QmodnZ(Parent, UniqueRepresentation):
|
|
|
70
70
|
"""
|
|
71
71
|
Element = QmodnZ_Element
|
|
72
72
|
|
|
73
|
-
def __init__(self, n=1):
|
|
73
|
+
def __init__(self, n=1) -> None:
|
|
74
74
|
r"""
|
|
75
75
|
Initialization.
|
|
76
76
|
|
|
@@ -91,7 +91,7 @@ class QmodnZ(Parent, UniqueRepresentation):
|
|
|
91
91
|
Parent.__init__(self, base=ZZ, category=category)
|
|
92
92
|
self._populate_coercion_lists_(coerce_list=[QQ])
|
|
93
93
|
|
|
94
|
-
def _repr_(self):
|
|
94
|
+
def _repr_(self) -> str:
|
|
95
95
|
r"""
|
|
96
96
|
Display the group.
|
|
97
97
|
|
|
@@ -157,7 +157,7 @@ class QmodnZ(Parent, UniqueRepresentation):
|
|
|
157
157
|
"""
|
|
158
158
|
return self.element_class(self, QQ(x))
|
|
159
159
|
|
|
160
|
-
def
|
|
160
|
+
def _an_element_(self):
|
|
161
161
|
"""
|
|
162
162
|
Return an element, for use in coercion system.
|
|
163
163
|
|
|
@@ -168,7 +168,7 @@ class QmodnZ(Parent, UniqueRepresentation):
|
|
|
168
168
|
"""
|
|
169
169
|
return self(0)
|
|
170
170
|
|
|
171
|
-
def some_elements(self):
|
|
171
|
+
def some_elements(self) -> list:
|
|
172
172
|
"""
|
|
173
173
|
Return some elements, for use in testing.
|
|
174
174
|
|
|
@@ -256,7 +256,7 @@ class CoxeterMatrixGroup(UniqueRepresentation, FinitelyGeneratedMatrixGroup_gene
|
|
|
256
256
|
sage: CoxeterGroup(['D',4], base_ring=QQ).category()
|
|
257
257
|
Category of finite irreducible Coxeter groups
|
|
258
258
|
|
|
259
|
-
sage: # needs sage.rings.number_field
|
|
259
|
+
sage: # needs sage.rings.number_field sage.symbolic
|
|
260
260
|
sage: CoxeterGroup(['H',4], base_ring=QQbar).category()
|
|
261
261
|
Category of finite irreducible Coxeter groups
|
|
262
262
|
sage: F = CoxeterGroups().Finite()
|
|
@@ -547,6 +547,18 @@ class CoxeterMatrixGroup(UniqueRepresentation, FinitelyGeneratedMatrixGroup_gene
|
|
|
547
547
|
[-1 1] [ 0 -1] [ 1 0]
|
|
548
548
|
[ 0 1], [-1 0], [ 1 -1]
|
|
549
549
|
]
|
|
550
|
+
|
|
551
|
+
TESTS::
|
|
552
|
+
|
|
553
|
+
sage: W = CoxeterGroup(CoxeterType(['A', 2]).relabel({1: 'r', 2: 's'}))
|
|
554
|
+
sage: F = W._positive_roots_reflections()
|
|
555
|
+
sage: F.keys()
|
|
556
|
+
[(1, 0), (1, 1), (0, 1)]
|
|
557
|
+
sage: list(F)
|
|
558
|
+
[
|
|
559
|
+
[-1 1] [ 0 -1] [ 1 0]
|
|
560
|
+
[ 0 1], [-1 0], [ 1 -1]
|
|
561
|
+
]
|
|
550
562
|
"""
|
|
551
563
|
if not self.is_finite():
|
|
552
564
|
raise NotImplementedError('not available for infinite groups')
|
|
@@ -558,13 +570,14 @@ class CoxeterMatrixGroup(UniqueRepresentation, FinitelyGeneratedMatrixGroup_gene
|
|
|
558
570
|
simple_roots = FreeModule(self.base_ring(), self.ngens()).gens()
|
|
559
571
|
|
|
560
572
|
refls = self.simple_reflections()
|
|
573
|
+
refls_index = {refl_i[1]: refl_i[0] for refl_i in enumerate(refls.keys())}
|
|
561
574
|
resu = []
|
|
562
575
|
d = {}
|
|
563
576
|
for i in range(1, N + 1):
|
|
564
577
|
segment = word[:i]
|
|
565
578
|
last = segment.pop()
|
|
566
579
|
ref = refls[last]
|
|
567
|
-
rt = simple_roots[last
|
|
580
|
+
rt = simple_roots[refls_index[last]]
|
|
568
581
|
while segment:
|
|
569
582
|
last = segment.pop()
|
|
570
583
|
cr = refls[last]
|
|
@@ -722,7 +735,7 @@ class CoxeterMatrixGroup(UniqueRepresentation, FinitelyGeneratedMatrixGroup_gene
|
|
|
722
735
|
def first_descent(self, side='right', index_set=None, positive=False):
|
|
723
736
|
"""
|
|
724
737
|
Return the first left (resp. right) descent of ``self``, as
|
|
725
|
-
|
|
738
|
+
an element of ``index_set``, or ``None`` if there is none.
|
|
726
739
|
|
|
727
740
|
See :meth:`descents` for a description of the options.
|
|
728
741
|
|
|
@@ -798,7 +811,7 @@ class CoxeterMatrixGroup(UniqueRepresentation, FinitelyGeneratedMatrixGroup_gene
|
|
|
798
811
|
return [I[i] for i in index_set if not _matrix_test_right_descent(M, i, n, zero)]
|
|
799
812
|
return [I[i] for i in index_set if _matrix_test_right_descent(M, i, n, zero)]
|
|
800
813
|
|
|
801
|
-
def has_right_descent(self, i):
|
|
814
|
+
def has_right_descent(self, i) -> bool:
|
|
802
815
|
r"""
|
|
803
816
|
Return whether ``i`` is a right descent of ``self``.
|
|
804
817
|
|
|
Binary file
|
|
@@ -778,7 +778,7 @@ class UnitCircleGroup(AbstractArgumentGroup):
|
|
|
778
778
|
raise ValueError('{} is not in {}'.format(data, self))
|
|
779
779
|
|
|
780
780
|
elif not isinstance(data, int) or data != 0:
|
|
781
|
-
raise ValueError('input is
|
|
781
|
+
raise ValueError('input is ambiguous: '
|
|
782
782
|
'{} as well as exponent={} '
|
|
783
783
|
'specified'.format(data, exponent))
|
|
784
784
|
|
|
@@ -1835,7 +1835,7 @@ class ArgumentGroupFactory(UniqueFactory):
|
|
|
1835
1835
|
domain is not None,
|
|
1836
1836
|
exponents is not None)):
|
|
1837
1837
|
raise ValueError(
|
|
1838
|
-
'input
|
|
1838
|
+
'input ambiguous: ' +
|
|
1839
1839
|
', '.join('{}={}'.format(s, v) for s, v in
|
|
1840
1840
|
[('data', data), ('specification', specification),
|
|
1841
1841
|
('domain', domain), ('exponents', exponents)]
|
|
@@ -20,15 +20,15 @@ AUTHORS:
|
|
|
20
20
|
Classes and Methods
|
|
21
21
|
===================
|
|
22
22
|
"""
|
|
23
|
-
|
|
23
|
+
# ****************************************************************************
|
|
24
24
|
# Copyright (C) 2018 Daniel Krenn <dev@danielkrenn.at>
|
|
25
25
|
#
|
|
26
26
|
# This program is free software: you can redistribute it and/or modify
|
|
27
27
|
# it under the terms of the GNU General Public License as published by
|
|
28
28
|
# the Free Software Foundation, either version 2 of the License, or
|
|
29
29
|
# (at your option) any later version.
|
|
30
|
-
#
|
|
31
|
-
|
|
30
|
+
# https://www.gnu.org/licenses/
|
|
31
|
+
# ****************************************************************************
|
|
32
32
|
|
|
33
33
|
from sage.structure.element import AdditiveGroupElement
|
|
34
34
|
from sage.structure.parent import Parent
|
|
@@ -472,7 +472,7 @@ class ImaginaryGroup(UniqueRepresentation, Parent):
|
|
|
472
472
|
raise ValueError('{} is not in {}'.format(data, self))
|
|
473
473
|
|
|
474
474
|
elif not isinstance(data, int) or data != 0:
|
|
475
|
-
raise ValueError('input is
|
|
475
|
+
raise ValueError('input is ambiguous: '
|
|
476
476
|
'{} as well as imag={} '
|
|
477
477
|
'specified'.format(data, imag))
|
|
478
478
|
|
|
Binary file
|
|
Binary file
|
sage/homology/chain_complex.py
CHANGED
|
@@ -55,13 +55,11 @@ from sage.structure.element import ModuleElement, Vector, coercion_model
|
|
|
55
55
|
from sage.misc.cachefunc import cached_method
|
|
56
56
|
|
|
57
57
|
from sage.rings.integer_ring import ZZ
|
|
58
|
-
from sage.rings.rational_field import QQ
|
|
59
58
|
from sage.modules.free_module import FreeModule
|
|
60
59
|
from sage.modules.free_module_element import vector
|
|
61
60
|
from sage.matrix.matrix0 import Matrix
|
|
62
61
|
from sage.matrix.constructor import matrix
|
|
63
62
|
from sage.misc.latex import latex
|
|
64
|
-
from sage.misc.superseded import deprecation
|
|
65
63
|
from sage.rings.fast_arith import prime_range
|
|
66
64
|
from sage.homology.homology_group import HomologyGroup
|
|
67
65
|
from sage.misc.persist import register_unpickle_override
|
|
@@ -226,13 +226,13 @@ class HochschildComplex(UniqueRepresentation, Parent):
|
|
|
226
226
|
sage: d1 = H.boundary(1)
|
|
227
227
|
sage: x = d1.domain().an_element(); x
|
|
228
228
|
2*s[] # s[] + 2*s[] # s[1] + 3*s[] # s[2]
|
|
229
|
-
sage: d1(x) # needs
|
|
229
|
+
sage: d1(x) # needs lrcalc_python
|
|
230
230
|
0
|
|
231
231
|
sage: y = tensor([s.an_element(), s.an_element()])
|
|
232
|
-
sage: d1(y) # needs
|
|
232
|
+
sage: d1(y) # needs lrcalc_python
|
|
233
233
|
0
|
|
234
234
|
sage: z = tensor([s[2,1] + s[3], s.an_element()])
|
|
235
|
-
sage: d1(z) # needs
|
|
235
|
+
sage: d1(z) # needs lrcalc_python
|
|
236
236
|
0
|
|
237
237
|
|
|
238
238
|
TESTS::
|
|
@@ -13,15 +13,15 @@ AUTHORS:
|
|
|
13
13
|
- John H. Palmieri (2015.09)
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
# ######################################################################
|
|
17
17
|
# Copyright (C) 2015 John H. Palmieri <palmieri@math.washington.edu>
|
|
18
18
|
#
|
|
19
19
|
# Distributed under the terms of the GNU General Public License (GPL)
|
|
20
20
|
# as published by the Free Software Foundation; either version 2 of
|
|
21
21
|
# the License, or (at your option) any later version.
|
|
22
22
|
#
|
|
23
|
-
#
|
|
24
|
-
|
|
23
|
+
# https://www.gnu.org/licenses/
|
|
24
|
+
# ######################################################################
|
|
25
25
|
|
|
26
26
|
# To do: implement morphisms of cubical complexes, with methods
|
|
27
27
|
# - domain
|
|
@@ -131,7 +131,7 @@ class InducedHomologyMorphism(Morphism):
|
|
|
131
131
|
sage: diag_c(c)
|
|
132
132
|
h^{1,0}
|
|
133
133
|
"""
|
|
134
|
-
def __init__(self, map, base_ring=None, cohomology=False):
|
|
134
|
+
def __init__(self, map, base_ring=None, cohomology=False) -> None:
|
|
135
135
|
"""
|
|
136
136
|
INPUT:
|
|
137
137
|
|
|
@@ -387,7 +387,7 @@ class InducedHomologyMorphism(Morphism):
|
|
|
387
387
|
"""
|
|
388
388
|
return self.to_matrix().right_nullity() == 0
|
|
389
389
|
|
|
390
|
-
def _repr_type(self):
|
|
390
|
+
def _repr_type(self) -> str:
|
|
391
391
|
"""
|
|
392
392
|
EXAMPLES::
|
|
393
393
|
|
|
@@ -401,7 +401,7 @@ class InducedHomologyMorphism(Morphism):
|
|
|
401
401
|
"""
|
|
402
402
|
return "Graded vector space" if not self._cohomology else "Graded algebra"
|
|
403
403
|
|
|
404
|
-
def _repr_defn(self):
|
|
404
|
+
def _repr_defn(self) -> str:
|
|
405
405
|
"""
|
|
406
406
|
EXAMPLES::
|
|
407
407
|
|
|
@@ -445,7 +445,7 @@ class HomologyVectorSpaceWithBasis(CombinatorialFreeModule):
|
|
|
445
445
|
tester = self._tester(**options)
|
|
446
446
|
dual = self.dual()
|
|
447
447
|
dims = [a[0] for a in self._indices]
|
|
448
|
-
for dim in range(max(
|
|
448
|
+
for dim in range(max(*dims, tester._max_runs) + 1):
|
|
449
449
|
n = len(self.basis(dim))
|
|
450
450
|
m = matrix(n, n, [a.eval(b) for a in self.basis(dim) for b in dual.basis(dim)])
|
|
451
451
|
tester.assertEqual(m, 1, f"error in dimension {dim}")
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
sage/matrix/args.pyx
CHANGED
|
@@ -298,9 +298,12 @@ cdef class MatrixArgs:
|
|
|
298
298
|
Test invalid input::
|
|
299
299
|
|
|
300
300
|
sage: MatrixArgs(ZZ, 2, 2, entries='abcd').finalized()
|
|
301
|
+
<MatrixArgs for Full MatrixSpace of 2 by 2 dense matrices
|
|
302
|
+
over Integer Ring; typ=SCALAR; entries='abcd'>
|
|
303
|
+
sage: matrix(ZZ, 2, 2, entries='abcd')
|
|
301
304
|
Traceback (most recent call last):
|
|
302
305
|
...
|
|
303
|
-
TypeError: unable to convert 'abcd' to
|
|
306
|
+
TypeError: unable to convert 'abcd' to an integer
|
|
304
307
|
sage: MatrixArgs(ZZ, 2, 2, entries=MatrixArgs()).finalized()
|
|
305
308
|
Traceback (most recent call last):
|
|
306
309
|
...
|
|
@@ -396,7 +399,7 @@ cdef class MatrixArgs:
|
|
|
396
399
|
# but do not check for positional row_keys, column_keys arguments
|
|
397
400
|
# -- we do not allow those, as they would be too easy to
|
|
398
401
|
# confuse with entries
|
|
399
|
-
cdef
|
|
402
|
+
cdef Py_ssize_t k
|
|
400
403
|
cdef long v
|
|
401
404
|
if self.nrows == -1 and self.ncols == -1:
|
|
402
405
|
for k in range(2):
|
|
@@ -1522,12 +1525,19 @@ cdef class MatrixArgs:
|
|
|
1522
1525
|
[() 0 0]
|
|
1523
1526
|
[ 0 () 0]
|
|
1524
1527
|
[ 0 0 ()]
|
|
1528
|
+
|
|
1529
|
+
Verify that :issue:`34821` is fixed::
|
|
1530
|
+
|
|
1531
|
+
sage: matrix(ZZ, 2, 2, "3")
|
|
1532
|
+
[3 0]
|
|
1533
|
+
[0 3]
|
|
1525
1534
|
"""
|
|
1526
1535
|
# Check basic Python types. This is very fast, so it doesn't
|
|
1527
1536
|
# hurt to do these first.
|
|
1528
1537
|
if self.entries is None:
|
|
1529
1538
|
return MA_ENTRIES_ZERO
|
|
1530
|
-
if isinstance(self.entries, (int, float, complex, Integer)):
|
|
1539
|
+
if isinstance(self.entries, (int, float, complex, Integer, str)):
|
|
1540
|
+
# Note that a string is not considered to be a sequence.
|
|
1531
1541
|
if self.entries:
|
|
1532
1542
|
return MA_ENTRIES_SCALAR
|
|
1533
1543
|
return MA_ENTRIES_ZERO
|
|
@@ -1572,9 +1582,6 @@ cdef class MatrixArgs:
|
|
|
1572
1582
|
if isinstance(self.entries, MatrixArgs):
|
|
1573
1583
|
# Prevent recursion
|
|
1574
1584
|
return MA_ENTRIES_UNKNOWN
|
|
1575
|
-
if isinstance(self.entries, str):
|
|
1576
|
-
# Blacklist strings, we don't want them to be considered a sequence
|
|
1577
|
-
return MA_ENTRIES_UNKNOWN
|
|
1578
1585
|
try:
|
|
1579
1586
|
self.entries = list(self.entries)
|
|
1580
1587
|
except TypeError:
|
|
@@ -1593,6 +1600,16 @@ cdef class MatrixArgs:
|
|
|
1593
1600
|
is a sequence.
|
|
1594
1601
|
|
|
1595
1602
|
If the entries are invalid, return ``MA_ENTRIES_UNKNOWN``.
|
|
1603
|
+
|
|
1604
|
+
TESTS:
|
|
1605
|
+
|
|
1606
|
+
Verify that :issue:`34821` is fixed::
|
|
1607
|
+
|
|
1608
|
+
sage: matrix(ZZ, 1,2, ["1", "2"])
|
|
1609
|
+
[1 2]
|
|
1610
|
+
sage: matrix(ZZ, 2,1, ["1", "2"])
|
|
1611
|
+
[1]
|
|
1612
|
+
[2]
|
|
1596
1613
|
"""
|
|
1597
1614
|
if not self.entries:
|
|
1598
1615
|
return MA_ENTRIES_SEQ_FLAT
|
|
@@ -1608,13 +1625,11 @@ cdef class MatrixArgs:
|
|
|
1608
1625
|
return MA_ENTRIES_SEQ_SEQ
|
|
1609
1626
|
else:
|
|
1610
1627
|
return MA_ENTRIES_SEQ_FLAT
|
|
1611
|
-
if isinstance(x, (int, float, complex)):
|
|
1628
|
+
if isinstance(x, (int, float, complex, str)):
|
|
1629
|
+
# Note that a string is not considered to be a sequence.
|
|
1612
1630
|
return MA_ENTRIES_SEQ_FLAT
|
|
1613
1631
|
if isinstance(x, Element) and element_is_scalar(<Element>x):
|
|
1614
1632
|
return MA_ENTRIES_SEQ_FLAT
|
|
1615
|
-
if isinstance(x, str):
|
|
1616
|
-
# Blacklist strings, we don't want them to be considered a sequence
|
|
1617
|
-
return MA_ENTRIES_UNKNOWN
|
|
1618
1633
|
try:
|
|
1619
1634
|
iter(x)
|
|
1620
1635
|
except TypeError:
|
sage/matrix/benchmark.py
CHANGED
|
@@ -19,13 +19,17 @@ The basic command syntax is as follows::
|
|
|
19
19
|
======================================================================
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
import sys
|
|
23
|
+
|
|
24
|
+
from sage.matrix.constructor import Matrix, random_matrix
|
|
23
25
|
from sage.misc.lazy_import import lazy_import
|
|
26
|
+
from sage.misc.timing import cputime
|
|
27
|
+
from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF
|
|
24
28
|
from sage.rings.integer_ring import ZZ
|
|
25
29
|
from sage.rings.rational_field import QQ
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
from cysignals.alarm import AlarmInterrupt, alarm, cancel_alarm
|
|
30
|
+
|
|
31
|
+
if sys.platform != 'win32':
|
|
32
|
+
from cysignals.alarm import AlarmInterrupt, alarm, cancel_alarm
|
|
29
33
|
|
|
30
34
|
lazy_import('sage.interfaces.magma', 'magma')
|
|
31
35
|
|
sage/matrix/compute_J_ideal.py
CHANGED
|
@@ -494,7 +494,7 @@ class ComputeMinimalPolynomials(SageObject):
|
|
|
494
494
|
verbose("Generators with (p^t)-generating property:")
|
|
495
495
|
verbose(generators)
|
|
496
496
|
|
|
497
|
-
heap =
|
|
497
|
+
heap = [(f.degree(), f) for f in generators]
|
|
498
498
|
heapq.heapify(heap)
|
|
499
499
|
|
|
500
500
|
# find poly of minimal degree
|
|
@@ -795,7 +795,7 @@ class ComputeMinimalPolynomials(SageObject):
|
|
|
795
795
|
if s_max < t:
|
|
796
796
|
result = {r: polynomial
|
|
797
797
|
for r, polynomial in p_min_polys.items() if r < s_max}
|
|
798
|
-
next_t_candidates =
|
|
798
|
+
next_t_candidates = [r for r in p_min_polys if r >= s_max]
|
|
799
799
|
if next_t_candidates:
|
|
800
800
|
next_t = min(next_t_candidates)
|
|
801
801
|
result.update({s_max: p_min_polys[next_t] % p**s_max})
|
|
Binary file
|
|
Binary file
|
sage/matrix/echelon_matrix.pyx
CHANGED
|
Binary file
|