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
|
Binary file
|
|
Binary file
|
sage/matrix/matrix_sparse.pyx
CHANGED
|
@@ -17,7 +17,6 @@ from cysignals.signals cimport sig_check
|
|
|
17
17
|
cimport sage.matrix.matrix as matrix
|
|
18
18
|
cimport sage.matrix.matrix0 as matrix0
|
|
19
19
|
from sage.categories.rings import Rings
|
|
20
|
-
from sage.calculus.functional import derivative
|
|
21
20
|
from sage.structure.element cimport Element, Vector
|
|
22
21
|
from sage.structure.richcmp cimport richcmp_item, rich_to_bool
|
|
23
22
|
|
|
@@ -937,18 +936,18 @@ cdef class Matrix_sparse(matrix.Matrix):
|
|
|
937
936
|
|
|
938
937
|
cdef Py_ssize_t nrows, ncols, k, i, j
|
|
939
938
|
|
|
940
|
-
ncols =
|
|
941
|
-
nrows =
|
|
939
|
+
ncols = len(columns)
|
|
940
|
+
nrows = len(rows)
|
|
942
941
|
cdef Matrix_sparse A = self.new_matrix(nrows=nrows, ncols=ncols)
|
|
943
942
|
|
|
944
943
|
tmp = [el for el in columns if 0 <= el < self._ncols]
|
|
945
944
|
columns = tmp
|
|
946
|
-
if ncols !=
|
|
945
|
+
if ncols != len(columns):
|
|
947
946
|
raise IndexError("column index out of range")
|
|
948
947
|
|
|
949
948
|
tmp = [el for el in rows if 0 <= el < self._nrows]
|
|
950
949
|
rows = tmp
|
|
951
|
-
if nrows !=
|
|
950
|
+
if nrows != len(rows):
|
|
952
951
|
raise IndexError("row index out of range")
|
|
953
952
|
|
|
954
953
|
row_map = {}
|
|
@@ -1151,7 +1150,7 @@ cdef class Matrix_sparse(matrix.Matrix):
|
|
|
1151
1150
|
sage: (v * m).parent() is m.row(0).parent()
|
|
1152
1151
|
True
|
|
1153
1152
|
"""
|
|
1154
|
-
cdef
|
|
1153
|
+
cdef Py_ssize_t i, j
|
|
1155
1154
|
if self._nrows != v._degree:
|
|
1156
1155
|
raise ArithmeticError("number of rows of matrix must equal degree of vector")
|
|
1157
1156
|
parent = self.row_ambient_module(base_ring=None, sparse=v.is_sparse_c())
|
|
@@ -1204,7 +1203,7 @@ cdef class Matrix_sparse(matrix.Matrix):
|
|
|
1204
1203
|
sage: M*w
|
|
1205
1204
|
(x*y)
|
|
1206
1205
|
"""
|
|
1207
|
-
cdef
|
|
1206
|
+
cdef Py_ssize_t i, j
|
|
1208
1207
|
if self._ncols != v._degree:
|
|
1209
1208
|
raise ArithmeticError("number of columns of matrix must equal degree of vector")
|
|
1210
1209
|
parent = self.column_ambient_module(base_ring=None, sparse=v.is_sparse_c())
|
|
Binary file
|
sage/matrix/matrix_window.pyx
CHANGED
|
@@ -67,8 +67,8 @@ cdef class MatrixWindow:
|
|
|
67
67
|
a = self._matrix.new_matrix(nrows, ncols)
|
|
68
68
|
return self.new_matrix_window(a, 0, 0, nrows, ncols)
|
|
69
69
|
|
|
70
|
-
def __repr__(self):
|
|
71
|
-
return "Matrix window of size %s x %s at (%s,%s):\n%s"%(
|
|
70
|
+
def __repr__(self) -> str:
|
|
71
|
+
return "Matrix window of size %s x %s at (%s,%s):\n%s" % (
|
|
72
72
|
self._nrows, self._ncols, self._row, self._col, self._matrix)
|
|
73
73
|
|
|
74
74
|
############################
|
|
Binary file
|
sage/matrix/operation_table.py
CHANGED
|
@@ -15,8 +15,6 @@ This module implements general operation tables, which are very matrix-like.
|
|
|
15
15
|
# https://www.gnu.org/licenses/
|
|
16
16
|
# ****************************************************************************
|
|
17
17
|
|
|
18
|
-
from copy import copy
|
|
19
|
-
|
|
20
18
|
from sage.structure.sage_object import SageObject
|
|
21
19
|
from sage.matrix.constructor import Matrix
|
|
22
20
|
|
sage/matrix/special.py
CHANGED
|
@@ -3013,6 +3013,10 @@ def random_unimodular_matrix(parent, upper_bound=None, max_tries=100):
|
|
|
3013
3013
|
sage: y = polygen(ZZ, 'y')
|
|
3014
3014
|
sage: K = NumberField(y^2 - 2*y - 2, 'y')
|
|
3015
3015
|
sage: C = random_matrix(K, 3, algorithm='unimodular')
|
|
3016
|
+
sage: C # random
|
|
3017
|
+
[ -1/7*y + 47/35 3/5*y - 127/70 -2917/70*y + 4419/70]
|
|
3018
|
+
[ 1 1/2*y - 1/2 -104/3*y + 211/6]
|
|
3019
|
+
[ 1/3*y - 1/3 y - 1 -35/6*y - 149/6]
|
|
3016
3020
|
sage: det(C)
|
|
3017
3021
|
1
|
|
3018
3022
|
sage: C.base_ring() is K
|
|
@@ -3130,7 +3134,7 @@ def random_diagonalizable_matrix(parent, eigenvalues=None, dimensions=None):
|
|
|
3130
3134
|
sage: M = random_matrix(K, 3, 3, algorithm="diagonalizable")
|
|
3131
3135
|
sage: M.parent()
|
|
3132
3136
|
Full MatrixSpace of 3 by 3 dense matrices over Finite Field of size 3
|
|
3133
|
-
sage: M.is_diagonalizable()
|
|
3137
|
+
sage: M.is_diagonalizable() # needs sage.libs.pari
|
|
3134
3138
|
True
|
|
3135
3139
|
sage: M # random
|
|
3136
3140
|
[0 0 1]
|
|
Binary file
|
sage/matrix/strassen.pyx
CHANGED
|
@@ -806,7 +806,7 @@ def test(n, m, R, c=2):
|
|
|
806
806
|
|
|
807
807
|
# TODO -- the doctests below are currently not
|
|
808
808
|
# tested/enabled/working -- enable them when linear algebra
|
|
809
|
-
#
|
|
809
|
+
# restructuring gets going.
|
|
810
810
|
|
|
811
811
|
# sage: dim1 = 64; dim2 = 83; dim3 = 101
|
|
812
812
|
# sage: R = MatrixSpace(QQ, dim1, dim2)
|
|
Binary file
|
|
Binary file
|
sage/matroids/chow_ring.py
CHANGED
|
@@ -188,25 +188,25 @@ class ChowRing(QuotientRing_generic):
|
|
|
188
188
|
|
|
189
189
|
sage: ch = matroids.Uniform(3, 6).chow_ring(QQ, True, 'fy')
|
|
190
190
|
sage: ch.basis()
|
|
191
|
-
Family (1,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
191
|
+
Family (1, B0, B0*B012345, B1, B1*B012345, B01, B01^2, B2,
|
|
192
|
+
B2*B012345, B12, B12^2, B02, B02^2, B3, B3*B012345, B23, B23^2,
|
|
193
|
+
B13, B13^2, B03, B03^2, B4, B4*B012345, B34, B34^2, B24, B24^2,
|
|
194
|
+
B14, B14^2, B04, B04^2, B5, B5*B012345, B45, B45^2, B35, B35^2,
|
|
195
|
+
B25, B25^2, B15, B15^2, B05, B05^2, B012345, B012345^2, B012345^3)
|
|
196
196
|
sage: set(ch.defining_ideal().normal_basis()) == set(ch.basis())
|
|
197
197
|
True
|
|
198
198
|
sage: ch = matroids.catalog.Fano().chow_ring(QQ, False)
|
|
199
199
|
sage: ch.basis()
|
|
200
|
-
Family (1, Abcd, Aace,
|
|
201
|
-
|
|
200
|
+
Family (1, Abcd, Aace, Adef, Aabf, Acfg, Abeg, Aadg, Aabcdefg,
|
|
201
|
+
Aabcdefg^2)
|
|
202
202
|
sage: set(ch.defining_ideal().normal_basis()) == set(ch.basis())
|
|
203
203
|
True
|
|
204
204
|
sage: ch = matroids.Wheel(3).chow_ring(QQ, True, 'atom-free')
|
|
205
205
|
sage: ch.basis()
|
|
206
|
-
Family (1, A0, A0*A012345,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
206
|
+
Family (1, A0, A0*A012345, A1, A1*A012345, A2, A2*A012345, A3,
|
|
207
|
+
A3*A012345, A23, A23^2, A013, A013^2, A4, A4*A012345, A124, A124^2,
|
|
208
|
+
A04, A04^2, A5, A5*A012345, A345, A345^2, A15, A15^2, A025, A025^2,
|
|
209
|
+
A012345, A012345^2, A012345^3)
|
|
210
210
|
sage: set(ch.defining_ideal().normal_basis()) == set(ch.basis())
|
|
211
211
|
True
|
|
212
212
|
"""
|
|
@@ -247,12 +247,14 @@ class ChowRing(QuotientRing_generic):
|
|
|
247
247
|
....: basis_deg[deg].append(b)
|
|
248
248
|
....:
|
|
249
249
|
sage: basis_deg
|
|
250
|
-
{0: [1],
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
250
|
+
{0: [1],
|
|
251
|
+
1: [A01, A12, A02, A012, A23, A13, A123, A03, A013, A023, A34, A24,
|
|
252
|
+
A234, A14, A124, A134, A04, A014, A024, A034, A01234],
|
|
253
|
+
2: [A01*A01234, A12*A01234, A02*A01234, A012^2, A23*A01234,
|
|
254
|
+
A13*A01234, A123^2, A03*A01234, A013^2, A023^2, A34*A01234,
|
|
255
|
+
A24*A01234, A234^2, A14*A01234, A124^2, A134^2, A04*A01234,
|
|
256
|
+
A014^2, A024^2, A034^2, A01234^2],
|
|
257
|
+
3: [A01234^3]}
|
|
256
258
|
sage: g_eq_maps = {}
|
|
257
259
|
sage: lefschetz_el = ch.lefschetz_element(); lefschetz_el
|
|
258
260
|
-2*A01 - 2*A02 - 2*A03 - 2*A04 - 2*A12 - 2*A13 - 2*A14 - 2*A23
|
|
@@ -264,37 +266,38 @@ class ChowRing(QuotientRing_generic):
|
|
|
264
266
|
....: g_eq_maps[deg].extend([i*lefschetz_el for i in basis_deg[deg]])
|
|
265
267
|
....:
|
|
266
268
|
sage: g_eq_maps
|
|
267
|
-
{0: [-2*A01 - 2*A02 - 2*A03 - 2*A04 - 2*A12 - 2*A13 - 2*A14
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
269
|
+
{0: [-2*A01 - 2*A02 - 2*A03 - 2*A04 - 2*A12 - 2*A13 - 2*A14 - 2*A23
|
|
270
|
+
- 2*A24 - 2*A34 - 6*A012 - 6*A013 - 6*A014 - 6*A023 - 6*A024
|
|
271
|
+
- 6*A034 - 6*A123 - 6*A124 - 6*A134 - 6*A234 - 20*A01234],
|
|
272
|
+
1: [2*A012^2 + 2*A013^2 + 2*A014^2 - 10*A01*A01234 + 2*A01234^2,
|
|
273
|
+
2*A012^2 + 2*A123^2 + 2*A124^2 - 10*A12*A01234 + 2*A01234^2,
|
|
274
|
+
2*A012^2 + 2*A023^2 + 2*A024^2 - 10*A02*A01234 + 2*A01234^2,
|
|
275
|
+
-6*A012^2 + 2*A01*A01234 + 2*A02*A01234 + 2*A12*A01234,
|
|
276
|
+
2*A023^2 + 2*A123^2 + 2*A234^2 - 10*A23*A01234 + 2*A01234^2,
|
|
277
|
+
2*A013^2 + 2*A123^2 + 2*A134^2 - 10*A13*A01234 + 2*A01234^2,
|
|
278
|
+
-6*A123^2 + 2*A12*A01234 + 2*A13*A01234 + 2*A23*A01234,
|
|
279
|
+
2*A013^2 + 2*A023^2 + 2*A034^2 - 10*A03*A01234 + 2*A01234^2,
|
|
280
|
+
-6*A013^2 + 2*A01*A01234 + 2*A03*A01234 + 2*A13*A01234,
|
|
281
|
+
-6*A023^2 + 2*A02*A01234 + 2*A03*A01234 + 2*A23*A01234,
|
|
282
|
+
2*A034^2 + 2*A134^2 + 2*A234^2 - 10*A34*A01234 + 2*A01234^2,
|
|
283
|
+
2*A024^2 + 2*A124^2 + 2*A234^2 - 10*A24*A01234 + 2*A01234^2,
|
|
284
|
+
-6*A234^2 + 2*A23*A01234 + 2*A24*A01234 + 2*A34*A01234,
|
|
285
|
+
2*A014^2 + 2*A124^2 + 2*A134^2 - 10*A14*A01234 + 2*A01234^2,
|
|
286
|
+
-6*A124^2 + 2*A12*A01234 + 2*A14*A01234 + 2*A24*A01234,
|
|
287
|
+
-6*A134^2 + 2*A13*A01234 + 2*A14*A01234 + 2*A34*A01234,
|
|
288
|
+
2*A014^2 + 2*A024^2 + 2*A034^2 - 10*A04*A01234 + 2*A01234^2,
|
|
289
|
+
-6*A014^2 + 2*A01*A01234 + 2*A04*A01234 + 2*A14*A01234,
|
|
290
|
+
-6*A024^2 + 2*A02*A01234 + 2*A04*A01234 + 2*A24*A01234,
|
|
291
|
+
-6*A034^2 + 2*A03*A01234 + 2*A04*A01234 + 2*A34*A01234,
|
|
292
|
+
-2*A01*A01234 - 2*A02*A01234 - 2*A03*A01234 - 2*A04*A01234
|
|
293
|
+
- 2*A12*A01234 - 2*A13*A01234 - 2*A14*A01234 - 2*A23*A01234
|
|
294
|
+
- 2*A24*A01234 - 2*A34*A01234 - 20*A01234^2],
|
|
295
|
+
2: [2*A01234^3, 2*A01234^3, 2*A01234^3, 6*A01234^3, 2*A01234^3,
|
|
296
|
+
2*A01234^3, 6*A01234^3, 2*A01234^3, 6*A01234^3, 6*A01234^3,
|
|
297
|
+
2*A01234^3, 2*A01234^3, 6*A01234^3, 2*A01234^3, 6*A01234^3,
|
|
298
|
+
6*A01234^3, 2*A01234^3, 6*A01234^3, 6*A01234^3, 6*A01234^3,
|
|
299
|
+
-20*A01234^3],
|
|
300
|
+
3: [0]}
|
|
298
301
|
"""
|
|
299
302
|
w = sum(len(F) * (len(self.matroid().groundset()) - len(F)) * gen
|
|
300
303
|
for F, gen in self.defining_ideal().flats_to_generator_dict().items())
|
|
@@ -338,7 +341,7 @@ class ChowRing(QuotientRing_generic):
|
|
|
338
341
|
sage: v = ch.an_element(); v
|
|
339
342
|
-A01 - A02 - A03 - A04 - A05 - A012345
|
|
340
343
|
sage: v.to_vector()
|
|
341
|
-
(0, -1,
|
|
344
|
+
(0, -1, 0, -1, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, -1, -1, 0)
|
|
342
345
|
"""
|
|
343
346
|
P = self.parent()
|
|
344
347
|
B = P.basis()
|
|
@@ -379,20 +382,20 @@ class ChowRing(QuotientRing_generic):
|
|
|
379
382
|
....: print(b, b.degree())
|
|
380
383
|
1 0
|
|
381
384
|
A01 1
|
|
382
|
-
A02 1
|
|
383
385
|
A12 1
|
|
384
|
-
|
|
385
|
-
A13 1
|
|
386
|
+
A02 1
|
|
386
387
|
A23 1
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
A24 1
|
|
388
|
+
A13 1
|
|
389
|
+
A03 1
|
|
390
390
|
A34 1
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
A35 1
|
|
391
|
+
A24 1
|
|
392
|
+
A14 1
|
|
393
|
+
A04 1
|
|
395
394
|
A45 1
|
|
395
|
+
A35 1
|
|
396
|
+
A25 1
|
|
397
|
+
A15 1
|
|
398
|
+
A05 1
|
|
396
399
|
A012345 1
|
|
397
400
|
A012345^2 2
|
|
398
401
|
sage: v = sum(ch.basis())
|
|
@@ -428,18 +431,18 @@ class ChowRing(QuotientRing_generic):
|
|
|
428
431
|
Bace^2 2
|
|
429
432
|
Bf 1
|
|
430
433
|
Bf*Babcdefg 2
|
|
431
|
-
Babf 1
|
|
432
|
-
Babf^2 2
|
|
433
434
|
Bdef 1
|
|
434
435
|
Bdef^2 2
|
|
436
|
+
Babf 1
|
|
437
|
+
Babf^2 2
|
|
435
438
|
Bg 1
|
|
436
439
|
Bg*Babcdefg 2
|
|
437
|
-
Badg 1
|
|
438
|
-
Badg^2 2
|
|
439
|
-
Bbeg 1
|
|
440
|
-
Bbeg^2 2
|
|
441
440
|
Bcfg 1
|
|
442
441
|
Bcfg^2 2
|
|
442
|
+
Bbeg 1
|
|
443
|
+
Bbeg^2 2
|
|
444
|
+
Badg 1
|
|
445
|
+
Badg^2 2
|
|
443
446
|
Babcdefg 1
|
|
444
447
|
Babcdefg^2 2
|
|
445
448
|
Babcdefg^3 3
|
sage/matroids/chow_ring_ideal.py
CHANGED
|
@@ -17,12 +17,13 @@ AUTHORS:
|
|
|
17
17
|
# https://www.gnu.org/licenses/
|
|
18
18
|
# ****************************************************************************
|
|
19
19
|
|
|
20
|
-
from
|
|
20
|
+
from itertools import product
|
|
21
|
+
|
|
22
|
+
from sage.combinat.posets.posets import Poset
|
|
21
23
|
from sage.matroids.utilities import cmp_elements_key
|
|
22
|
-
from sage.rings.polynomial.
|
|
24
|
+
from sage.rings.polynomial.multi_polynomial_ideal import MPolynomialIdeal
|
|
23
25
|
from sage.rings.polynomial.multi_polynomial_sequence import PolynomialSequence
|
|
24
|
-
from sage.
|
|
25
|
-
from itertools import product
|
|
26
|
+
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
class ChowRingIdeal(MPolynomialIdeal):
|
|
@@ -39,7 +40,7 @@ class ChowRingIdeal(MPolynomialIdeal):
|
|
|
39
40
|
"""
|
|
40
41
|
return self._matroid
|
|
41
42
|
|
|
42
|
-
def _lattice_flats(self):
|
|
43
|
+
def _lattice_flats(self) -> tuple:
|
|
43
44
|
r"""
|
|
44
45
|
Return the ranks and chains of lattice of flats of the matroid.
|
|
45
46
|
|
|
@@ -67,7 +68,7 @@ class ChowRingIdeal(MPolynomialIdeal):
|
|
|
67
68
|
chains = lattice_flats.chains() # Only chains
|
|
68
69
|
return (ranks, chains)
|
|
69
70
|
|
|
70
|
-
def flats_to_generator_dict(self):
|
|
71
|
+
def flats_to_generator_dict(self) -> dict:
|
|
71
72
|
r"""
|
|
72
73
|
Return the corresponding generators of flats/groundset elements of
|
|
73
74
|
Chow ring ideal.
|
|
@@ -148,7 +149,7 @@ class ChowRingIdeal_nonaug(ChowRingIdeal):
|
|
|
148
149
|
Chow ring ideal of Fano: Binary matroid of rank 3 on 7 elements,
|
|
149
150
|
type (3, 0) - non augmented
|
|
150
151
|
"""
|
|
151
|
-
def __init__(self, M, R):
|
|
152
|
+
def __init__(self, M, R) -> None:
|
|
152
153
|
r"""
|
|
153
154
|
Initialize ``self``.
|
|
154
155
|
|
|
@@ -169,7 +170,7 @@ class ChowRingIdeal_nonaug(ChowRingIdeal):
|
|
|
169
170
|
self._flats_generator = dict(zip(flats, gens))
|
|
170
171
|
MPolynomialIdeal.__init__(self, poly_ring, self._gens_constructor(poly_ring))
|
|
171
172
|
|
|
172
|
-
def _gens_constructor(self, poly_ring):
|
|
173
|
+
def _gens_constructor(self, poly_ring) -> list:
|
|
173
174
|
r"""
|
|
174
175
|
Return the generators of ``self``.
|
|
175
176
|
|
|
@@ -217,7 +218,7 @@ class ChowRingIdeal_nonaug(ChowRingIdeal):
|
|
|
217
218
|
J = list(atoms_gen.values()) # Linear generators
|
|
218
219
|
return I + J
|
|
219
220
|
|
|
220
|
-
def _repr_(self):
|
|
221
|
+
def _repr_(self) -> str:
|
|
221
222
|
r"""
|
|
222
223
|
Return a string representation of ``self``.
|
|
223
224
|
|
|
@@ -230,7 +231,7 @@ class ChowRingIdeal_nonaug(ChowRingIdeal):
|
|
|
230
231
|
"""
|
|
231
232
|
return "Chow ring ideal of {} - non augmented".format(self._matroid)
|
|
232
233
|
|
|
233
|
-
def _latex_(self):
|
|
234
|
+
def _latex_(self) -> str:
|
|
234
235
|
r"""
|
|
235
236
|
Return a LaTeX representation of ``self``.
|
|
236
237
|
|
|
@@ -273,7 +274,7 @@ class ChowRingIdeal_nonaug(ChowRingIdeal):
|
|
|
273
274
|
algorithm = 'constructed'
|
|
274
275
|
if algorithm != 'constructed':
|
|
275
276
|
return super().groebner_basis(algorithm=algorithm, *args, **kwargs)
|
|
276
|
-
flats = sorted(
|
|
277
|
+
flats = sorted(self._flats_generator, key=len)
|
|
277
278
|
ranks = {F: self._matroid.rank(F) for F in flats}
|
|
278
279
|
gb = []
|
|
279
280
|
R = self.ring()
|
|
@@ -291,7 +292,7 @@ class ChowRingIdeal_nonaug(ChowRingIdeal):
|
|
|
291
292
|
term += flats_gen[G]
|
|
292
293
|
for G in lattice_flats.order_ideal([F]):
|
|
293
294
|
if G != F:
|
|
294
|
-
gb.append(flats_gen[G]*(term) ** (ranks[F] - ranks[G]))
|
|
295
|
+
gb.append(flats_gen[G] * (term) ** (ranks[F] - ranks[G]))
|
|
295
296
|
|
|
296
297
|
gb.append(term ** ranks[F])
|
|
297
298
|
|
|
@@ -306,14 +307,15 @@ class ChowRingIdeal_nonaug(ChowRingIdeal):
|
|
|
306
307
|
sage: ch = matroids.Z(3).chow_ring(QQ, False)
|
|
307
308
|
sage: I = ch.defining_ideal()
|
|
308
309
|
sage: I.normal_basis()
|
|
309
|
-
[1, Ax2x3y1, Ax1x3y2,
|
|
310
|
+
[1, Ax2x3y1, Ax1x3y2, Ay1y2y3, Ax1x2y3, Atx3y3, Atx2y2, Atx1y1,
|
|
311
|
+
Atx1x2x3y1y2y3, Atx1x2x3y1y2y3^2]
|
|
310
312
|
sage: set(I.gens().ideal().normal_basis()) == set(I.normal_basis())
|
|
311
313
|
True
|
|
312
314
|
sage: ch = matroids.AG(2,3).chow_ring(QQ, False)
|
|
313
315
|
sage: I = ch.defining_ideal()
|
|
314
316
|
sage: I.normal_basis()
|
|
315
|
-
[1, A012,
|
|
316
|
-
|
|
317
|
+
[1, A012, A345, A236, A156, A046, A247, A137, A057, A678, A258,
|
|
318
|
+
A148, A038, A012345678, A012345678^2]
|
|
317
319
|
sage: set(I.gens().ideal().normal_basis()) == set(I.normal_basis())
|
|
318
320
|
True
|
|
319
321
|
"""
|
|
@@ -421,7 +423,7 @@ class AugmentedChowRingIdeal_fy(ChowRingIdeal):
|
|
|
421
423
|
Augmented Chow ring ideal of Wheel(3): Regular matroid of rank 3 on 6
|
|
422
424
|
elements with 16 bases of Feitchner-Yuzvinsky presentation
|
|
423
425
|
"""
|
|
424
|
-
def __init__(self, M, R):
|
|
426
|
+
def __init__(self, M, R) -> None:
|
|
425
427
|
r"""
|
|
426
428
|
Initialize ``self``.
|
|
427
429
|
|
|
@@ -451,7 +453,7 @@ class AugmentedChowRingIdeal_fy(ChowRingIdeal):
|
|
|
451
453
|
self._flats_containing[x].append(F)
|
|
452
454
|
MPolynomialIdeal.__init__(self, poly_ring, self._gens_constructor(poly_ring))
|
|
453
455
|
|
|
454
|
-
def _gens_constructor(self, poly_ring):
|
|
456
|
+
def _gens_constructor(self, poly_ring) -> list:
|
|
455
457
|
r"""
|
|
456
458
|
Return the generators of ``self``.
|
|
457
459
|
|
|
@@ -489,12 +491,13 @@ class AugmentedChowRingIdeal_fy(ChowRingIdeal):
|
|
|
489
491
|
A4*B, A3*B, A2*B, A1*B, A0*B]
|
|
490
492
|
"""
|
|
491
493
|
E = list(self._matroid.groundset())
|
|
492
|
-
Q = []
|
|
493
494
|
L = []
|
|
494
495
|
lattice_flats = Poset((self._flats, lambda x, y: x <= y))
|
|
495
496
|
antichains = lattice_flats.antichains().elements_of_depth_iterator(2)
|
|
496
|
-
|
|
497
|
-
|
|
497
|
+
|
|
498
|
+
# Quadratic generators
|
|
499
|
+
Q = [self._flats_generator[F] * self._flats_generator[G]
|
|
500
|
+
for F, G in antichains]
|
|
498
501
|
|
|
499
502
|
for x in E:
|
|
500
503
|
term = poly_ring.zero()
|
|
@@ -509,7 +512,7 @@ class AugmentedChowRingIdeal_fy(ChowRingIdeal):
|
|
|
509
512
|
L.append(term1)
|
|
510
513
|
return Q + L
|
|
511
514
|
|
|
512
|
-
def _repr_(self):
|
|
515
|
+
def _repr_(self) -> str:
|
|
513
516
|
r"""
|
|
514
517
|
EXAMPLES::
|
|
515
518
|
|
|
@@ -520,7 +523,7 @@ class AugmentedChowRingIdeal_fy(ChowRingIdeal):
|
|
|
520
523
|
"""
|
|
521
524
|
return "Augmented Chow ring ideal of {} of Feitchner-Yuzvinsky presentation".format(self._matroid)
|
|
522
525
|
|
|
523
|
-
def _latex_(self):
|
|
526
|
+
def _latex_(self) -> str:
|
|
524
527
|
r"""
|
|
525
528
|
Return a LaTeX representation of ``self``.
|
|
526
529
|
|
|
@@ -555,11 +558,12 @@ class AugmentedChowRingIdeal_fy(ChowRingIdeal):
|
|
|
555
558
|
gb = [] # reduced groebner basis with two eliminated cases
|
|
556
559
|
E = list(self._matroid.groundset())
|
|
557
560
|
poly_ring = self.ring()
|
|
558
|
-
|
|
559
|
-
lattice_flats = Poset((self._flats,
|
|
561
|
+
|
|
562
|
+
lattice_flats = Poset((self._flats, lambda x, y: x <= y))
|
|
560
563
|
antichains = lattice_flats.antichains().elements_of_depth_iterator(2)
|
|
561
564
|
for F, G in antichains:
|
|
562
|
-
|
|
565
|
+
# non-nested flats
|
|
566
|
+
gb.append(self._flats_generator[F] * self._flats_generator[G])
|
|
563
567
|
for i in E:
|
|
564
568
|
term = poly_ring.zero()
|
|
565
569
|
for H in self._flats_containing[i]:
|
|
@@ -576,7 +580,7 @@ class AugmentedChowRingIdeal_fy(ChowRingIdeal):
|
|
|
576
580
|
order_ideal_modified = lattice_flats.order_ideal([F])
|
|
577
581
|
order_ideal_modified.remove(F)
|
|
578
582
|
for G in order_ideal_modified: # nested flats
|
|
579
|
-
gb.append(self._flats_generator[G]*term1**(self._matroid.rank(F) - self._matroid.rank(G)))
|
|
583
|
+
gb.append(self._flats_generator[G] * term1**(self._matroid.rank(F) - self._matroid.rank(G)))
|
|
580
584
|
|
|
581
585
|
return PolynomialSequence(poly_ring, [gb])
|
|
582
586
|
|
|
@@ -612,10 +616,9 @@ class AugmentedChowRingIdeal_fy(ChowRingIdeal):
|
|
|
612
616
|
monomial_basis.append(R.one())
|
|
613
617
|
else:
|
|
614
618
|
k = len(subset)
|
|
615
|
-
max_powers = []
|
|
616
|
-
max_powers.
|
|
617
|
-
|
|
618
|
-
max_powers.append(ranks[subset[i]] - ranks[subset[i-1]])
|
|
619
|
+
max_powers = [ranks[subset[0]]]
|
|
620
|
+
max_powers.extend(ranks[subset[i]] - ranks[subset[i - 1]]
|
|
621
|
+
for i in range(1, k))
|
|
619
622
|
ranges = [range(1, p) for p in max_powers]
|
|
620
623
|
ranges[0] = range(1, max_powers[0] + 1)
|
|
621
624
|
for combination in product(*(r for r in ranges)):
|
|
@@ -675,7 +678,7 @@ class AugmentedChowRingIdeal_atom_free(ChowRingIdeal):
|
|
|
675
678
|
Augmented Chow ring ideal of Wheel(3): Regular matroid of rank 3 on 6
|
|
676
679
|
elements with 16 bases in the atom-free presentation
|
|
677
680
|
"""
|
|
678
|
-
def __init__(self, M, R):
|
|
681
|
+
def __init__(self, M, R) -> None:
|
|
679
682
|
r"""
|
|
680
683
|
Initialize ``self``.
|
|
681
684
|
|
|
@@ -696,7 +699,7 @@ class AugmentedChowRingIdeal_atom_free(ChowRingIdeal):
|
|
|
696
699
|
self._flats_generator = dict(zip(self._flats, gens))
|
|
697
700
|
MPolynomialIdeal.__init__(self, poly_ring, self._gens_constructor(poly_ring))
|
|
698
701
|
|
|
699
|
-
def _gens_constructor(self, poly_ring):
|
|
702
|
+
def _gens_constructor(self, poly_ring) -> list:
|
|
700
703
|
r"""
|
|
701
704
|
Return the generators of ``self``.
|
|
702
705
|
|
|
@@ -715,8 +718,7 @@ class AugmentedChowRingIdeal_atom_free(ChowRingIdeal):
|
|
|
715
718
|
for F in self._flats:
|
|
716
719
|
for x in F:
|
|
717
720
|
flats_containing[x].append(F)
|
|
718
|
-
|
|
719
|
-
lattice_flats = Poset((self._flats, reln))
|
|
721
|
+
lattice_flats = Poset((self._flats, lambda x, y: x <= y))
|
|
720
722
|
antichains = lattice_flats.antichains().elements_of_depth_iterator(2)
|
|
721
723
|
for F, G in antichains:
|
|
722
724
|
Q.append(self._flats_generator[F] * self._flats_generator[G])
|
|
@@ -728,11 +730,12 @@ class AugmentedChowRingIdeal_atom_free(ChowRingIdeal):
|
|
|
728
730
|
if term**2 not in Q:
|
|
729
731
|
Q.append(term**2)
|
|
730
732
|
|
|
731
|
-
if F not in flats_containing[x]:
|
|
732
|
-
|
|
733
|
+
if F not in flats_containing[x]:
|
|
734
|
+
# generators for every set of flats not containing element
|
|
735
|
+
Q.append(self._flats_generator[F] * term)
|
|
733
736
|
return Q
|
|
734
737
|
|
|
735
|
-
def _repr_(self):
|
|
738
|
+
def _repr_(self) -> str:
|
|
736
739
|
r"""
|
|
737
740
|
EXAMPLES::
|
|
738
741
|
|
|
@@ -743,7 +746,7 @@ class AugmentedChowRingIdeal_atom_free(ChowRingIdeal):
|
|
|
743
746
|
"""
|
|
744
747
|
return "Augmented Chow ring ideal of {} in the atom-free presentation".format(self._matroid)
|
|
745
748
|
|
|
746
|
-
def _latex_(self):
|
|
749
|
+
def _latex_(self) -> str:
|
|
747
750
|
r"""
|
|
748
751
|
Return the LaTeX output of the ring and generators of ``self``.
|
|
749
752
|
|
|
Binary file
|
|
Binary file
|
|
@@ -2142,7 +2142,7 @@ def Z(r, t=True, groundset=None):
|
|
|
2142
2142
|
Id = Matrix(GF(2), identity_matrix(r))
|
|
2143
2143
|
J = Matrix(GF(2), ones_matrix(r))
|
|
2144
2144
|
tip = Matrix(GF(2), ones_matrix(r, 1))
|
|
2145
|
-
A = Id.augment(J-Id).augment(tip)
|
|
2145
|
+
A = Id.augment(J - Id).augment(tip)
|
|
2146
2146
|
|
|
2147
2147
|
M = Matroid(A)
|
|
2148
2148
|
X = [f'x{i}' for i in range(1, r + 1)]
|
|
@@ -2259,7 +2259,7 @@ def Spike(r, t=True, C3=[], groundset=None):
|
|
|
2259
2259
|
else:
|
|
2260
2260
|
for S in C3:
|
|
2261
2261
|
for xy in S:
|
|
2262
|
-
if xy not in X+Y:
|
|
2262
|
+
if xy not in X + Y:
|
|
2263
2263
|
raise ValueError(
|
|
2264
2264
|
"The sets in C3 must contain elements xi and yi only."
|
|
2265
2265
|
)
|
|
@@ -2431,13 +2431,13 @@ def Psi(r, groundset=None):
|
|
|
2431
2431
|
for i in range(0, r):
|
|
2432
2432
|
for k in range(1, r - 2):
|
|
2433
2433
|
I0 = [f'a{i}', f'b{i}']
|
|
2434
|
-
IK = [f'a{(i+k) % r}', f'b{(i+k) % r}']
|
|
2434
|
+
IK = [f'a{(i + k) % r}', f'b{(i + k) % r}']
|
|
2435
2435
|
for AB in generate_binary_strings(k - 1):
|
|
2436
2436
|
C = []
|
|
2437
2437
|
C += I0 + IK
|
|
2438
2438
|
j = 1
|
|
2439
2439
|
for z in AB:
|
|
2440
|
-
C += [f'{z}{(i+j) % r}']
|
|
2440
|
+
C += [f'{z}{(i + j) % r}']
|
|
2441
2441
|
j += 1
|
|
2442
2442
|
NSC += [C]
|
|
2443
2443
|
|
|
@@ -5104,6 +5104,17 @@ def BetsyRoss(groundset=None):
|
|
|
5104
5104
|
'cjk', 'dfk', 'dgh', 'dij', 'efj', 'egk', 'ehi']
|
|
5105
5105
|
M = Matroid(rank=3, nonspanning_circuits=NSC)
|
|
5106
5106
|
M = _rename_and_relabel(M, "BetsyRoss", groundset)
|
|
5107
|
+
pos = {'a': (0, 1.61000000000000),
|
|
5108
|
+
'c': (0.946334256190882, -1.30251736094367),
|
|
5109
|
+
'b': (1.53120099123520, 0.497517360943665),
|
|
5110
|
+
'e': (-1.53120099123520, 0.497517360943665),
|
|
5111
|
+
'd': (-0.946334256190882, -1.30251736094367),
|
|
5112
|
+
'g': (0.590718333102580, -0.191936021350899),
|
|
5113
|
+
'f': (0.365084007635076, 0.502495027562079),
|
|
5114
|
+
'i': (-0.590718333102580, -0.191936021350899),
|
|
5115
|
+
'h': (0, -0.621118012422360),
|
|
5116
|
+
'k': (0, 0), 'j': (-0.365084007635076, 0.502495027562079)}
|
|
5117
|
+
M._fix_positions(pos_dict=pos)
|
|
5107
5118
|
return M
|
|
5108
5119
|
|
|
5109
5120
|
|
|
@@ -5322,6 +5333,6 @@ def _rename_and_relabel(M, name=None, groundset=None):
|
|
|
5322
5333
|
M = M.relabel(dict(zip(M.groundset(), groundset)))
|
|
5323
5334
|
|
|
5324
5335
|
if name is not None:
|
|
5325
|
-
M.rename(name+": " + repr(M))
|
|
5336
|
+
M.rename(name + ": " + repr(M))
|
|
5326
5337
|
|
|
5327
5338
|
return M
|
sage/matroids/dual_matroid.py
CHANGED
|
@@ -333,8 +333,8 @@ class DualMatroid(Matroid):
|
|
|
333
333
|
EXAMPLES::
|
|
334
334
|
|
|
335
335
|
sage: M = matroids.catalog.Vamos().dual()
|
|
336
|
-
sage: N = M._minor(contractions=set(['a']), deletions=set(
|
|
337
|
-
sage: N._minor(contractions=set(
|
|
336
|
+
sage: N = M._minor(contractions=set(['a']), deletions=set())
|
|
337
|
+
sage: N._minor(contractions=set(), deletions=set(['b', 'c']))
|
|
338
338
|
Dual of 'M / {'b', 'c'} \ {'a'}, where M is Vamos:
|
|
339
339
|
Matroid of rank 4 on 8 elements with circuit-closures
|
|
340
340
|
{3: {{'a', 'b', 'c', 'd'}, {'a', 'b', 'e', 'f'},
|
|
Binary file
|
|
Binary file
|