passagemath-categories 10.6.32__cp314-cp314t-musllinux_1_2_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- passagemath_categories-10.6.32.dist-info/METADATA +156 -0
- passagemath_categories-10.6.32.dist-info/RECORD +719 -0
- passagemath_categories-10.6.32.dist-info/WHEEL +5 -0
- passagemath_categories-10.6.32.dist-info/top_level.txt +2 -0
- passagemath_categories.libs/libgcc_s-2d945d6c.so.1 +0 -0
- passagemath_categories.libs/libgmp-28992bcb.so.10.5.0 +0 -0
- passagemath_categories.libs/libstdc++-85f2cd6d.so.6.0.33 +0 -0
- sage/all__sagemath_categories.py +28 -0
- sage/arith/all.py +38 -0
- sage/arith/constants.pxd +27 -0
- sage/arith/functions.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/arith/functions.pxd +4 -0
- sage/arith/functions.pyx +221 -0
- sage/arith/misc.py +6552 -0
- sage/arith/multi_modular.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/arith/multi_modular.pxd +39 -0
- sage/arith/multi_modular.pyx +994 -0
- sage/arith/rational_reconstruction.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/arith/rational_reconstruction.pxd +4 -0
- sage/arith/rational_reconstruction.pyx +115 -0
- sage/arith/srange.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/arith/srange.pyx +571 -0
- sage/calculus/all__sagemath_categories.py +2 -0
- sage/calculus/functional.py +481 -0
- sage/calculus/functions.py +151 -0
- sage/categories/additive_groups.py +73 -0
- sage/categories/additive_magmas.py +1044 -0
- sage/categories/additive_monoids.py +114 -0
- sage/categories/additive_semigroups.py +184 -0
- sage/categories/affine_weyl_groups.py +238 -0
- sage/categories/algebra_ideals.py +95 -0
- sage/categories/algebra_modules.py +96 -0
- sage/categories/algebras.py +349 -0
- sage/categories/algebras_with_basis.py +377 -0
- sage/categories/all.py +160 -0
- sage/categories/aperiodic_semigroups.py +29 -0
- sage/categories/associative_algebras.py +47 -0
- sage/categories/bialgebras.py +101 -0
- sage/categories/bialgebras_with_basis.py +414 -0
- sage/categories/bimodules.py +206 -0
- sage/categories/chain_complexes.py +268 -0
- sage/categories/classical_crystals.py +480 -0
- sage/categories/coalgebras.py +405 -0
- sage/categories/coalgebras_with_basis.py +232 -0
- sage/categories/coercion_methods.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/categories/coercion_methods.pyx +52 -0
- sage/categories/commutative_additive_groups.py +104 -0
- sage/categories/commutative_additive_monoids.py +45 -0
- sage/categories/commutative_additive_semigroups.py +48 -0
- sage/categories/commutative_algebra_ideals.py +87 -0
- sage/categories/commutative_algebras.py +94 -0
- sage/categories/commutative_ring_ideals.py +58 -0
- sage/categories/commutative_rings.py +736 -0
- sage/categories/complete_discrete_valuation.py +293 -0
- sage/categories/complex_reflection_groups.py +145 -0
- sage/categories/complex_reflection_or_generalized_coxeter_groups.py +1249 -0
- sage/categories/coxeter_group_algebras.py +186 -0
- sage/categories/coxeter_groups.py +3402 -0
- sage/categories/crystals.py +2628 -0
- sage/categories/cw_complexes.py +216 -0
- sage/categories/dedekind_domains.py +137 -0
- sage/categories/discrete_valuation.py +325 -0
- sage/categories/distributive_magmas_and_additive_magmas.py +100 -0
- sage/categories/division_rings.py +114 -0
- sage/categories/domains.py +95 -0
- sage/categories/drinfeld_modules.py +789 -0
- sage/categories/dual.py +42 -0
- sage/categories/enumerated_sets.py +1146 -0
- sage/categories/euclidean_domains.py +271 -0
- sage/categories/examples/algebras_with_basis.py +102 -0
- sage/categories/examples/all.py +1 -0
- sage/categories/examples/commutative_additive_monoids.py +130 -0
- sage/categories/examples/commutative_additive_semigroups.py +199 -0
- sage/categories/examples/coxeter_groups.py +8 -0
- sage/categories/examples/crystals.py +236 -0
- sage/categories/examples/cw_complexes.py +163 -0
- sage/categories/examples/facade_sets.py +187 -0
- sage/categories/examples/filtered_algebras_with_basis.py +204 -0
- sage/categories/examples/filtered_modules_with_basis.py +154 -0
- sage/categories/examples/finite_coxeter_groups.py +252 -0
- sage/categories/examples/finite_dimensional_algebras_with_basis.py +148 -0
- sage/categories/examples/finite_dimensional_lie_algebras_with_basis.py +495 -0
- sage/categories/examples/finite_enumerated_sets.py +208 -0
- sage/categories/examples/finite_monoids.py +150 -0
- sage/categories/examples/finite_semigroups.py +190 -0
- sage/categories/examples/finite_weyl_groups.py +191 -0
- sage/categories/examples/graded_connected_hopf_algebras_with_basis.py +152 -0
- sage/categories/examples/graded_modules_with_basis.py +168 -0
- sage/categories/examples/graphs.py +122 -0
- sage/categories/examples/hopf_algebras_with_basis.py +145 -0
- sage/categories/examples/infinite_enumerated_sets.py +190 -0
- sage/categories/examples/lie_algebras.py +352 -0
- sage/categories/examples/lie_algebras_with_basis.py +196 -0
- sage/categories/examples/magmas.py +162 -0
- sage/categories/examples/manifolds.py +94 -0
- sage/categories/examples/monoids.py +144 -0
- sage/categories/examples/posets.py +178 -0
- sage/categories/examples/semigroups.py +580 -0
- sage/categories/examples/semigroups_cython.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/categories/examples/semigroups_cython.pyx +221 -0
- sage/categories/examples/semirings.py +249 -0
- sage/categories/examples/sets_cat.py +706 -0
- sage/categories/examples/sets_with_grading.py +101 -0
- sage/categories/examples/with_realizations.py +542 -0
- sage/categories/fields.py +991 -0
- sage/categories/filtered_algebras.py +63 -0
- sage/categories/filtered_algebras_with_basis.py +548 -0
- sage/categories/filtered_hopf_algebras_with_basis.py +138 -0
- sage/categories/filtered_modules.py +210 -0
- sage/categories/filtered_modules_with_basis.py +1209 -0
- sage/categories/finite_complex_reflection_groups.py +1506 -0
- sage/categories/finite_coxeter_groups.py +1138 -0
- sage/categories/finite_crystals.py +103 -0
- sage/categories/finite_dimensional_algebras_with_basis.py +1860 -0
- sage/categories/finite_dimensional_bialgebras_with_basis.py +33 -0
- sage/categories/finite_dimensional_coalgebras_with_basis.py +33 -0
- sage/categories/finite_dimensional_graded_lie_algebras_with_basis.py +231 -0
- sage/categories/finite_dimensional_hopf_algebras_with_basis.py +38 -0
- sage/categories/finite_dimensional_lie_algebras_with_basis.py +2774 -0
- sage/categories/finite_dimensional_modules_with_basis.py +1407 -0
- sage/categories/finite_dimensional_nilpotent_lie_algebras_with_basis.py +167 -0
- sage/categories/finite_dimensional_semisimple_algebras_with_basis.py +270 -0
- sage/categories/finite_enumerated_sets.py +769 -0
- sage/categories/finite_fields.py +252 -0
- sage/categories/finite_groups.py +256 -0
- sage/categories/finite_lattice_posets.py +242 -0
- sage/categories/finite_monoids.py +316 -0
- sage/categories/finite_permutation_groups.py +339 -0
- sage/categories/finite_posets.py +1994 -0
- sage/categories/finite_semigroups.py +136 -0
- sage/categories/finite_sets.py +93 -0
- sage/categories/finite_weyl_groups.py +39 -0
- sage/categories/finitely_generated_lambda_bracket_algebras.py +112 -0
- sage/categories/finitely_generated_lie_conformal_algebras.py +114 -0
- sage/categories/finitely_generated_magmas.py +57 -0
- sage/categories/finitely_generated_semigroups.py +214 -0
- sage/categories/function_fields.py +76 -0
- sage/categories/g_sets.py +77 -0
- sage/categories/gcd_domains.py +65 -0
- sage/categories/generalized_coxeter_groups.py +94 -0
- sage/categories/graded_algebras.py +85 -0
- sage/categories/graded_algebras_with_basis.py +258 -0
- sage/categories/graded_bialgebras.py +32 -0
- sage/categories/graded_bialgebras_with_basis.py +32 -0
- sage/categories/graded_coalgebras.py +65 -0
- sage/categories/graded_coalgebras_with_basis.py +51 -0
- sage/categories/graded_hopf_algebras.py +41 -0
- sage/categories/graded_hopf_algebras_with_basis.py +169 -0
- sage/categories/graded_lie_algebras.py +91 -0
- sage/categories/graded_lie_algebras_with_basis.py +44 -0
- sage/categories/graded_lie_conformal_algebras.py +74 -0
- sage/categories/graded_modules.py +133 -0
- sage/categories/graded_modules_with_basis.py +329 -0
- sage/categories/graphs.py +138 -0
- sage/categories/group_algebras.py +430 -0
- sage/categories/groupoid.py +94 -0
- sage/categories/groups.py +667 -0
- sage/categories/h_trivial_semigroups.py +64 -0
- sage/categories/hecke_modules.py +185 -0
- sage/categories/highest_weight_crystals.py +980 -0
- sage/categories/hopf_algebras.py +219 -0
- sage/categories/hopf_algebras_with_basis.py +309 -0
- sage/categories/infinite_enumerated_sets.py +115 -0
- sage/categories/integral_domains.py +203 -0
- sage/categories/j_trivial_semigroups.py +29 -0
- sage/categories/kac_moody_algebras.py +82 -0
- sage/categories/kahler_algebras.py +203 -0
- sage/categories/l_trivial_semigroups.py +63 -0
- sage/categories/lambda_bracket_algebras.py +280 -0
- sage/categories/lambda_bracket_algebras_with_basis.py +107 -0
- sage/categories/lattice_posets.py +89 -0
- sage/categories/left_modules.py +49 -0
- sage/categories/lie_algebras.py +1070 -0
- sage/categories/lie_algebras_with_basis.py +261 -0
- sage/categories/lie_conformal_algebras.py +350 -0
- sage/categories/lie_conformal_algebras_with_basis.py +147 -0
- sage/categories/lie_groups.py +73 -0
- sage/categories/loop_crystals.py +1290 -0
- sage/categories/magmas.py +1189 -0
- sage/categories/magmas_and_additive_magmas.py +149 -0
- sage/categories/magmatic_algebras.py +365 -0
- sage/categories/manifolds.py +352 -0
- sage/categories/matrix_algebras.py +40 -0
- sage/categories/metric_spaces.py +387 -0
- sage/categories/modular_abelian_varieties.py +78 -0
- sage/categories/modules.py +989 -0
- sage/categories/modules_with_basis.py +2794 -0
- sage/categories/monoid_algebras.py +38 -0
- sage/categories/monoids.py +739 -0
- sage/categories/noetherian_rings.py +87 -0
- sage/categories/number_fields.py +242 -0
- sage/categories/ore_modules.py +189 -0
- sage/categories/partially_ordered_monoids.py +49 -0
- sage/categories/permutation_groups.py +63 -0
- sage/categories/pointed_sets.py +42 -0
- sage/categories/polyhedra.py +74 -0
- sage/categories/poor_man_map.py +270 -0
- sage/categories/posets.py +722 -0
- sage/categories/principal_ideal_domains.py +270 -0
- sage/categories/quantum_group_representations.py +543 -0
- sage/categories/quotient_fields.py +728 -0
- sage/categories/r_trivial_semigroups.py +45 -0
- sage/categories/regular_crystals.py +898 -0
- sage/categories/regular_supercrystals.py +170 -0
- sage/categories/right_modules.py +49 -0
- sage/categories/ring_ideals.py +74 -0
- sage/categories/rings.py +1904 -0
- sage/categories/rngs.py +175 -0
- sage/categories/schemes.py +393 -0
- sage/categories/semigroups.py +1060 -0
- sage/categories/semirings.py +71 -0
- sage/categories/semisimple_algebras.py +114 -0
- sage/categories/sets_with_grading.py +235 -0
- sage/categories/shephard_groups.py +43 -0
- sage/categories/signed_tensor.py +120 -0
- sage/categories/simplicial_complexes.py +134 -0
- sage/categories/simplicial_sets.py +1206 -0
- sage/categories/super_algebras.py +149 -0
- sage/categories/super_algebras_with_basis.py +144 -0
- sage/categories/super_hopf_algebras_with_basis.py +126 -0
- sage/categories/super_lie_conformal_algebras.py +193 -0
- sage/categories/super_modules.py +229 -0
- sage/categories/super_modules_with_basis.py +193 -0
- sage/categories/supercommutative_algebras.py +99 -0
- sage/categories/supercrystals.py +406 -0
- sage/categories/tensor.py +110 -0
- sage/categories/topological_spaces.py +170 -0
- sage/categories/triangular_kac_moody_algebras.py +439 -0
- sage/categories/tutorial.py +58 -0
- sage/categories/unique_factorization_domains.py +318 -0
- sage/categories/unital_algebras.py +426 -0
- sage/categories/vector_bundles.py +159 -0
- sage/categories/vector_spaces.py +357 -0
- sage/categories/weyl_groups.py +853 -0
- sage/combinat/all__sagemath_categories.py +34 -0
- sage/combinat/backtrack.py +180 -0
- sage/combinat/combinat.py +2269 -0
- sage/combinat/combinat_cython.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/combinat/combinat_cython.pxd +6 -0
- sage/combinat/combinat_cython.pyx +390 -0
- sage/combinat/combination.py +796 -0
- sage/combinat/combinatorial_map.py +416 -0
- sage/combinat/composition.py +2192 -0
- sage/combinat/dlx.py +510 -0
- sage/combinat/integer_lists/__init__.py +7 -0
- sage/combinat/integer_lists/base.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/combinat/integer_lists/base.pxd +16 -0
- sage/combinat/integer_lists/base.pyx +713 -0
- sage/combinat/integer_lists/invlex.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/combinat/integer_lists/invlex.pxd +4 -0
- sage/combinat/integer_lists/invlex.pyx +1650 -0
- sage/combinat/integer_lists/lists.py +328 -0
- sage/combinat/integer_lists/nn.py +48 -0
- sage/combinat/integer_vector.py +1818 -0
- sage/combinat/integer_vector_weighted.py +413 -0
- sage/combinat/matrices/all__sagemath_categories.py +5 -0
- sage/combinat/matrices/dancing_links.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/combinat/matrices/dancing_links.pyx +1159 -0
- sage/combinat/matrices/dancing_links_c.h +380 -0
- sage/combinat/matrices/dlxcpp.py +136 -0
- sage/combinat/partition.py +10070 -0
- sage/combinat/partitions.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/combinat/partitions.pyx +743 -0
- sage/combinat/permutation.py +10168 -0
- sage/combinat/permutation_cython.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/combinat/permutation_cython.pxd +11 -0
- sage/combinat/permutation_cython.pyx +407 -0
- sage/combinat/q_analogues.py +1090 -0
- sage/combinat/ranker.py +268 -0
- sage/combinat/subset.py +1561 -0
- sage/combinat/subsets_hereditary.py +202 -0
- sage/combinat/subsets_pairwise.py +184 -0
- sage/combinat/tools.py +63 -0
- sage/combinat/tuple.py +348 -0
- sage/data_structures/all.py +2 -0
- sage/data_structures/all__sagemath_categories.py +2 -0
- sage/data_structures/binary_matrix.pxd +138 -0
- sage/data_structures/binary_search.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/data_structures/binary_search.pxd +3 -0
- sage/data_structures/binary_search.pyx +66 -0
- sage/data_structures/bitset.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/data_structures/bitset.pxd +40 -0
- sage/data_structures/bitset.pyx +2385 -0
- sage/data_structures/bitset_base.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/data_structures/bitset_base.pxd +926 -0
- sage/data_structures/bitset_base.pyx +117 -0
- sage/data_structures/bitset_intrinsics.h +487 -0
- sage/data_structures/blas_dict.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/data_structures/blas_dict.pxd +12 -0
- sage/data_structures/blas_dict.pyx +469 -0
- sage/data_structures/list_of_pairs.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/data_structures/list_of_pairs.pxd +16 -0
- sage/data_structures/list_of_pairs.pyx +122 -0
- sage/data_structures/mutable_poset.py +3312 -0
- sage/data_structures/pairing_heap.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/data_structures/pairing_heap.h +346 -0
- sage/data_structures/pairing_heap.pxd +88 -0
- sage/data_structures/pairing_heap.pyx +1464 -0
- sage/data_structures/sparse_bitset.pxd +62 -0
- sage/data_structures/stream.py +5070 -0
- sage/databases/all__sagemath_categories.py +7 -0
- sage/databases/sql_db.py +2236 -0
- sage/ext/all__sagemath_categories.py +3 -0
- sage/ext/fast_callable.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/ext/fast_callable.pxd +4 -0
- sage/ext/fast_callable.pyx +2746 -0
- sage/ext/fast_eval.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/ext/fast_eval.pxd +1 -0
- sage/ext/fast_eval.pyx +102 -0
- sage/ext/interpreters/__init__.py +1 -0
- sage/ext/interpreters/all__sagemath_categories.py +2 -0
- sage/ext/interpreters/wrapper_el.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/ext/interpreters/wrapper_el.pxd +18 -0
- sage/ext/interpreters/wrapper_el.pyx +148 -0
- sage/ext/interpreters/wrapper_py.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/ext/interpreters/wrapper_py.pxd +17 -0
- sage/ext/interpreters/wrapper_py.pyx +133 -0
- sage/functions/airy.py +937 -0
- sage/functions/all.py +97 -0
- sage/functions/bessel.py +2102 -0
- sage/functions/error.py +784 -0
- sage/functions/exp_integral.py +1529 -0
- sage/functions/gamma.py +1087 -0
- sage/functions/generalized.py +672 -0
- sage/functions/hyperbolic.py +747 -0
- sage/functions/hypergeometric.py +1156 -0
- sage/functions/jacobi.py +1705 -0
- sage/functions/log.py +1402 -0
- sage/functions/min_max.py +338 -0
- sage/functions/orthogonal_polys.py +3106 -0
- sage/functions/other.py +2303 -0
- sage/functions/piecewise.py +1505 -0
- sage/functions/prime_pi.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/functions/prime_pi.pyx +262 -0
- sage/functions/special.py +1212 -0
- sage/functions/spike_function.py +278 -0
- sage/functions/transcendental.py +690 -0
- sage/functions/trig.py +1062 -0
- sage/functions/wigner.py +726 -0
- sage/geometry/abc.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/geometry/abc.pyx +82 -0
- sage/geometry/all__sagemath_categories.py +1 -0
- sage/groups/all__sagemath_categories.py +11 -0
- sage/groups/generic.py +1733 -0
- sage/groups/groups_catalog.py +113 -0
- sage/groups/perm_gps/all__sagemath_categories.py +1 -0
- sage/groups/perm_gps/partn_ref/all.py +1 -0
- sage/groups/perm_gps/partn_ref/all__sagemath_categories.py +1 -0
- sage/groups/perm_gps/partn_ref/automorphism_group_canonical_label.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/groups/perm_gps/partn_ref/automorphism_group_canonical_label.pxd +52 -0
- sage/groups/perm_gps/partn_ref/automorphism_group_canonical_label.pyx +906 -0
- sage/groups/perm_gps/partn_ref/canonical_augmentation.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/groups/perm_gps/partn_ref/canonical_augmentation.pxd +85 -0
- sage/groups/perm_gps/partn_ref/canonical_augmentation.pyx +534 -0
- sage/groups/perm_gps/partn_ref/data_structures.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/groups/perm_gps/partn_ref/data_structures.pxd +576 -0
- sage/groups/perm_gps/partn_ref/data_structures.pyx +1792 -0
- sage/groups/perm_gps/partn_ref/double_coset.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/groups/perm_gps/partn_ref/double_coset.pxd +45 -0
- sage/groups/perm_gps/partn_ref/double_coset.pyx +739 -0
- sage/groups/perm_gps/partn_ref/refinement_lists.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_lists.pxd +18 -0
- sage/groups/perm_gps/partn_ref/refinement_lists.pyx +82 -0
- sage/groups/perm_gps/partn_ref/refinement_python.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_python.pxd +16 -0
- sage/groups/perm_gps/partn_ref/refinement_python.pyx +564 -0
- sage/groups/perm_gps/partn_ref/refinement_sets.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_sets.pxd +60 -0
- sage/groups/perm_gps/partn_ref/refinement_sets.pyx +858 -0
- sage/interfaces/abc.py +140 -0
- sage/interfaces/all.py +58 -0
- sage/interfaces/all__sagemath_categories.py +1 -0
- sage/interfaces/expect.py +1643 -0
- sage/interfaces/interface.py +1682 -0
- sage/interfaces/process.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/interfaces/process.pxd +5 -0
- sage/interfaces/process.pyx +288 -0
- sage/interfaces/quit.py +167 -0
- sage/interfaces/sage0.py +604 -0
- sage/interfaces/sagespawn.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/interfaces/sagespawn.pyx +308 -0
- sage/interfaces/tab_completion.py +101 -0
- sage/misc/all__sagemath_categories.py +78 -0
- sage/misc/allocator.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/misc/allocator.pxd +6 -0
- sage/misc/allocator.pyx +47 -0
- sage/misc/binary_tree.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/misc/binary_tree.pxd +29 -0
- sage/misc/binary_tree.pyx +537 -0
- sage/misc/callable_dict.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/misc/callable_dict.pyx +89 -0
- sage/misc/citation.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/misc/citation.pyx +159 -0
- sage/misc/converting_dict.py +293 -0
- sage/misc/defaults.py +129 -0
- sage/misc/derivative.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/misc/derivative.pyx +223 -0
- sage/misc/functional.py +2005 -0
- sage/misc/html.py +589 -0
- sage/misc/latex.py +2673 -0
- sage/misc/latex_macros.py +236 -0
- sage/misc/latex_standalone.py +1833 -0
- sage/misc/map_threaded.py +38 -0
- sage/misc/mathml.py +76 -0
- sage/misc/method_decorator.py +88 -0
- sage/misc/mrange.py +755 -0
- sage/misc/multireplace.py +41 -0
- sage/misc/object_multiplexer.py +92 -0
- sage/misc/parser.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/misc/parser.pyx +1107 -0
- sage/misc/random_testing.py +264 -0
- sage/misc/rest_index_of_methods.py +377 -0
- sage/misc/search.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/misc/search.pxd +2 -0
- sage/misc/search.pyx +68 -0
- sage/misc/stopgap.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/misc/stopgap.pyx +95 -0
- sage/misc/table.py +853 -0
- sage/monoids/all__sagemath_categories.py +1 -0
- sage/monoids/indexed_free_monoid.py +1071 -0
- sage/monoids/monoid.py +82 -0
- sage/numerical/all__sagemath_categories.py +1 -0
- sage/numerical/backends/all__sagemath_categories.py +1 -0
- sage/numerical/backends/generic_backend.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/numerical/backends/generic_backend.pxd +61 -0
- sage/numerical/backends/generic_backend.pyx +1893 -0
- sage/numerical/backends/generic_sdp_backend.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/numerical/backends/generic_sdp_backend.pxd +38 -0
- sage/numerical/backends/generic_sdp_backend.pyx +755 -0
- sage/parallel/all.py +6 -0
- sage/parallel/decorate.py +575 -0
- sage/parallel/map_reduce.py +1997 -0
- sage/parallel/multiprocessing_sage.py +76 -0
- sage/parallel/ncpus.py +35 -0
- sage/parallel/parallelism.py +364 -0
- sage/parallel/reference.py +47 -0
- sage/parallel/use_fork.py +333 -0
- sage/rings/abc.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/abc.pxd +31 -0
- sage/rings/abc.pyx +526 -0
- sage/rings/algebraic_closure_finite_field.py +1154 -0
- sage/rings/all__sagemath_categories.py +91 -0
- sage/rings/big_oh.py +227 -0
- sage/rings/continued_fraction.py +2754 -0
- sage/rings/continued_fraction_gosper.py +220 -0
- sage/rings/factorint.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/factorint.pyx +295 -0
- sage/rings/fast_arith.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/fast_arith.pxd +21 -0
- sage/rings/fast_arith.pyx +535 -0
- sage/rings/finite_rings/all__sagemath_categories.py +9 -0
- sage/rings/finite_rings/conway_polynomials.py +542 -0
- sage/rings/finite_rings/element_base.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/finite_rings/element_base.pxd +12 -0
- sage/rings/finite_rings/element_base.pyx +1176 -0
- sage/rings/finite_rings/finite_field_base.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/finite_rings/finite_field_base.pxd +7 -0
- sage/rings/finite_rings/finite_field_base.pyx +2171 -0
- sage/rings/finite_rings/finite_field_constructor.py +827 -0
- sage/rings/finite_rings/finite_field_prime_modn.py +372 -0
- sage/rings/finite_rings/galois_group.py +154 -0
- sage/rings/finite_rings/hom_finite_field.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/finite_rings/hom_finite_field.pxd +23 -0
- sage/rings/finite_rings/hom_finite_field.pyx +856 -0
- sage/rings/finite_rings/hom_prime_finite_field.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/finite_rings/hom_prime_finite_field.pxd +15 -0
- sage/rings/finite_rings/hom_prime_finite_field.pyx +164 -0
- sage/rings/finite_rings/homset.py +357 -0
- sage/rings/finite_rings/integer_mod.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/finite_rings/integer_mod.pxd +56 -0
- sage/rings/finite_rings/integer_mod.pyx +4586 -0
- sage/rings/finite_rings/integer_mod_limits.h +11 -0
- sage/rings/finite_rings/integer_mod_ring.py +2044 -0
- sage/rings/finite_rings/residue_field.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/finite_rings/residue_field.pxd +30 -0
- sage/rings/finite_rings/residue_field.pyx +1811 -0
- sage/rings/finite_rings/stdint.pxd +19 -0
- sage/rings/fraction_field.py +1452 -0
- sage/rings/fraction_field_element.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/fraction_field_element.pyx +1357 -0
- sage/rings/function_field/all.py +7 -0
- sage/rings/function_field/all__sagemath_categories.py +2 -0
- sage/rings/function_field/constructor.py +218 -0
- sage/rings/function_field/element.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/function_field/element.pxd +11 -0
- sage/rings/function_field/element.pyx +1008 -0
- sage/rings/function_field/element_rational.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/function_field/element_rational.pyx +513 -0
- sage/rings/function_field/extensions.py +230 -0
- sage/rings/function_field/function_field.py +1468 -0
- sage/rings/function_field/function_field_rational.py +1005 -0
- sage/rings/function_field/ideal.py +1155 -0
- sage/rings/function_field/ideal_rational.py +629 -0
- sage/rings/function_field/jacobian_base.py +826 -0
- sage/rings/function_field/jacobian_hess.py +1053 -0
- sage/rings/function_field/jacobian_khuri_makdisi.py +1027 -0
- sage/rings/function_field/maps.py +1039 -0
- sage/rings/function_field/order.py +281 -0
- sage/rings/function_field/order_basis.py +586 -0
- sage/rings/function_field/order_rational.py +576 -0
- sage/rings/function_field/place.py +426 -0
- sage/rings/function_field/place_rational.py +181 -0
- sage/rings/generic.py +320 -0
- sage/rings/homset.py +332 -0
- sage/rings/ideal.py +1885 -0
- sage/rings/ideal_monoid.py +215 -0
- sage/rings/infinity.py +1890 -0
- sage/rings/integer.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/integer.pxd +45 -0
- sage/rings/integer.pyx +7874 -0
- sage/rings/integer_ring.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/integer_ring.pxd +8 -0
- sage/rings/integer_ring.pyx +1693 -0
- sage/rings/laurent_series_ring.py +931 -0
- sage/rings/laurent_series_ring_element.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/laurent_series_ring_element.pxd +11 -0
- sage/rings/laurent_series_ring_element.pyx +1927 -0
- sage/rings/lazy_series.py +7815 -0
- sage/rings/lazy_series_ring.py +4356 -0
- sage/rings/localization.py +1043 -0
- sage/rings/morphism.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/morphism.pxd +39 -0
- sage/rings/morphism.pyx +3299 -0
- sage/rings/multi_power_series_ring.py +1145 -0
- sage/rings/multi_power_series_ring_element.py +2184 -0
- sage/rings/noncommutative_ideals.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/noncommutative_ideals.pyx +423 -0
- sage/rings/number_field/all__sagemath_categories.py +1 -0
- sage/rings/number_field/number_field_base.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/number_field/number_field_base.pxd +8 -0
- sage/rings/number_field/number_field_base.pyx +507 -0
- sage/rings/number_field/number_field_element_base.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/number_field/number_field_element_base.pxd +6 -0
- sage/rings/number_field/number_field_element_base.pyx +36 -0
- sage/rings/number_field/number_field_ideal.py +3550 -0
- sage/rings/padics/all__sagemath_categories.py +4 -0
- sage/rings/padics/local_generic.py +1670 -0
- sage/rings/padics/local_generic_element.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/padics/local_generic_element.pxd +5 -0
- sage/rings/padics/local_generic_element.pyx +1017 -0
- sage/rings/padics/misc.py +256 -0
- sage/rings/padics/padic_generic.py +1911 -0
- sage/rings/padics/pow_computer.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/padics/pow_computer.pxd +38 -0
- sage/rings/padics/pow_computer.pyx +671 -0
- sage/rings/padics/precision_error.py +24 -0
- sage/rings/polynomial/all__sagemath_categories.py +25 -0
- sage/rings/polynomial/commutative_polynomial.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/commutative_polynomial.pxd +6 -0
- sage/rings/polynomial/commutative_polynomial.pyx +24 -0
- sage/rings/polynomial/cyclotomic.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/cyclotomic.pyx +404 -0
- sage/rings/polynomial/flatten.py +711 -0
- sage/rings/polynomial/ideal.py +102 -0
- sage/rings/polynomial/infinite_polynomial_element.py +1768 -0
- sage/rings/polynomial/infinite_polynomial_ring.py +1653 -0
- sage/rings/polynomial/laurent_polynomial.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/laurent_polynomial.pxd +18 -0
- sage/rings/polynomial/laurent_polynomial.pyx +2190 -0
- sage/rings/polynomial/laurent_polynomial_ideal.py +590 -0
- sage/rings/polynomial/laurent_polynomial_ring.py +832 -0
- sage/rings/polynomial/laurent_polynomial_ring_base.py +708 -0
- sage/rings/polynomial/multi_polynomial.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/multi_polynomial.pxd +12 -0
- sage/rings/polynomial/multi_polynomial.pyx +3082 -0
- sage/rings/polynomial/multi_polynomial_element.py +2570 -0
- sage/rings/polynomial/multi_polynomial_ideal.py +5771 -0
- sage/rings/polynomial/multi_polynomial_ring.py +947 -0
- sage/rings/polynomial/multi_polynomial_ring_base.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/multi_polynomial_ring_base.pxd +15 -0
- sage/rings/polynomial/multi_polynomial_ring_base.pyx +1855 -0
- sage/rings/polynomial/multi_polynomial_sequence.py +2204 -0
- sage/rings/polynomial/polydict.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/polydict.pxd +45 -0
- sage/rings/polynomial/polydict.pyx +2701 -0
- sage/rings/polynomial/polynomial_compiled.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/polynomial_compiled.pxd +59 -0
- sage/rings/polynomial/polynomial_compiled.pyx +509 -0
- sage/rings/polynomial/polynomial_element.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/polynomial_element.pxd +64 -0
- sage/rings/polynomial/polynomial_element.pyx +13255 -0
- sage/rings/polynomial/polynomial_element_generic.py +1637 -0
- sage/rings/polynomial/polynomial_fateman.py +97 -0
- sage/rings/polynomial/polynomial_quotient_ring.py +2465 -0
- sage/rings/polynomial/polynomial_quotient_ring_element.py +779 -0
- sage/rings/polynomial/polynomial_ring.py +3784 -0
- sage/rings/polynomial/polynomial_ring_constructor.py +1051 -0
- sage/rings/polynomial/polynomial_ring_homomorphism.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/polynomial_ring_homomorphism.pxd +5 -0
- sage/rings/polynomial/polynomial_ring_homomorphism.pyx +121 -0
- sage/rings/polynomial/polynomial_singular_interface.py +549 -0
- sage/rings/polynomial/symmetric_ideal.py +989 -0
- sage/rings/polynomial/symmetric_reduction.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/polynomial/symmetric_reduction.pxd +8 -0
- sage/rings/polynomial/symmetric_reduction.pyx +669 -0
- sage/rings/polynomial/term_order.py +2279 -0
- sage/rings/polynomial/toy_buchberger.py +449 -0
- sage/rings/polynomial/toy_d_basis.py +387 -0
- sage/rings/polynomial/toy_variety.py +362 -0
- sage/rings/power_series_mpoly.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/power_series_mpoly.pxd +9 -0
- sage/rings/power_series_mpoly.pyx +161 -0
- sage/rings/power_series_poly.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/power_series_poly.pxd +10 -0
- sage/rings/power_series_poly.pyx +1317 -0
- sage/rings/power_series_ring.py +1441 -0
- sage/rings/power_series_ring_element.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/power_series_ring_element.pxd +12 -0
- sage/rings/power_series_ring_element.pyx +3028 -0
- sage/rings/puiseux_series_ring.py +487 -0
- sage/rings/puiseux_series_ring_element.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/puiseux_series_ring_element.pxd +7 -0
- sage/rings/puiseux_series_ring_element.pyx +1055 -0
- sage/rings/qqbar_decorators.py +167 -0
- sage/rings/quotient_ring.py +1598 -0
- sage/rings/quotient_ring_element.py +979 -0
- sage/rings/rational.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/rational.pxd +20 -0
- sage/rings/rational.pyx +4284 -0
- sage/rings/rational_field.py +1730 -0
- sage/rings/real_double.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/real_double.pxd +16 -0
- sage/rings/real_double.pyx +2218 -0
- sage/rings/real_lazy.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/real_lazy.pxd +30 -0
- sage/rings/real_lazy.pyx +1773 -0
- sage/rings/ring.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/ring.pxd +30 -0
- sage/rings/ring.pyx +850 -0
- sage/rings/semirings/all.py +3 -0
- sage/rings/semirings/non_negative_integer_semiring.py +107 -0
- sage/rings/semirings/tropical_mpolynomial.py +972 -0
- sage/rings/semirings/tropical_polynomial.py +997 -0
- sage/rings/semirings/tropical_semiring.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/semirings/tropical_semiring.pyx +676 -0
- sage/rings/semirings/tropical_variety.py +1701 -0
- sage/rings/sum_of_squares.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/rings/sum_of_squares.pxd +3 -0
- sage/rings/sum_of_squares.pyx +336 -0
- sage/rings/tests.py +504 -0
- sage/schemes/affine/affine_homset.py +508 -0
- sage/schemes/affine/affine_morphism.py +1574 -0
- sage/schemes/affine/affine_point.py +460 -0
- sage/schemes/affine/affine_rational_point.py +308 -0
- sage/schemes/affine/affine_space.py +1264 -0
- sage/schemes/affine/affine_subscheme.py +592 -0
- sage/schemes/affine/all.py +25 -0
- sage/schemes/all__sagemath_categories.py +5 -0
- sage/schemes/generic/algebraic_scheme.py +2092 -0
- sage/schemes/generic/all.py +5 -0
- sage/schemes/generic/ambient_space.py +400 -0
- sage/schemes/generic/divisor.py +465 -0
- sage/schemes/generic/divisor_group.py +313 -0
- sage/schemes/generic/glue.py +84 -0
- sage/schemes/generic/homset.py +820 -0
- sage/schemes/generic/hypersurface.py +234 -0
- sage/schemes/generic/morphism.py +2107 -0
- sage/schemes/generic/point.py +237 -0
- sage/schemes/generic/scheme.py +1190 -0
- sage/schemes/generic/spec.py +199 -0
- sage/schemes/product_projective/all.py +6 -0
- sage/schemes/product_projective/homset.py +236 -0
- sage/schemes/product_projective/morphism.py +517 -0
- sage/schemes/product_projective/point.py +568 -0
- sage/schemes/product_projective/rational_point.py +550 -0
- sage/schemes/product_projective/space.py +1301 -0
- sage/schemes/product_projective/subscheme.py +466 -0
- sage/schemes/projective/all.py +24 -0
- sage/schemes/projective/proj_bdd_height.py +453 -0
- sage/schemes/projective/projective_homset.py +718 -0
- sage/schemes/projective/projective_morphism.py +2792 -0
- sage/schemes/projective/projective_point.py +1484 -0
- sage/schemes/projective/projective_rational_point.py +569 -0
- sage/schemes/projective/projective_space.py +2571 -0
- sage/schemes/projective/projective_subscheme.py +1574 -0
- sage/sets/all.py +17 -0
- sage/sets/cartesian_product.py +376 -0
- sage/sets/condition_set.py +525 -0
- sage/sets/disjoint_set.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/sets/disjoint_set.pxd +36 -0
- sage/sets/disjoint_set.pyx +998 -0
- sage/sets/disjoint_union_enumerated_sets.py +625 -0
- sage/sets/family.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/sets/family.pxd +12 -0
- sage/sets/family.pyx +1556 -0
- sage/sets/finite_enumerated_set.py +406 -0
- sage/sets/finite_set_map_cy.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/sets/finite_set_map_cy.pxd +34 -0
- sage/sets/finite_set_map_cy.pyx +708 -0
- sage/sets/finite_set_maps.py +591 -0
- sage/sets/image_set.py +448 -0
- sage/sets/integer_range.py +829 -0
- sage/sets/non_negative_integers.py +241 -0
- sage/sets/positive_integers.py +93 -0
- sage/sets/primes.py +188 -0
- sage/sets/real_set.py +2760 -0
- sage/sets/recursively_enumerated_set.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/sets/recursively_enumerated_set.pxd +31 -0
- sage/sets/recursively_enumerated_set.pyx +2082 -0
- sage/sets/set.py +2083 -0
- sage/sets/set_from_iterator.py +1021 -0
- sage/sets/totally_ordered_finite_set.py +329 -0
- sage/symbolic/all__sagemath_categories.py +1 -0
- sage/symbolic/function.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/symbolic/function.pxd +29 -0
- sage/symbolic/function.pyx +1488 -0
- sage/symbolic/symbols.py +56 -0
- sage/tests/all__sagemath_categories.py +1 -0
- sage/tests/cython.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/tests/cython.pyx +37 -0
- sage/tests/stl_vector.cpython-314t-aarch64-linux-musl.so +0 -0
- sage/tests/stl_vector.pyx +171 -0
- sage/typeset/all.py +6 -0
- sage/typeset/ascii_art.py +295 -0
- sage/typeset/character_art.py +789 -0
- sage/typeset/character_art_factory.py +572 -0
- sage/typeset/symbols.py +334 -0
- sage/typeset/unicode_art.py +183 -0
- sage/typeset/unicode_characters.py +101 -0
|
@@ -0,0 +1,1574 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-categories
|
|
2
|
+
r"""
|
|
3
|
+
Morphisms on affine schemes
|
|
4
|
+
|
|
5
|
+
This module implements morphisms from affine schemes. A morphism from
|
|
6
|
+
an affine scheme to an affine scheme is determined by rational functions that
|
|
7
|
+
define what the morphism does on points in the ambient affine space. A morphism
|
|
8
|
+
from an affine scheme to a projective scheme is determined by homogeneous
|
|
9
|
+
polynomials.
|
|
10
|
+
|
|
11
|
+
EXAMPLES::
|
|
12
|
+
|
|
13
|
+
sage: A2.<x,y> = AffineSpace(QQ, 2)
|
|
14
|
+
sage: P2.<x0,x1,x2> = ProjectiveSpace(QQ, 2)
|
|
15
|
+
sage: A2.hom([x, x + y], A2)
|
|
16
|
+
Scheme endomorphism of Affine Space of dimension 2 over Rational Field
|
|
17
|
+
Defn: Defined on coordinates by sending (x, y) to (x, x + y)
|
|
18
|
+
sage: A2.hom([1, x, x + y], P2)
|
|
19
|
+
Scheme morphism:
|
|
20
|
+
From: Affine Space of dimension 2 over Rational Field
|
|
21
|
+
To: Projective Space of dimension 2 over Rational Field
|
|
22
|
+
Defn: Defined on coordinates by sending (x, y) to (1 : x : x + y)
|
|
23
|
+
|
|
24
|
+
AUTHORS:
|
|
25
|
+
|
|
26
|
+
- David Kohel, William Stein: initial version
|
|
27
|
+
|
|
28
|
+
- Volker Braun (2011-08-08): renamed classes, more documentation, misc
|
|
29
|
+
cleanups
|
|
30
|
+
|
|
31
|
+
- Ben Hutz (2013-03): iteration functionality and new directory structure
|
|
32
|
+
for affine/projective
|
|
33
|
+
|
|
34
|
+
- Kwankyu Lee (2020-02): added indeterminacy_locus() and image()
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
# ****************************************************************************
|
|
38
|
+
# Copyright (C) 2011 Volker Braun <vbraun.name@gmail.com>
|
|
39
|
+
# Copyright (C) 2006 David Kohel <kohel@maths.usyd.edu.au>
|
|
40
|
+
# Copyright (C) 2006 William Stein <wstein@gmail.com>
|
|
41
|
+
#
|
|
42
|
+
# This program is free software: you can redistribute it and/or modify
|
|
43
|
+
# it under the terms of the GNU General Public License as published by
|
|
44
|
+
# the Free Software Foundation, either version 2 of the License, or
|
|
45
|
+
# (at your option) any later version.
|
|
46
|
+
# https://www.gnu.org/licenses/
|
|
47
|
+
# ****************************************************************************
|
|
48
|
+
|
|
49
|
+
import sys
|
|
50
|
+
|
|
51
|
+
from sage.categories.homset import Hom, End
|
|
52
|
+
from sage.categories.fields import Fields
|
|
53
|
+
|
|
54
|
+
from sage.misc.misc_c import prod
|
|
55
|
+
from sage.misc.cachefunc import cached_method
|
|
56
|
+
from sage.misc.lazy_attribute import lazy_attribute
|
|
57
|
+
|
|
58
|
+
from sage.arith.misc import GCD as gcd
|
|
59
|
+
|
|
60
|
+
from sage.rings.integer import Integer
|
|
61
|
+
from sage.rings.fraction_field import FractionField
|
|
62
|
+
from sage.rings.fraction_field_element import FractionFieldElement
|
|
63
|
+
from sage.rings.integer_ring import ZZ
|
|
64
|
+
from sage.rings.rational_field import QQ
|
|
65
|
+
from sage.rings.finite_rings.finite_field_base import FiniteField
|
|
66
|
+
|
|
67
|
+
from sage.schemes.generic.morphism import SchemeMorphism_polynomial
|
|
68
|
+
|
|
69
|
+
from sage.categories.number_fields import NumberFields
|
|
70
|
+
|
|
71
|
+
_NumberFields = NumberFields()
|
|
72
|
+
_Fields = Fields()
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class SchemeMorphism_polynomial_affine_space(SchemeMorphism_polynomial):
|
|
76
|
+
"""
|
|
77
|
+
A morphism of schemes determined by rational functions.
|
|
78
|
+
|
|
79
|
+
EXAMPLES::
|
|
80
|
+
|
|
81
|
+
sage: RA.<x,y> = QQ[]
|
|
82
|
+
sage: A2 = AffineSpace(RA)
|
|
83
|
+
sage: RP.<u,v,w> = QQ[]
|
|
84
|
+
sage: P2 = ProjectiveSpace(RP)
|
|
85
|
+
sage: H = A2.Hom(P2)
|
|
86
|
+
sage: f = H([x, y, 1])
|
|
87
|
+
sage: f
|
|
88
|
+
Scheme morphism:
|
|
89
|
+
From: Affine Space of dimension 2 over Rational Field
|
|
90
|
+
To: Projective Space of dimension 2 over Rational Field
|
|
91
|
+
Defn: Defined on coordinates by sending (x, y) to (x : y : 1)
|
|
92
|
+
"""
|
|
93
|
+
def __init__(self, parent, polys, check=True):
|
|
94
|
+
r"""
|
|
95
|
+
Initialize.
|
|
96
|
+
|
|
97
|
+
INPUT:
|
|
98
|
+
|
|
99
|
+
- ``parent`` -- Hom
|
|
100
|
+
|
|
101
|
+
- ``polys`` -- list or tuple of polynomials or rational functions
|
|
102
|
+
|
|
103
|
+
- ``check`` -- boolean
|
|
104
|
+
|
|
105
|
+
EXAMPLES::
|
|
106
|
+
|
|
107
|
+
sage: A.<x,y> = AffineSpace(ZZ, 2)
|
|
108
|
+
sage: H = Hom(A, A)
|
|
109
|
+
sage: H([3/5*x^2, y^2/(2*x^2)])
|
|
110
|
+
Scheme endomorphism of Affine Space of dimension 2 over Integer Ring
|
|
111
|
+
Defn: Defined on coordinates by sending (x, y) to
|
|
112
|
+
(3*x^2/5, y^2/(2*x^2))
|
|
113
|
+
|
|
114
|
+
::
|
|
115
|
+
|
|
116
|
+
sage: A.<x,y> = AffineSpace(ZZ, 2)
|
|
117
|
+
sage: H = Hom(A, A)
|
|
118
|
+
sage: H([3*x^2/(5*y), y^2/(2*x^2)])
|
|
119
|
+
Scheme endomorphism of Affine Space of dimension 2 over Integer Ring
|
|
120
|
+
Defn: Defined on coordinates by sending (x, y) to
|
|
121
|
+
(3*x^2/(5*y), y^2/(2*x^2))
|
|
122
|
+
|
|
123
|
+
::
|
|
124
|
+
|
|
125
|
+
sage: A.<x,y> = AffineSpace(QQ, 2)
|
|
126
|
+
sage: H = Hom(A, A)
|
|
127
|
+
sage: H([3/2*x^2, y^2])
|
|
128
|
+
Scheme endomorphism of Affine Space of dimension 2 over Rational Field
|
|
129
|
+
Defn: Defined on coordinates by sending (x, y) to (3/2*x^2, y^2)
|
|
130
|
+
|
|
131
|
+
::
|
|
132
|
+
|
|
133
|
+
sage: A.<x,y> = AffineSpace(QQ, 2)
|
|
134
|
+
sage: X = A.subscheme([x - y^2])
|
|
135
|
+
sage: H = Hom(X, X)
|
|
136
|
+
sage: H([9/4*x^2, 3/2*y])
|
|
137
|
+
Scheme endomorphism of Closed subscheme of Affine Space of dimension 2
|
|
138
|
+
over Rational Field defined by: -y^2 + x
|
|
139
|
+
Defn: Defined on coordinates by sending (x, y) to (9/4*x^2, 3/2*y)
|
|
140
|
+
|
|
141
|
+
sage: P.<x,y,z> = ProjectiveSpace(ZZ, 2)
|
|
142
|
+
sage: H = Hom(P, P)
|
|
143
|
+
sage: f = H([5*x^3 + 3*x*y^2-y^3, 3*z^3 + y*x^2, x^3-z^3])
|
|
144
|
+
sage: f.dehomogenize(2)
|
|
145
|
+
Scheme endomorphism of Affine Space of dimension 2 over Integer Ring
|
|
146
|
+
Defn: Defined on coordinates by sending (x, y) to
|
|
147
|
+
((5*x^3 + 3*x*y^2 - y^3)/(x^3 - 1), (x^2*y + 3)/(x^3 - 1))
|
|
148
|
+
|
|
149
|
+
If you pass in quotient ring elements, they are reduced::
|
|
150
|
+
|
|
151
|
+
sage: A.<x,y,z> = AffineSpace(QQ, 3)
|
|
152
|
+
sage: X = A.subscheme([x - y])
|
|
153
|
+
sage: H = Hom(X, X)
|
|
154
|
+
sage: u,v,w = X.coordinate_ring().gens() # needs sage.libs.singular
|
|
155
|
+
sage: H([u, v, u + v]) # needs sage.libs.singular
|
|
156
|
+
Scheme endomorphism of Closed subscheme of Affine Space of dimension 3
|
|
157
|
+
over Rational Field defined by: x - y
|
|
158
|
+
Defn: Defined on coordinates by sending (x, y, z) to (y, y, 2*y)
|
|
159
|
+
|
|
160
|
+
You must use the ambient space variables to create rational functions::
|
|
161
|
+
|
|
162
|
+
sage: A.<x,y,z> = AffineSpace(QQ, 3)
|
|
163
|
+
sage: X = A.subscheme([x^2 - y^2])
|
|
164
|
+
sage: H = Hom(X, X)
|
|
165
|
+
sage: u,v,w = X.coordinate_ring().gens() # needs sage.libs.singular
|
|
166
|
+
sage: H([u, v, (u+1)/v]) # needs sage.libs.singular
|
|
167
|
+
Traceback (most recent call last):
|
|
168
|
+
...
|
|
169
|
+
ArithmeticError: Division failed. The numerator is not a multiple of the denominator.
|
|
170
|
+
sage: H([x, y, (x+1)/y])
|
|
171
|
+
Scheme endomorphism of Closed subscheme of Affine Space of dimension 3
|
|
172
|
+
over Rational Field defined by:
|
|
173
|
+
x^2 - y^2
|
|
174
|
+
Defn: Defined on coordinates by sending (x, y, z) to
|
|
175
|
+
(x, y, (x + 1)/y)
|
|
176
|
+
|
|
177
|
+
::
|
|
178
|
+
|
|
179
|
+
sage: R.<t> = PolynomialRing(QQ)
|
|
180
|
+
sage: A.<x,y,z> = AffineSpace(R, 3)
|
|
181
|
+
sage: X = A.subscheme(x^2 - y^2)
|
|
182
|
+
sage: H = End(X)
|
|
183
|
+
sage: H([x^2/(t*y), t*y^2, x*z])
|
|
184
|
+
Scheme endomorphism of Closed subscheme of Affine Space of dimension 3
|
|
185
|
+
over Univariate Polynomial Ring in t over Rational Field defined by:
|
|
186
|
+
x^2 - y^2
|
|
187
|
+
Defn: Defined on coordinates by sending (x, y, z) to
|
|
188
|
+
(x^2/(t*y), t*y^2, x*z)
|
|
189
|
+
"""
|
|
190
|
+
if check:
|
|
191
|
+
if not isinstance(polys, (list, tuple)):
|
|
192
|
+
raise TypeError("polys (=%s) must be a list or tuple" % polys)
|
|
193
|
+
source_ring = parent.domain().ambient_space().coordinate_ring()
|
|
194
|
+
target = parent.codomain().ambient_space()
|
|
195
|
+
if len(polys) != target.ngens():
|
|
196
|
+
raise ValueError("there must be %s polynomials" % target.ngens())
|
|
197
|
+
try:
|
|
198
|
+
polys = [source_ring(poly) for poly in polys]
|
|
199
|
+
except TypeError: # maybe given quotient ring elements
|
|
200
|
+
try:
|
|
201
|
+
polys = [source_ring(poly.lift()) for poly in polys]
|
|
202
|
+
except (TypeError, AttributeError):
|
|
203
|
+
# must be a rational function since we cannot have
|
|
204
|
+
# rational functions for quotient rings
|
|
205
|
+
source_field = source_ring.base_ring().fraction_field()
|
|
206
|
+
try:
|
|
207
|
+
if not all(p.base_ring().fraction_field() == source_field for p in polys):
|
|
208
|
+
raise TypeError("polys (=%s) must be rational functions in %s" % (polys, source_ring))
|
|
209
|
+
K = FractionField(source_ring)
|
|
210
|
+
polys = [K(p) for p in polys]
|
|
211
|
+
# polys = [source_ring(poly.numerator())/source_ring(poly.denominator()) for poly in polys]
|
|
212
|
+
except TypeError: # can't seem to coerce
|
|
213
|
+
raise TypeError("polys (=%s) must be rational functions in %s" % (polys, source_ring))
|
|
214
|
+
check = False
|
|
215
|
+
|
|
216
|
+
SchemeMorphism_polynomial.__init__(self, parent, polys, check)
|
|
217
|
+
|
|
218
|
+
# used in _fast_eval and _fastpolys
|
|
219
|
+
R = polys[0].base_ring()
|
|
220
|
+
self._is_prime_finite_field = isinstance(R, FiniteField) and R.is_prime_field()
|
|
221
|
+
|
|
222
|
+
def __call__(self, x, check=True):
|
|
223
|
+
"""
|
|
224
|
+
Evaluate affine morphism at point described by ``x``.
|
|
225
|
+
|
|
226
|
+
EXAMPLES::
|
|
227
|
+
|
|
228
|
+
sage: P.<x,y,z> = AffineSpace(QQ, 3)
|
|
229
|
+
sage: H = Hom(P, P)
|
|
230
|
+
sage: f = H([x^2 + y^2, y^2, z^2 + y*z])
|
|
231
|
+
sage: f(P([1, 1, 1]))
|
|
232
|
+
(2, 1, 2)
|
|
233
|
+
|
|
234
|
+
TESTS:
|
|
235
|
+
|
|
236
|
+
Check that :issue:`32209` is fixed::
|
|
237
|
+
|
|
238
|
+
sage: S.<x,y> = AffineSpace(ZZ, 2)
|
|
239
|
+
sage: T.<u,v> = AffineSpace(ZZ, 2)
|
|
240
|
+
sage: h = T.hom([u + v, u*v], S); h
|
|
241
|
+
Scheme morphism:
|
|
242
|
+
From: Affine Space of dimension 2 over Integer Ring
|
|
243
|
+
To: Affine Space of dimension 2 over Integer Ring
|
|
244
|
+
Defn: Defined on coordinates by sending (u, v) to
|
|
245
|
+
(u + v, u*v)
|
|
246
|
+
|
|
247
|
+
sage: # needs sage.rings.finite_rings
|
|
248
|
+
sage: F.<a> = GF(4)
|
|
249
|
+
sage: P = T(F)(1, a)
|
|
250
|
+
sage: h(P)
|
|
251
|
+
(a + 1, a)
|
|
252
|
+
sage: h(P).domain()
|
|
253
|
+
Spectrum of Finite Field in a of size 2^2
|
|
254
|
+
sage: h.change_ring(F)(P)
|
|
255
|
+
(a + 1, a)
|
|
256
|
+
"""
|
|
257
|
+
from sage.schemes.affine.affine_point import SchemeMorphism_point_affine
|
|
258
|
+
if check:
|
|
259
|
+
if not isinstance(x, SchemeMorphism_point_affine) or self.domain() != x.codomain():
|
|
260
|
+
try:
|
|
261
|
+
x = self.domain()(x)
|
|
262
|
+
except (TypeError, NotImplementedError):
|
|
263
|
+
raise TypeError("%s fails to convert into the map's domain %s, but a `pushforward` method is not properly implemented" % (x, self.domain()))
|
|
264
|
+
|
|
265
|
+
R = x.domain().coordinate_ring()
|
|
266
|
+
if R is self.base_ring():
|
|
267
|
+
P = self._fast_eval(x._coords)
|
|
268
|
+
else:
|
|
269
|
+
P = [f(x._coords) for f in self._polys]
|
|
270
|
+
return self.codomain().point_homset(R)(P, check=check)
|
|
271
|
+
|
|
272
|
+
def __eq__(self, right):
|
|
273
|
+
"""
|
|
274
|
+
Test the equality of two affine maps.
|
|
275
|
+
|
|
276
|
+
INPUT:
|
|
277
|
+
|
|
278
|
+
- ``right`` -- a map on affine space
|
|
279
|
+
|
|
280
|
+
OUTPUT: ``True`` if the two affine maps define the same map
|
|
281
|
+
|
|
282
|
+
EXAMPLES::
|
|
283
|
+
|
|
284
|
+
sage: A.<x,y> = AffineSpace(QQ, 2)
|
|
285
|
+
sage: A2.<u,v> = AffineSpace(QQ, 2)
|
|
286
|
+
sage: H = End(A)
|
|
287
|
+
sage: H2 = End(A2)
|
|
288
|
+
sage: f = H([x^2 - 2*x*y, y/(x+1)])
|
|
289
|
+
sage: g = H2([u^3 - v, v^2])
|
|
290
|
+
sage: f == g
|
|
291
|
+
False
|
|
292
|
+
|
|
293
|
+
::
|
|
294
|
+
|
|
295
|
+
sage: # needs sage.rings.real_mpfr
|
|
296
|
+
sage: A.<x,y,z> = AffineSpace(CC, 3)
|
|
297
|
+
sage: H = End(A)
|
|
298
|
+
sage: f = H([x^2 - CC.0*x*y + z*x, 1/z^2 - y^2, 5*x])
|
|
299
|
+
sage: f == f
|
|
300
|
+
True
|
|
301
|
+
"""
|
|
302
|
+
if not isinstance(right, SchemeMorphism_polynomial):
|
|
303
|
+
return False
|
|
304
|
+
if self.parent() != right.parent():
|
|
305
|
+
return False
|
|
306
|
+
return all(val == right._polys[i] for i, val in enumerate(self._polys))
|
|
307
|
+
|
|
308
|
+
def __ne__(self, right):
|
|
309
|
+
"""
|
|
310
|
+
Test the inequality of two affine maps.
|
|
311
|
+
|
|
312
|
+
INPUT:
|
|
313
|
+
|
|
314
|
+
- ``right`` -- a map on affine space
|
|
315
|
+
|
|
316
|
+
OUTPUT: ``True`` if the two affine maps define the same map
|
|
317
|
+
|
|
318
|
+
EXAMPLES::
|
|
319
|
+
|
|
320
|
+
sage: # needs sage.rings.real_mpfr
|
|
321
|
+
sage: A.<x,y> = AffineSpace(RR, 2)
|
|
322
|
+
sage: H = End(A)
|
|
323
|
+
sage: f = H([x^2 - y, y^2])
|
|
324
|
+
sage: g = H([x^3 - x*y, x*y^2])
|
|
325
|
+
sage: f != g
|
|
326
|
+
True
|
|
327
|
+
sage: f != f
|
|
328
|
+
False
|
|
329
|
+
"""
|
|
330
|
+
if not isinstance(right, SchemeMorphism_polynomial):
|
|
331
|
+
return True
|
|
332
|
+
if self.parent() != right.parent():
|
|
333
|
+
return True
|
|
334
|
+
return any(val != right._polys[i] for i, val in enumerate(self._polys))
|
|
335
|
+
|
|
336
|
+
@lazy_attribute
|
|
337
|
+
def _fastpolys(self):
|
|
338
|
+
"""
|
|
339
|
+
Lazy attribute for fast_callable polynomials for affine morphisms.
|
|
340
|
+
|
|
341
|
+
EXAMPLES::
|
|
342
|
+
|
|
343
|
+
sage: P.<x,y> = AffineSpace(QQ, 2)
|
|
344
|
+
sage: H = Hom(P, P)
|
|
345
|
+
sage: f = H([x^2 + y^2, y^2/(1+x)])
|
|
346
|
+
sage: [t.op_list() for g in f._fastpolys for t in g]
|
|
347
|
+
[[('load_const', 0), ('load_const', 1), ('load_arg', ...), ('ipow', 2),
|
|
348
|
+
'mul', 'add', ('load_const', 1), ('load_arg', ...), ('ipow', 2), 'mul',
|
|
349
|
+
'add', 'return'], [('load_const', 0), ('load_const', 1), ('load_arg',
|
|
350
|
+
...), ('ipow', 2), 'mul', 'add', 'return'], [('load_const', 0),
|
|
351
|
+
('load_const', 1), 'add', 'return'], [('load_const', 0), ('load_const',
|
|
352
|
+
1), ('load_arg', ...), ('ipow', 1), 'mul', 'add', ('load_const', 1),
|
|
353
|
+
'add', 'return']]
|
|
354
|
+
"""
|
|
355
|
+
from sage.ext.fast_callable import fast_callable
|
|
356
|
+
|
|
357
|
+
polys = self._polys
|
|
358
|
+
|
|
359
|
+
R = self.domain().ambient_space().coordinate_ring()
|
|
360
|
+
# fastpolys[0] corresponds to the numerator polys, fastpolys[1] corresponds to denominator polys
|
|
361
|
+
fastpolys = [[], []]
|
|
362
|
+
for poly in polys:
|
|
363
|
+
# Determine if truly polynomials. Store the numerator and denominator as separate polynomials
|
|
364
|
+
# and repeat the normal process for both.
|
|
365
|
+
try:
|
|
366
|
+
poly_numerator = R(poly)
|
|
367
|
+
poly_denominator = R.one()
|
|
368
|
+
except TypeError:
|
|
369
|
+
poly_numerator = R(poly.numerator())
|
|
370
|
+
poly_denominator = R(poly.denominator())
|
|
371
|
+
|
|
372
|
+
# These tests are in place because the float and integer domain evaluate
|
|
373
|
+
# faster than using the base_ring
|
|
374
|
+
if self._is_prime_finite_field:
|
|
375
|
+
prime = polys[0].base_ring().characteristic()
|
|
376
|
+
degree = max(poly_numerator.degree(), poly_denominator.degree())
|
|
377
|
+
height = max([abs(c.lift())
|
|
378
|
+
for c in poly_numerator.coefficients()]
|
|
379
|
+
+ [abs(c.lift())
|
|
380
|
+
for c in poly_denominator.coefficients()])
|
|
381
|
+
num_terms = max(len(poly_numerator.coefficients()),
|
|
382
|
+
len(poly_denominator.coefficients()))
|
|
383
|
+
largest_value = num_terms * height * (prime - 1) ** degree
|
|
384
|
+
# If the calculations will not overflow the float data type use domain float
|
|
385
|
+
# Else use domain integer
|
|
386
|
+
if largest_value < (2 ** sys.float_info.mant_dig):
|
|
387
|
+
fastpolys[0].append(fast_callable(poly_numerator, domain=float))
|
|
388
|
+
fastpolys[1].append(fast_callable(poly_denominator, domain=float))
|
|
389
|
+
else:
|
|
390
|
+
fastpolys[0].append(fast_callable(poly_numerator, domain=ZZ))
|
|
391
|
+
fastpolys[1].append(fast_callable(poly_denominator, domain=ZZ))
|
|
392
|
+
else:
|
|
393
|
+
fastpolys[0].append(fast_callable(poly_numerator, domain=poly.base_ring()))
|
|
394
|
+
fastpolys[1].append(fast_callable(poly_denominator, domain=poly.base_ring()))
|
|
395
|
+
return fastpolys
|
|
396
|
+
|
|
397
|
+
def _fast_eval(self, x):
|
|
398
|
+
"""
|
|
399
|
+
Evaluate affine morphism at point described by ``x``.
|
|
400
|
+
|
|
401
|
+
EXAMPLES::
|
|
402
|
+
|
|
403
|
+
sage: P.<x,y,z> = AffineSpace(QQ, 3)
|
|
404
|
+
sage: H = Hom(P, P)
|
|
405
|
+
sage: f = H([x^2 + y^2, y^2, z^2 + y*z])
|
|
406
|
+
sage: f._fast_eval([1, 1, 1])
|
|
407
|
+
[2, 1, 2]
|
|
408
|
+
|
|
409
|
+
::
|
|
410
|
+
|
|
411
|
+
sage: P.<x,y,z> = AffineSpace(QQ, 3)
|
|
412
|
+
sage: H = Hom(P, P)
|
|
413
|
+
sage: f = H([x^2/y, y/x, (y^2+z)/(x*y)])
|
|
414
|
+
sage: f._fast_eval([2, 3, 1])
|
|
415
|
+
[4/3, 3/2, 5/3]
|
|
416
|
+
"""
|
|
417
|
+
R = self.domain().ambient_space().coordinate_ring()
|
|
418
|
+
|
|
419
|
+
P = []
|
|
420
|
+
for i in range(len(self._fastpolys[0])):
|
|
421
|
+
# Check if denominator is the identity;
|
|
422
|
+
# if not, then must append the fraction evaluated at the point
|
|
423
|
+
if self._fastpolys[1][i] is R.one():
|
|
424
|
+
P.append(self._fastpolys[0][i](*x))
|
|
425
|
+
else:
|
|
426
|
+
P.append(self._fastpolys[0][i](*x) / self._fastpolys[1][i](*x))
|
|
427
|
+
return P
|
|
428
|
+
|
|
429
|
+
def homogenize(self, n):
|
|
430
|
+
r"""
|
|
431
|
+
Return the homogenization of this map.
|
|
432
|
+
|
|
433
|
+
If it's domain is a subscheme, the domain of the homogenized map is the
|
|
434
|
+
projective embedding of the domain. The domain and codomain can be
|
|
435
|
+
homogenized at different coordinates: ``n[0]`` for the domain and
|
|
436
|
+
``n[1]`` for the codomain.
|
|
437
|
+
|
|
438
|
+
INPUT:
|
|
439
|
+
|
|
440
|
+
- ``n`` -- tuple of nonnegative integers; if ``n`` is an integer,
|
|
441
|
+
then the two values of the tuple are assumed to be the same
|
|
442
|
+
|
|
443
|
+
OUTPUT: a morphism from the projective embedding of the domain of this map
|
|
444
|
+
|
|
445
|
+
EXAMPLES::
|
|
446
|
+
|
|
447
|
+
sage: A.<x,y> = AffineSpace(ZZ, 2)
|
|
448
|
+
sage: H = Hom(A, A)
|
|
449
|
+
sage: f = H([(x^2-2)/x^5, y^2])
|
|
450
|
+
sage: f.homogenize(2)
|
|
451
|
+
Scheme endomorphism of Projective Space of dimension 2 over Integer Ring
|
|
452
|
+
Defn: Defined on coordinates by sending (x0 : x1 : x2) to
|
|
453
|
+
(x0^2*x2^5 - 2*x2^7 : x0^5*x1^2 : x0^5*x2^2)
|
|
454
|
+
|
|
455
|
+
::
|
|
456
|
+
|
|
457
|
+
sage: # needs sage.rings.real_mpfr
|
|
458
|
+
sage: A.<x,y> = AffineSpace(CC, 2)
|
|
459
|
+
sage: H = Hom(A, A)
|
|
460
|
+
sage: f = H([(x^2-2)/(x*y), y^2 - x])
|
|
461
|
+
sage: f.homogenize((2, 0))
|
|
462
|
+
Scheme endomorphism of Projective Space of dimension 2
|
|
463
|
+
over Complex Field with 53 bits of precision
|
|
464
|
+
Defn: Defined on coordinates by sending (x0 : x1 : x2) to
|
|
465
|
+
(x0*x1*x2^2 : x0^2*x2^2 + (-2.00000000000000)*x2^4 : x0*x1^3 - x0^2*x1*x2)
|
|
466
|
+
|
|
467
|
+
::
|
|
468
|
+
|
|
469
|
+
sage: A.<x,y> = AffineSpace(ZZ, 2)
|
|
470
|
+
sage: X = A.subscheme([x - y^2])
|
|
471
|
+
sage: H = Hom(X, X)
|
|
472
|
+
sage: f = H([9*y^2, 3*y])
|
|
473
|
+
sage: f.homogenize(2) # needs sage.libs.singular
|
|
474
|
+
Scheme endomorphism of Closed subscheme of Projective Space
|
|
475
|
+
of dimension 2 over Integer Ring defined by: x1^2 - x0*x2
|
|
476
|
+
Defn: Defined on coordinates by sending (x0 : x1 : x2) to
|
|
477
|
+
(9*x1^2 : 3*x1*x2 : x2^2)
|
|
478
|
+
|
|
479
|
+
::
|
|
480
|
+
|
|
481
|
+
sage: R.<t> = PolynomialRing(ZZ)
|
|
482
|
+
sage: A.<x,y> = AffineSpace(R, 2)
|
|
483
|
+
sage: H = Hom(A, A)
|
|
484
|
+
sage: f = H([(x^2-2)/y, y^2 - x])
|
|
485
|
+
sage: f.homogenize((2, 0))
|
|
486
|
+
Scheme endomorphism of Projective Space of dimension 2
|
|
487
|
+
over Univariate Polynomial Ring in t over Integer Ring
|
|
488
|
+
Defn: Defined on coordinates by sending (x0 : x1 : x2) to
|
|
489
|
+
(x1*x2^2 : x0^2*x2 + (-2)*x2^3 : x1^3 - x0*x1*x2)
|
|
490
|
+
|
|
491
|
+
::
|
|
492
|
+
|
|
493
|
+
sage: A.<x> = AffineSpace(QQ, 1)
|
|
494
|
+
sage: H = End(A)
|
|
495
|
+
sage: f = H([x^2 - 1])
|
|
496
|
+
sage: f.homogenize((1, 0))
|
|
497
|
+
Scheme endomorphism of Projective Space of dimension 1 over Rational Field
|
|
498
|
+
Defn: Defined on coordinates by sending (x0 : x1) to
|
|
499
|
+
(x1^2 : x0^2 - x1^2)
|
|
500
|
+
|
|
501
|
+
::
|
|
502
|
+
|
|
503
|
+
sage: # needs sage.rings.number_field
|
|
504
|
+
sage: R.<a> = PolynomialRing(QQbar)
|
|
505
|
+
sage: A.<x,y> = AffineSpace(R, 2)
|
|
506
|
+
sage: H = End(A)
|
|
507
|
+
sage: f = H([QQbar(sqrt(2))*x*y, a*x^2]) # needs sage.symbolic
|
|
508
|
+
sage: f.homogenize(2) # needs sage.libs.singular sage.symbolic
|
|
509
|
+
Scheme endomorphism of Projective Space of dimension 2
|
|
510
|
+
over Univariate Polynomial Ring in a over Algebraic Field
|
|
511
|
+
Defn: Defined on coordinates by sending (x0 : x1 : x2) to
|
|
512
|
+
(1.414213562373095?*x0*x1 : a*x0^2 : x2^2)
|
|
513
|
+
|
|
514
|
+
::
|
|
515
|
+
|
|
516
|
+
sage: P.<x,y,z> = AffineSpace(QQ, 3)
|
|
517
|
+
sage: H = End(P)
|
|
518
|
+
sage: f = H([x^2 - 2*x*y + z*x, z^2 -y^2 , 5*z*y])
|
|
519
|
+
sage: f.homogenize(2).dehomogenize(2) == f
|
|
520
|
+
True
|
|
521
|
+
|
|
522
|
+
::
|
|
523
|
+
|
|
524
|
+
sage: K.<c> = FunctionField(QQ)
|
|
525
|
+
sage: A.<x> = AffineSpace(K, 1)
|
|
526
|
+
sage: f = Hom(A, A)([x^2 + c])
|
|
527
|
+
sage: f.homogenize(1)
|
|
528
|
+
Scheme endomorphism of Projective Space of dimension 1
|
|
529
|
+
over Rational function field in c over Rational Field
|
|
530
|
+
Defn: Defined on coordinates by sending (x0 : x1) to
|
|
531
|
+
(x0^2 + c*x1^2 : x1^2)
|
|
532
|
+
|
|
533
|
+
::
|
|
534
|
+
|
|
535
|
+
sage: # needs sage.rings.number_field
|
|
536
|
+
sage: A.<z> = AffineSpace(QQbar, 1)
|
|
537
|
+
sage: H = End(A)
|
|
538
|
+
sage: f = H([2*z / (z^2 + 2*z + 3)])
|
|
539
|
+
sage: f.homogenize(1)
|
|
540
|
+
Scheme endomorphism of Projective Space of dimension 1
|
|
541
|
+
over Algebraic Field
|
|
542
|
+
Defn: Defined on coordinates by sending (x0 : x1) to
|
|
543
|
+
(2*x0*x1 : x0^2 + 2*x0*x1 + 3*x1^2)
|
|
544
|
+
|
|
545
|
+
::
|
|
546
|
+
|
|
547
|
+
sage: # needs sage.rings.number_field
|
|
548
|
+
sage: R.<c,d> = QQbar[]
|
|
549
|
+
sage: A.<x> = AffineSpace(R, 1)
|
|
550
|
+
sage: H = Hom(A, A)
|
|
551
|
+
sage: F = H([d*x^2 + c])
|
|
552
|
+
sage: F.homogenize(1)
|
|
553
|
+
Scheme endomorphism of Projective Space of dimension 1
|
|
554
|
+
over Multivariate Polynomial Ring in c, d over Algebraic Field
|
|
555
|
+
Defn: Defined on coordinates by sending (x0 : x1) to
|
|
556
|
+
(d*x0^2 + c*x1^2 : x1^2)
|
|
557
|
+
|
|
558
|
+
TESTS::
|
|
559
|
+
|
|
560
|
+
sage: A2.<u,v> = AffineSpace(QQ, 2)
|
|
561
|
+
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
|
|
562
|
+
sage: f = A2.hom([u, v, u*v], P2)
|
|
563
|
+
sage: g = f.homogenize(0)
|
|
564
|
+
sage: i = A2.projective_embedding(0, g.domain())
|
|
565
|
+
sage: g*i == f
|
|
566
|
+
True
|
|
567
|
+
sage: g = f.homogenize(1)
|
|
568
|
+
sage: i = A2.projective_embedding(1, g.domain())
|
|
569
|
+
sage: g*i == f
|
|
570
|
+
True
|
|
571
|
+
sage: g = f.homogenize(2)
|
|
572
|
+
sage: i = A2.projective_embedding(2, g.domain())
|
|
573
|
+
sage: g*i == f
|
|
574
|
+
True
|
|
575
|
+
"""
|
|
576
|
+
# it is possible to homogenize the domain and codomain at different coordinates
|
|
577
|
+
if isinstance(n, (tuple, list)):
|
|
578
|
+
ind = tuple(n)
|
|
579
|
+
else:
|
|
580
|
+
ind = (n, n)
|
|
581
|
+
|
|
582
|
+
# homogenize the domain and codomain
|
|
583
|
+
A = self.domain().projective_embedding(ind[0]).codomain()
|
|
584
|
+
if self.is_endomorphism():
|
|
585
|
+
B = A
|
|
586
|
+
H = End(A)
|
|
587
|
+
else:
|
|
588
|
+
B = self.codomain()
|
|
589
|
+
if not B.is_projective():
|
|
590
|
+
B = B.projective_embedding(ind[1]).codomain()
|
|
591
|
+
H = Hom(A, B)
|
|
592
|
+
|
|
593
|
+
newvar = A.ambient_space().coordinate_ring().gen(ind[0])
|
|
594
|
+
|
|
595
|
+
N = A.ambient_space().dimension_relative()
|
|
596
|
+
M = B.ambient_space().dimension_relative()
|
|
597
|
+
|
|
598
|
+
# create dictionary for mapping of coordinate rings
|
|
599
|
+
R = self.domain().ambient_space().coordinate_ring()
|
|
600
|
+
S = A.ambient_space().coordinate_ring()
|
|
601
|
+
D = dict(zip(R.gens(), [S.gen(i) for i in range(N + 1) if i != ind[0]]))
|
|
602
|
+
|
|
603
|
+
if self.codomain().is_projective():
|
|
604
|
+
L = [self[i].denominator() for i in range(M + 1)]
|
|
605
|
+
l = [prod(L[:j] + L[j + 1:M + 1]) for j in range(M + 1)]
|
|
606
|
+
F = [S(R(self[i].numerator() * l[i]).subs(D)) for i in range(M + 1)]
|
|
607
|
+
else:
|
|
608
|
+
# clear the denominators if a rational function
|
|
609
|
+
L = [self[i].denominator() for i in range(M)]
|
|
610
|
+
l = [prod(L[:j] + L[j + 1:M]) for j in range(M)]
|
|
611
|
+
F = [S(R(self[i].numerator() * l[i]).subs(D)) for i in range(M)]
|
|
612
|
+
F.insert(ind[1], S(R(prod(L)).subs(D))) # coerce in case l is a constant
|
|
613
|
+
|
|
614
|
+
try:
|
|
615
|
+
# remove possible gcd of the polynomials
|
|
616
|
+
g = gcd(F)
|
|
617
|
+
F = [S(f / g) for f in F]
|
|
618
|
+
# remove possible gcd of coefficients
|
|
619
|
+
gc = gcd([f.content() for f in F])
|
|
620
|
+
F = [S(f / gc) for f in F]
|
|
621
|
+
except (AttributeError, ValueError, NotImplementedError, TypeError, ArithmeticError): # no gcd
|
|
622
|
+
pass
|
|
623
|
+
|
|
624
|
+
# homogenize
|
|
625
|
+
d = max([F[i].degree() for i in range(M + 1)])
|
|
626
|
+
F = [F[i].homogenize(str(newvar)) * newvar**(d - F[i].degree()) for i in range(M + 1)]
|
|
627
|
+
|
|
628
|
+
return H(F)
|
|
629
|
+
|
|
630
|
+
def as_dynamical_system(self):
|
|
631
|
+
"""
|
|
632
|
+
Return this endomorphism as a :class:`DynamicalSystem_affine`.
|
|
633
|
+
|
|
634
|
+
OUTPUT: :class:`DynamicalSystem_affine`
|
|
635
|
+
|
|
636
|
+
EXAMPLES::
|
|
637
|
+
|
|
638
|
+
sage: A.<x,y,z> = AffineSpace(ZZ, 3)
|
|
639
|
+
sage: H = End(A)
|
|
640
|
+
sage: f = H([x^2, y^2, z^2])
|
|
641
|
+
sage: type(f.as_dynamical_system()) # needs sage.schemes
|
|
642
|
+
<class 'sage.dynamics.arithmetic_dynamics.affine_ds.DynamicalSystem_affine'>
|
|
643
|
+
|
|
644
|
+
::
|
|
645
|
+
|
|
646
|
+
sage: A.<x,y> = AffineSpace(ZZ, 2)
|
|
647
|
+
sage: H = End(A)
|
|
648
|
+
sage: f = H([x^2 - y^2, y^2])
|
|
649
|
+
sage: type(f.as_dynamical_system()) # needs sage.schemes
|
|
650
|
+
<class 'sage.dynamics.arithmetic_dynamics.affine_ds.DynamicalSystem_affine'>
|
|
651
|
+
|
|
652
|
+
::
|
|
653
|
+
|
|
654
|
+
sage: A.<x> = AffineSpace(GF(5), 1)
|
|
655
|
+
sage: H = End(A)
|
|
656
|
+
sage: f = H([x^2])
|
|
657
|
+
sage: type(f.as_dynamical_system()) # needs sage.schemes
|
|
658
|
+
<class 'sage.dynamics.arithmetic_dynamics.affine_ds.DynamicalSystem_affine_finite_field'>
|
|
659
|
+
|
|
660
|
+
::
|
|
661
|
+
|
|
662
|
+
sage: P.<x,y> = AffineSpace(RR, 2)
|
|
663
|
+
sage: f = DynamicalSystem([x^2 + y^2, y^2], P) # needs sage.schemes
|
|
664
|
+
sage: g = f.as_dynamical_system() # needs sage.schemes
|
|
665
|
+
sage: g is f # needs sage.schemes
|
|
666
|
+
True
|
|
667
|
+
"""
|
|
668
|
+
from sage.dynamics.arithmetic_dynamics.generic_ds import DynamicalSystem
|
|
669
|
+
if isinstance(self, DynamicalSystem):
|
|
670
|
+
return self
|
|
671
|
+
if not self.domain() == self.codomain():
|
|
672
|
+
raise TypeError("must be an endomorphism")
|
|
673
|
+
from sage.dynamics.arithmetic_dynamics.affine_ds import DynamicalSystem_affine
|
|
674
|
+
from sage.dynamics.arithmetic_dynamics.affine_ds import DynamicalSystem_affine_field
|
|
675
|
+
from sage.dynamics.arithmetic_dynamics.affine_ds import DynamicalSystem_affine_finite_field
|
|
676
|
+
R = self.base_ring()
|
|
677
|
+
if R not in _Fields:
|
|
678
|
+
return DynamicalSystem_affine(list(self), self.domain())
|
|
679
|
+
if isinstance(R, FiniteField):
|
|
680
|
+
return DynamicalSystem_affine_finite_field(list(self), self.domain())
|
|
681
|
+
return DynamicalSystem_affine_field(list(self), self.domain())
|
|
682
|
+
|
|
683
|
+
def global_height(self, prec=None):
|
|
684
|
+
"""
|
|
685
|
+
Take the height of the homogenization, and return the global height of
|
|
686
|
+
the coefficients as a projective point.
|
|
687
|
+
|
|
688
|
+
INPUT:
|
|
689
|
+
|
|
690
|
+
- ``prec`` -- desired floating point precision (default:
|
|
691
|
+
default RealField precision)
|
|
692
|
+
|
|
693
|
+
OUTPUT: a real number
|
|
694
|
+
|
|
695
|
+
EXAMPLES::
|
|
696
|
+
|
|
697
|
+
sage: A.<x> = AffineSpace(QQ, 1)
|
|
698
|
+
sage: H = Hom(A, A)
|
|
699
|
+
sage: f = H([1/1331*x^2 + 4000])
|
|
700
|
+
sage: f.global_height() # needs sage.symbolic
|
|
701
|
+
15.4877354584971
|
|
702
|
+
|
|
703
|
+
::
|
|
704
|
+
|
|
705
|
+
sage: # needs sage.rings.number_field
|
|
706
|
+
sage: R.<x> = PolynomialRing(QQ)
|
|
707
|
+
sage: k.<w> = NumberField(x^2 + 5)
|
|
708
|
+
sage: A.<x,y> = AffineSpace(k, 2)
|
|
709
|
+
sage: H = Hom(A, A)
|
|
710
|
+
sage: f = H([13*w*x^2 + 4*y, 1/w*y^2])
|
|
711
|
+
sage: f.global_height(prec=2)
|
|
712
|
+
4.0
|
|
713
|
+
|
|
714
|
+
::
|
|
715
|
+
|
|
716
|
+
sage: A.<x> = AffineSpace(ZZ, 1)
|
|
717
|
+
sage: H = Hom(A, A)
|
|
718
|
+
sage: f = H([7*x^2 + 1513])
|
|
719
|
+
sage: f.global_height() # needs sage.symbolic
|
|
720
|
+
7.32184971378836
|
|
721
|
+
|
|
722
|
+
::
|
|
723
|
+
|
|
724
|
+
sage: A.<x> = AffineSpace(QQ, 1)
|
|
725
|
+
sage: B.<y,z> = AffineSpace(QQ, 2)
|
|
726
|
+
sage: H = Hom(A, B)
|
|
727
|
+
sage: f = H([1/3*x^2 + 10, 7*x^3])
|
|
728
|
+
sage: f.global_height() # needs sage.symbolic
|
|
729
|
+
3.40119738166216
|
|
730
|
+
|
|
731
|
+
::
|
|
732
|
+
|
|
733
|
+
sage: P.<x,y> = AffineSpace(QQ, 2)
|
|
734
|
+
sage: A.<z> = AffineSpace(QQ, 1)
|
|
735
|
+
sage: H = Hom(P, A)
|
|
736
|
+
sage: f = H([1/1331*x^2 + 4000*y])
|
|
737
|
+
sage: f.global_height() # needs sage.symbolic
|
|
738
|
+
15.4877354584971
|
|
739
|
+
"""
|
|
740
|
+
return self.homogenize(0).global_height(prec=prec)
|
|
741
|
+
|
|
742
|
+
def local_height(self, v, prec=None):
|
|
743
|
+
"""
|
|
744
|
+
Return the maximum of the local heights of the coefficients in any
|
|
745
|
+
of the coordinate functions of this map.
|
|
746
|
+
|
|
747
|
+
INPUT:
|
|
748
|
+
|
|
749
|
+
- ``v`` -- a prime or prime ideal of the base ring
|
|
750
|
+
|
|
751
|
+
- ``prec`` -- desired floating point precision (default:
|
|
752
|
+
default RealField precision)
|
|
753
|
+
|
|
754
|
+
OUTPUT: a real number
|
|
755
|
+
|
|
756
|
+
EXAMPLES::
|
|
757
|
+
|
|
758
|
+
sage: P.<x,y> = AffineSpace(QQ, 2)
|
|
759
|
+
sage: H = Hom(P, P)
|
|
760
|
+
sage: f = H([1/1331*x^2 + 1/4000*y^2, 210*x*y])
|
|
761
|
+
sage: f.local_height(1331) # needs sage.rings.real_mpfr
|
|
762
|
+
7.19368581839511
|
|
763
|
+
|
|
764
|
+
::
|
|
765
|
+
|
|
766
|
+
sage: P.<x,y,z> = AffineSpace(QQ, 3)
|
|
767
|
+
sage: H = Hom(P, P)
|
|
768
|
+
sage: f = H([4*x^2 + 3/100*y^2, 8/210*x*y, 1/10000*z^2])
|
|
769
|
+
sage: f.local_height(2) # needs sage.rings.real_mpfr
|
|
770
|
+
2.77258872223978
|
|
771
|
+
|
|
772
|
+
::
|
|
773
|
+
|
|
774
|
+
sage: P.<x,y,z> = AffineSpace(QQ, 3)
|
|
775
|
+
sage: H = Hom(P, P)
|
|
776
|
+
sage: f = H([4*x^2 + 3/100*y^2, 8/210*x*y, 1/10000*z^2])
|
|
777
|
+
sage: f.local_height(2, prec=2) # needs sage.rings.real_mpfr
|
|
778
|
+
3.0
|
|
779
|
+
|
|
780
|
+
::
|
|
781
|
+
|
|
782
|
+
sage: # needs sage.rings.number_field
|
|
783
|
+
sage: R.<z> = PolynomialRing(QQ)
|
|
784
|
+
sage: K.<w> = NumberField(z^2 - 2)
|
|
785
|
+
sage: P.<x,y> = AffineSpace(K, 2)
|
|
786
|
+
sage: H = Hom(P, P)
|
|
787
|
+
sage: f = H([2*x^2 + w/3*y^2, 1/w*y^2])
|
|
788
|
+
sage: f.local_height(K.ideal(3))
|
|
789
|
+
1.09861228866811
|
|
790
|
+
"""
|
|
791
|
+
K = FractionField(self.domain().base_ring())
|
|
792
|
+
if K not in _NumberFields:
|
|
793
|
+
raise TypeError("must be over a number field or a number field order")
|
|
794
|
+
return max([K(c).local_height(v, prec=prec) for f in self for c in f.coefficients()])
|
|
795
|
+
|
|
796
|
+
def local_height_arch(self, i, prec=None):
|
|
797
|
+
"""
|
|
798
|
+
Return the maximum of the local height at the ``i``-th infinite place
|
|
799
|
+
of the coefficients in any of the coordinate functions of this map.
|
|
800
|
+
|
|
801
|
+
INPUT:
|
|
802
|
+
|
|
803
|
+
- ``i`` -- integer
|
|
804
|
+
|
|
805
|
+
- ``prec`` -- desired floating point precision (default:
|
|
806
|
+
default RealField precision)
|
|
807
|
+
|
|
808
|
+
OUTPUT: a real number
|
|
809
|
+
|
|
810
|
+
EXAMPLES::
|
|
811
|
+
|
|
812
|
+
sage: P.<x,y> = AffineSpace(QQ, 2)
|
|
813
|
+
sage: H = Hom(P, P)
|
|
814
|
+
sage: f = H([1/1331*x^2 + 1/4000*y^2, 210*x*y]);
|
|
815
|
+
sage: f.local_height_arch(0) # needs sage.rings.real_mpfr
|
|
816
|
+
5.34710753071747
|
|
817
|
+
|
|
818
|
+
::
|
|
819
|
+
|
|
820
|
+
sage: P.<x,y> = AffineSpace(QQ, 2)
|
|
821
|
+
sage: H = Hom(P, P)
|
|
822
|
+
sage: f = H([1/1331*x^2 + 1/4000*y^2, 210*x*y]);
|
|
823
|
+
sage: f.local_height_arch(0, prec=5) # needs sage.rings.real_mpfr
|
|
824
|
+
5.2
|
|
825
|
+
|
|
826
|
+
::
|
|
827
|
+
|
|
828
|
+
sage: # needs sage.rings.number_field
|
|
829
|
+
sage: R.<z> = PolynomialRing(QQ)
|
|
830
|
+
sage: K.<w> = NumberField(z^2 - 2)
|
|
831
|
+
sage: P.<x,y> = AffineSpace(K, 2)
|
|
832
|
+
sage: H = Hom(P, P)
|
|
833
|
+
sage: f = H([2*x^2 + w/3*y^2, 1/w*y^2])
|
|
834
|
+
sage: f.local_height_arch(1)
|
|
835
|
+
0.6931471805599453094172321214582
|
|
836
|
+
"""
|
|
837
|
+
K = FractionField(self.domain().base_ring())
|
|
838
|
+
if K not in _NumberFields:
|
|
839
|
+
raise TypeError("must be over a number field or a number field order")
|
|
840
|
+
|
|
841
|
+
if K == QQ:
|
|
842
|
+
return max([K(c).local_height_arch(prec=prec) for f in self for c in f.coefficients()])
|
|
843
|
+
return max([K(c).local_height_arch(i, prec=prec) for f in self for c in f.coefficients()])
|
|
844
|
+
|
|
845
|
+
def jacobian(self):
|
|
846
|
+
r"""
|
|
847
|
+
Return the Jacobian matrix of partial derivative of this map.
|
|
848
|
+
|
|
849
|
+
The `(i, j)` entry of the Jacobian matrix is the partial derivative
|
|
850
|
+
``diff(functions[i], variables[j])``.
|
|
851
|
+
|
|
852
|
+
OUTPUT: matrix with coordinates in the coordinate ring of the map
|
|
853
|
+
|
|
854
|
+
EXAMPLES::
|
|
855
|
+
|
|
856
|
+
sage: A.<z> = AffineSpace(QQ, 1)
|
|
857
|
+
sage: H = End(A)
|
|
858
|
+
sage: f = H([z^2 - 3/4])
|
|
859
|
+
sage: f.jacobian() # needs sage.modules
|
|
860
|
+
[2*z]
|
|
861
|
+
|
|
862
|
+
::
|
|
863
|
+
|
|
864
|
+
sage: A.<x,y> = AffineSpace(QQ, 2)
|
|
865
|
+
sage: H = End(A)
|
|
866
|
+
sage: f = H([x^3 - 25*x + 12*y, 5*y^2*x - 53*y + 24])
|
|
867
|
+
sage: f.jacobian() # needs sage.modules
|
|
868
|
+
[ 3*x^2 - 25 12]
|
|
869
|
+
[ 5*y^2 10*x*y - 53]
|
|
870
|
+
|
|
871
|
+
::
|
|
872
|
+
|
|
873
|
+
sage: A.<x,y> = AffineSpace(ZZ, 2)
|
|
874
|
+
sage: H = End(A)
|
|
875
|
+
sage: f = H([(x^2 - x*y)/(1+y), (5+y)/(2+x)])
|
|
876
|
+
sage: f.jacobian() # needs sage.modules
|
|
877
|
+
[ (2*x - y)/(y + 1) (-x^2 - x)/(y^2 + 2*y + 1)]
|
|
878
|
+
[ (-y - 5)/(x^2 + 4*x + 4) 1/(x + 2)]
|
|
879
|
+
"""
|
|
880
|
+
try:
|
|
881
|
+
return self.__jacobian
|
|
882
|
+
except AttributeError:
|
|
883
|
+
pass
|
|
884
|
+
|
|
885
|
+
from sage.calculus.functions import jacobian
|
|
886
|
+
|
|
887
|
+
self.__jacobian = jacobian(list(self), self.domain().ambient_space().gens())
|
|
888
|
+
return self.__jacobian
|
|
889
|
+
|
|
890
|
+
def _matrix_times_polymap_(self, mat, h):
|
|
891
|
+
"""
|
|
892
|
+
Multiply the morphism on the left by a matrix ``mat``.
|
|
893
|
+
|
|
894
|
+
INPUT:
|
|
895
|
+
|
|
896
|
+
- ``mat`` -- a matrix
|
|
897
|
+
|
|
898
|
+
OUTPUT: a scheme morphism given by ``self*mat``
|
|
899
|
+
|
|
900
|
+
EXAMPLES::
|
|
901
|
+
|
|
902
|
+
sage: A.<x> = AffineSpace(ZZ, 1)
|
|
903
|
+
sage: H = Hom(A, A)
|
|
904
|
+
sage: f = H([x^2 + 1])
|
|
905
|
+
sage: matrix([[1,2], [0,1]]) * f # needs sage.modules
|
|
906
|
+
Scheme endomorphism of Affine Space of dimension 1 over Integer Ring
|
|
907
|
+
Defn: Defined on coordinates by sending (x) to
|
|
908
|
+
(x^2 + 3)
|
|
909
|
+
|
|
910
|
+
::
|
|
911
|
+
|
|
912
|
+
sage: A1 = AffineSpace(ZZ, 1)
|
|
913
|
+
sage: A2 = AffineSpace(ZZ, 2)
|
|
914
|
+
sage: H = Hom(A1, A2)
|
|
915
|
+
sage: f = H([x^2 + 1, x^2 - 1])
|
|
916
|
+
sage: matrix([[1,2,3], [0,1,2], [0,0,1]]) * f # needs sage.modules
|
|
917
|
+
Scheme morphism:
|
|
918
|
+
From: Affine Space of dimension 1 over Integer Ring
|
|
919
|
+
To: Affine Space of dimension 2 over Integer Ring
|
|
920
|
+
Defn: Defined on coordinates by sending (x) to
|
|
921
|
+
(3*x^2 + 2, x^2 + 1)
|
|
922
|
+
"""
|
|
923
|
+
if not mat.is_square():
|
|
924
|
+
raise TypeError("matrix must be square")
|
|
925
|
+
if mat.ncols() != self.codomain().ngens() + 1:
|
|
926
|
+
raise TypeError("the size of the matrix must be n + 1, where n is the dimension of the codomain")
|
|
927
|
+
if self.is_endomorphism():
|
|
928
|
+
d = self.domain().ngens()
|
|
929
|
+
else:
|
|
930
|
+
d = (self.domain().ngens(), self.codomain().ngens())
|
|
931
|
+
f = mat * self.homogenize(d)
|
|
932
|
+
return f.dehomogenize(d)
|
|
933
|
+
|
|
934
|
+
def _polymap_times_matrix_(self, mat, h):
|
|
935
|
+
"""
|
|
936
|
+
Multiply the morphism on the right by a matrix ``mat``.
|
|
937
|
+
|
|
938
|
+
INPUT:
|
|
939
|
+
|
|
940
|
+
- ``mat`` -- a matrix
|
|
941
|
+
|
|
942
|
+
OUTPUT: a scheme morphism given by ``mat*self``
|
|
943
|
+
|
|
944
|
+
EXAMPLES::
|
|
945
|
+
|
|
946
|
+
sage: A.<x> = AffineSpace(ZZ, 1)
|
|
947
|
+
sage: H = Hom(A, A)
|
|
948
|
+
sage: f = H([x^2 + 1])
|
|
949
|
+
sage: f * matrix([[1,2], [0,1]]) # needs sage.modules
|
|
950
|
+
Scheme endomorphism of Affine Space of dimension 1 over Integer Ring
|
|
951
|
+
Defn: Defined on coordinates by sending (x) to
|
|
952
|
+
(x^2 + 4*x + 5)
|
|
953
|
+
|
|
954
|
+
::
|
|
955
|
+
|
|
956
|
+
sage: A1 = AffineSpace(ZZ, 1)
|
|
957
|
+
sage: A2 = AffineSpace(ZZ, 2)
|
|
958
|
+
sage: H = Hom(A1, A2)
|
|
959
|
+
sage: f = H([x^2 + 1, x^2 - 1])
|
|
960
|
+
sage: f * matrix([[1,2], [0,1]]) # needs sage.modules
|
|
961
|
+
Scheme morphism:
|
|
962
|
+
From: Affine Space of dimension 1 over Integer Ring
|
|
963
|
+
To: Affine Space of dimension 2 over Integer Ring
|
|
964
|
+
Defn: Defined on coordinates by sending (x) to
|
|
965
|
+
(x^2 + 4*x + 5, x^2 + 4*x + 3)
|
|
966
|
+
|
|
967
|
+
::
|
|
968
|
+
|
|
969
|
+
sage: P.<x, y> = AffineSpace(QQ, 2)
|
|
970
|
+
sage: P2.<u,v,w> = AffineSpace(QQ, 3)
|
|
971
|
+
sage: H = Hom(P2, P)
|
|
972
|
+
sage: f = H([u^2 + v^2, w^2])
|
|
973
|
+
sage: m = matrix([[1,1,1], [1,0,1], [0,0,1]]) # needs sage.modules
|
|
974
|
+
sage: m*f # needs sage.modules
|
|
975
|
+
Scheme morphism:
|
|
976
|
+
From: Affine Space of dimension 3 over Rational Field
|
|
977
|
+
To: Affine Space of dimension 2 over Rational Field
|
|
978
|
+
Defn: Defined on coordinates by sending (u, v, w) to
|
|
979
|
+
(u^2 + v^2 + w^2 + 1, u^2 + v^2 + 1)
|
|
980
|
+
"""
|
|
981
|
+
if not mat.is_square():
|
|
982
|
+
raise TypeError("matrix must be square")
|
|
983
|
+
if mat.nrows() != self.domain().ngens() + 1:
|
|
984
|
+
raise TypeError("the size of the matrix must be n + 1, where n is the dimension of the domain")
|
|
985
|
+
if self.is_endomorphism():
|
|
986
|
+
d = self.domain().ngens()
|
|
987
|
+
else:
|
|
988
|
+
d = (self.domain().ngens(), self.codomain().ngens())
|
|
989
|
+
f = self.homogenize(d) * mat
|
|
990
|
+
return f.dehomogenize(d)
|
|
991
|
+
|
|
992
|
+
def degree(self):
|
|
993
|
+
r"""
|
|
994
|
+
Return the degree of the affine morphism.
|
|
995
|
+
|
|
996
|
+
EXAMPLES::
|
|
997
|
+
|
|
998
|
+
sage: R.<x> = AffineSpace(QQ, 1)
|
|
999
|
+
sage: H = Hom(R, R)
|
|
1000
|
+
sage: f = H([x^7])
|
|
1001
|
+
sage: f.degree()
|
|
1002
|
+
7
|
|
1003
|
+
|
|
1004
|
+
::
|
|
1005
|
+
|
|
1006
|
+
sage: R.<x,y,z> = AffineSpace(QQ, 3)
|
|
1007
|
+
sage: H = Hom(R, R)
|
|
1008
|
+
sage: f = H([x^3, y^2 + 5, z^4 + y])
|
|
1009
|
+
sage: f.degree()
|
|
1010
|
+
4
|
|
1011
|
+
"""
|
|
1012
|
+
polys = self._polys
|
|
1013
|
+
max_degree = 0
|
|
1014
|
+
for poly in polys:
|
|
1015
|
+
# rational affine map
|
|
1016
|
+
if isinstance(poly, FractionFieldElement):
|
|
1017
|
+
poly_numerator = poly.numerator()
|
|
1018
|
+
poly_denominator = poly.denominator()
|
|
1019
|
+
degree = max(poly_numerator.degree(), poly_denominator.degree())
|
|
1020
|
+
max_degree = max(degree, max_degree)
|
|
1021
|
+
# polynomial affine map
|
|
1022
|
+
elif poly.degree() > max_degree:
|
|
1023
|
+
max_degree = poly.degree()
|
|
1024
|
+
return max_degree
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
class SchemeMorphism_polynomial_affine_space_field(SchemeMorphism_polynomial_affine_space):
|
|
1028
|
+
|
|
1029
|
+
@cached_method
|
|
1030
|
+
def weil_restriction(self):
|
|
1031
|
+
r"""
|
|
1032
|
+
Compute the Weil restriction of this morphism over some extension field.
|
|
1033
|
+
|
|
1034
|
+
If the field is a finite field, then this computes
|
|
1035
|
+
the Weil restriction to the prime subfield.
|
|
1036
|
+
|
|
1037
|
+
A Weil restriction of scalars - denoted `Res_{L/k}` - is a
|
|
1038
|
+
functor which, for any finite extension of fields `L/k` and
|
|
1039
|
+
any algebraic variety `X` over `L`, produces another
|
|
1040
|
+
corresponding variety `Res_{L/k}(X)`, defined over `k`. It is
|
|
1041
|
+
useful for reducing questions about varieties over large
|
|
1042
|
+
fields to questions about more complicated varieties over
|
|
1043
|
+
smaller fields. Since it is a functor it also applied to morphisms.
|
|
1044
|
+
In particular, the functor applied to a morphism gives the equivalent
|
|
1045
|
+
morphism from the Weil restriction of the domain to the Weil restriction
|
|
1046
|
+
of the codomain.
|
|
1047
|
+
|
|
1048
|
+
OUTPUT: scheme morphism on the Weil restrictions of the domain
|
|
1049
|
+
and codomain of the map.
|
|
1050
|
+
|
|
1051
|
+
EXAMPLES::
|
|
1052
|
+
|
|
1053
|
+
sage: # needs sage.rings.number_field
|
|
1054
|
+
sage: K.<v> = QuadraticField(5)
|
|
1055
|
+
sage: A.<x,y> = AffineSpace(K, 2)
|
|
1056
|
+
sage: H = End(A)
|
|
1057
|
+
sage: f = H([x^2 - y^2, y^2])
|
|
1058
|
+
sage: f.weil_restriction() # needs sage.libs.singular
|
|
1059
|
+
Scheme endomorphism of Affine Space of dimension 4 over Rational Field
|
|
1060
|
+
Defn: Defined on coordinates by sending (z0, z1, z2, z3) to
|
|
1061
|
+
(z0^2 + 5*z1^2 - z2^2 - 5*z3^2, 2*z0*z1 - 2*z2*z3, z2^2 + 5*z3^2, 2*z2*z3)
|
|
1062
|
+
|
|
1063
|
+
::
|
|
1064
|
+
|
|
1065
|
+
sage: # needs sage.libs.singular sage.rings.number_field
|
|
1066
|
+
sage: K.<v> = QuadraticField(5)
|
|
1067
|
+
sage: PS.<x,y> = AffineSpace(K, 2)
|
|
1068
|
+
sage: H = Hom(PS, PS)
|
|
1069
|
+
sage: f = H([x, y])
|
|
1070
|
+
sage: F = f.weil_restriction()
|
|
1071
|
+
sage: P = PS(2, 1)
|
|
1072
|
+
sage: Q = P.weil_restriction()
|
|
1073
|
+
sage: f(P).weil_restriction() == F(Q)
|
|
1074
|
+
True
|
|
1075
|
+
"""
|
|
1076
|
+
if any(isinstance(f, FractionFieldElement) for f in self):
|
|
1077
|
+
raise TypeError("coordinate functions must be polynomials")
|
|
1078
|
+
|
|
1079
|
+
DS = self.domain()
|
|
1080
|
+
R = DS.coordinate_ring()
|
|
1081
|
+
# using the Weil restriction on ideal generators to not duplicate code
|
|
1082
|
+
result = R.ideal(self._polys).weil_restriction().gens()
|
|
1083
|
+
H = Hom(DS.weil_restriction(), self.codomain().weil_restriction())
|
|
1084
|
+
|
|
1085
|
+
return H(result)
|
|
1086
|
+
|
|
1087
|
+
def reduce_base_field(self):
|
|
1088
|
+
"""
|
|
1089
|
+
Return this map defined over the field of definition of the coefficients.
|
|
1090
|
+
|
|
1091
|
+
The base field of the map could be strictly larger than the field where
|
|
1092
|
+
all of the coefficients are defined. This function reduces the base
|
|
1093
|
+
field to the minimal possible. This can be done when the base ring is a
|
|
1094
|
+
number field, QQbar, a finite field, or algebraic closure of a finite
|
|
1095
|
+
field.
|
|
1096
|
+
|
|
1097
|
+
OUTPUT: a scheme morphism
|
|
1098
|
+
|
|
1099
|
+
EXAMPLES::
|
|
1100
|
+
|
|
1101
|
+
sage: # needs sage.rings.finite_rings
|
|
1102
|
+
sage: K.<t> = GF(5^4)
|
|
1103
|
+
sage: A.<x> = AffineSpace(K, 1)
|
|
1104
|
+
sage: A2.<a,b> = AffineSpace(K, 2)
|
|
1105
|
+
sage: H = End(A)
|
|
1106
|
+
sage: H2 = Hom(A, A2)
|
|
1107
|
+
sage: H3 = Hom(A2, A)
|
|
1108
|
+
sage: f = H([x^2 + 2*(t^3 + t^2 + t + 3)])
|
|
1109
|
+
sage: f.reduce_base_field() # needs sage.libs.singular
|
|
1110
|
+
Scheme endomorphism of Affine Space of dimension 1
|
|
1111
|
+
over Finite Field in t2 of size 5^2
|
|
1112
|
+
Defn: Defined on coordinates by sending (x) to (x^2 + (2*t2))
|
|
1113
|
+
sage: f2 = H2([x^2 + 4, 2*x])
|
|
1114
|
+
sage: f2.reduce_base_field() # needs sage.libs.singular
|
|
1115
|
+
Scheme morphism:
|
|
1116
|
+
From: Affine Space of dimension 1 over Finite Field of size 5
|
|
1117
|
+
To: Affine Space of dimension 2 over Finite Field of size 5
|
|
1118
|
+
Defn: Defined on coordinates by sending (x) to (x^2 - 1, 2*x)
|
|
1119
|
+
sage: f3 = H3([a^2 + t*b])
|
|
1120
|
+
sage: f3.reduce_base_field() # needs sage.libs.singular
|
|
1121
|
+
Scheme morphism:
|
|
1122
|
+
From: Affine Space of dimension 2 over Finite Field in t of size 5^4
|
|
1123
|
+
To: Affine Space of dimension 1 over Finite Field in t of size 5^4
|
|
1124
|
+
Defn: Defined on coordinates by sending (a, b) to (a^2 + t*b)
|
|
1125
|
+
|
|
1126
|
+
::
|
|
1127
|
+
|
|
1128
|
+
sage: # needs sage.rings.number_field
|
|
1129
|
+
sage: K.<v> = CyclotomicField(4)
|
|
1130
|
+
sage: A.<x> = AffineSpace(K, 1)
|
|
1131
|
+
sage: H = End(A)
|
|
1132
|
+
sage: f = H([x^2 + v])
|
|
1133
|
+
sage: g = f.reduce_base_field(); g # needs sage.libs.singular
|
|
1134
|
+
Scheme endomorphism of Affine Space of dimension 1
|
|
1135
|
+
over Cyclotomic Field of order 4 and degree 2
|
|
1136
|
+
Defn: Defined on coordinates by sending (x) to (x^2 + v)
|
|
1137
|
+
sage: g.base_ring() is K # needs sage.libs.singular
|
|
1138
|
+
True
|
|
1139
|
+
|
|
1140
|
+
::
|
|
1141
|
+
|
|
1142
|
+
sage: # needs sage.rings.number_field
|
|
1143
|
+
sage: A.<x> = AffineSpace(QQbar, 1)
|
|
1144
|
+
sage: H = End(A)
|
|
1145
|
+
sage: f = H([(QQbar(sqrt(2))*x^2 + 1/QQbar(sqrt(3))) / (5*x)]) # needs sage.symbolic
|
|
1146
|
+
sage: f.reduce_base_field() # needs sage.libs.singular sage.symbolic
|
|
1147
|
+
Scheme endomorphism of Affine Space of dimension 1 over Number Field in a
|
|
1148
|
+
with defining polynomial y^4 - 4*y^2 + 1 with a = ...?
|
|
1149
|
+
Defn: Defined on coordinates by sending (x) to
|
|
1150
|
+
(((a^3 - 3*a)*x^2 + (-1/3*a^2 + 2/3))/(5*x))
|
|
1151
|
+
|
|
1152
|
+
::
|
|
1153
|
+
|
|
1154
|
+
sage: # needs sage.rings.number_field
|
|
1155
|
+
sage: R.<x> = PolynomialRing(QQ)
|
|
1156
|
+
sage: A.<x> = AffineSpace(QQbar, 1)
|
|
1157
|
+
sage: H = End(A)
|
|
1158
|
+
sage: f = H([QQbar(3^(1/3))*x^2 + QQbar(sqrt(-2))]) # needs sage.symbolic
|
|
1159
|
+
sage: f.reduce_base_field() # needs sage.libs.singular sage.symbolic
|
|
1160
|
+
Scheme endomorphism of Affine Space of dimension 1 over Number Field in a
|
|
1161
|
+
with defining polynomial y^6 + 6*y^4 - 6*y^3 + 12*y^2 + 36*y + 17
|
|
1162
|
+
with a = 1.442249570307409? - 1.414213562373095?*I
|
|
1163
|
+
Defn: Defined on coordinates by sending (x) to
|
|
1164
|
+
((-48/269*a^5 + 27/269*a^4 - 320/269*a^3 + 468/269*a^2 - 772/269*a
|
|
1165
|
+
- 1092/269)*x^2 + (-48/269*a^5 + 27/269*a^4 - 320/269*a^3 + 468/269*a^2
|
|
1166
|
+
- 1041/269*a - 1092/269))
|
|
1167
|
+
|
|
1168
|
+
::
|
|
1169
|
+
|
|
1170
|
+
sage: # needs sage.rings.number_field
|
|
1171
|
+
sage: R.<x> = PolynomialRing(QQ)
|
|
1172
|
+
sage: K.<a> = NumberField(x^3 - x + 1,
|
|
1173
|
+
....: embedding=(x^3 + x + 1).roots(ring=CC)[0][0])
|
|
1174
|
+
sage: A.<x> = AffineSpace(K, 1)
|
|
1175
|
+
sage: A2.<u,v> = AffineSpace(K, 2)
|
|
1176
|
+
sage: H = Hom(A, A2)
|
|
1177
|
+
sage: f = H([x^2 + a*x + 3, 5*x])
|
|
1178
|
+
sage: f.reduce_base_field() # needs sage.libs.singular
|
|
1179
|
+
Scheme morphism:
|
|
1180
|
+
From: Affine Space of dimension 1 over Number Field in a with
|
|
1181
|
+
defining polynomial x^3 - x + 1 with a = -1.324717957244746?
|
|
1182
|
+
To: Affine Space of dimension 2 over Number Field in a with
|
|
1183
|
+
defining polynomial x^3 - x + 1 with a = -1.324717957244746?
|
|
1184
|
+
Defn: Defined on coordinates by sending (x) to (x^2 + a*x + 3, 5*x)
|
|
1185
|
+
|
|
1186
|
+
::
|
|
1187
|
+
|
|
1188
|
+
sage: # needs sage.rings.number_field
|
|
1189
|
+
sage: K.<v> = QuadraticField(2)
|
|
1190
|
+
sage: A.<x> = AffineSpace(K, 1)
|
|
1191
|
+
sage: H = End(A)
|
|
1192
|
+
sage: f = H([3*x^2 + x + 1])
|
|
1193
|
+
sage: f.reduce_base_field() # needs sage.libs.singular
|
|
1194
|
+
Scheme endomorphism of Affine Space of dimension 1 over Rational Field
|
|
1195
|
+
Defn: Defined on coordinates by sending (x) to (3*x^2 + x + 1)
|
|
1196
|
+
|
|
1197
|
+
::
|
|
1198
|
+
|
|
1199
|
+
sage: # needs sage.rings.finite_rings
|
|
1200
|
+
sage: K.<t> = GF(5^6)
|
|
1201
|
+
sage: A.<x> = AffineSpace(K, 1)
|
|
1202
|
+
sage: H = End(A)
|
|
1203
|
+
sage: f = H([x^2 + x*(t^3 + 2*t^2 + 4*t) + (t^5 + 3*t^4 + t^2 + 4*t)])
|
|
1204
|
+
sage: f.reduce_base_field() # needs sage.libs.singular
|
|
1205
|
+
Scheme endomorphism of Affine Space of dimension 1
|
|
1206
|
+
over Finite Field in t of size 5^6
|
|
1207
|
+
Defn: Defined on coordinates by sending (x) to
|
|
1208
|
+
(x^2 + (t^3 + 2*t^2 - t)*x + (t^5 - 2*t^4 + t^2 - t))
|
|
1209
|
+
"""
|
|
1210
|
+
g = self.homogenize(0).reduce_base_field().dehomogenize(0)
|
|
1211
|
+
from sage.schemes.affine.affine_space import AffineSpace
|
|
1212
|
+
new_domain = AffineSpace(g.domain().base_ring(),
|
|
1213
|
+
self.domain().dimension_relative(),
|
|
1214
|
+
self.domain().variable_names())
|
|
1215
|
+
new_codomain = AffineSpace(g.codomain().base_ring(),
|
|
1216
|
+
self.codomain().dimension_relative(),
|
|
1217
|
+
self.codomain().variable_names())
|
|
1218
|
+
R = new_domain.coordinate_ring()
|
|
1219
|
+
H = Hom(new_domain, new_codomain)
|
|
1220
|
+
if isinstance(g[0], FractionFieldElement):
|
|
1221
|
+
return H([R(G.numerator()) / R(G.denominator()) for G in g])
|
|
1222
|
+
return H([R(G) for G in g])
|
|
1223
|
+
|
|
1224
|
+
def indeterminacy_locus(self):
|
|
1225
|
+
r"""
|
|
1226
|
+
Return the indeterminacy locus of this map as a rational map on the domain.
|
|
1227
|
+
|
|
1228
|
+
The indeterminacy locus is the intersection of all the base indeterminacy
|
|
1229
|
+
locuses of maps that define the same rational map as by this map.
|
|
1230
|
+
|
|
1231
|
+
OUTPUT: a subscheme of the domain of the map
|
|
1232
|
+
|
|
1233
|
+
EXAMPLES::
|
|
1234
|
+
|
|
1235
|
+
sage: A.<x,y> = AffineSpace(QQ, 2)
|
|
1236
|
+
sage: H = End(A)
|
|
1237
|
+
sage: f = H([x - y, x^2 - y^2])
|
|
1238
|
+
sage: f.indeterminacy_locus() # needs sage.libs.singular
|
|
1239
|
+
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
|
|
1240
|
+
1
|
|
1241
|
+
|
|
1242
|
+
::
|
|
1243
|
+
|
|
1244
|
+
sage: A.<x,y> = AffineSpace(QQ, 2)
|
|
1245
|
+
sage: f = A.hom([x, x/y], A)
|
|
1246
|
+
sage: f.indeterminacy_locus() # needs sage.libs.singular
|
|
1247
|
+
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
|
|
1248
|
+
y
|
|
1249
|
+
"""
|
|
1250
|
+
A = self.domain()
|
|
1251
|
+
X = A.subscheme(0) # affine space as a subscheme
|
|
1252
|
+
return (self * X.hom(A.gens(), A)).indeterminacy_locus()
|
|
1253
|
+
|
|
1254
|
+
def indeterminacy_points(self, F=None):
|
|
1255
|
+
r"""
|
|
1256
|
+
Return the points in the indeterminacy locus of this map.
|
|
1257
|
+
|
|
1258
|
+
If the dimension of the indeterminacy locus is not zero, an error is raised.
|
|
1259
|
+
|
|
1260
|
+
INPUT:
|
|
1261
|
+
|
|
1262
|
+
- ``F`` -- a field; if not given, the base ring of the domain is assumed
|
|
1263
|
+
|
|
1264
|
+
OUTPUT: indeterminacy points of the map defined over ``F``
|
|
1265
|
+
|
|
1266
|
+
EXAMPLES::
|
|
1267
|
+
|
|
1268
|
+
sage: A.<x,y> = AffineSpace(QQ, 2)
|
|
1269
|
+
sage: H = End(A)
|
|
1270
|
+
sage: f = H([x - y, x^2 - y^2])
|
|
1271
|
+
sage: f.indeterminacy_points() # needs sage.libs.singular
|
|
1272
|
+
[]
|
|
1273
|
+
|
|
1274
|
+
::
|
|
1275
|
+
|
|
1276
|
+
sage: A2.<x,y> = AffineSpace(QQ, 2)
|
|
1277
|
+
sage: P2.<x0,x1,x2> = ProjectiveSpace(QQ, 2)
|
|
1278
|
+
sage: f = A2.hom([x*y, y, x], P2)
|
|
1279
|
+
sage: f.indeterminacy_points() # needs sage.libs.singular
|
|
1280
|
+
[(0, 0)]
|
|
1281
|
+
"""
|
|
1282
|
+
if F is None:
|
|
1283
|
+
fcn = self
|
|
1284
|
+
else:
|
|
1285
|
+
if not F.is_field():
|
|
1286
|
+
raise NotImplementedError("indeterminacy points only implemented for fields")
|
|
1287
|
+
fcn = self.change_ring(F)
|
|
1288
|
+
|
|
1289
|
+
indScheme = fcn.indeterminacy_locus()
|
|
1290
|
+
|
|
1291
|
+
if indScheme.dimension() > 0:
|
|
1292
|
+
raise ValueError("indeterminacy scheme is not dimension 0")
|
|
1293
|
+
|
|
1294
|
+
return indScheme.rational_points()
|
|
1295
|
+
|
|
1296
|
+
def image(self):
|
|
1297
|
+
"""
|
|
1298
|
+
Return the scheme-theoretic image of the morphism.
|
|
1299
|
+
|
|
1300
|
+
OUTPUT: a subscheme of the ambient space of the codomain
|
|
1301
|
+
|
|
1302
|
+
EXAMPLES::
|
|
1303
|
+
|
|
1304
|
+
sage: # needs sage.libs.singular
|
|
1305
|
+
sage: A1.<w> = AffineSpace(QQ, 1)
|
|
1306
|
+
sage: A2.<x,y> = AffineSpace(QQ, 2)
|
|
1307
|
+
sage: f = A2.hom([x + y], A1)
|
|
1308
|
+
sage: f.image()
|
|
1309
|
+
Closed subscheme of Affine Space of dimension 1 over Rational Field defined by:
|
|
1310
|
+
(no polynomials)
|
|
1311
|
+
sage: f = A2.hom([x, x], A2)
|
|
1312
|
+
sage: f.image()
|
|
1313
|
+
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
|
|
1314
|
+
x - y
|
|
1315
|
+
sage: f = A2.hom([x^2, x^3], A2)
|
|
1316
|
+
sage: f.image()
|
|
1317
|
+
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
|
|
1318
|
+
x^3 - y^2
|
|
1319
|
+
sage: P2.<x0,x1,x2> = ProjectiveSpace(QQ, 2)
|
|
1320
|
+
sage: f = A2.hom([x, x^2, x^3], P2)
|
|
1321
|
+
sage: f.image()
|
|
1322
|
+
Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
|
|
1323
|
+
x1^2 - x0*x2
|
|
1324
|
+
"""
|
|
1325
|
+
X = self.domain().subscheme(0)
|
|
1326
|
+
e = X.embedding_morphism()
|
|
1327
|
+
return (self * e).image()
|
|
1328
|
+
|
|
1329
|
+
|
|
1330
|
+
class SchemeMorphism_polynomial_affine_space_finite_field(SchemeMorphism_polynomial_affine_space_field):
|
|
1331
|
+
|
|
1332
|
+
def _fast_eval(self, x):
|
|
1333
|
+
"""
|
|
1334
|
+
Evaluate affine morphism at point described by ``x``.
|
|
1335
|
+
|
|
1336
|
+
EXAMPLES::
|
|
1337
|
+
|
|
1338
|
+
sage: P.<x,y,z> = AffineSpace(GF(7), 3)
|
|
1339
|
+
sage: H = Hom(P, P)
|
|
1340
|
+
sage: f = H([x^2 + y^2,y ^2, z^2 + y*z])
|
|
1341
|
+
sage: f._fast_eval([1, 1, 1])
|
|
1342
|
+
[2, 1, 2]
|
|
1343
|
+
|
|
1344
|
+
::
|
|
1345
|
+
|
|
1346
|
+
sage: P.<x,y,z> = AffineSpace(GF(19), 3)
|
|
1347
|
+
sage: H = Hom(P, P)
|
|
1348
|
+
sage: f = H([x/(y+1), y, (z^2 + y^2)/(x^2 + 1)])
|
|
1349
|
+
sage: f._fast_eval([2, 1, 3])
|
|
1350
|
+
[1, 1, 2]
|
|
1351
|
+
"""
|
|
1352
|
+
R = self.domain().ambient_space().coordinate_ring()
|
|
1353
|
+
P = []
|
|
1354
|
+
for i in range(len(self._fastpolys[0])):
|
|
1355
|
+
r = self._fastpolys[0][i](*x)
|
|
1356
|
+
if self._fastpolys[1][i] is R.one():
|
|
1357
|
+
if self._is_prime_finite_field:
|
|
1358
|
+
p = self.base_ring().characteristic()
|
|
1359
|
+
r = Integer(r) % p
|
|
1360
|
+
P.append(r)
|
|
1361
|
+
else:
|
|
1362
|
+
s = self._fastpolys[1][i](*x)
|
|
1363
|
+
if self._is_prime_finite_field:
|
|
1364
|
+
p = self.base_ring().characteristic()
|
|
1365
|
+
r = Integer(r) % p
|
|
1366
|
+
s = Integer(s) % p
|
|
1367
|
+
P.append(r / s)
|
|
1368
|
+
return P
|
|
1369
|
+
|
|
1370
|
+
|
|
1371
|
+
class SchemeMorphism_polynomial_affine_subscheme_field(SchemeMorphism_polynomial_affine_space_field):
|
|
1372
|
+
"""
|
|
1373
|
+
Morphisms from subschemes of affine spaces defined over fields.
|
|
1374
|
+
"""
|
|
1375
|
+
@cached_method
|
|
1376
|
+
def representatives(self):
|
|
1377
|
+
"""
|
|
1378
|
+
Return all maps representing the same rational map as by this map.
|
|
1379
|
+
|
|
1380
|
+
EXAMPLES::
|
|
1381
|
+
|
|
1382
|
+
sage: A2.<x,y> = AffineSpace(QQ, 2)
|
|
1383
|
+
sage: X = A2.subscheme(0)
|
|
1384
|
+
sage: f = X.hom([x, x/y], A2)
|
|
1385
|
+
sage: f.representatives() # needs sage.libs.singular
|
|
1386
|
+
[Scheme morphism:
|
|
1387
|
+
From: Closed subscheme of Affine Space of dimension 2 over Rational Field
|
|
1388
|
+
defined by: 0
|
|
1389
|
+
To: Affine Space of dimension 2 over Rational Field
|
|
1390
|
+
Defn: Defined on coordinates by sending (x, y) to (x, x/y)]
|
|
1391
|
+
|
|
1392
|
+
::
|
|
1393
|
+
|
|
1394
|
+
sage: # needs sage.libs.singular
|
|
1395
|
+
sage: A2.<x,y> = AffineSpace(QQ, 2)
|
|
1396
|
+
sage: A1.<a> = AffineSpace(QQ, 1)
|
|
1397
|
+
sage: X = A2.subscheme([x^2 - y^2 - y])
|
|
1398
|
+
sage: f = X.hom([x/y], A1)
|
|
1399
|
+
sage: f.representatives()
|
|
1400
|
+
[Scheme morphism:
|
|
1401
|
+
From: Closed subscheme of Affine Space of dimension 2 over Rational Field
|
|
1402
|
+
defined by: x^2 - y^2 - y
|
|
1403
|
+
To: Affine Space of dimension 1 over Rational Field
|
|
1404
|
+
Defn: Defined on coordinates by sending (x, y) to (x/y),
|
|
1405
|
+
Scheme morphism:
|
|
1406
|
+
From: Closed subscheme of Affine Space of dimension 2 over Rational Field
|
|
1407
|
+
defined by: x^2 - y^2 - y
|
|
1408
|
+
To: Affine Space of dimension 1 over Rational Field
|
|
1409
|
+
Defn: Defined on coordinates by sending (x, y) to ((y + 1)/x)]
|
|
1410
|
+
sage: g = _[1]
|
|
1411
|
+
sage: g.representatives()
|
|
1412
|
+
[Scheme morphism:
|
|
1413
|
+
From: Closed subscheme of Affine Space of dimension 2 over Rational Field
|
|
1414
|
+
defined by: x^2 - y^2 - y
|
|
1415
|
+
To: Affine Space of dimension 1 over Rational Field
|
|
1416
|
+
Defn: Defined on coordinates by sending (x, y) to (x/y),
|
|
1417
|
+
Scheme morphism:
|
|
1418
|
+
From: Closed subscheme of Affine Space of dimension 2 over Rational Field
|
|
1419
|
+
defined by: x^2 - y^2 - y
|
|
1420
|
+
To: Affine Space of dimension 1 over Rational Field
|
|
1421
|
+
Defn: Defined on coordinates by sending (x, y) to ((y + 1)/x)]
|
|
1422
|
+
|
|
1423
|
+
::
|
|
1424
|
+
|
|
1425
|
+
sage: A2.<x,y> = AffineSpace(QQ, 2)
|
|
1426
|
+
sage: P1.<a,b> = ProjectiveSpace(QQ, 1)
|
|
1427
|
+
sage: X = A2.subscheme([x^2 - y^2 - y])
|
|
1428
|
+
sage: f = X.hom([x, y], P1)
|
|
1429
|
+
sage: f.representatives() # needs sage.libs.singular
|
|
1430
|
+
[Scheme morphism:
|
|
1431
|
+
From: Closed subscheme of Affine Space of dimension 2 over Rational Field
|
|
1432
|
+
defined by: x^2 - y^2 - y
|
|
1433
|
+
To: Projective Space of dimension 1 over Rational Field
|
|
1434
|
+
Defn: Defined on coordinates by sending (x, y) to
|
|
1435
|
+
(x : y),
|
|
1436
|
+
Scheme morphism:
|
|
1437
|
+
From: Closed subscheme of Affine Space of dimension 2 over Rational Field
|
|
1438
|
+
defined by: x^2 - y^2 - y
|
|
1439
|
+
To: Projective Space of dimension 1 over Rational Field
|
|
1440
|
+
Defn: Defined on coordinates by sending (x, y) to (y + 1 : x)]
|
|
1441
|
+
"""
|
|
1442
|
+
X = self.domain()
|
|
1443
|
+
Y = self.codomain()
|
|
1444
|
+
|
|
1445
|
+
if not X.is_irreducible():
|
|
1446
|
+
raise ValueError("domain is not irreducible")
|
|
1447
|
+
|
|
1448
|
+
h = self.homogenize(0)
|
|
1449
|
+
if Y.is_projective():
|
|
1450
|
+
reprs = []
|
|
1451
|
+
for r in h.representatives():
|
|
1452
|
+
i = X.projective_embedding(0, h.domain().ambient_space())
|
|
1453
|
+
reprs.append(r * i)
|
|
1454
|
+
else:
|
|
1455
|
+
reprs = []
|
|
1456
|
+
for r in h.representatives():
|
|
1457
|
+
reprs.append(r.dehomogenize(0))
|
|
1458
|
+
|
|
1459
|
+
return reprs
|
|
1460
|
+
|
|
1461
|
+
def indeterminacy_locus(self):
|
|
1462
|
+
"""
|
|
1463
|
+
Return the indeterminacy locus of this map.
|
|
1464
|
+
|
|
1465
|
+
The map defines a rational map on the domain. The output is the
|
|
1466
|
+
subscheme of the domain on which the rational map is not defined by any
|
|
1467
|
+
representative of the rational map. See :meth:`representatives()`.
|
|
1468
|
+
|
|
1469
|
+
EXAMPLES::
|
|
1470
|
+
|
|
1471
|
+
sage: A2.<x1,x2> = AffineSpace(QQ, 2)
|
|
1472
|
+
sage: X = A2.subscheme(0)
|
|
1473
|
+
sage: A1.<x> = AffineSpace(QQ, 1)
|
|
1474
|
+
sage: f = X.hom([x1/x2], A1)
|
|
1475
|
+
sage: f.indeterminacy_locus() # needs sage.libs.singular
|
|
1476
|
+
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
|
|
1477
|
+
x2
|
|
1478
|
+
|
|
1479
|
+
::
|
|
1480
|
+
|
|
1481
|
+
sage: A2.<x1,x2> = AffineSpace(QQ, 2)
|
|
1482
|
+
sage: X = A2.subscheme(0)
|
|
1483
|
+
sage: P1.<a,b> = ProjectiveSpace(QQ, 1)
|
|
1484
|
+
sage: f = X.hom([x1,x2], P1)
|
|
1485
|
+
sage: L = f.indeterminacy_locus() # needs sage.libs.singular
|
|
1486
|
+
sage: L.rational_points() # needs sage.libs.singular
|
|
1487
|
+
[(0, 0)]
|
|
1488
|
+
|
|
1489
|
+
::
|
|
1490
|
+
|
|
1491
|
+
sage: A2.<x,y> = AffineSpace(QQ, 2)
|
|
1492
|
+
sage: X = A2.subscheme([x^2 - y^2 - y])
|
|
1493
|
+
sage: A1.<a> = AffineSpace(QQ, 1)
|
|
1494
|
+
sage: f = X.hom([x/y], A1)
|
|
1495
|
+
sage: f.indeterminacy_locus() # needs sage.libs.singular
|
|
1496
|
+
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
|
|
1497
|
+
y,
|
|
1498
|
+
x
|
|
1499
|
+
|
|
1500
|
+
::
|
|
1501
|
+
|
|
1502
|
+
sage: A3.<x,y,z> = AffineSpace(QQ, 3)
|
|
1503
|
+
sage: X = A3.subscheme(x^2 - y*z - x)
|
|
1504
|
+
sage: A2.<a,b> = AffineSpace(QQ, 2)
|
|
1505
|
+
sage: f = X.hom([y, y/x], A2)
|
|
1506
|
+
sage: L = f.indeterminacy_locus(); L # needs sage.libs.singular
|
|
1507
|
+
Closed subscheme of Affine Space of dimension 3 over Rational Field defined by:
|
|
1508
|
+
x,
|
|
1509
|
+
y*z
|
|
1510
|
+
sage: L.dimension() # needs sage.libs.singular
|
|
1511
|
+
1
|
|
1512
|
+
"""
|
|
1513
|
+
# homogenize using 0th affine patch both for domain and codomain
|
|
1514
|
+
h = self.homogenize(0)
|
|
1515
|
+
|
|
1516
|
+
locus = h.indeterminacy_locus()
|
|
1517
|
+
|
|
1518
|
+
if not self.codomain().is_projective():
|
|
1519
|
+
# cut out points mapping to the horizon
|
|
1520
|
+
A = h.domain().ambient_space()
|
|
1521
|
+
Z = h.domain().intersection(A.subscheme(h[0]))
|
|
1522
|
+
|
|
1523
|
+
locus = locus.union(Z)
|
|
1524
|
+
|
|
1525
|
+
return locus.affine_patch(0, self.domain().ambient_space()).reduce()
|
|
1526
|
+
|
|
1527
|
+
def is_morphism(self):
|
|
1528
|
+
"""
|
|
1529
|
+
Return ``True`` if the map is defined everywhere on the domain.
|
|
1530
|
+
|
|
1531
|
+
EXAMPLES::
|
|
1532
|
+
|
|
1533
|
+
sage: P2.<x,y,z> = ProjectiveSpace(QQ,2)
|
|
1534
|
+
sage: P1.<a,b> = ProjectiveSpace(QQ,1)
|
|
1535
|
+
sage: X = P2.subscheme([x^2 - y^2 - y*z])
|
|
1536
|
+
sage: f = X.hom([x,y], P1)
|
|
1537
|
+
sage: f.is_morphism() # needs sage.libs.singular
|
|
1538
|
+
True
|
|
1539
|
+
"""
|
|
1540
|
+
return self.indeterminacy_locus().dimension() < 0
|
|
1541
|
+
|
|
1542
|
+
def image(self):
|
|
1543
|
+
"""
|
|
1544
|
+
Return the scheme-theoretic image of the morphism.
|
|
1545
|
+
|
|
1546
|
+
OUTPUT: a subscheme of the ambient space of the codomain
|
|
1547
|
+
|
|
1548
|
+
EXAMPLES::
|
|
1549
|
+
|
|
1550
|
+
sage: A1.<w> = AffineSpace(QQ, 1)
|
|
1551
|
+
sage: A2.<x,y> = AffineSpace(QQ, 2)
|
|
1552
|
+
sage: X = A2.subscheme(0)
|
|
1553
|
+
sage: f = X.hom([x + y], A1)
|
|
1554
|
+
sage: f.image() # needs sage.libs.singular
|
|
1555
|
+
Closed subscheme of Affine Space of dimension 1 over Rational Field defined by:
|
|
1556
|
+
(no polynomials)
|
|
1557
|
+
|
|
1558
|
+
::
|
|
1559
|
+
|
|
1560
|
+
sage: A2.<x,y> = AffineSpace(QQ, 2)
|
|
1561
|
+
sage: X = A2.subscheme([x*y^2 - y^3 - 1])
|
|
1562
|
+
sage: f = X.hom([y, y/x], A2)
|
|
1563
|
+
sage: f.image() # needs sage.libs.singular
|
|
1564
|
+
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
|
|
1565
|
+
-x^3*y + x^3 - y
|
|
1566
|
+
"""
|
|
1567
|
+
Y = self.codomain()
|
|
1568
|
+
|
|
1569
|
+
if Y.is_projective():
|
|
1570
|
+
return self.homogenize(0).image()
|
|
1571
|
+
|
|
1572
|
+
e = Y.projective_embedding(0)
|
|
1573
|
+
h = (e * self).homogenize(0)
|
|
1574
|
+
return h.image().affine_patch(0, Y.ambient_space())
|