passagemath-modules 10.5.46__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.46.dist-info → passagemath_modules-10.6.20.dist-info}/METADATA +49 -44
- {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/RECORD +320 -314
- passagemath_modules.dylibs/libmpc.3.dylib +0 -0
- passagemath_modules.dylibs/libopenblasp-r0.3.29.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 +63 -27
- 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/free_module.py +22 -2
- 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 +1 -1
- sage/combinat/root_system/braid_orbit.cpython-310-darwin.so +0 -0
- sage/combinat/root_system/branching_rules.py +2 -2
- sage/combinat/root_system/cartan_type.py +14 -14
- sage/combinat/root_system/coxeter_group.py +2 -2
- sage/combinat/root_system/coxeter_type.py +11 -0
- sage/combinat/root_system/extended_affine_weyl_group.py +8 -8
- sage/combinat/root_system/fundamental_group.py +2 -4
- sage/combinat/root_system/hecke_algebra_representation.py +1 -1
- sage/combinat/root_system/pieri_factors.py +2 -2
- 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 +1 -1
- 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 +758 -75
- 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 +2 -3
- 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 +4 -0
- 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 +144 -15
- 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 +7 -7
- 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/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 -9
- 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/projective/cohomology.py +2 -2
- sage/stats/basic_stats.py +9 -6
- 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-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/WHEEL +0 -0
- {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/top_level.txt +0 -0
|
@@ -453,12 +453,13 @@ examples.
|
|
|
453
453
|
# Distributed under the terms of the GNU General Public License (GPL)
|
|
454
454
|
# ****************************************************************************
|
|
455
455
|
|
|
456
|
-
from sage.
|
|
457
|
-
from sage.misc.lazy_attribute import lazy_attribute
|
|
458
|
-
from sage.misc.cachefunc import cached_method
|
|
456
|
+
from sage.categories.homset import Hom
|
|
459
457
|
from sage.categories.modules_with_basis import ModulesWithBasis
|
|
460
458
|
from sage.categories.tensor import tensor
|
|
461
|
-
from sage.
|
|
459
|
+
from sage.combinat.free_module import CombinatorialFreeModule
|
|
460
|
+
from sage.misc.cachefunc import cached_method
|
|
461
|
+
from sage.misc.lazy_attribute import lazy_attribute
|
|
462
|
+
from sage.sets.family import Family
|
|
462
463
|
|
|
463
464
|
######################################################
|
|
464
465
|
# the main class
|
|
@@ -2109,7 +2110,7 @@ class SteenrodAlgebra_generic(CombinatorialFreeModule):
|
|
|
2109
2110
|
sage: A1._element_constructor_(Sq(4)) # Sq(4) not in A1
|
|
2110
2111
|
Traceback (most recent call last):
|
|
2111
2112
|
...
|
|
2112
|
-
ValueError:
|
|
2113
|
+
ValueError: element does not lie in this Steenrod algebra
|
|
2113
2114
|
sage: A1({(2,): 1, (1,): 13})
|
|
2114
2115
|
Sq(1) + Sq(2)
|
|
2115
2116
|
"""
|
|
@@ -2131,7 +2132,7 @@ class SteenrodAlgebra_generic(CombinatorialFreeModule):
|
|
|
2131
2132
|
if self.basis_name() == 'milnor':
|
|
2132
2133
|
return a
|
|
2133
2134
|
return a.change_basis(self.basis_name())
|
|
2134
|
-
raise ValueError("
|
|
2135
|
+
raise ValueError("element does not lie in this Steenrod algebra")
|
|
2135
2136
|
|
|
2136
2137
|
def __contains__(self, x):
|
|
2137
2138
|
r"""
|
|
@@ -2343,7 +2344,8 @@ class SteenrodAlgebra_generic(CombinatorialFreeModule):
|
|
|
2343
2344
|
"""
|
|
2344
2345
|
from sage.rings.integer import Integer
|
|
2345
2346
|
if self.basis_name() != 'milnor':
|
|
2346
|
-
return self(SteenrodAlgebra(p=self.prime(),
|
|
2347
|
+
return self(SteenrodAlgebra(p=self.prime(),
|
|
2348
|
+
generic=self._generic).P(*nums))
|
|
2347
2349
|
while nums and nums[-1] == 0:
|
|
2348
2350
|
nums = nums[:-1]
|
|
2349
2351
|
if len(nums) == 0 or (len(nums) == 1 and nums[0] == 0):
|
|
@@ -2359,10 +2361,11 @@ class SteenrodAlgebra_generic(CombinatorialFreeModule):
|
|
|
2359
2361
|
else:
|
|
2360
2362
|
t = ((), nums)
|
|
2361
2363
|
if self._check_profile_on_basis(t):
|
|
2362
|
-
A = SteenrodAlgebra_generic(p=self.prime(),
|
|
2364
|
+
A = SteenrodAlgebra_generic(p=self.prime(),
|
|
2365
|
+
generic=self._generic)
|
|
2363
2366
|
a = A.monomial(t)
|
|
2364
2367
|
return self(a)
|
|
2365
|
-
raise ValueError("
|
|
2368
|
+
raise ValueError("element not in this algebra")
|
|
2366
2369
|
|
|
2367
2370
|
def Q_exp(self, *nums):
|
|
2368
2371
|
r"""
|
|
@@ -2399,7 +2402,7 @@ class SteenrodAlgebra_generic(CombinatorialFreeModule):
|
|
|
2399
2402
|
Q_0 Q_2
|
|
2400
2403
|
"""
|
|
2401
2404
|
if not all(x in (0, 1) for x in nums):
|
|
2402
|
-
raise ValueError("
|
|
2405
|
+
raise ValueError("the tuple %s should consist " % (nums,) +
|
|
2403
2406
|
"only of 0s and 1s")
|
|
2404
2407
|
else:
|
|
2405
2408
|
if self.basis_name() != 'milnor':
|
|
@@ -2452,13 +2455,14 @@ class SteenrodAlgebra_generic(CombinatorialFreeModule):
|
|
|
2452
2455
|
sage: H.Q(4)
|
|
2453
2456
|
Traceback (most recent call last):
|
|
2454
2457
|
...
|
|
2455
|
-
ValueError:
|
|
2458
|
+
ValueError: element not in this algebra
|
|
2456
2459
|
"""
|
|
2457
2460
|
if len(nums) != len(set(nums)):
|
|
2458
2461
|
return self(0)
|
|
2459
2462
|
else:
|
|
2460
2463
|
if self.basis_name() != 'milnor':
|
|
2461
|
-
return self(SteenrodAlgebra(p=self.prime(),
|
|
2464
|
+
return self(SteenrodAlgebra(p=self.prime(),
|
|
2465
|
+
generic=self._generic).Q(*nums))
|
|
2462
2466
|
if not self._generic:
|
|
2463
2467
|
if len(nums) == 0:
|
|
2464
2468
|
return self.one()
|
|
@@ -2474,9 +2478,9 @@ class SteenrodAlgebra_generic(CombinatorialFreeModule):
|
|
|
2474
2478
|
t = answer.leading_support()
|
|
2475
2479
|
if self._check_profile_on_basis(t):
|
|
2476
2480
|
return answer
|
|
2477
|
-
raise ValueError("
|
|
2481
|
+
raise ValueError("element not in this algebra")
|
|
2478
2482
|
|
|
2479
|
-
def
|
|
2483
|
+
def _an_element_(self):
|
|
2480
2484
|
"""
|
|
2481
2485
|
An element of this Steenrod algebra.
|
|
2482
2486
|
|
|
@@ -2509,29 +2513,32 @@ class SteenrodAlgebra_generic(CombinatorialFreeModule):
|
|
|
2509
2513
|
return self.one()
|
|
2510
2514
|
|
|
2511
2515
|
if basis == 'milnor' and not self._generic:
|
|
2512
|
-
return self.monomial((2,1))
|
|
2516
|
+
return self.monomial((2, 1))
|
|
2513
2517
|
if basis == 'milnor' and self._generic:
|
|
2514
|
-
return self.term(((1,3), (2,1)), GF(p)(p-1))
|
|
2518
|
+
return self.term(((1, 3), (2, 1)), GF(p)(p - 1))
|
|
2515
2519
|
if basis == 'serre-cartan' and not self._generic:
|
|
2516
|
-
return self.monomial((4,2,1))
|
|
2520
|
+
return self.monomial((4, 2, 1))
|
|
2517
2521
|
if basis == 'serre-cartan' and self._generic:
|
|
2518
|
-
return self.term((1,p,0,1,0), GF(p)(p-1))
|
|
2522
|
+
return self.term((1, p, 0, 1, 0), GF(p)(p - 1))
|
|
2519
2523
|
if basis == 'woody' or basis == 'woodz':
|
|
2520
|
-
return self._from_dict({((3,0),): 1,
|
|
2524
|
+
return self._from_dict({((3, 0),): 1,
|
|
2525
|
+
((1, 1), (1, 0)): 1}, coerce=True)
|
|
2521
2526
|
if basis.find('wall') >= 0:
|
|
2522
|
-
return self._from_dict({((1,1), (1,
|
|
2527
|
+
return self._from_dict({((1, 1), (1, 0)): 1,
|
|
2528
|
+
((2, 2), (0, 0)): 1}, coerce=True)
|
|
2523
2529
|
if basis.find('arnona') >= 0:
|
|
2524
|
-
return self._from_dict({((3,3),): 1,
|
|
2530
|
+
return self._from_dict({((3, 3),): 1,
|
|
2531
|
+
((1, 1), (2, 1)): 1}, coerce=True)
|
|
2525
2532
|
if basis == 'arnonc':
|
|
2526
2533
|
return self._from_dict({(8,): 1, (4, 4): 1}, coerce=True)
|
|
2527
2534
|
if basis.find('pst') >= 0:
|
|
2528
2535
|
if not self._generic:
|
|
2529
2536
|
return self.monomial(((3, 1),))
|
|
2530
|
-
return self.term(((1,), (((1,1), 2),)), GF(p)(p-1))
|
|
2537
|
+
return self.term(((1,), (((1, 1), 2),)), GF(p)(p - 1))
|
|
2531
2538
|
if basis.find('comm') >= 0:
|
|
2532
2539
|
if not self._generic:
|
|
2533
2540
|
return self.monomial(((1, 2),))
|
|
2534
|
-
return self.term(((), (((1,2), 1),)), GF(p)(p-1))
|
|
2541
|
+
return self.term(((), (((1, 2), 1),)), GF(p)(p - 1))
|
|
2535
2542
|
|
|
2536
2543
|
def pst(self, s, t):
|
|
2537
2544
|
r"""
|
|
@@ -2564,7 +2571,8 @@ class SteenrodAlgebra_generic(CombinatorialFreeModule):
|
|
|
2564
2571
|
"""
|
|
2565
2572
|
from sage.rings.integer import Integer
|
|
2566
2573
|
if self.basis_name() != 'milnor':
|
|
2567
|
-
return self(SteenrodAlgebra(p=self.prime(),
|
|
2574
|
+
return self(SteenrodAlgebra(p=self.prime(),
|
|
2575
|
+
generic=self._generic).pst(s, t))
|
|
2568
2576
|
if not isinstance(s, (Integer, int)) and s >= 0:
|
|
2569
2577
|
raise ValueError("%s is not a nonnegative integer" % s)
|
|
2570
2578
|
if not isinstance(t, (Integer, int)) and t > 0:
|
|
@@ -2620,7 +2628,7 @@ class SteenrodAlgebra_generic(CombinatorialFreeModule):
|
|
|
2620
2628
|
return sum(self._profile)
|
|
2621
2629
|
return sum(self._profile[0]) + len([a for a in self._profile[1] if a == 2])
|
|
2622
2630
|
|
|
2623
|
-
def gens(self):
|
|
2631
|
+
def gens(self) -> Family:
|
|
2624
2632
|
r"""
|
|
2625
2633
|
Family of generators for this algebra.
|
|
2626
2634
|
|
|
@@ -2677,7 +2685,6 @@ class SteenrodAlgebra_generic(CombinatorialFreeModule):
|
|
|
2677
2685
|
sage: SteenrodAlgebra(p=5, profile=[[2,1], [2,2,2]]).algebra_generators()
|
|
2678
2686
|
Family (Q_0, P(1), P(5))
|
|
2679
2687
|
"""
|
|
2680
|
-
from sage.sets.family import Family
|
|
2681
2688
|
from sage.sets.non_negative_integers import NonNegativeIntegers
|
|
2682
2689
|
from sage.rings.infinity import Infinity
|
|
2683
2690
|
n = self.ngens()
|
|
@@ -2739,7 +2746,7 @@ class SteenrodAlgebra_generic(CombinatorialFreeModule):
|
|
|
2739
2746
|
sage: SteenrodAlgebra(profile=[1,2,1]).gen(5)
|
|
2740
2747
|
Traceback (most recent call last):
|
|
2741
2748
|
...
|
|
2742
|
-
ValueError:
|
|
2749
|
+
ValueError: this algebra only has 4 generators, so call gen(i) with 0 <= i < 4
|
|
2743
2750
|
|
|
2744
2751
|
sage: D = SteenrodAlgebra(profile=lambda n: n)
|
|
2745
2752
|
sage: [D.gen(n) for n in range(5)]
|
|
@@ -2761,11 +2768,11 @@ class SteenrodAlgebra_generic(CombinatorialFreeModule):
|
|
|
2761
2768
|
num = self.ngens()
|
|
2762
2769
|
if num < Infinity:
|
|
2763
2770
|
if i >= num:
|
|
2764
|
-
raise ValueError("
|
|
2771
|
+
raise ValueError("this algebra only has %s generators, so call gen(i) with 0 <= i < %s" % (num, num))
|
|
2765
2772
|
# check to see if equal to A(n) for some n.
|
|
2766
2773
|
n = self.profile(1)
|
|
2767
2774
|
if not self._generic and self._profile == AA(n-1, p=p)._profile:
|
|
2768
|
-
return self.pst(i,1)
|
|
2775
|
+
return self.pst(i, 1)
|
|
2769
2776
|
if self._generic and self._profile == AA(n, p=p)._profile:
|
|
2770
2777
|
if i == 0:
|
|
2771
2778
|
return self.Q(0)
|
|
@@ -3053,7 +3060,7 @@ class SteenrodAlgebra_generic(CombinatorialFreeModule):
|
|
|
3053
3060
|
"""
|
|
3054
3061
|
return self.is_field()
|
|
3055
3062
|
|
|
3056
|
-
def is_noetherian(self):
|
|
3063
|
+
def is_noetherian(self) -> bool:
|
|
3057
3064
|
"""
|
|
3058
3065
|
This algebra is Noetherian if and only if it is finite.
|
|
3059
3066
|
|
|
@@ -355,7 +355,7 @@ def steenrod_algebra_basis(n, basis='milnor', p=2, **kwds):
|
|
|
355
355
|
profile = kwds.get("profile", None)
|
|
356
356
|
if (profile is not None and profile != () and profile != ((), ())
|
|
357
357
|
and basis != 'milnor' and basis.find('pst') == -1):
|
|
358
|
-
raise ValueError("
|
|
358
|
+
raise ValueError("profile functions may only be used with the Milnor or pst bases")
|
|
359
359
|
|
|
360
360
|
# Milnor basis
|
|
361
361
|
if basis_name == 'milnor':
|
|
@@ -377,7 +377,7 @@ def steenrod_algebra_basis(n, basis='milnor', p=2, **kwds):
|
|
|
377
377
|
elif not generic and basis == 'arnonc':
|
|
378
378
|
return arnonC_basis(n)
|
|
379
379
|
else:
|
|
380
|
-
raise ValueError("
|
|
380
|
+
raise ValueError("unknown basis: %s at the prime %s" % (basis, p))
|
|
381
381
|
|
|
382
382
|
|
|
383
383
|
# helper functions for producing bases
|
|
@@ -414,7 +414,7 @@ def normalize_profile(profile, precision=None, truncation_type='auto', p=2, gene
|
|
|
414
414
|
sage: normalize_profile(lambda n: 3, precision=4, truncation_type=0)
|
|
415
415
|
Traceback (most recent call last):
|
|
416
416
|
...
|
|
417
|
-
ValueError:
|
|
417
|
+
ValueError: invalid profile
|
|
418
418
|
sage: normalize_profile(lambda n: 3, precision=4, truncation_type = Infinity)
|
|
419
419
|
((3, 3, 3), +Infinity)
|
|
420
420
|
|
|
@@ -458,7 +458,7 @@ def normalize_profile(profile, precision=None, truncation_type='auto', p=2, gene
|
|
|
458
458
|
sage: normalize_profile([[0,0,0], [1,2,3,2,1]], p=11)
|
|
459
459
|
Traceback (most recent call last):
|
|
460
460
|
...
|
|
461
|
-
ValueError:
|
|
461
|
+
ValueError: invalid profile
|
|
462
462
|
"""
|
|
463
463
|
from sage.rings.infinity import Infinity
|
|
464
464
|
if truncation_type == 'zero':
|
|
@@ -501,7 +501,7 @@ def normalize_profile(profile, precision=None, truncation_type='auto', p=2, gene
|
|
|
501
501
|
if is_valid_profile(new_profile, truncation_type, p):
|
|
502
502
|
return new_profile, truncation_type
|
|
503
503
|
else:
|
|
504
|
-
raise ValueError("
|
|
504
|
+
raise ValueError("invalid profile")
|
|
505
505
|
else: # p odd
|
|
506
506
|
if profile is None or profile == Infinity:
|
|
507
507
|
# no specified profile or infinite profile: return profile
|
|
@@ -561,7 +561,7 @@ def normalize_profile(profile, precision=None, truncation_type='auto', p=2, gene
|
|
|
561
561
|
if is_valid_profile(new_profile, truncation_type, p, generic=True):
|
|
562
562
|
return new_profile, truncation_type
|
|
563
563
|
else:
|
|
564
|
-
raise ValueError("
|
|
564
|
+
raise ValueError("invalid profile")
|
|
565
565
|
|
|
566
566
|
######################################################
|
|
567
567
|
# string representations for elements
|
|
@@ -195,10 +195,10 @@ squares or `p`-th power operations and Bocksteins into a dictionary
|
|
|
195
195
|
representing a sum of admissible monomials.
|
|
196
196
|
"""
|
|
197
197
|
|
|
198
|
-
|
|
198
|
+
# ****************************************************************************
|
|
199
199
|
# Copyright (C) 2008-2010 John H. Palmieri <palmieri@math.washington.edu>
|
|
200
200
|
# Distributed under the terms of the GNU General Public License (GPL)
|
|
201
|
-
|
|
201
|
+
# ****************************************************************************
|
|
202
202
|
|
|
203
203
|
from sage.misc.cachefunc import cached_function
|
|
204
204
|
|
sage/all__sagemath_modules.py
CHANGED
|
Binary file
|
sage/calculus/integration.pyx
CHANGED
|
@@ -74,7 +74,7 @@ cdef double c_f(double t, void *params) noexcept:
|
|
|
74
74
|
|
|
75
75
|
def numerical_integral(func, a, b=None,
|
|
76
76
|
algorithm='qag',
|
|
77
|
-
max_points=87, params=
|
|
77
|
+
max_points=87, params=None, eps_abs=1e-6,
|
|
78
78
|
eps_rel=1e-6, rule=6):
|
|
79
79
|
r"""
|
|
80
80
|
Return the numerical integral of the function on the interval
|
|
@@ -268,8 +268,6 @@ def numerical_integral(func, a, b=None,
|
|
|
268
268
|
"""
|
|
269
269
|
cdef double abs_err # step size
|
|
270
270
|
cdef double result
|
|
271
|
-
cdef int i
|
|
272
|
-
cdef int j
|
|
273
271
|
cdef double _a, _b
|
|
274
272
|
cdef PyFunctionWrapper wrapper # struct to pass information into GSL C function
|
|
275
273
|
|
|
@@ -289,6 +287,9 @@ def numerical_integral(func, a, b=None,
|
|
|
289
287
|
cdef gsl_integration_workspace* W
|
|
290
288
|
W = NULL
|
|
291
289
|
|
|
290
|
+
if params is None:
|
|
291
|
+
params = []
|
|
292
|
+
|
|
292
293
|
if True:
|
|
293
294
|
from sage.rings.infinity import Infinity
|
|
294
295
|
try:
|
|
@@ -620,7 +621,7 @@ def monte_carlo_integral(func, xl, xu, size_t calls, algorithm='plain',
|
|
|
620
621
|
if len(vars) < target_dim:
|
|
621
622
|
raise ValueError(("The function to be integrated depends on "
|
|
622
623
|
"{} variables {}, and so cannot be "
|
|
623
|
-
|
|
624
|
+
"integrated in {} dimensions. Please fix "
|
|
624
625
|
"additional variables with the 'params' "
|
|
625
626
|
"argument").format(len(vars), tuple(vars),
|
|
626
627
|
target_dim))
|
|
@@ -629,7 +630,7 @@ def monte_carlo_integral(func, xl, xu, size_t calls, algorithm='plain',
|
|
|
629
630
|
"{} variables {}, and so cannot be "
|
|
630
631
|
"integrated in {} dimensions. Please add "
|
|
631
632
|
"more items in upper and lower limits"
|
|
632
|
-
|
|
633
|
+
).format(len(vars), tuple(vars), target_dim))
|
|
633
634
|
|
|
634
635
|
from sage.structure.element import Expression
|
|
635
636
|
if isinstance(func, Expression):
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
sage/calculus/ode.pxd
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-modules
|
|
2
2
|
cdef class ode_system:
|
|
3
|
-
|
|
3
|
+
cdef int c_j(self, double , double *, double *, double *) noexcept
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
cdef int c_f(self, double t, double* , double*) noexcept
|
sage/calculus/ode.pyx
CHANGED
|
@@ -343,7 +343,9 @@ class ode_solver():
|
|
|
343
343
|
sage: with NamedTemporaryFile(suffix='.png') as f:
|
|
344
344
|
....: T.plot_solution(i=0, filename=f.name)
|
|
345
345
|
"""
|
|
346
|
-
def __init__(self, function=None, jacobian=None, h=1e-2, error_abs=1e-10,
|
|
346
|
+
def __init__(self, function=None, jacobian=None, h=1e-2, error_abs=1e-10,
|
|
347
|
+
error_rel=1e-10, a=False, a_dydt=False, scale_abs=False,
|
|
348
|
+
algorithm='rkf45', y_0=None, t_span=None, params=None):
|
|
347
349
|
self.function = function
|
|
348
350
|
self.jacobian = jacobian
|
|
349
351
|
self.h = h
|
|
@@ -355,7 +357,7 @@ class ode_solver():
|
|
|
355
357
|
self.algorithm = algorithm
|
|
356
358
|
self.y_0 = y_0
|
|
357
359
|
self.t_span = t_span
|
|
358
|
-
self.params = params
|
|
360
|
+
self.params = [] if params is None else params
|
|
359
361
|
self.solution = []
|
|
360
362
|
|
|
361
363
|
def __setattr__(self, name, value):
|
|
@@ -408,7 +410,7 @@ class ode_solver():
|
|
|
408
410
|
else:
|
|
409
411
|
G.save(filename=filename)
|
|
410
412
|
|
|
411
|
-
def ode_solve(self, t_span=False, y_0=False, num_points=False, params=
|
|
413
|
+
def ode_solve(self, t_span=False, y_0=False, num_points=False, params=None):
|
|
412
414
|
cdef double h # step size
|
|
413
415
|
h = self.h
|
|
414
416
|
cdef int i
|
|
@@ -416,7 +418,7 @@ class ode_solver():
|
|
|
416
418
|
cdef int type
|
|
417
419
|
cdef int dim
|
|
418
420
|
cdef PyFunctionWrapper wrapper # struct to pass information into GSL C function
|
|
419
|
-
self.params = params
|
|
421
|
+
self.params = [] if params is None else params
|
|
420
422
|
|
|
421
423
|
if t_span:
|
|
422
424
|
self.t_span = t_span
|
|
Binary file
|
sage/calculus/riemann.pyx
CHANGED
|
@@ -52,7 +52,7 @@ from math import pi
|
|
|
52
52
|
from math import sin
|
|
53
53
|
from math import cos
|
|
54
54
|
|
|
55
|
-
from math import log
|
|
55
|
+
from math import log # used for complex plot lightness
|
|
56
56
|
from math import atan
|
|
57
57
|
|
|
58
58
|
from cmath import exp
|
|
@@ -202,7 +202,7 @@ cdef class Riemann_Map:
|
|
|
202
202
|
cdef exterior
|
|
203
203
|
|
|
204
204
|
def __init__(self, fs, fprimes, COMPLEX_T a, int N=500, int ncorners=4,
|
|
205
|
-
|
|
205
|
+
opp=False, exterior=False):
|
|
206
206
|
"""
|
|
207
207
|
Initialize the ``Riemann_Map`` class. See the class :class:`Riemann_Map`
|
|
208
208
|
for full documentation on the input of this initialization method.
|
|
@@ -228,7 +228,7 @@ cdef class Riemann_Map:
|
|
|
228
228
|
self.f = fs[0]
|
|
229
229
|
self.a = a
|
|
230
230
|
self.ncorners = ncorners
|
|
231
|
-
self.N = N
|
|
231
|
+
self.N = N # Number of collocation pts
|
|
232
232
|
self.opp = opp
|
|
233
233
|
self.exterior = exterior
|
|
234
234
|
self.tk = np.array(np.arange(N) * TWOPI / N + 0.001 / N,
|
|
@@ -237,14 +237,14 @@ cdef class Riemann_Map:
|
|
|
237
237
|
for i in range(N):
|
|
238
238
|
self.tk2[i] = self.tk[i]
|
|
239
239
|
self.tk2[N] = TWOPI
|
|
240
|
-
self.B = len(fs)
|
|
240
|
+
self.B = len(fs) # number of boundaries of the figure
|
|
241
241
|
if self.exterior and (self.B > 1):
|
|
242
242
|
raise ValueError(
|
|
243
243
|
"The exterior map is undefined for multiply connected domains")
|
|
244
244
|
cdef np.ndarray[COMPLEX_T,ndim=2] cps = np.zeros([self.B, N],
|
|
245
|
-
|
|
245
|
+
dtype=COMPLEX)
|
|
246
246
|
cdef np.ndarray[COMPLEX_T,ndim=2] dps = np.zeros([self.B, N],
|
|
247
|
-
|
|
247
|
+
dtype=COMPLEX)
|
|
248
248
|
# Find the points on the boundaries and their derivatives.
|
|
249
249
|
if self.exterior:
|
|
250
250
|
for k in range(self.B):
|
|
@@ -322,14 +322,14 @@ cdef class Riemann_Map:
|
|
|
322
322
|
hconj = h.conjugate()
|
|
323
323
|
g = -sadp * hconj
|
|
324
324
|
normalized_dp=dp/adp
|
|
325
|
-
C = I / N * sadp
|
|
326
|
-
errinvalid = np.geterr()['invalid']
|
|
327
|
-
errdivide = np.geterr()['divide']
|
|
325
|
+
C = I / N * sadp # equivalent to -TWOPI / N * 1 / (TWOPI * I) * sadp
|
|
326
|
+
errinvalid = np.geterr()['invalid'] # checks the current error handling for invalid
|
|
327
|
+
errdivide = np.geterr()['divide'] # checks the current error handling for divide
|
|
328
328
|
np.seterr(divide='ignore',invalid='ignore')
|
|
329
329
|
K = np.array([C * sadp[t] * (normalized_dp/(cp-cp[t]) -
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
np.seterr(divide=errdivide,invalid=errinvalid)
|
|
330
|
+
(normalized_dp[t]/(cp-cp[t])).conjugate())
|
|
331
|
+
for t in np.arange(NB)], dtype=np.complex128)
|
|
332
|
+
np.seterr(divide=errdivide,invalid=errinvalid) # resets the error handling
|
|
333
333
|
for i in range(NB):
|
|
334
334
|
K[i, i] = 1
|
|
335
335
|
# Nystrom Method for solving 2nd kind integrals
|
|
@@ -337,7 +337,6 @@ cdef class Riemann_Map:
|
|
|
337
337
|
# the all-important Szego kernel
|
|
338
338
|
szego = np.array(phi.flatten() / np.sqrt(dp), dtype=COMPLEX)
|
|
339
339
|
self.szego = szego.reshape([B, N])
|
|
340
|
-
start = 0
|
|
341
340
|
# Finding the theta correspondence using phase. Misbehaves for some
|
|
342
341
|
# regions.
|
|
343
342
|
if B != 1:
|
|
@@ -432,7 +431,6 @@ cdef class Riemann_Map:
|
|
|
432
431
|
sage: sz0 = m.get_szego(boundary=0)
|
|
433
432
|
sage: sz1 = m.get_szego(boundary=1)
|
|
434
433
|
"""
|
|
435
|
-
cdef int k, B
|
|
436
434
|
if boundary < 0:
|
|
437
435
|
temptk = self.tk
|
|
438
436
|
for i in range(self.B - 1):
|
|
@@ -707,10 +705,11 @@ cdef class Riemann_Map:
|
|
|
707
705
|
else:
|
|
708
706
|
return mapped
|
|
709
707
|
|
|
710
|
-
def plot_boundaries(self, plotjoined=True, rgbcolor=
|
|
708
|
+
def plot_boundaries(self, plotjoined=True, rgbcolor=None, thickness=1):
|
|
711
709
|
"""
|
|
712
|
-
|
|
713
|
-
|
|
710
|
+
Plot the boundaries of the region for the Riemann map.
|
|
711
|
+
|
|
712
|
+
Note that this method DOES work for multiply connected domains.
|
|
714
713
|
|
|
715
714
|
INPUT:
|
|
716
715
|
|
|
@@ -748,6 +747,9 @@ cdef class Riemann_Map:
|
|
|
748
747
|
"""
|
|
749
748
|
from sage.plot.all import list_plot
|
|
750
749
|
|
|
750
|
+
if rgbcolor is None:
|
|
751
|
+
rgbcolor = [0, 0, 0]
|
|
752
|
+
|
|
751
753
|
plots = list(range(self.B))
|
|
752
754
|
for k in range(self.B):
|
|
753
755
|
# This conditional should be eliminated when the thickness/pointsize
|
|
@@ -828,8 +830,9 @@ cdef class Riemann_Map:
|
|
|
828
830
|
|
|
829
831
|
@options(interpolation='catrom')
|
|
830
832
|
def plot_spiderweb(self, spokes=16, circles=4, pts=32, linescale=0.99,
|
|
831
|
-
|
|
832
|
-
|
|
833
|
+
rgbcolor=None, thickness=1,
|
|
834
|
+
plotjoined=True, withcolor=False,
|
|
835
|
+
plot_points=200, min_mag=0.001, **options):
|
|
833
836
|
"""
|
|
834
837
|
Generate a traditional "spiderweb plot" of the Riemann map.
|
|
835
838
|
|
|
@@ -945,12 +948,16 @@ cdef class Riemann_Map:
|
|
|
945
948
|
cdef int k, i
|
|
946
949
|
if self.exterior:
|
|
947
950
|
raise ValueError(
|
|
948
|
-
"Spiderwebs for exterior maps are not currently
|
|
951
|
+
"Spiderwebs for exterior maps are not currently supported")
|
|
952
|
+
|
|
953
|
+
if rgbcolor is None:
|
|
954
|
+
rgbcolor = [0, 0, 0]
|
|
955
|
+
|
|
949
956
|
if self.B == 1: # The efficient simply connected
|
|
950
957
|
edge = self.plot_boundaries(plotjoined=plotjoined,
|
|
951
|
-
|
|
958
|
+
rgbcolor=rgbcolor,
|
|
959
|
+
thickness=thickness)
|
|
952
960
|
circle_list = list(range(circles))
|
|
953
|
-
theta_array = self.theta_array[0]
|
|
954
961
|
s = spline(np.column_stack([self.theta_array[0], self.tk2]).tolist())
|
|
955
962
|
tmax = self.theta_array[0, self.N]
|
|
956
963
|
tmin = self.theta_array[0, 0]
|
|
@@ -961,10 +968,13 @@ cdef class Riemann_Map:
|
|
|
961
968
|
(k + 1) / (circles + 1.0) * exp(I*i * TWOPI / (2*pts)))
|
|
962
969
|
if plotjoined:
|
|
963
970
|
circle_list[k] = list_plot(comp_pt(temp, 1),
|
|
964
|
-
|
|
971
|
+
rgbcolor=rgbcolor,
|
|
972
|
+
thickness=thickness,
|
|
973
|
+
plotjoined=True)
|
|
965
974
|
else:
|
|
966
975
|
circle_list[k] = list_plot(comp_pt(temp, 1),
|
|
967
|
-
|
|
976
|
+
rgbcolor=rgbcolor,
|
|
977
|
+
pointsize=thickness)
|
|
968
978
|
line_list = list(range(spokes))
|
|
969
979
|
for k in range(spokes):
|
|
970
980
|
temp = list(range(pts))
|
|
@@ -990,24 +1000,31 @@ cdef class Riemann_Map:
|
|
|
990
1000
|
self.plot_colored(plot_points=plot_points)
|
|
991
1001
|
else:
|
|
992
1002
|
return edge + sum(circle_list) + sum(line_list)
|
|
993
|
-
else:
|
|
1003
|
+
else: # The more difficult multiply connected
|
|
994
1004
|
z_values, xmin, xmax, ymin, ymax = self.compute_on_grid([],
|
|
995
|
-
|
|
1005
|
+
plot_points)
|
|
996
1006
|
xstep = (xmax-xmin)/plot_points
|
|
997
1007
|
ystep = (ymax-ymin)/plot_points
|
|
998
|
-
dr, dtheta= get_derivatives(z_values, xstep, ystep)
|
|
1008
|
+
dr, dtheta= get_derivatives(z_values, xstep, ystep) # clean later
|
|
999
1009
|
|
|
1000
1010
|
g = Graphics()
|
|
1001
|
-
g.add_primitive(ComplexPlot(complex_to_spiderweb(z_values,dr,
|
|
1002
|
-
|
|
1003
|
-
|
|
1011
|
+
g.add_primitive(ComplexPlot(complex_to_spiderweb(z_values, dr,
|
|
1012
|
+
dtheta, spokes,
|
|
1013
|
+
circles,
|
|
1014
|
+
rgbcolor,
|
|
1015
|
+
thickness,
|
|
1016
|
+
withcolor,
|
|
1017
|
+
min_mag),
|
|
1018
|
+
(xmin, xmax), (ymin, ymax),options))
|
|
1004
1019
|
return g + self.plot_boundaries(thickness = thickness)
|
|
1005
1020
|
|
|
1006
1021
|
@options(interpolation='catrom')
|
|
1007
|
-
def plot_colored(self, plot_range=
|
|
1022
|
+
def plot_colored(self, plot_range=None, int plot_points=100, **options):
|
|
1008
1023
|
"""
|
|
1009
|
-
|
|
1010
|
-
|
|
1024
|
+
Generate a colored plot of the Riemann map.
|
|
1025
|
+
|
|
1026
|
+
A red point on the colored plot corresponds to a red point on
|
|
1027
|
+
the unit disc.
|
|
1011
1028
|
|
|
1012
1029
|
INPUT:
|
|
1013
1030
|
|
|
@@ -1054,11 +1071,14 @@ cdef class Riemann_Map:
|
|
|
1054
1071
|
from sage.plot.complex_plot import ComplexPlot
|
|
1055
1072
|
from sage.plot.all import Graphics
|
|
1056
1073
|
|
|
1074
|
+
if plot_range is None:
|
|
1075
|
+
plot_range = []
|
|
1076
|
+
|
|
1057
1077
|
z_values, xmin, xmax, ymin, ymax = self.compute_on_grid(plot_range,
|
|
1058
|
-
|
|
1078
|
+
plot_points)
|
|
1059
1079
|
g = Graphics()
|
|
1060
1080
|
g.add_primitive(ComplexPlot(complex_to_rgb(z_values), (xmin, xmax),
|
|
1061
|
-
|
|
1081
|
+
(ymin, ymax), options))
|
|
1062
1082
|
return g
|
|
1063
1083
|
|
|
1064
1084
|
cdef comp_pt(clist, loop=True):
|
|
@@ -1090,8 +1110,8 @@ cdef comp_pt(clist, loop=True):
|
|
|
1090
1110
|
list2.append(list2[0])
|
|
1091
1111
|
return list2
|
|
1092
1112
|
|
|
1093
|
-
cpdef get_derivatives(np.ndarray[COMPLEX_T, ndim=2] z_values,
|
|
1094
|
-
|
|
1113
|
+
cpdef get_derivatives(np.ndarray[COMPLEX_T, ndim=2] z_values,
|
|
1114
|
+
FLOAT_T xstep, FLOAT_T ystep):
|
|
1095
1115
|
"""
|
|
1096
1116
|
Compute the r*e^(I*theta) form of derivatives from the grid of points. The
|
|
1097
1117
|
derivatives are computed using quick-and-dirty taylor expansion and
|
|
@@ -1133,8 +1153,6 @@ cpdef get_derivatives(np.ndarray[COMPLEX_T, ndim=2] z_values, FLOAT_T xstep,
|
|
|
1133
1153
|
"""
|
|
1134
1154
|
cdef np.ndarray[COMPLEX_T, ndim=2] xderiv
|
|
1135
1155
|
cdef np.ndarray[FLOAT_T, ndim = 2] dr, dtheta, zabs
|
|
1136
|
-
imax = len(z_values)-2
|
|
1137
|
-
jmax = len(z_values[0])-2
|
|
1138
1156
|
# (f(x+delta)-f(x-delta))/2delta
|
|
1139
1157
|
xderiv = (z_values[1:-1,2:]-z_values[1:-1,:-2])/(2*xstep)
|
|
1140
1158
|
# b/c the function is analytic, we know the magnitude of its
|
|
@@ -1142,12 +1160,14 @@ cpdef get_derivatives(np.ndarray[COMPLEX_T, ndim=2] z_values, FLOAT_T xstep,
|
|
|
1142
1160
|
dr = np.abs(xderiv)
|
|
1143
1161
|
# the abs(derivative) scaled by distance from origin
|
|
1144
1162
|
zabs = np.abs(z_values[1:-1,1:-1])
|
|
1145
|
-
dtheta = np.divide(dr,zabs)
|
|
1163
|
+
dtheta = np.divide(dr, zabs)
|
|
1146
1164
|
return dr, dtheta
|
|
1147
1165
|
|
|
1148
1166
|
cpdef complex_to_spiderweb(np.ndarray[COMPLEX_T, ndim = 2] z_values,
|
|
1149
|
-
|
|
1150
|
-
|
|
1167
|
+
np.ndarray[FLOAT_T, ndim = 2] dr,
|
|
1168
|
+
np.ndarray[FLOAT_T, ndim = 2] dtheta,
|
|
1169
|
+
spokes, circles, rgbcolor, thickness,
|
|
1170
|
+
withcolor, min_mag):
|
|
1151
1171
|
"""
|
|
1152
1172
|
Convert a grid of complex numbers into a matrix containing rgb data
|
|
1153
1173
|
for the Riemann spiderweb plot.
|
|
@@ -1222,9 +1242,9 @@ cpdef complex_to_spiderweb(np.ndarray[COMPLEX_T, ndim = 2] z_values,
|
|
|
1222
1242
|
[1. , 1. , 1. ]]])
|
|
1223
1243
|
"""
|
|
1224
1244
|
cdef Py_ssize_t i, j, imax, jmax
|
|
1225
|
-
cdef FLOAT_T
|
|
1245
|
+
cdef FLOAT_T mag, arg, target, precision, dmag, darg
|
|
1226
1246
|
cdef COMPLEX_T z
|
|
1227
|
-
cdef FLOAT_T DMAX = 70
|
|
1247
|
+
cdef FLOAT_T DMAX = 70 # change to adjust rate_of_change cutoff below
|
|
1228
1248
|
precision = thickness/150.0
|
|
1229
1249
|
imax = len(z_values)
|
|
1230
1250
|
jmax = len(z_values[0])
|
|
@@ -1235,7 +1255,7 @@ cpdef complex_to_spiderweb(np.ndarray[COMPLEX_T, ndim = 2] z_values,
|
|
|
1235
1255
|
rgb = np.zeros(dtype=FLOAT, shape=(imax, jmax, 3))
|
|
1236
1256
|
rgb += 1
|
|
1237
1257
|
if circles != 0:
|
|
1238
|
-
circ_radii = srange(0,1.0,1.0/circles)
|
|
1258
|
+
circ_radii = srange(0, 1.0, 1.0/circles)
|
|
1239
1259
|
else:
|
|
1240
1260
|
circ_radii = []
|
|
1241
1261
|
if spokes != 0:
|
|
@@ -1302,7 +1322,7 @@ cpdef complex_to_rgb(np.ndarray[COMPLEX_T, ndim=2] z_values):
|
|
|
1302
1322
|
TypeError: Argument 'z_values' has incorrect type (expected numpy.ndarray, got list)
|
|
1303
1323
|
"""
|
|
1304
1324
|
cdef Py_ssize_t i, j, imax, jmax
|
|
1305
|
-
cdef FLOAT_T
|
|
1325
|
+
cdef FLOAT_T mag, arg
|
|
1306
1326
|
cdef FLOAT_T lightness, hue, top, bot
|
|
1307
1327
|
cdef FLOAT_T r, g, b
|
|
1308
1328
|
cdef int ihue
|
|
@@ -1495,7 +1515,7 @@ cpdef analytic_interior(COMPLEX_T z, int n, FLOAT_T epsilon):
|
|
|
1495
1515
|
# evaluates the Cauchy integral of the boundary, split into the real
|
|
1496
1516
|
# and imaginary results because numerical_integral can't handle complex data.
|
|
1497
1517
|
rp = 1/(TWOPI)*numerical_integral(cauchy_kernel,0,2*pi,
|
|
1498
|
-
|
|
1518
|
+
params = [epsilon,z,n,'i'])[0]
|
|
1499
1519
|
ip = 1/(TWOPI*I)*numerical_integral(cauchy_kernel,0,2*pi,
|
|
1500
|
-
|
|
1520
|
+
params = [epsilon,z,n,'r'])[0]
|
|
1501
1521
|
return rp + ip
|
|
Binary file
|