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,2107 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-categories
|
|
2
|
+
r"""
|
|
3
|
+
Scheme morphism
|
|
4
|
+
|
|
5
|
+
.. NOTE::
|
|
6
|
+
|
|
7
|
+
You should never create the morphisms directly. Instead, use the
|
|
8
|
+
:meth:`~sage.schemes.generic.scheme.hom` and
|
|
9
|
+
:meth:`~sage.structure.parent.Hom` methods that are inherited by
|
|
10
|
+
all schemes.
|
|
11
|
+
|
|
12
|
+
If you want to extend the Sage library with some new kind of scheme,
|
|
13
|
+
your new class (say, ``MyScheme``) should provide a method
|
|
14
|
+
|
|
15
|
+
* ``MyScheme._morphism(*args, **kwds)`` returning a morphism
|
|
16
|
+
between two schemes in your category, usually defined via
|
|
17
|
+
polynomials. Your morphism class should derive from
|
|
18
|
+
:class:`SchemeMorphism_polynomial`. These morphisms will usually be
|
|
19
|
+
elements of the Hom-set
|
|
20
|
+
:class:`~sage.schemes.generic.homset.SchemeHomset_generic`.
|
|
21
|
+
|
|
22
|
+
Optionally, you can also provide a special Hom-set class for your
|
|
23
|
+
subcategory of schemes. If you want to do this, you should also
|
|
24
|
+
provide a method
|
|
25
|
+
|
|
26
|
+
* ``MyScheme._homset(*args, **kwds)`` returning a
|
|
27
|
+
Hom-set, which must be an element of a derived class of
|
|
28
|
+
:class:`~sage.schemes.generic.homset.SchemeHomset_generic`. If your
|
|
29
|
+
new Hom-set class does not use ``MyScheme._morphism`` then you
|
|
30
|
+
do not have to provide it.
|
|
31
|
+
|
|
32
|
+
Note that points on schemes are morphisms `\mathrm{Spec}(K)\to X`, too. But we
|
|
33
|
+
typically use a different notation, so they are implemented in a different
|
|
34
|
+
derived class. For this, you should implement a method
|
|
35
|
+
|
|
36
|
+
* ``MyScheme._point(*args, **kwds)`` returning a point, that is, a morphism
|
|
37
|
+
`\mathrm{Spec}(K)\to X`. Your point class should derive from
|
|
38
|
+
:class:`SchemeMorphism_point`.
|
|
39
|
+
|
|
40
|
+
Optionally, you can also provide a special Hom-set for the points, for
|
|
41
|
+
example the point Hom-set can provide a method to enumerate all
|
|
42
|
+
points. If you want to do this, you should also provide a method
|
|
43
|
+
|
|
44
|
+
* ``MyScheme._point_homset(*args, **kwds)`` returning
|
|
45
|
+
the :mod:`~sage.schemes.generic.homset` of points. The Hom-sets of
|
|
46
|
+
points are implemented in classes named ``SchemeHomset_points_...``.
|
|
47
|
+
If your new Hom-set class does not use ``MyScheme._point`` then
|
|
48
|
+
you do not have to provide it.
|
|
49
|
+
|
|
50
|
+
AUTHORS:
|
|
51
|
+
|
|
52
|
+
- David Kohel, William Stein
|
|
53
|
+
|
|
54
|
+
- William Stein (2006-02-11): fixed bug where P(0,0,0) was allowed as
|
|
55
|
+
a projective point.
|
|
56
|
+
|
|
57
|
+
- Volker Braun (2011-08-08): Renamed classes, more documentation, misc
|
|
58
|
+
cleanups.
|
|
59
|
+
|
|
60
|
+
- Ben Hutz (June 2012): added support for projective ring
|
|
61
|
+
|
|
62
|
+
- Simon King (2013-10): copy the changes of :class:`~sage.categories.morphism.Morphism`
|
|
63
|
+
that have been introduced in :issue:`14711`.
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
# ****************************************************************************
|
|
67
|
+
# Copyright (C) 2013 Simon King <simon.king@uni-jena.de>
|
|
68
|
+
# Copyright (C) 2011 Volker Braun <vbraun.name@gmail.com>
|
|
69
|
+
# Copyright (C) 2006 David Kohel <kohel@maths.usyd.edu.au>
|
|
70
|
+
# Copyright (C) 2006 William Stein <wstein@gmail.com>
|
|
71
|
+
#
|
|
72
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
73
|
+
# as published by the Free Software Foundation; either version 2 of
|
|
74
|
+
# the License, or (at your option) any later version.
|
|
75
|
+
# https://www.gnu.org/licenses/
|
|
76
|
+
# ****************************************************************************
|
|
77
|
+
|
|
78
|
+
import operator
|
|
79
|
+
|
|
80
|
+
from sage.arith.power import generic_power
|
|
81
|
+
from sage.categories.homset import Homset, Hom, End
|
|
82
|
+
from sage.categories.map import FormalCompositeMap, Map
|
|
83
|
+
from sage.categories.morphism import SetMorphism
|
|
84
|
+
from sage.misc.constant_function import ConstantFunction
|
|
85
|
+
from sage.misc.lazy_attribute import lazy_attribute
|
|
86
|
+
from sage.rings.fraction_field import FractionField_generic
|
|
87
|
+
from sage.rings.fraction_field_element import FractionFieldElement
|
|
88
|
+
from sage.schemes.generic.algebraic_scheme import AlgebraicScheme_subscheme
|
|
89
|
+
from sage.structure.element import Element, parent, coercion_model
|
|
90
|
+
from sage.structure.richcmp import richcmp
|
|
91
|
+
from sage.structure.sequence import Sequence
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def is_SchemeMorphism(f):
|
|
95
|
+
"""
|
|
96
|
+
Test whether ``f`` is a scheme morphism.
|
|
97
|
+
|
|
98
|
+
INPUT:
|
|
99
|
+
|
|
100
|
+
- ``f`` -- anything
|
|
101
|
+
|
|
102
|
+
OUTPUT:
|
|
103
|
+
|
|
104
|
+
boolean; return ``True`` if ``f`` is a scheme morphism or a point
|
|
105
|
+
on an elliptic curve.
|
|
106
|
+
|
|
107
|
+
EXAMPLES::
|
|
108
|
+
|
|
109
|
+
sage: A.<x,y> = AffineSpace(QQ, 2); H = A.Hom(A)
|
|
110
|
+
sage: f = H([y, x^2 + y]); f
|
|
111
|
+
Scheme endomorphism of Affine Space of dimension 2 over Rational Field
|
|
112
|
+
Defn: Defined on coordinates by sending (x, y) to (y, x^2 + y)
|
|
113
|
+
sage: from sage.schemes.generic.morphism import is_SchemeMorphism
|
|
114
|
+
sage: is_SchemeMorphism(f)
|
|
115
|
+
doctest:warning...
|
|
116
|
+
DeprecationWarning: The function is_SchemeMorphism is deprecated;
|
|
117
|
+
use 'isinstance(..., SchemeMorphism)' instead.
|
|
118
|
+
See https://github.com/sagemath/sage/issues/38296 for details.
|
|
119
|
+
True
|
|
120
|
+
"""
|
|
121
|
+
from sage.misc.superseded import deprecation
|
|
122
|
+
deprecation(38296,
|
|
123
|
+
"The function is_SchemeMorphism is deprecated; "
|
|
124
|
+
"use 'isinstance(..., SchemeMorphism)' instead.")
|
|
125
|
+
return isinstance(f, SchemeMorphism)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
class SchemeMorphism(Element):
|
|
129
|
+
"""
|
|
130
|
+
Base class for scheme morphisms.
|
|
131
|
+
|
|
132
|
+
INPUT:
|
|
133
|
+
|
|
134
|
+
- ``parent`` -- the parent of the morphism
|
|
135
|
+
|
|
136
|
+
.. TODO::
|
|
137
|
+
|
|
138
|
+
For historical reasons, :class:`SchemeMorphism` copies code from
|
|
139
|
+
:class:`~sage.categories.map.Map` rather than inheriting from it.
|
|
140
|
+
Proper inheritance should be used instead. See :issue:`14711`.
|
|
141
|
+
|
|
142
|
+
EXAMPLES::
|
|
143
|
+
|
|
144
|
+
sage: X = Spec(ZZ)
|
|
145
|
+
sage: Hom = X.Hom(X)
|
|
146
|
+
sage: from sage.schemes.generic.morphism import SchemeMorphism
|
|
147
|
+
sage: f = SchemeMorphism(Hom)
|
|
148
|
+
sage: type(f)
|
|
149
|
+
<class 'sage.schemes.generic.morphism.SchemeMorphism'>
|
|
150
|
+
|
|
151
|
+
TESTS::
|
|
152
|
+
|
|
153
|
+
sage: A2 = AffineSpace(QQ, 2)
|
|
154
|
+
sage: A2.structure_morphism().domain()
|
|
155
|
+
Affine Space of dimension 2 over Rational Field
|
|
156
|
+
sage: A2.structure_morphism().category()
|
|
157
|
+
Category of homsets of schemes
|
|
158
|
+
"""
|
|
159
|
+
|
|
160
|
+
def __init__(self, parent, codomain=None):
|
|
161
|
+
"""
|
|
162
|
+
The Python constructor.
|
|
163
|
+
|
|
164
|
+
EXAMPLES::
|
|
165
|
+
|
|
166
|
+
sage: X = Spec(ZZ)
|
|
167
|
+
sage: Hom = X.Hom(X)
|
|
168
|
+
sage: from sage.schemes.generic.morphism import SchemeMorphism
|
|
169
|
+
sage: f = SchemeMorphism(Hom)
|
|
170
|
+
sage: type(f)
|
|
171
|
+
<class 'sage.schemes.generic.morphism.SchemeMorphism'>
|
|
172
|
+
"""
|
|
173
|
+
if codomain is not None:
|
|
174
|
+
parent = Hom(parent, codomain)
|
|
175
|
+
if not isinstance(parent, Homset):
|
|
176
|
+
raise TypeError("parent (=%s) must be a Homspace" % parent)
|
|
177
|
+
Element.__init__(self, parent)
|
|
178
|
+
self._codomain = parent.codomain()
|
|
179
|
+
|
|
180
|
+
@lazy_attribute
|
|
181
|
+
def domain(self):
|
|
182
|
+
r"""
|
|
183
|
+
The constant function from the domain.
|
|
184
|
+
|
|
185
|
+
EXAMPLES::
|
|
186
|
+
|
|
187
|
+
sage: A.<x,y> = AffineSpace(QQ['x,y'])
|
|
188
|
+
sage: H = A.Hom(A)
|
|
189
|
+
sage: f = H([y, x^2 + y])
|
|
190
|
+
sage: f.domain() is A
|
|
191
|
+
True
|
|
192
|
+
"""
|
|
193
|
+
return ConstantFunction(self.parent().domain())
|
|
194
|
+
|
|
195
|
+
@lazy_attribute
|
|
196
|
+
def codomain(self):
|
|
197
|
+
r"""
|
|
198
|
+
The constant function from the codomain.
|
|
199
|
+
|
|
200
|
+
EXAMPLES::
|
|
201
|
+
|
|
202
|
+
sage: A.<x,y> = AffineSpace(QQ['x,y'])
|
|
203
|
+
sage: H = A.Hom(A)
|
|
204
|
+
sage: f = H([y, x^2 + y])
|
|
205
|
+
sage: f.codomain() is A
|
|
206
|
+
True
|
|
207
|
+
"""
|
|
208
|
+
return ConstantFunction(self._codomain)
|
|
209
|
+
|
|
210
|
+
# We copy methods of sage.categories.map.Map, to make
|
|
211
|
+
# a future transition of SchemeMorphism to a sub-class of Morphism
|
|
212
|
+
# easier.
|
|
213
|
+
def __call__(self, x, *args, **kwds):
|
|
214
|
+
"""
|
|
215
|
+
Do not override this method!
|
|
216
|
+
|
|
217
|
+
For implementing application of maps, implement a method
|
|
218
|
+
``_call_(self, x)`` and/or a method ``_call_with_args(x, args, kwds)`.
|
|
219
|
+
In these methods, you can assume that ``x`` belongs to the domain of
|
|
220
|
+
this morphism, ``args`` is a tuple and ``kwds`` is a dict.
|
|
221
|
+
|
|
222
|
+
EXAMPLES::
|
|
223
|
+
|
|
224
|
+
sage: R.<x,y> = QQ[]
|
|
225
|
+
sage: A.<x,y> = AffineSpace(R)
|
|
226
|
+
sage: H = A.Hom(A)
|
|
227
|
+
sage: f = H([y, x^2 + y])
|
|
228
|
+
sage: f([2,3]) # indirect doctest
|
|
229
|
+
(3, 7)
|
|
230
|
+
|
|
231
|
+
An example with optional arguments::
|
|
232
|
+
|
|
233
|
+
sage: PS.<x,y> = ProjectiveSpace(QQ, 1)
|
|
234
|
+
sage: H = Hom(PS, PS)
|
|
235
|
+
sage: f = H([x^3, x*y^2])
|
|
236
|
+
sage: P = PS(0, 1)
|
|
237
|
+
sage: f(P, check=False) # indirect doctest
|
|
238
|
+
(0 : 0)
|
|
239
|
+
"""
|
|
240
|
+
P = parent(x)
|
|
241
|
+
D = self.domain()
|
|
242
|
+
if P is D: # we certainly want to call _call_/with_args
|
|
243
|
+
if not args and not kwds:
|
|
244
|
+
return self._call_(x)
|
|
245
|
+
return self._call_with_args(x, args, kwds)
|
|
246
|
+
# Is there coercion?
|
|
247
|
+
converter = D._internal_coerce_map_from(P)
|
|
248
|
+
if converter is None:
|
|
249
|
+
try:
|
|
250
|
+
return self.pushforward(x, *args, **kwds)
|
|
251
|
+
except (AttributeError, TypeError, NotImplementedError):
|
|
252
|
+
# raise TypeError("%s must be coercible into %s" % (x, self.domain()))
|
|
253
|
+
pass
|
|
254
|
+
|
|
255
|
+
# Here, we would like to do
|
|
256
|
+
##try:
|
|
257
|
+
## x = D(x).
|
|
258
|
+
##except (TypeError, NotImplementedError):
|
|
259
|
+
## raise TypeError("%s fails to convert into the map's domain %s, but a `pushforward` method is not properly implemented" % (x, self.domain()))
|
|
260
|
+
# However, this would involve a test whether x.codomain() ==
|
|
261
|
+
# self. This would trigger a Groebner basis computation, that
|
|
262
|
+
# (1) could be slow and (2) could involve an even slower toy
|
|
263
|
+
# implementation, resulting in a warning.
|
|
264
|
+
#
|
|
265
|
+
# Contract: If x is a scheme morphism point, then _call_ knows
|
|
266
|
+
# what to do with it (e.g., use the _coords attribute). Otherwise,
|
|
267
|
+
# we can try a conversion into the domain (e.g., if x is a list),
|
|
268
|
+
# WITHOUT to trigger a Groebner basis computation.
|
|
269
|
+
if kwds.get('check', True):
|
|
270
|
+
if not isinstance(x, SchemeMorphism_point):
|
|
271
|
+
try:
|
|
272
|
+
x = D(x)
|
|
273
|
+
except (TypeError, NotImplementedError):
|
|
274
|
+
raise TypeError("%s fails to convert into the map's domain %s, but a `pushforward` method is not properly implemented" % (x, self.domain()))
|
|
275
|
+
elif self.domain() != x.codomain():
|
|
276
|
+
raise TypeError("%s fails to convert into the map's domain %s, but a `pushforward` method is not properly implemented" % (x, self.domain()))
|
|
277
|
+
else:
|
|
278
|
+
x = converter(x)
|
|
279
|
+
if not args and not kwds:
|
|
280
|
+
return self._call_(x)
|
|
281
|
+
return self._call_with_args(x, args, kwds)
|
|
282
|
+
|
|
283
|
+
def _repr_defn(self):
|
|
284
|
+
r"""
|
|
285
|
+
Return a string representation of the definition of ``self``.
|
|
286
|
+
|
|
287
|
+
OUTPUT: string
|
|
288
|
+
|
|
289
|
+
EXAMPLES::
|
|
290
|
+
|
|
291
|
+
sage: X = Spec(ZZ)
|
|
292
|
+
sage: Hom = X.Hom(X)
|
|
293
|
+
sage: from sage.schemes.generic.morphism import SchemeMorphism
|
|
294
|
+
sage: f = SchemeMorphism(Hom)
|
|
295
|
+
sage: f._repr_defn()
|
|
296
|
+
Traceback (most recent call last):
|
|
297
|
+
...
|
|
298
|
+
NotImplementedError
|
|
299
|
+
"""
|
|
300
|
+
raise NotImplementedError
|
|
301
|
+
|
|
302
|
+
def _repr_type(self):
|
|
303
|
+
r"""
|
|
304
|
+
Return a string representation of the type of ``self``.
|
|
305
|
+
|
|
306
|
+
OUTPUT: string
|
|
307
|
+
|
|
308
|
+
EXAMPLES::
|
|
309
|
+
|
|
310
|
+
sage: A2 = AffineSpace(QQ, 2)
|
|
311
|
+
sage: A2.structure_morphism() # indirect doctest
|
|
312
|
+
Scheme morphism:
|
|
313
|
+
From: Affine Space of dimension 2 over Rational Field
|
|
314
|
+
To: Spectrum of Rational Field
|
|
315
|
+
Defn: Structure map
|
|
316
|
+
"""
|
|
317
|
+
return "Scheme"
|
|
318
|
+
|
|
319
|
+
def _repr_(self):
|
|
320
|
+
r"""
|
|
321
|
+
Return a string representation of ``self``.
|
|
322
|
+
|
|
323
|
+
OUTPUT: string
|
|
324
|
+
|
|
325
|
+
EXAMPLES::
|
|
326
|
+
|
|
327
|
+
sage: X = Spec(ZZ)
|
|
328
|
+
sage: Hom = X.Hom(X)
|
|
329
|
+
sage: from sage.schemes.generic.morphism import SchemeMorphism
|
|
330
|
+
sage: f = SchemeMorphism(Hom)
|
|
331
|
+
sage: f._repr_()
|
|
332
|
+
Traceback (most recent call last):
|
|
333
|
+
...
|
|
334
|
+
NotImplementedError
|
|
335
|
+
"""
|
|
336
|
+
if self.is_endomorphism():
|
|
337
|
+
s = "%s endomorphism of %s" % (self._repr_type(), self.domain())
|
|
338
|
+
else:
|
|
339
|
+
s = "%s morphism:" % self._repr_type()
|
|
340
|
+
s += "\n From: %s" % self.domain()
|
|
341
|
+
s += "\n To: %s" % self._codomain
|
|
342
|
+
d = self._repr_defn()
|
|
343
|
+
if d != '':
|
|
344
|
+
s += "\n Defn: %s" % ('\n '.join(self._repr_defn().split('\n')))
|
|
345
|
+
return s
|
|
346
|
+
|
|
347
|
+
def __mul__(self, right):
|
|
348
|
+
"""
|
|
349
|
+
We can currently only multiply scheme morphisms.
|
|
350
|
+
|
|
351
|
+
If one factor is an identity morphism, the other is returned.
|
|
352
|
+
Otherwise, a formal composition of maps obtained from the scheme
|
|
353
|
+
morphisms is returned.
|
|
354
|
+
|
|
355
|
+
EXAMPLES:
|
|
356
|
+
|
|
357
|
+
Identity maps do not contribute to the product::
|
|
358
|
+
|
|
359
|
+
sage: X = AffineSpace(QQ, 2)
|
|
360
|
+
sage: id = X.identity_morphism()
|
|
361
|
+
sage: id^0 # indirect doctest
|
|
362
|
+
Scheme endomorphism of Affine Space of dimension 2 over Rational Field
|
|
363
|
+
Defn: Identity map
|
|
364
|
+
sage: id^2
|
|
365
|
+
Scheme endomorphism of Affine Space of dimension 2 over Rational Field
|
|
366
|
+
Defn: Identity map
|
|
367
|
+
|
|
368
|
+
Here, we see a formal composition::
|
|
369
|
+
|
|
370
|
+
sage: X = AffineSpace(QQ, 2)
|
|
371
|
+
sage: f = X.structure_morphism()
|
|
372
|
+
sage: Y = Spec(QQ)
|
|
373
|
+
sage: g = Y.structure_morphism()
|
|
374
|
+
sage: g * f # indirect doctest
|
|
375
|
+
Composite map:
|
|
376
|
+
From: Affine Space of dimension 2 over Rational Field
|
|
377
|
+
To: Spectrum of Integer Ring
|
|
378
|
+
Defn: Generic morphism:
|
|
379
|
+
From: Affine Space of dimension 2 over Rational Field
|
|
380
|
+
To: Spectrum of Rational Field
|
|
381
|
+
then
|
|
382
|
+
Generic morphism:
|
|
383
|
+
From: Spectrum of Rational Field
|
|
384
|
+
To: Spectrum of Integer Ring
|
|
385
|
+
|
|
386
|
+
Of course, the codomain of the first factor must coincide with the
|
|
387
|
+
domain of the second factor::
|
|
388
|
+
|
|
389
|
+
sage: f * g
|
|
390
|
+
Traceback (most recent call last):
|
|
391
|
+
...
|
|
392
|
+
TypeError: self (=Scheme morphism:
|
|
393
|
+
From: Affine Space of dimension 2 over Rational Field
|
|
394
|
+
To: Spectrum of Rational Field
|
|
395
|
+
Defn: Structure map) domain must equal right (=Scheme morphism:
|
|
396
|
+
From: Spectrum of Rational Field
|
|
397
|
+
To: Spectrum of Integer Ring
|
|
398
|
+
Defn: Structure map) codomain
|
|
399
|
+
"""
|
|
400
|
+
if not isinstance(right, SchemeMorphism):
|
|
401
|
+
return coercion_model.bin_op(self, right, operator.mul)
|
|
402
|
+
if right.codomain() != self.domain():
|
|
403
|
+
raise TypeError("self (=%s) domain must equal right (=%s) codomain" % (self, right))
|
|
404
|
+
if isinstance(self, SchemeMorphism_id):
|
|
405
|
+
return right
|
|
406
|
+
if isinstance(right, SchemeMorphism_id):
|
|
407
|
+
return self
|
|
408
|
+
return self._composition(right)
|
|
409
|
+
|
|
410
|
+
def __pow__(self, n, dummy=None):
|
|
411
|
+
"""
|
|
412
|
+
Exponentiate an endomorphism.
|
|
413
|
+
|
|
414
|
+
INPUT:
|
|
415
|
+
|
|
416
|
+
- ``n`` -- integer; the exponent
|
|
417
|
+
|
|
418
|
+
OUTPUT: a composite map that belongs to the same endomorphism set as ``self``
|
|
419
|
+
|
|
420
|
+
EXAMPLES::
|
|
421
|
+
|
|
422
|
+
sage: X = AffineSpace(QQ, 2)
|
|
423
|
+
sage: id = X.identity_morphism()
|
|
424
|
+
sage: id^0
|
|
425
|
+
Scheme endomorphism of Affine Space of dimension 2 over Rational Field
|
|
426
|
+
Defn: Identity map
|
|
427
|
+
sage: id^2
|
|
428
|
+
Scheme endomorphism of Affine Space of dimension 2 over Rational Field
|
|
429
|
+
Defn: Identity map
|
|
430
|
+
"""
|
|
431
|
+
if not self.is_endomorphism():
|
|
432
|
+
raise TypeError("self must be an endomorphism.")
|
|
433
|
+
if n == 0:
|
|
434
|
+
return self.domain().identity_morphism()
|
|
435
|
+
return generic_power(self, n)
|
|
436
|
+
|
|
437
|
+
def category(self):
|
|
438
|
+
"""
|
|
439
|
+
Return the category of the Hom-set.
|
|
440
|
+
|
|
441
|
+
OUTPUT: a category
|
|
442
|
+
|
|
443
|
+
EXAMPLES::
|
|
444
|
+
|
|
445
|
+
sage: A2 = AffineSpace(QQ, 2)
|
|
446
|
+
sage: A2.structure_morphism().category()
|
|
447
|
+
Category of homsets of schemes
|
|
448
|
+
"""
|
|
449
|
+
return self.parent().category()
|
|
450
|
+
|
|
451
|
+
def category_for(self):
|
|
452
|
+
"""
|
|
453
|
+
Return the category which this morphism belongs to.
|
|
454
|
+
|
|
455
|
+
EXAMPLES::
|
|
456
|
+
|
|
457
|
+
sage: A2 = AffineSpace(QQ, 2)
|
|
458
|
+
sage: A2.structure_morphism().category_for()
|
|
459
|
+
Category of schemes
|
|
460
|
+
"""
|
|
461
|
+
return self.parent().homset_category()
|
|
462
|
+
|
|
463
|
+
def is_endomorphism(self) -> bool:
|
|
464
|
+
"""
|
|
465
|
+
Return whether the morphism is an endomorphism.
|
|
466
|
+
|
|
467
|
+
OUTPUT: boolean; whether the domain and codomain are identical
|
|
468
|
+
|
|
469
|
+
EXAMPLES::
|
|
470
|
+
|
|
471
|
+
sage: X = AffineSpace(QQ, 2)
|
|
472
|
+
sage: X.structure_morphism().is_endomorphism()
|
|
473
|
+
False
|
|
474
|
+
sage: X.identity_morphism().is_endomorphism()
|
|
475
|
+
True
|
|
476
|
+
"""
|
|
477
|
+
return self.parent().is_endomorphism_set()
|
|
478
|
+
|
|
479
|
+
def base_ring(self):
|
|
480
|
+
r"""
|
|
481
|
+
Return the base ring of ``self``, that is, the ring over which
|
|
482
|
+
the defining polynomials of ``self`` are defined.
|
|
483
|
+
|
|
484
|
+
OUTPUT: ring
|
|
485
|
+
|
|
486
|
+
EXAMPLES::
|
|
487
|
+
|
|
488
|
+
sage: P.<x,y> = ProjectiveSpace(QQ, 1)
|
|
489
|
+
sage: H = Hom(P, P)
|
|
490
|
+
sage: f = H([3/5*x^2, 6*y^2])
|
|
491
|
+
sage: f.base_ring()
|
|
492
|
+
Rational Field
|
|
493
|
+
|
|
494
|
+
::
|
|
495
|
+
|
|
496
|
+
sage: R.<t> = PolynomialRing(ZZ, 1)
|
|
497
|
+
sage: P.<x,y> = ProjectiveSpace(R, 1)
|
|
498
|
+
sage: H = Hom(P, P)
|
|
499
|
+
sage: f = H([3*x^2, y^2])
|
|
500
|
+
sage: f.base_ring()
|
|
501
|
+
Multivariate Polynomial Ring in t over Integer Ring
|
|
502
|
+
|
|
503
|
+
Points have correct base rings too (:issue:`34336`)::
|
|
504
|
+
|
|
505
|
+
sage: x = P(t, 5); x
|
|
506
|
+
(t : 5)
|
|
507
|
+
sage: x.base_ring()
|
|
508
|
+
Multivariate Polynomial Ring in t over Integer Ring
|
|
509
|
+
|
|
510
|
+
::
|
|
511
|
+
|
|
512
|
+
sage: # needs sage.rings.finite_rings sage.schemes
|
|
513
|
+
sage: E = EllipticCurve(GF((17,2)), [1,2,3,4,5])
|
|
514
|
+
sage: P = E.random_point()
|
|
515
|
+
sage: P.base_ring()
|
|
516
|
+
Finite Field in z2 of size 17^2
|
|
517
|
+
"""
|
|
518
|
+
return self.domain().base_ring()
|
|
519
|
+
|
|
520
|
+
def _composition(self, right):
|
|
521
|
+
"""
|
|
522
|
+
A helper for multiplying maps by composition.
|
|
523
|
+
|
|
524
|
+
.. WARNING::
|
|
525
|
+
|
|
526
|
+
Do not override this method! Override :meth:`_composition_`
|
|
527
|
+
instead.
|
|
528
|
+
|
|
529
|
+
EXAMPLES::
|
|
530
|
+
|
|
531
|
+
sage: X = AffineSpace(QQ, 2)
|
|
532
|
+
sage: f = X.structure_morphism()
|
|
533
|
+
sage: Y = Spec(QQ)
|
|
534
|
+
sage: g = Y.structure_morphism()
|
|
535
|
+
sage: g * f # indirect doctest
|
|
536
|
+
Composite map:
|
|
537
|
+
From: Affine Space of dimension 2 over Rational Field
|
|
538
|
+
To: Spectrum of Integer Ring
|
|
539
|
+
Defn: Generic morphism:
|
|
540
|
+
From: Affine Space of dimension 2 over Rational Field
|
|
541
|
+
To: Spectrum of Rational Field
|
|
542
|
+
then
|
|
543
|
+
Generic morphism:
|
|
544
|
+
From: Spectrum of Rational Field
|
|
545
|
+
To: Spectrum of Integer Ring
|
|
546
|
+
|
|
547
|
+
sage: f * g
|
|
548
|
+
Traceback (most recent call last):
|
|
549
|
+
...
|
|
550
|
+
TypeError: self (=Scheme morphism:
|
|
551
|
+
From: Affine Space of dimension 2 over Rational Field
|
|
552
|
+
To: Spectrum of Rational Field
|
|
553
|
+
Defn: Structure map) domain
|
|
554
|
+
must equal right (=Scheme morphism:
|
|
555
|
+
From: Spectrum of Rational Field
|
|
556
|
+
To: Spectrum of Integer Ring
|
|
557
|
+
Defn: Structure map) codomain
|
|
558
|
+
"""
|
|
559
|
+
category = self.category_for()._meet_(right.category_for())
|
|
560
|
+
H = Hom(right.domain(), self._codomain, category)
|
|
561
|
+
return self._composition_(right, H)
|
|
562
|
+
|
|
563
|
+
def _composition_(self, right, homset):
|
|
564
|
+
"""
|
|
565
|
+
Helper to construct the composition of two morphisms.
|
|
566
|
+
|
|
567
|
+
Override this if you want to have a different behaviour of composition
|
|
568
|
+
|
|
569
|
+
INPUT:
|
|
570
|
+
|
|
571
|
+
- ``right`` -- a map or callable
|
|
572
|
+
- ``homset`` -- a homset containing the composed map
|
|
573
|
+
|
|
574
|
+
OUTPUT:
|
|
575
|
+
|
|
576
|
+
An element of ``homset``. The output is obtained by converting the
|
|
577
|
+
arguments to :class:`~sage.categories.morphism.SetMorphism` if
|
|
578
|
+
necessary, and then forming a :class:`~sage.categories.map.FormalCompositeMap`
|
|
579
|
+
|
|
580
|
+
EXAMPLES::
|
|
581
|
+
|
|
582
|
+
sage: X = AffineSpace(QQ, 2)
|
|
583
|
+
sage: f = X.structure_morphism()
|
|
584
|
+
sage: Y = Spec(QQ)
|
|
585
|
+
sage: g = Y.structure_morphism()
|
|
586
|
+
sage: g * f # indirect doctest
|
|
587
|
+
Composite map:
|
|
588
|
+
From: Affine Space of dimension 2 over Rational Field
|
|
589
|
+
To: Spectrum of Integer Ring
|
|
590
|
+
Defn: Generic morphism:
|
|
591
|
+
From: Affine Space of dimension 2 over Rational Field
|
|
592
|
+
To: Spectrum of Rational Field
|
|
593
|
+
then
|
|
594
|
+
Generic morphism:
|
|
595
|
+
From: Spectrum of Rational Field
|
|
596
|
+
To: Spectrum of Integer Ring
|
|
597
|
+
"""
|
|
598
|
+
if not isinstance(right, Map):
|
|
599
|
+
right = SetMorphism(right.parent(), right)
|
|
600
|
+
return FormalCompositeMap(homset, right, SetMorphism(self.parent(),self))
|
|
601
|
+
|
|
602
|
+
def glue_along_domains(self, other):
|
|
603
|
+
r"""
|
|
604
|
+
Glue two morphisms.
|
|
605
|
+
|
|
606
|
+
INPUT:
|
|
607
|
+
|
|
608
|
+
- ``other`` -- a scheme morphism with the same domain
|
|
609
|
+
|
|
610
|
+
OUTPUT:
|
|
611
|
+
|
|
612
|
+
Assuming that ``self`` and ``other`` are open immersions with the same
|
|
613
|
+
domain, return scheme obtained by gluing along the images.
|
|
614
|
+
|
|
615
|
+
EXAMPLES:
|
|
616
|
+
|
|
617
|
+
We construct a scheme isomorphic to the projective line over
|
|
618
|
+
`\mathrm{Spec}(\QQ)` by gluing two copies of `\mathbb{A}^1`
|
|
619
|
+
minus a point::
|
|
620
|
+
|
|
621
|
+
sage: # needs sage.libs.singular
|
|
622
|
+
sage: R.<x,y> = PolynomialRing(QQ, 2)
|
|
623
|
+
sage: S.<xbar, ybar> = R.quotient(x*y - 1)
|
|
624
|
+
sage: Rx = PolynomialRing(QQ, 'x')
|
|
625
|
+
sage: i1 = Rx.hom([xbar])
|
|
626
|
+
sage: Ry = PolynomialRing(QQ, 'y')
|
|
627
|
+
sage: i2 = Ry.hom([ybar])
|
|
628
|
+
sage: Sch = Schemes()
|
|
629
|
+
sage: f1 = Sch(i1)
|
|
630
|
+
sage: f2 = Sch(i2)
|
|
631
|
+
|
|
632
|
+
Now f1 and f2 have the same domain, which is a
|
|
633
|
+
`\mathbb{A}^1` minus a point. We glue along the domain::
|
|
634
|
+
|
|
635
|
+
sage: # needs sage.libs.singular
|
|
636
|
+
sage: P1 = f1.glue_along_domains(f2); P1
|
|
637
|
+
Scheme obtained by gluing X and Y along U, where
|
|
638
|
+
X: Spectrum of Univariate Polynomial Ring in x over Rational Field
|
|
639
|
+
Y: Spectrum of Univariate Polynomial Ring in y over Rational Field
|
|
640
|
+
U: Spectrum of Quotient of Multivariate Polynomial Ring in x, y
|
|
641
|
+
over Rational Field by the ideal (x*y - 1)
|
|
642
|
+
sage: a, b = P1.gluing_maps()
|
|
643
|
+
sage: a
|
|
644
|
+
Affine Scheme morphism:
|
|
645
|
+
From: Spectrum of Quotient of Multivariate Polynomial Ring in x, y
|
|
646
|
+
over Rational Field by the ideal (x*y - 1)
|
|
647
|
+
To: Spectrum of Univariate Polynomial Ring in x over Rational Field
|
|
648
|
+
Defn: Ring morphism:
|
|
649
|
+
From: Univariate Polynomial Ring in x over Rational Field
|
|
650
|
+
To: Quotient of Multivariate Polynomial Ring in x, y over
|
|
651
|
+
Rational Field by the ideal (x*y - 1)
|
|
652
|
+
Defn: x |--> xbar
|
|
653
|
+
sage: b
|
|
654
|
+
Affine Scheme morphism:
|
|
655
|
+
From: Spectrum of Quotient of Multivariate Polynomial Ring in x, y
|
|
656
|
+
over Rational Field by the ideal (x*y - 1)
|
|
657
|
+
To: Spectrum of Univariate Polynomial Ring in y over Rational Field
|
|
658
|
+
Defn: Ring morphism:
|
|
659
|
+
From: Univariate Polynomial Ring in y over Rational Field
|
|
660
|
+
To: Quotient of Multivariate Polynomial Ring in x, y over
|
|
661
|
+
Rational Field by the ideal (x*y - 1)
|
|
662
|
+
Defn: y |--> ybar
|
|
663
|
+
"""
|
|
664
|
+
from . import glue
|
|
665
|
+
return glue.GluedScheme(self, other)
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
class SchemeMorphism_id(SchemeMorphism):
|
|
669
|
+
"""
|
|
670
|
+
Return the identity morphism from `X` to itself.
|
|
671
|
+
|
|
672
|
+
INPUT:
|
|
673
|
+
|
|
674
|
+
- ``X`` -- the scheme
|
|
675
|
+
|
|
676
|
+
EXAMPLES::
|
|
677
|
+
|
|
678
|
+
sage: X = Spec(ZZ)
|
|
679
|
+
sage: X.identity_morphism() # indirect doctest
|
|
680
|
+
Scheme endomorphism of Spectrum of Integer Ring
|
|
681
|
+
Defn: Identity map
|
|
682
|
+
"""
|
|
683
|
+
def __init__(self, X):
|
|
684
|
+
"""
|
|
685
|
+
The Python constructor.
|
|
686
|
+
|
|
687
|
+
See :class:`SchemeMorphism_id` for details.
|
|
688
|
+
|
|
689
|
+
TESTS::
|
|
690
|
+
|
|
691
|
+
sage: Spec(ZZ).identity_morphism()
|
|
692
|
+
Scheme endomorphism of Spectrum of Integer Ring
|
|
693
|
+
Defn: Identity map
|
|
694
|
+
"""
|
|
695
|
+
SchemeMorphism.__init__(self, X.Hom(X))
|
|
696
|
+
|
|
697
|
+
def _repr_defn(self):
|
|
698
|
+
r"""
|
|
699
|
+
Return a string representation of the definition of ``self``.
|
|
700
|
+
|
|
701
|
+
OUTPUT: string
|
|
702
|
+
|
|
703
|
+
EXAMPLES::
|
|
704
|
+
|
|
705
|
+
sage: Spec(ZZ).identity_morphism()._repr_defn()
|
|
706
|
+
'Identity map'
|
|
707
|
+
"""
|
|
708
|
+
return 'Identity map'
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
class SchemeMorphism_structure_map(SchemeMorphism):
|
|
712
|
+
r"""
|
|
713
|
+
The structure morphism.
|
|
714
|
+
|
|
715
|
+
INPUT:
|
|
716
|
+
|
|
717
|
+
- ``parent`` -- Hom-set with codomain equal to the base scheme of
|
|
718
|
+
the domain
|
|
719
|
+
|
|
720
|
+
EXAMPLES::
|
|
721
|
+
|
|
722
|
+
sage: Spec(ZZ).structure_morphism() # indirect doctest
|
|
723
|
+
Scheme endomorphism of Spectrum of Integer Ring
|
|
724
|
+
Defn: Structure map
|
|
725
|
+
"""
|
|
726
|
+
def __init__(self, parent, codomain=None):
|
|
727
|
+
"""
|
|
728
|
+
The Python constructor.
|
|
729
|
+
|
|
730
|
+
See :class:`SchemeMorphism_structure_map` for details.
|
|
731
|
+
|
|
732
|
+
TESTS::
|
|
733
|
+
|
|
734
|
+
sage: from sage.schemes.generic.morphism import SchemeMorphism_structure_map
|
|
735
|
+
sage: SchemeMorphism_structure_map( Spec(QQ).Hom(Spec(ZZ)) )
|
|
736
|
+
Scheme morphism:
|
|
737
|
+
From: Spectrum of Rational Field
|
|
738
|
+
To: Spectrum of Integer Ring
|
|
739
|
+
Defn: Structure map
|
|
740
|
+
"""
|
|
741
|
+
SchemeMorphism.__init__(self, parent, codomain=None)
|
|
742
|
+
if self.domain().base_scheme() != self._codomain:
|
|
743
|
+
raise ValueError("parent must have codomain equal the base scheme of domain.")
|
|
744
|
+
|
|
745
|
+
def _repr_defn(self):
|
|
746
|
+
r"""
|
|
747
|
+
Return a string representation of the definition of ``self``.
|
|
748
|
+
|
|
749
|
+
OUTPUT: string
|
|
750
|
+
|
|
751
|
+
EXAMPLES::
|
|
752
|
+
|
|
753
|
+
sage: Spec(ZZ).structure_morphism()._repr_defn()
|
|
754
|
+
'Structure map'
|
|
755
|
+
"""
|
|
756
|
+
return 'Structure map'
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
class SchemeMorphism_spec(SchemeMorphism):
|
|
760
|
+
"""
|
|
761
|
+
Morphism of spectra of rings.
|
|
762
|
+
|
|
763
|
+
INPUT:
|
|
764
|
+
|
|
765
|
+
- ``parent`` -- Hom-set whose domain and codomain are affine schemes
|
|
766
|
+
|
|
767
|
+
- ``phi`` -- a ring morphism with matching domain and codomain
|
|
768
|
+
|
|
769
|
+
- ``check`` -- boolean (default: ``True``); whether to
|
|
770
|
+
check the input for consistency
|
|
771
|
+
|
|
772
|
+
EXAMPLES::
|
|
773
|
+
|
|
774
|
+
sage: R.<x> = PolynomialRing(QQ)
|
|
775
|
+
sage: phi = R.hom([QQ(7)]); phi
|
|
776
|
+
Ring morphism:
|
|
777
|
+
From: Univariate Polynomial Ring in x over Rational Field
|
|
778
|
+
To: Rational Field
|
|
779
|
+
Defn: x |--> 7
|
|
780
|
+
|
|
781
|
+
sage: X = Spec(QQ); Y = Spec(R)
|
|
782
|
+
sage: f = X.hom(phi); f
|
|
783
|
+
Affine Scheme morphism:
|
|
784
|
+
From: Spectrum of Rational Field
|
|
785
|
+
To: Spectrum of Univariate Polynomial Ring in x over Rational Field
|
|
786
|
+
Defn: Ring morphism:
|
|
787
|
+
From: Univariate Polynomial Ring in x over Rational Field
|
|
788
|
+
To: Rational Field
|
|
789
|
+
Defn: x |--> 7
|
|
790
|
+
|
|
791
|
+
sage: f.ring_homomorphism()
|
|
792
|
+
Ring morphism:
|
|
793
|
+
From: Univariate Polynomial Ring in x over Rational Field
|
|
794
|
+
To: Rational Field
|
|
795
|
+
Defn: x |--> 7
|
|
796
|
+
"""
|
|
797
|
+
def __init__(self, parent, phi, check=True):
|
|
798
|
+
"""
|
|
799
|
+
The Python constructor.
|
|
800
|
+
|
|
801
|
+
See :class:`SchemeMorphism_structure_map` for details.
|
|
802
|
+
|
|
803
|
+
TESTS::
|
|
804
|
+
|
|
805
|
+
sage: from sage.schemes.generic.morphism import SchemeMorphism_spec
|
|
806
|
+
sage: SchemeMorphism_spec(Spec(QQ).Hom(Spec(ZZ)), ZZ.hom(QQ))
|
|
807
|
+
Affine Scheme morphism:
|
|
808
|
+
From: Spectrum of Rational Field
|
|
809
|
+
To: Spectrum of Integer Ring
|
|
810
|
+
Defn: Natural morphism:
|
|
811
|
+
From: Integer Ring
|
|
812
|
+
To: Rational Field
|
|
813
|
+
"""
|
|
814
|
+
SchemeMorphism.__init__(self, parent)
|
|
815
|
+
if check:
|
|
816
|
+
from sage.categories.rings import Rings
|
|
817
|
+
if not (isinstance(phi, Map) and phi.category_for().is_subcategory(Rings())):
|
|
818
|
+
raise TypeError("phi (=%s) must be a ring homomorphism" % phi)
|
|
819
|
+
if phi.domain() != parent.codomain().coordinate_ring():
|
|
820
|
+
raise TypeError("phi (=%s) must have domain %s"
|
|
821
|
+
% (phi, parent.codomain().coordinate_ring()))
|
|
822
|
+
if phi.codomain() != parent.domain().coordinate_ring():
|
|
823
|
+
raise TypeError("phi (=%s) must have codomain %s"
|
|
824
|
+
% (phi, parent.domain().coordinate_ring()))
|
|
825
|
+
self.__ring_homomorphism = phi
|
|
826
|
+
|
|
827
|
+
def _call_(self, x):
|
|
828
|
+
r"""
|
|
829
|
+
Make morphisms callable.
|
|
830
|
+
|
|
831
|
+
INPUT:
|
|
832
|
+
|
|
833
|
+
- ``x`` -- a scheme point
|
|
834
|
+
|
|
835
|
+
OUTPUT: the image scheme point
|
|
836
|
+
|
|
837
|
+
EXAMPLES:
|
|
838
|
+
|
|
839
|
+
The following fails because inverse images of prime ideals
|
|
840
|
+
under ring homomorphisms are not yet implemented::
|
|
841
|
+
|
|
842
|
+
sage: R.<x> = PolynomialRing(QQ)
|
|
843
|
+
sage: phi = R.hom([QQ(7)])
|
|
844
|
+
sage: X = Spec(QQ); Y = Spec(R)
|
|
845
|
+
sage: f = X.hom(phi)
|
|
846
|
+
sage: f(X.an_element()) # indirect doctest
|
|
847
|
+
Traceback (most recent call last):
|
|
848
|
+
...
|
|
849
|
+
NotImplementedError: inverse not implemented for morphisms of
|
|
850
|
+
Rational Field
|
|
851
|
+
"""
|
|
852
|
+
# By virtue of argument preprocessing in __call__, we can assume that
|
|
853
|
+
# x is a topological scheme point of self
|
|
854
|
+
S = self.ring_homomorphism().inverse_image(x.prime_ideal())
|
|
855
|
+
return self._codomain(S)
|
|
856
|
+
|
|
857
|
+
def _repr_type(self):
|
|
858
|
+
r"""
|
|
859
|
+
Return a string representation of the type of ``self``.
|
|
860
|
+
|
|
861
|
+
OUTPUT: string
|
|
862
|
+
|
|
863
|
+
EXAMPLES::
|
|
864
|
+
|
|
865
|
+
sage: R.<x> = PolynomialRing(QQ)
|
|
866
|
+
sage: phi = R.hom([QQ(7)])
|
|
867
|
+
sage: X = Spec(QQ); Y = Spec(R)
|
|
868
|
+
sage: f = X.hom(phi)
|
|
869
|
+
sage: f._repr_type()
|
|
870
|
+
'Affine Scheme'
|
|
871
|
+
"""
|
|
872
|
+
return "Affine Scheme"
|
|
873
|
+
|
|
874
|
+
def _repr_defn(self):
|
|
875
|
+
r"""
|
|
876
|
+
Return a string representation of the definition of ``self``.
|
|
877
|
+
|
|
878
|
+
OUTPUT: string
|
|
879
|
+
|
|
880
|
+
EXAMPLES::
|
|
881
|
+
|
|
882
|
+
sage: R.<x> = PolynomialRing(QQ)
|
|
883
|
+
sage: phi = R.hom([QQ(7)])
|
|
884
|
+
sage: X = Spec(QQ); Y = Spec(R)
|
|
885
|
+
sage: f = X.hom(phi)
|
|
886
|
+
sage: print(f._repr_defn())
|
|
887
|
+
Ring morphism:
|
|
888
|
+
From: Univariate Polynomial Ring in x over Rational Field
|
|
889
|
+
To: Rational Field
|
|
890
|
+
Defn: x |--> 7
|
|
891
|
+
"""
|
|
892
|
+
return repr(self.ring_homomorphism())
|
|
893
|
+
|
|
894
|
+
def ring_homomorphism(self):
|
|
895
|
+
"""
|
|
896
|
+
Return the underlying ring homomorphism.
|
|
897
|
+
|
|
898
|
+
OUTPUT: a ring homomorphism
|
|
899
|
+
|
|
900
|
+
EXAMPLES::
|
|
901
|
+
|
|
902
|
+
sage: R.<x> = PolynomialRing(QQ)
|
|
903
|
+
sage: phi = R.hom([QQ(7)])
|
|
904
|
+
sage: X = Spec(QQ); Y = Spec(R)
|
|
905
|
+
sage: f = X.hom(phi)
|
|
906
|
+
sage: f.ring_homomorphism()
|
|
907
|
+
Ring morphism:
|
|
908
|
+
From: Univariate Polynomial Ring in x over Rational Field
|
|
909
|
+
To: Rational Field
|
|
910
|
+
Defn: x |--> 7
|
|
911
|
+
"""
|
|
912
|
+
return self.__ring_homomorphism
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
############################################################################
|
|
916
|
+
# Morphisms between schemes given on points. The _affine and _projective below
|
|
917
|
+
# refer to the CODOMAIN. The domain can be either affine or projective
|
|
918
|
+
# regardless of the class
|
|
919
|
+
############################################################################
|
|
920
|
+
|
|
921
|
+
class SchemeMorphism_polynomial(SchemeMorphism):
|
|
922
|
+
r"""
|
|
923
|
+
A morphism of schemes determined by polynomials that define what
|
|
924
|
+
the morphism does on points in the ambient space.
|
|
925
|
+
|
|
926
|
+
INPUT:
|
|
927
|
+
|
|
928
|
+
- ``parent`` -- Hom-set whose domain and codomain are affine or
|
|
929
|
+
projective schemes
|
|
930
|
+
|
|
931
|
+
- ``polys`` -- list/tuple/iterable of polynomials defining the
|
|
932
|
+
scheme morphism
|
|
933
|
+
|
|
934
|
+
- ``check`` -- boolean (default: ``True``); whether to
|
|
935
|
+
check the input for consistency
|
|
936
|
+
|
|
937
|
+
EXAMPLES:
|
|
938
|
+
|
|
939
|
+
An example involving the affine plane::
|
|
940
|
+
|
|
941
|
+
sage: R.<x,y> = QQ[]
|
|
942
|
+
sage: A2 = AffineSpace(R)
|
|
943
|
+
sage: H = A2.Hom(A2)
|
|
944
|
+
sage: f = H([x - y, x*y])
|
|
945
|
+
sage: f([0, 1])
|
|
946
|
+
(-1, 0)
|
|
947
|
+
|
|
948
|
+
An example involving the projective line::
|
|
949
|
+
|
|
950
|
+
sage: R.<x,y> = QQ[]
|
|
951
|
+
sage: P1 = ProjectiveSpace(R)
|
|
952
|
+
sage: H = P1.Hom(P1)
|
|
953
|
+
sage: f = H([x^2 + y^2, x*y])
|
|
954
|
+
sage: f([0, 1])
|
|
955
|
+
(1 : 0)
|
|
956
|
+
|
|
957
|
+
Some checks are performed to make sure the given polynomials
|
|
958
|
+
define a morphism::
|
|
959
|
+
|
|
960
|
+
sage: f = H([exp(x),exp(y)]) # needs sage.symbolic
|
|
961
|
+
Traceback (most recent call last):
|
|
962
|
+
...
|
|
963
|
+
TypeError: polys (=[e^x, e^y]) must be elements of Multivariate
|
|
964
|
+
Polynomial Ring in x, y over Rational Field
|
|
965
|
+
"""
|
|
966
|
+
def __init__(self, parent, polys, check=True):
|
|
967
|
+
"""
|
|
968
|
+
The Python constructor.
|
|
969
|
+
|
|
970
|
+
See :class:`SchemeMorphism_polynomial` for details.
|
|
971
|
+
|
|
972
|
+
EXAMPLES::
|
|
973
|
+
|
|
974
|
+
sage: A2.<x,y> = AffineSpace(QQ, 2)
|
|
975
|
+
sage: H = A2.Hom(A2)
|
|
976
|
+
sage: H([x - y, x*y])
|
|
977
|
+
Scheme endomorphism of Affine Space of dimension 2 over Rational Field
|
|
978
|
+
Defn: Defined on coordinates by sending (x, y) to (x - y, x*y)
|
|
979
|
+
"""
|
|
980
|
+
if check:
|
|
981
|
+
if not isinstance(polys, (list, tuple)):
|
|
982
|
+
raise TypeError("polys (=%s) must be a list or tuple" % polys)
|
|
983
|
+
source_ring = parent.domain().ambient_space().coordinate_ring()
|
|
984
|
+
target = parent._codomain.ambient_space()
|
|
985
|
+
if len(polys) != target.ngens():
|
|
986
|
+
raise ValueError("there must be %s polynomials" % target.ngens())
|
|
987
|
+
F = []
|
|
988
|
+
for poly in polys:
|
|
989
|
+
try:
|
|
990
|
+
p = source_ring(poly)
|
|
991
|
+
except TypeError:
|
|
992
|
+
try:
|
|
993
|
+
p = source_ring(poly.lift())
|
|
994
|
+
except (TypeError, AttributeError):
|
|
995
|
+
try:
|
|
996
|
+
p = source_ring(poly.numerator()) / source_ring(poly.denominator())
|
|
997
|
+
except (TypeError, AttributeError):
|
|
998
|
+
raise TypeError("polys (=%s) must be elements of %s" % (polys, source_ring))
|
|
999
|
+
F.append(p)
|
|
1000
|
+
polys = Sequence(F)
|
|
1001
|
+
|
|
1002
|
+
self._polys = tuple(polys)
|
|
1003
|
+
|
|
1004
|
+
SchemeMorphism.__init__(self, parent)
|
|
1005
|
+
|
|
1006
|
+
def __eq__(self, other):
|
|
1007
|
+
"""
|
|
1008
|
+
Check equality of ``self`` and ``other``.
|
|
1009
|
+
|
|
1010
|
+
INPUT:
|
|
1011
|
+
|
|
1012
|
+
- ``other`` -- a morphism
|
|
1013
|
+
|
|
1014
|
+
EXAMPLES::
|
|
1015
|
+
|
|
1016
|
+
sage: A.<x,y> = AffineSpace(2, QQ)
|
|
1017
|
+
sage: I = A.identity_morphism()
|
|
1018
|
+
sage: I.parent().identity() == I
|
|
1019
|
+
True
|
|
1020
|
+
"""
|
|
1021
|
+
if isinstance(other, SchemeMorphism_polynomial):
|
|
1022
|
+
if self.parent() == other.parent() and self._polys == other._polys:
|
|
1023
|
+
return True
|
|
1024
|
+
raise TypeError('cannot determine equality')
|
|
1025
|
+
|
|
1026
|
+
def defining_polynomials(self):
|
|
1027
|
+
"""
|
|
1028
|
+
Return the defining polynomials.
|
|
1029
|
+
|
|
1030
|
+
OUTPUT:
|
|
1031
|
+
|
|
1032
|
+
An immutable sequence of polynomials that defines this scheme
|
|
1033
|
+
morphism.
|
|
1034
|
+
|
|
1035
|
+
EXAMPLES::
|
|
1036
|
+
|
|
1037
|
+
sage: R.<x,y> = QQ[]
|
|
1038
|
+
sage: A.<x,y> = AffineSpace(R)
|
|
1039
|
+
sage: H = A.Hom(A)
|
|
1040
|
+
sage: H([x^3 + y, 1 - x - y]).defining_polynomials()
|
|
1041
|
+
(x^3 + y, -x - y + 1)
|
|
1042
|
+
"""
|
|
1043
|
+
return self._polys
|
|
1044
|
+
|
|
1045
|
+
def _call_(self, x):
|
|
1046
|
+
"""
|
|
1047
|
+
Apply this morphism to a point in the domain.
|
|
1048
|
+
|
|
1049
|
+
INPUT:
|
|
1050
|
+
|
|
1051
|
+
- ``x`` -- a point in the domain or a list or tuple that
|
|
1052
|
+
defines a point in the domain
|
|
1053
|
+
|
|
1054
|
+
OUTPUT: a point in the codomain
|
|
1055
|
+
|
|
1056
|
+
EXAMPLES::
|
|
1057
|
+
|
|
1058
|
+
sage: R.<x,y> = QQ[]
|
|
1059
|
+
sage: A.<x,y> = AffineSpace(R)
|
|
1060
|
+
sage: H = A.Hom(A)
|
|
1061
|
+
sage: f = H([y, x^2 + y])
|
|
1062
|
+
sage: f([2, 3]) # indirect doctest
|
|
1063
|
+
(3, 7)
|
|
1064
|
+
|
|
1065
|
+
An example with algebraic schemes::
|
|
1066
|
+
|
|
1067
|
+
sage: A.<x,y> = AffineSpace(QQ, 2)
|
|
1068
|
+
sage: X = A.subscheme(x)
|
|
1069
|
+
sage: Y = A.subscheme(y)
|
|
1070
|
+
sage: Hom_XY = X.Hom(Y)
|
|
1071
|
+
sage: f = Hom_XY([y,0]) # (0,y) |-> (y,0)
|
|
1072
|
+
sage: f
|
|
1073
|
+
Scheme morphism:
|
|
1074
|
+
From: Closed subscheme of Affine Space of dimension 2 over Rational Field
|
|
1075
|
+
defined by: x
|
|
1076
|
+
To: Closed subscheme of Affine Space of dimension 2 over Rational Field
|
|
1077
|
+
defined by: y
|
|
1078
|
+
Defn: Defined on coordinates by sending (x, y) to (y, 0)
|
|
1079
|
+
sage: f([0,3])
|
|
1080
|
+
(3, 0)
|
|
1081
|
+
|
|
1082
|
+
The input must be convertible into the map's domain::
|
|
1083
|
+
|
|
1084
|
+
sage: f(0)
|
|
1085
|
+
Traceback (most recent call last):
|
|
1086
|
+
...
|
|
1087
|
+
TypeError: 0 fails to convert into the map's domain Closed
|
|
1088
|
+
subscheme of Affine Space of dimension 2 over Rational Field
|
|
1089
|
+
defined by:
|
|
1090
|
+
x, but a `pushforward` method is not properly implemented
|
|
1091
|
+
|
|
1092
|
+
It is possible to avoid the checks on the resulting point which can be
|
|
1093
|
+
useful for indeterminacies, but be careful!! ::
|
|
1094
|
+
|
|
1095
|
+
sage: PS.<x,y> = ProjectiveSpace(QQ, 1)
|
|
1096
|
+
sage: H = Hom(PS, PS)
|
|
1097
|
+
sage: f = H([x^3, x*y^2])
|
|
1098
|
+
sage: P = PS(0,1)
|
|
1099
|
+
sage: f(P, check=False)
|
|
1100
|
+
(0 : 0)
|
|
1101
|
+
|
|
1102
|
+
sage: P.<x,y,z> = ProjectiveSpace(ZZ, 2)
|
|
1103
|
+
sage: X = P.subscheme(x^2 - y^2)
|
|
1104
|
+
sage: H = Hom(X, X)
|
|
1105
|
+
sage: f = H([x^2, y^2, z^2])
|
|
1106
|
+
sage: f([4,4,1])
|
|
1107
|
+
(16 : 16 : 1)
|
|
1108
|
+
|
|
1109
|
+
sage: P.<x,y,z> = ProjectiveSpace(ZZ, 2)
|
|
1110
|
+
sage: X = P.subscheme(x^2 - y^2)
|
|
1111
|
+
sage: H = Hom(X, X)
|
|
1112
|
+
sage: f = H([x^2, y^2, z^2])
|
|
1113
|
+
sage: f(P([4,4,1]))
|
|
1114
|
+
(16 : 16 : 1)
|
|
1115
|
+
"""
|
|
1116
|
+
# Checks were done in __call__
|
|
1117
|
+
P = [f(x._coords) for f in self.defining_polynomials()]
|
|
1118
|
+
return self._codomain.point(P,check=True)
|
|
1119
|
+
|
|
1120
|
+
def _call_with_args(self, x, args, kwds):
|
|
1121
|
+
"""
|
|
1122
|
+
Apply this morphism to a point in the domain, with additional arguments.
|
|
1123
|
+
|
|
1124
|
+
INPUT:
|
|
1125
|
+
|
|
1126
|
+
- ``x`` -- a point in the domain or a list or tuple that defines a
|
|
1127
|
+
point in the domain
|
|
1128
|
+
- ``check`` -- boolean; either provided by position or name
|
|
1129
|
+
|
|
1130
|
+
OUTPUT: a point in the codomain
|
|
1131
|
+
|
|
1132
|
+
EXAMPLES::
|
|
1133
|
+
|
|
1134
|
+
sage: R.<x,y> = QQ[]
|
|
1135
|
+
sage: A.<x,y> = AffineSpace(R)
|
|
1136
|
+
sage: H = A.Hom(A)
|
|
1137
|
+
sage: f = H([y, x^2 + y])
|
|
1138
|
+
sage: f([2,3])
|
|
1139
|
+
(3, 7)
|
|
1140
|
+
|
|
1141
|
+
An example with algebraic schemes::
|
|
1142
|
+
|
|
1143
|
+
sage: A.<x,y> = AffineSpace(QQ, 2)
|
|
1144
|
+
sage: X = A.subscheme(x)
|
|
1145
|
+
sage: Y = A.subscheme(y)
|
|
1146
|
+
sage: Hom_XY = X.Hom(Y)
|
|
1147
|
+
sage: f = Hom_XY([y,0]) # (0,y) |-> (y,0)
|
|
1148
|
+
sage: f
|
|
1149
|
+
Scheme morphism:
|
|
1150
|
+
From: Closed subscheme of Affine Space of dimension 2 over Rational Field
|
|
1151
|
+
defined by: x
|
|
1152
|
+
To: Closed subscheme of Affine Space of dimension 2 over Rational Field
|
|
1153
|
+
defined by: y
|
|
1154
|
+
Defn: Defined on coordinates by sending (x, y) to (y, 0)
|
|
1155
|
+
sage: f([0,3])
|
|
1156
|
+
(3, 0)
|
|
1157
|
+
|
|
1158
|
+
As usual, if the input does not belong to a map's domain, it is first
|
|
1159
|
+
attempted to convert it::
|
|
1160
|
+
|
|
1161
|
+
sage: f(0)
|
|
1162
|
+
Traceback (most recent call last):
|
|
1163
|
+
...
|
|
1164
|
+
TypeError: 0 fails to convert into the map's domain Closed subscheme of
|
|
1165
|
+
Affine Space of dimension 2 over Rational Field defined by:
|
|
1166
|
+
x, but a `pushforward` method is not properly implemented
|
|
1167
|
+
|
|
1168
|
+
It is possible to avoid the checks on the resulting point which can be
|
|
1169
|
+
useful for indeterminacies, but be careful!! ::
|
|
1170
|
+
|
|
1171
|
+
sage: PS.<x,y> = ProjectiveSpace(QQ, 1)
|
|
1172
|
+
sage: H = Hom(PS,PS)
|
|
1173
|
+
sage: f = H([x^3, x*y^2])
|
|
1174
|
+
sage: P = PS(0,1)
|
|
1175
|
+
sage: f(P, check=False) # indirect doctest
|
|
1176
|
+
(0 : 0)
|
|
1177
|
+
|
|
1178
|
+
::
|
|
1179
|
+
|
|
1180
|
+
sage: P.<x,y,z> = ProjectiveSpace(ZZ, 2)
|
|
1181
|
+
sage: X = P.subscheme(x^2 - y^2)
|
|
1182
|
+
sage: H = Hom(X, X)
|
|
1183
|
+
sage: f = H([x^2, y^2, z^2])
|
|
1184
|
+
sage: f([4,4,1])
|
|
1185
|
+
(16 : 16 : 1)
|
|
1186
|
+
|
|
1187
|
+
::
|
|
1188
|
+
|
|
1189
|
+
sage: P.<x,y,z> = ProjectiveSpace(ZZ, 2)
|
|
1190
|
+
sage: P2.<u,v,w,t> = ProjectiveSpace(ZZ, 3)
|
|
1191
|
+
sage: X = P.subscheme(x^2 - y^2)
|
|
1192
|
+
sage: H = Hom(X, X)
|
|
1193
|
+
sage: f = H([x^2, y^2, z^2])
|
|
1194
|
+
sage: f(P2([4,4,1,1]))
|
|
1195
|
+
Traceback (most recent call last):
|
|
1196
|
+
...
|
|
1197
|
+
TypeError: (4 : 4 : 1 : 1) fails to convert into the map's domain Closed subscheme of
|
|
1198
|
+
Projective Space of dimension 2 over Integer Ring defined by:
|
|
1199
|
+
x^2 - y^2, but a `pushforward` method is not properly implemented
|
|
1200
|
+
"""
|
|
1201
|
+
if args:
|
|
1202
|
+
check = args[0]
|
|
1203
|
+
else:
|
|
1204
|
+
check = kwds.get("check", False)
|
|
1205
|
+
# containment of x in the domain has already been checked, in __call__
|
|
1206
|
+
P = [f(x._coords) for f in self.defining_polynomials()]
|
|
1207
|
+
return self._codomain.point(P,check)
|
|
1208
|
+
|
|
1209
|
+
def _repr_defn(self):
|
|
1210
|
+
"""
|
|
1211
|
+
Return a string representation of the definition of ``self``.
|
|
1212
|
+
|
|
1213
|
+
OUTPUT: string
|
|
1214
|
+
|
|
1215
|
+
EXAMPLES::
|
|
1216
|
+
|
|
1217
|
+
sage: R.<x,y> = QQ[]
|
|
1218
|
+
sage: A.<x,y> = AffineSpace(R)
|
|
1219
|
+
sage: H = A.Hom(A)
|
|
1220
|
+
sage: f = H([y, x^2 + y])
|
|
1221
|
+
sage: print(f._repr_defn())
|
|
1222
|
+
Defined on coordinates by sending (x, y) to (y, x^2 + y)
|
|
1223
|
+
"""
|
|
1224
|
+
i = self.domain().ambient_space()._repr_generic_point()
|
|
1225
|
+
o = self._codomain.ambient_space()._repr_generic_point(self.defining_polynomials())
|
|
1226
|
+
return "Defined on coordinates by sending %s to\n%s" % (i,o)
|
|
1227
|
+
|
|
1228
|
+
def __getitem__(self, i):
|
|
1229
|
+
"""
|
|
1230
|
+
Return the i-th poly with ``self[i]``.
|
|
1231
|
+
|
|
1232
|
+
INPUT:
|
|
1233
|
+
|
|
1234
|
+
- ``i`` -- integer
|
|
1235
|
+
|
|
1236
|
+
OUTPUT: element of the coordinate ring of the domain
|
|
1237
|
+
|
|
1238
|
+
EXAMPLES::
|
|
1239
|
+
|
|
1240
|
+
sage: P.<x,y> = ProjectiveSpace(QQ, 1)
|
|
1241
|
+
sage: H = Hom(P, P)
|
|
1242
|
+
sage: f = H([3/5*x^2, 6*y^2])
|
|
1243
|
+
sage: f[1]
|
|
1244
|
+
6*y^2
|
|
1245
|
+
"""
|
|
1246
|
+
return self._polys[i]
|
|
1247
|
+
|
|
1248
|
+
def __copy__(self):
|
|
1249
|
+
r"""
|
|
1250
|
+
Return a copy of ``self``.
|
|
1251
|
+
|
|
1252
|
+
OUTPUT: :class:`SchemeMorphism_polynomial`
|
|
1253
|
+
|
|
1254
|
+
EXAMPLES::
|
|
1255
|
+
|
|
1256
|
+
sage: P.<x,y> = ProjectiveSpace(QQ, 1)
|
|
1257
|
+
sage: H = Hom(P, P)
|
|
1258
|
+
sage: f = H([3/5*x^2, 6*y^2])
|
|
1259
|
+
sage: g = copy(f)
|
|
1260
|
+
sage: f == g
|
|
1261
|
+
True
|
|
1262
|
+
sage: f is g
|
|
1263
|
+
False
|
|
1264
|
+
|
|
1265
|
+
::
|
|
1266
|
+
|
|
1267
|
+
sage: P.<x,y,z> = ProjectiveSpace(QQ, 2)
|
|
1268
|
+
sage: X = P.subscheme(x^2 - y^2)
|
|
1269
|
+
sage: Q = X(23, 23, 46)
|
|
1270
|
+
sage: P = X(1, 1, 1)
|
|
1271
|
+
sage: P != Q
|
|
1272
|
+
True
|
|
1273
|
+
"""
|
|
1274
|
+
return self.parent()(self._polys)
|
|
1275
|
+
|
|
1276
|
+
def coordinate_ring(self):
|
|
1277
|
+
r"""
|
|
1278
|
+
Return the coordinate ring of the ambient projective space.
|
|
1279
|
+
|
|
1280
|
+
OUTPUT: a multivariable polynomial ring over the base ring
|
|
1281
|
+
|
|
1282
|
+
EXAMPLES::
|
|
1283
|
+
|
|
1284
|
+
sage: P.<x,y> = ProjectiveSpace(QQ, 1)
|
|
1285
|
+
sage: H = Hom(P, P)
|
|
1286
|
+
sage: f = H([3/5*x^2, 6*y^2])
|
|
1287
|
+
sage: f.coordinate_ring()
|
|
1288
|
+
Multivariate Polynomial Ring in x, y over Rational Field
|
|
1289
|
+
|
|
1290
|
+
::
|
|
1291
|
+
|
|
1292
|
+
sage: R.<t> = PolynomialRing(ZZ, 1)
|
|
1293
|
+
sage: P.<x,y> = ProjectiveSpace(R, 1)
|
|
1294
|
+
sage: H = Hom(P, P)
|
|
1295
|
+
sage: f = H([3*x^2, y^2])
|
|
1296
|
+
sage: f.coordinate_ring()
|
|
1297
|
+
Multivariate Polynomial Ring in x, y over Multivariate Polynomial Ring
|
|
1298
|
+
in t over Integer Ring
|
|
1299
|
+
"""
|
|
1300
|
+
return self._polys[0].parent()
|
|
1301
|
+
|
|
1302
|
+
def change_ring(self, R, check=True):
|
|
1303
|
+
r"""
|
|
1304
|
+
Return a new :class:`SchemeMorphism_polynomial` which is this map
|
|
1305
|
+
coerced to ``R``.
|
|
1306
|
+
|
|
1307
|
+
If ``check`` is ``True``, then the initialization checks are performed.
|
|
1308
|
+
|
|
1309
|
+
INPUT:
|
|
1310
|
+
|
|
1311
|
+
- ``R`` -- ring or morphism
|
|
1312
|
+
|
|
1313
|
+
- ``check`` -- boolean
|
|
1314
|
+
|
|
1315
|
+
OUTPUT: a new :class:`SchemeMorphism_polynomial` which is this map
|
|
1316
|
+
coerced to ``R``
|
|
1317
|
+
|
|
1318
|
+
TESTS::
|
|
1319
|
+
|
|
1320
|
+
sage: # needs sage.rings.number_field
|
|
1321
|
+
sage: R.<t> = QQ[]
|
|
1322
|
+
sage: K.<v> = QuadraticField(2)
|
|
1323
|
+
sage: K2.<w> = NumberField(t**4 - 2)
|
|
1324
|
+
sage: P.<x,y> = ProjectiveSpace(QQ, 1)
|
|
1325
|
+
sage: phi = K.embeddings(K2)[0]
|
|
1326
|
+
sage: f = DynamicalSystem_projective([x**2 + 3*y**2, y**2]) # needs sage.schemes
|
|
1327
|
+
sage: f.change_ring(phi) # needs sage.schemes
|
|
1328
|
+
Dynamical System of Projective Space of dimension 1 over
|
|
1329
|
+
Number Field in w with defining polynomial t^4 - 2
|
|
1330
|
+
Defn: Defined on coordinates by sending (x : y) to (x^2 + 3*y^2 : y^2)
|
|
1331
|
+
|
|
1332
|
+
::
|
|
1333
|
+
|
|
1334
|
+
sage: # needs sage.rings.number_field
|
|
1335
|
+
sage: R.<t> = QQ[]
|
|
1336
|
+
sage: K.<u> = QuadraticField(2)
|
|
1337
|
+
sage: K1.<v> = NumberField(t^4 - 2)
|
|
1338
|
+
sage: K2.<w> = NumberField(t^8 - 2)
|
|
1339
|
+
sage: P.<x,y> = ProjectiveSpace(K, 1)
|
|
1340
|
+
sage: phi = K1.embeddings(K2)[0]
|
|
1341
|
+
sage: f = DynamicalSystem_projective([x^2 + 3*y^2, y^2]) # needs sage.schemes
|
|
1342
|
+
sage: f.change_ring(phi) # needs sage.schemes
|
|
1343
|
+
Traceback (most recent call last):
|
|
1344
|
+
...
|
|
1345
|
+
ValueError: no canonical coercion of base ring of morphism to domain of embedding
|
|
1346
|
+
|
|
1347
|
+
EXAMPLES::
|
|
1348
|
+
|
|
1349
|
+
sage: P.<x,y> = ProjectiveSpace(ZZ, 1)
|
|
1350
|
+
sage: H = Hom(P, P)
|
|
1351
|
+
sage: f = H([3*x^2, y^2])
|
|
1352
|
+
sage: f.change_ring(GF(3))
|
|
1353
|
+
Scheme endomorphism of Projective Space of dimension 1 over Finite Field of size 3
|
|
1354
|
+
Defn: Defined on coordinates by sending (x : y) to (0 : y^2)
|
|
1355
|
+
|
|
1356
|
+
::
|
|
1357
|
+
|
|
1358
|
+
sage: P.<x,y,z> = ProjectiveSpace(QQ, 2)
|
|
1359
|
+
sage: H = Hom(P, P)
|
|
1360
|
+
sage: f = H([5/2*x^3 + 3*x*y^2 - y^3, 3*z^3 + y*x^2, x^3 - z^3])
|
|
1361
|
+
sage: f.change_ring(GF(3))
|
|
1362
|
+
Scheme endomorphism of Projective Space of dimension 2 over Finite Field of size 3
|
|
1363
|
+
Defn: Defined on coordinates by sending (x : y : z) to
|
|
1364
|
+
(x^3 - y^3 : x^2*y : x^3 - z^3)
|
|
1365
|
+
|
|
1366
|
+
::
|
|
1367
|
+
|
|
1368
|
+
sage: P.<x,y> = ProjectiveSpace(QQ, 1)
|
|
1369
|
+
sage: X = P.subscheme([5*x^2 - y^2])
|
|
1370
|
+
sage: H = Hom(X, X)
|
|
1371
|
+
sage: f = H([x, y])
|
|
1372
|
+
sage: f.change_ring(GF(3))
|
|
1373
|
+
Scheme endomorphism of Closed subscheme of Projective Space of dimension 1
|
|
1374
|
+
over Finite Field of size 3 defined by: -x^2 - y^2
|
|
1375
|
+
Defn: Defined on coordinates by sending (x : y) to (x : y)
|
|
1376
|
+
|
|
1377
|
+
|
|
1378
|
+
Check that :issue:`16834` is fixed::
|
|
1379
|
+
|
|
1380
|
+
sage: # needs sage.rings.real_mpfr
|
|
1381
|
+
sage: A.<x,y,z> = AffineSpace(RR, 3)
|
|
1382
|
+
sage: h = Hom(A, A)
|
|
1383
|
+
sage: f = h([x^2 + 1.5, y^3, z^5 - 2.0])
|
|
1384
|
+
sage: f.change_ring(CC)
|
|
1385
|
+
Scheme endomorphism of Affine Space of dimension 3 over
|
|
1386
|
+
Complex Field with 53 bits of precision
|
|
1387
|
+
Defn: Defined on coordinates by sending (x, y, z) to
|
|
1388
|
+
(x^2 + 1.50000000000000, y^3, z^5 - 2.00000000000000)
|
|
1389
|
+
|
|
1390
|
+
::
|
|
1391
|
+
|
|
1392
|
+
sage: A.<x,y> = AffineSpace(ZZ, 2)
|
|
1393
|
+
sage: B.<u,v> = ProjectiveSpace(QQ, 1)
|
|
1394
|
+
sage: h = Hom(A,B)
|
|
1395
|
+
sage: f = h([x^2, y^2])
|
|
1396
|
+
sage: f.change_ring(QQ)
|
|
1397
|
+
Scheme morphism:
|
|
1398
|
+
From: Affine Space of dimension 2 over Rational Field
|
|
1399
|
+
To: Projective Space of dimension 1 over Rational Field
|
|
1400
|
+
Defn: Defined on coordinates by sending (x, y) to (x^2 : y^2)
|
|
1401
|
+
|
|
1402
|
+
::
|
|
1403
|
+
|
|
1404
|
+
sage: A.<x,y> = AffineSpace(QQ, 2)
|
|
1405
|
+
sage: H = Hom(A, A)
|
|
1406
|
+
sage: f = H([3*x^2/y, y^2/x])
|
|
1407
|
+
sage: f.change_ring(RR) # needs sage.rings.real_mpfr
|
|
1408
|
+
Scheme endomorphism of Affine Space of dimension 2 over Real Field with
|
|
1409
|
+
53 bits of precision
|
|
1410
|
+
Defn: Defined on coordinates by sending (x, y) to
|
|
1411
|
+
(3.00000000000000*x^2/y, y^2/x)
|
|
1412
|
+
|
|
1413
|
+
::
|
|
1414
|
+
|
|
1415
|
+
sage: # needs sage.rings.number_field
|
|
1416
|
+
sage: R.<x> = PolynomialRing(QQ)
|
|
1417
|
+
sage: K.<a> = NumberField(x^3 - x + 1)
|
|
1418
|
+
sage: P.<x,y> = ProjectiveSpace(K, 1)
|
|
1419
|
+
sage: H = End(P)
|
|
1420
|
+
sage: f = H([x^2 + a*x*y + a^2*y^2, y^2])
|
|
1421
|
+
sage: emb = K.embeddings(QQbar)
|
|
1422
|
+
sage: f.change_ring(emb[0])
|
|
1423
|
+
Scheme endomorphism of Projective Space of dimension 1
|
|
1424
|
+
over Algebraic Field
|
|
1425
|
+
Defn: Defined on coordinates by sending (x : y) to
|
|
1426
|
+
(x^2 + (-1.324717957244746?)*x*y + 1.754877666246693?*y^2 : y^2)
|
|
1427
|
+
sage: f.change_ring(emb[1])
|
|
1428
|
+
Scheme endomorphism of Projective Space of dimension 1
|
|
1429
|
+
over Algebraic Field
|
|
1430
|
+
Defn: Defined on coordinates by sending (x : y) to
|
|
1431
|
+
(x^2 + (0.6623589786223730? - 0.5622795120623013?*I)*x*y
|
|
1432
|
+
+ (0.1225611668766537? - 0.744861766619745?*I)*y^2 : y^2)
|
|
1433
|
+
|
|
1434
|
+
::
|
|
1435
|
+
|
|
1436
|
+
sage: # needs sage.rings.number_field sage.symbolic
|
|
1437
|
+
sage: K.<v> = QuadraticField(2, embedding=QQbar(sqrt(2)))
|
|
1438
|
+
sage: P.<x,y> = ProjectiveSpace(K, 1)
|
|
1439
|
+
sage: H = End(P)
|
|
1440
|
+
sage: f = H([x^2 + v*y^2, y^2])
|
|
1441
|
+
sage: f.change_ring(QQbar)
|
|
1442
|
+
Scheme endomorphism of Projective Space of dimension 1
|
|
1443
|
+
over Algebraic Field
|
|
1444
|
+
Defn: Defined on coordinates by sending (x : y) to
|
|
1445
|
+
(x^2 + 1.414213562373095?*y^2 : y^2)
|
|
1446
|
+
|
|
1447
|
+
::
|
|
1448
|
+
|
|
1449
|
+
sage: # needs sage.rings.number_field sage.symbolic
|
|
1450
|
+
sage: from sage.misc.verbose import set_verbose
|
|
1451
|
+
sage: set_verbose(-1)
|
|
1452
|
+
sage: K.<w> = QuadraticField(2, embedding=QQbar(-sqrt(2)))
|
|
1453
|
+
sage: P.<x,y> = ProjectiveSpace(K, 1)
|
|
1454
|
+
sage: X = P.subscheme(x - y)
|
|
1455
|
+
sage: H = End(X)
|
|
1456
|
+
sage: f = H([6*x^2 + 2*x*y + 16*y^2, -w*x^2 - 4*x*y - 4*y^2])
|
|
1457
|
+
sage: f.change_ring(QQbar)
|
|
1458
|
+
Scheme endomorphism of Closed subscheme of Projective Space of dimension 1
|
|
1459
|
+
over Algebraic Field defined by: x - y
|
|
1460
|
+
Defn: Defined on coordinates by sending (x : y) to
|
|
1461
|
+
(6*x^2 + 2*x*y + 16*y^2 : 1.414213562373095?*x^2 + (-4)*x*y + (-4)*y^2)
|
|
1462
|
+
|
|
1463
|
+
::
|
|
1464
|
+
|
|
1465
|
+
sage: # needs sage.rings.number_field
|
|
1466
|
+
sage: R.<x> = QQ[]
|
|
1467
|
+
sage: f = x^6 - 2
|
|
1468
|
+
sage: L.<b> = NumberField(f, embedding=f.roots(QQbar)[1][0])
|
|
1469
|
+
sage: A.<x,y> = AffineSpace(L, 2)
|
|
1470
|
+
sage: H = Hom(A, A)
|
|
1471
|
+
sage: F = H([b*x/y, 1 + y])
|
|
1472
|
+
sage: F.change_ring(QQbar)
|
|
1473
|
+
Scheme endomorphism of Affine Space of dimension 2 over Algebraic Field
|
|
1474
|
+
Defn: Defined on coordinates by sending (x, y) to
|
|
1475
|
+
(1.122462048309373?*x/y, y + 1)
|
|
1476
|
+
|
|
1477
|
+
::
|
|
1478
|
+
|
|
1479
|
+
sage: # needs sage.rings.number_field
|
|
1480
|
+
sage: K.<a> = QuadraticField(-1)
|
|
1481
|
+
sage: A.<x,y> = AffineSpace(K, 2)
|
|
1482
|
+
sage: H = End(A)
|
|
1483
|
+
sage: phi = H([x/y, y])
|
|
1484
|
+
sage: emb = K.embeddings(QQbar)[0]
|
|
1485
|
+
sage: phi.change_ring(emb)
|
|
1486
|
+
Scheme endomorphism of Affine Space of dimension 2 over Algebraic Field
|
|
1487
|
+
Defn: Defined on coordinates by sending (x, y) to (x/y, y)
|
|
1488
|
+
"""
|
|
1489
|
+
T = self.domain().change_ring(R)
|
|
1490
|
+
if self.is_endomorphism():
|
|
1491
|
+
H = End(T)
|
|
1492
|
+
else:
|
|
1493
|
+
S = self.codomain().change_ring(R)
|
|
1494
|
+
H = Hom(T, S)
|
|
1495
|
+
|
|
1496
|
+
if isinstance(R, Map):
|
|
1497
|
+
from sage.structure.coerce_maps import CallableConvertMap
|
|
1498
|
+
if R.domain() == self.base_ring():
|
|
1499
|
+
S = self.domain().ambient_space().coordinate_ring()
|
|
1500
|
+
T = T.ambient_space().coordinate_ring()
|
|
1501
|
+
phi = CallableConvertMap(S, T, lambda self, g:T(g.map_coefficients(R)))
|
|
1502
|
+
G = []
|
|
1503
|
+
for f in self:
|
|
1504
|
+
if isinstance(f, FractionFieldElement):
|
|
1505
|
+
G.append(phi(f.numerator())/phi(f.denominator()))
|
|
1506
|
+
else:
|
|
1507
|
+
G.append(phi(f))
|
|
1508
|
+
elif R.domain().coerce_map_from(self.base_ring()) is not None:
|
|
1509
|
+
R = R*R.domain().coerce_map_from(self.base_ring())
|
|
1510
|
+
S = self.domain().ambient_space().coordinate_ring()
|
|
1511
|
+
T = T.ambient_space().coordinate_ring()
|
|
1512
|
+
phi = CallableConvertMap(S, T, lambda self, g:T(g.map_coefficients(R)))
|
|
1513
|
+
G = []
|
|
1514
|
+
for f in self:
|
|
1515
|
+
if isinstance(f, FractionFieldElement):
|
|
1516
|
+
G.append(phi(f.numerator())/phi(f.denominator()))
|
|
1517
|
+
else:
|
|
1518
|
+
G.append(phi(f))
|
|
1519
|
+
else:
|
|
1520
|
+
raise ValueError("no canonical coercion of base ring of morphism to domain of embedding")
|
|
1521
|
+
|
|
1522
|
+
else:
|
|
1523
|
+
G = []
|
|
1524
|
+
for f in self:
|
|
1525
|
+
if isinstance(f, FractionFieldElement):
|
|
1526
|
+
G.append(f.numerator().change_ring(R) / f.denominator().change_ring(R))
|
|
1527
|
+
else:
|
|
1528
|
+
G.append(f.change_ring(R))
|
|
1529
|
+
return H(G, check)
|
|
1530
|
+
|
|
1531
|
+
def specialization(self, D=None, phi=None, homset=None):
|
|
1532
|
+
r"""
|
|
1533
|
+
Specialization of this map.
|
|
1534
|
+
|
|
1535
|
+
Given a family of maps defined over a polynomial ring. A specialization
|
|
1536
|
+
is a particular member of that family. The specialization can be specified either
|
|
1537
|
+
by a dictionary or a :class:`SpecializationMorphism`.
|
|
1538
|
+
|
|
1539
|
+
INPUT:
|
|
1540
|
+
|
|
1541
|
+
- ``D`` -- dictionary (optional)
|
|
1542
|
+
|
|
1543
|
+
- ``phi`` -- SpecializationMorphism (optional)
|
|
1544
|
+
|
|
1545
|
+
- ``homset`` -- homset of specialized map (optional)
|
|
1546
|
+
|
|
1547
|
+
OUTPUT: :class:`SchemeMorphism_polynomial`
|
|
1548
|
+
|
|
1549
|
+
EXAMPLES::
|
|
1550
|
+
|
|
1551
|
+
sage: R.<c> = PolynomialRing(QQ)
|
|
1552
|
+
sage: P.<x,y> = ProjectiveSpace(R, 1)
|
|
1553
|
+
sage: H = End(P)
|
|
1554
|
+
sage: f = H([x^2 + c*y^2, y^2])
|
|
1555
|
+
sage: f.specialization({c: 1})
|
|
1556
|
+
Scheme endomorphism of Projective Space of dimension 1 over Rational Field
|
|
1557
|
+
Defn: Defined on coordinates by sending (x : y) to (x^2 + y^2 : y^2)
|
|
1558
|
+
|
|
1559
|
+
::
|
|
1560
|
+
|
|
1561
|
+
sage: R.<a,b> = PolynomialRing(QQ)
|
|
1562
|
+
sage: P.<x,y> = ProjectiveSpace(R, 1)
|
|
1563
|
+
sage: H = End(P)
|
|
1564
|
+
sage: f = H([x^3 + a*x*y^2 + b*y^3, y^3])
|
|
1565
|
+
sage: from sage.rings.polynomial.flatten import SpecializationMorphism
|
|
1566
|
+
sage: phi = SpecializationMorphism(P.coordinate_ring(), {a: 2, b: -1})
|
|
1567
|
+
sage: F = f.specialization(phi=phi); F
|
|
1568
|
+
Scheme endomorphism of Projective Space of dimension 1 over Rational Field
|
|
1569
|
+
Defn: Defined on coordinates by sending (x : y) to
|
|
1570
|
+
(x^3 + 2*x*y^2 - y^3 : y^3)
|
|
1571
|
+
sage: g = H([x^2 + a*y^2, y^2])
|
|
1572
|
+
sage: G = g.specialization(phi=phi)
|
|
1573
|
+
sage: G.parent() is F.parent()
|
|
1574
|
+
True
|
|
1575
|
+
sage: G = g.specialization(phi=phi, homset=F.parent())
|
|
1576
|
+
sage: G.parent() is F.parent()
|
|
1577
|
+
True
|
|
1578
|
+
|
|
1579
|
+
::
|
|
1580
|
+
|
|
1581
|
+
sage: R.<c> = PolynomialRing(QQ)
|
|
1582
|
+
sage: P.<x,y> = ProjectiveSpace(R, 1)
|
|
1583
|
+
sage: X = P.subscheme([x - c*y])
|
|
1584
|
+
sage: H = End(X)
|
|
1585
|
+
sage: f = H([x^2, c*y^2])
|
|
1586
|
+
sage: f.specialization({c: 2})
|
|
1587
|
+
Scheme endomorphism of Closed subscheme of Projective Space of dimension 1
|
|
1588
|
+
over Rational Field defined by: x - 2*y
|
|
1589
|
+
Defn: Defined on coordinates by sending (x : y) to (x^2 : 2*y^2)
|
|
1590
|
+
|
|
1591
|
+
::
|
|
1592
|
+
|
|
1593
|
+
sage: # needs sage.schemes
|
|
1594
|
+
sage: R.<c> = QQ[]
|
|
1595
|
+
sage: P.<x,y> = ProjectiveSpace(R, 1)
|
|
1596
|
+
sage: f = DynamicalSystem_projective([x^2 + c*y^2, y^2], domain=P)
|
|
1597
|
+
sage: F = f.dynatomic_polynomial(3) # needs sage.libs.pari
|
|
1598
|
+
sage: g = F.specialization({c: 1}); g
|
|
1599
|
+
x^6 + x^5*y + 4*x^4*y^2 + 3*x^3*y^3 + 7*x^2*y^4 + 4*x*y^5 + 5*y^6
|
|
1600
|
+
sage: g == f.specialization({c:1}).dynatomic_polynomial(3) # needs sage.libs.pari
|
|
1601
|
+
True
|
|
1602
|
+
|
|
1603
|
+
::
|
|
1604
|
+
|
|
1605
|
+
sage: # needs sage.schemes
|
|
1606
|
+
sage: R1.<alpha, beta> = QQ[]
|
|
1607
|
+
sage: A.<x> = AffineSpace(Frac(R1), 1)
|
|
1608
|
+
sage: f = DynamicalSystem_affine([alpha/(x^2 + 1/alpha)/(x - 1/beta^2)])
|
|
1609
|
+
sage: f.specialization({alpha: 5, beta: 10})
|
|
1610
|
+
Dynamical System of Affine Space of dimension 1 over Rational Field
|
|
1611
|
+
Defn: Defined on coordinates by sending (x) to
|
|
1612
|
+
(5/(x^3 - 1/100*x^2 + 1/5*x - 1/500))
|
|
1613
|
+
sage: f_5_10 = f.specialization({alpha: 5}).specialization({beta: 10})
|
|
1614
|
+
sage: f_5_10 == f.specialization({alpha: 5, beta: 10})
|
|
1615
|
+
True
|
|
1616
|
+
"""
|
|
1617
|
+
if D is None:
|
|
1618
|
+
if phi is None:
|
|
1619
|
+
raise ValueError("either the dictionary or the specialization must be provided")
|
|
1620
|
+
else:
|
|
1621
|
+
if isinstance(self[0].parent(), FractionField_generic):
|
|
1622
|
+
from sage.rings.polynomial.flatten import FractionSpecializationMorphism
|
|
1623
|
+
phi = FractionSpecializationMorphism(self[0].parent(), D)
|
|
1624
|
+
else:
|
|
1625
|
+
from sage.rings.polynomial.flatten import SpecializationMorphism
|
|
1626
|
+
phi = SpecializationMorphism(self[0].parent(), D)
|
|
1627
|
+
if homset is None:
|
|
1628
|
+
domain = self.domain()
|
|
1629
|
+
if isinstance(domain, AlgebraicScheme_subscheme):
|
|
1630
|
+
domain = domain.specialization(phi=phi)
|
|
1631
|
+
else:
|
|
1632
|
+
domain = domain.change_ring(phi.codomain().base_ring())
|
|
1633
|
+
if self.is_endomorphism():
|
|
1634
|
+
homset = End(domain)
|
|
1635
|
+
else:
|
|
1636
|
+
codomain = self.codomain()
|
|
1637
|
+
if isinstance(codomain, AlgebraicScheme_subscheme):
|
|
1638
|
+
codomain = codomain.specialization(phi=phi)
|
|
1639
|
+
else:
|
|
1640
|
+
codomain = codomain.change_ring(phi.codomain().base_ring())
|
|
1641
|
+
homset = Hom(domain, codomain)
|
|
1642
|
+
return homset([phi(g) for g in self])
|
|
1643
|
+
|
|
1644
|
+
def _composition_(self, other, homset):
|
|
1645
|
+
r"""
|
|
1646
|
+
Straightforward implementation of composition for scheme morphisms
|
|
1647
|
+
defined by polynomials.
|
|
1648
|
+
|
|
1649
|
+
TESTS::
|
|
1650
|
+
|
|
1651
|
+
sage: P.<x,y> = ProjectiveSpace(QQ, 1)
|
|
1652
|
+
sage: H = Hom(P, P)
|
|
1653
|
+
sage: f = H([x^2 - 29/16*y^2, y^2])
|
|
1654
|
+
sage: g = H([y, x + y])
|
|
1655
|
+
sage: h = f*g
|
|
1656
|
+
sage: h
|
|
1657
|
+
Scheme endomorphism of Projective Space of dimension 1 over Rational Field
|
|
1658
|
+
Defn: Defined on coordinates by sending (x : y) to
|
|
1659
|
+
(-29/16*x^2 - 29/8*x*y - 13/16*y^2 : x^2 + 2*x*y + y^2)
|
|
1660
|
+
sage: p = P((1,3))
|
|
1661
|
+
sage: h(p) == f(g(p))
|
|
1662
|
+
True
|
|
1663
|
+
|
|
1664
|
+
sage: Q = ProjectiveSpace(QQ, 2)
|
|
1665
|
+
sage: H2 = Hom(P, Q)
|
|
1666
|
+
sage: h2 = H2([x^2 + y^2, x^2, y^2 + 2*x^2])
|
|
1667
|
+
sage: h2 * f
|
|
1668
|
+
Scheme morphism:
|
|
1669
|
+
From: Projective Space of dimension 1 over Rational Field
|
|
1670
|
+
To: Projective Space of dimension 2 over Rational Field
|
|
1671
|
+
Defn: Defined on coordinates by sending (x : y) to
|
|
1672
|
+
(x^4 - 29/8*x^2*y^2 + 1097/256*y^4
|
|
1673
|
+
: x^4 - 29/8*x^2*y^2 + 841/256*y^4
|
|
1674
|
+
: 2*x^4 - 29/4*x^2*y^2 + 969/128*y^4)
|
|
1675
|
+
|
|
1676
|
+
::
|
|
1677
|
+
|
|
1678
|
+
sage: A.<x,y> = AffineSpace(QQ, 2)
|
|
1679
|
+
sage: A1.<z> = AffineSpace(QQ, 1)
|
|
1680
|
+
sage: H = End(A)
|
|
1681
|
+
sage: f = H([x^2 + y^2, y^2/x])
|
|
1682
|
+
sage: H1 = Hom(A, A1)
|
|
1683
|
+
sage: g = H1([x + y^2])
|
|
1684
|
+
sage: g*f
|
|
1685
|
+
Scheme morphism:
|
|
1686
|
+
From: Affine Space of dimension 2 over Rational Field
|
|
1687
|
+
To: Affine Space of dimension 1 over Rational Field
|
|
1688
|
+
Defn: Defined on coordinates by sending (x, y) to
|
|
1689
|
+
((x^4 + x^2*y^2 + y^4)/x^2)
|
|
1690
|
+
sage: f*g
|
|
1691
|
+
Traceback (most recent call last):
|
|
1692
|
+
...
|
|
1693
|
+
TypeError: self (=Scheme endomorphism of Affine Space of dimension 2 over Rational Field
|
|
1694
|
+
Defn: Defined on coordinates by sending (x, y) to
|
|
1695
|
+
(x^2 + y^2, y^2/x)) domain
|
|
1696
|
+
must equal right (=Scheme morphism:
|
|
1697
|
+
From: Affine Space of dimension 2 over Rational Field
|
|
1698
|
+
To: Affine Space of dimension 1 over Rational Field
|
|
1699
|
+
Defn: Defined on coordinates by sending (x, y) to
|
|
1700
|
+
(y^2 + x)) codomain
|
|
1701
|
+
|
|
1702
|
+
Not both defined by polynomials::
|
|
1703
|
+
|
|
1704
|
+
sage: # needs sage.rings.number_field
|
|
1705
|
+
sage: x = polygen(QQ)
|
|
1706
|
+
sage: K.<a> = NumberField(x^2 - 2)
|
|
1707
|
+
sage: p1, p2 = K.Hom(K)
|
|
1708
|
+
sage: R.<x,y> = K[]
|
|
1709
|
+
sage: q1 = R.Hom(R)(p1)
|
|
1710
|
+
sage: A = AffineSpace(R)
|
|
1711
|
+
sage: f1 = A.Hom(A)(q1)
|
|
1712
|
+
sage: g = A.Hom(A)([x^2 - y, y + 1])
|
|
1713
|
+
sage: g*f1
|
|
1714
|
+
Composite map:
|
|
1715
|
+
From: Affine Space of dimension 2 over Number Field in a
|
|
1716
|
+
with defining polynomial x^2 - 2
|
|
1717
|
+
To: Affine Space of dimension 2 over Number Field in a
|
|
1718
|
+
with defining polynomial x^2 - 2
|
|
1719
|
+
Defn: Generic endomorphism of Affine Space of dimension 2
|
|
1720
|
+
over Number Field in a with defining polynomial x^2 - 2
|
|
1721
|
+
then
|
|
1722
|
+
Generic endomorphism of Affine Space of dimension 2
|
|
1723
|
+
over Number Field in a with defining polynomial x^2 - 2
|
|
1724
|
+
"""
|
|
1725
|
+
try:
|
|
1726
|
+
opolys = tuple(other._polys)
|
|
1727
|
+
except AttributeError:
|
|
1728
|
+
return super()._composition_(other, homset)
|
|
1729
|
+
return homset([p(*opolys) for p in self._polys])
|
|
1730
|
+
|
|
1731
|
+
|
|
1732
|
+
class SchemeMorphism_polynomial_id(SchemeMorphism_id, SchemeMorphism_polynomial):
|
|
1733
|
+
"""
|
|
1734
|
+
Return the identity morphism from `X` to itself.
|
|
1735
|
+
|
|
1736
|
+
INPUT:
|
|
1737
|
+
|
|
1738
|
+
- ``X`` -- an affine or projective scheme
|
|
1739
|
+
|
|
1740
|
+
EXAMPLES::
|
|
1741
|
+
|
|
1742
|
+
sage: X = Spec(ZZ)
|
|
1743
|
+
sage: X.identity_morphism() # indirect doctest
|
|
1744
|
+
Scheme endomorphism of Spectrum of Integer Ring
|
|
1745
|
+
Defn: Identity map
|
|
1746
|
+
"""
|
|
1747
|
+
def __init__(self, X):
|
|
1748
|
+
"""
|
|
1749
|
+
Initialize.
|
|
1750
|
+
|
|
1751
|
+
TESTS::
|
|
1752
|
+
|
|
1753
|
+
sage: A = AffineSpace(2, GF(3))
|
|
1754
|
+
sage: A.identity_morphism().defining_polynomials()
|
|
1755
|
+
(x0, x1)
|
|
1756
|
+
"""
|
|
1757
|
+
super().__init__(X)
|
|
1758
|
+
variables = X.ambient_space().coordinate_ring().gens()
|
|
1759
|
+
SchemeMorphism_polynomial.__init__(self, X.Hom(X), variables, check=False)
|
|
1760
|
+
|
|
1761
|
+
|
|
1762
|
+
############################################################################
|
|
1763
|
+
# Rational points on schemes, which we view as morphisms determined
|
|
1764
|
+
# by coordinates.
|
|
1765
|
+
############################################################################
|
|
1766
|
+
|
|
1767
|
+
class SchemeMorphism_point(SchemeMorphism):
|
|
1768
|
+
r"""
|
|
1769
|
+
Base class for rational points on schemes.
|
|
1770
|
+
|
|
1771
|
+
Recall that the `K`-rational points of a scheme `X` over `k` can
|
|
1772
|
+
be identified with the set of morphisms `\mathrm{Spec}(K) \to X`. In Sage,
|
|
1773
|
+
the rational points are implemented by such scheme morphisms.
|
|
1774
|
+
|
|
1775
|
+
EXAMPLES::
|
|
1776
|
+
|
|
1777
|
+
sage: from sage.schemes.generic.morphism import SchemeMorphism
|
|
1778
|
+
sage: f = SchemeMorphism(Spec(ZZ).Hom(Spec(ZZ)))
|
|
1779
|
+
sage: type(f)
|
|
1780
|
+
<class 'sage.schemes.generic.morphism.SchemeMorphism'>
|
|
1781
|
+
"""
|
|
1782
|
+
def _repr_(self):
|
|
1783
|
+
r"""
|
|
1784
|
+
Return a string representation of ``self``.
|
|
1785
|
+
|
|
1786
|
+
OUTPUT: string
|
|
1787
|
+
|
|
1788
|
+
EXAMPLES::
|
|
1789
|
+
|
|
1790
|
+
sage: A = AffineSpace(2, QQ)
|
|
1791
|
+
sage: a = A(1,2)
|
|
1792
|
+
sage: a._repr_()
|
|
1793
|
+
'(1, 2)'
|
|
1794
|
+
"""
|
|
1795
|
+
return self._codomain.ambient_space()._repr_generic_point(self._coords)
|
|
1796
|
+
|
|
1797
|
+
def _latex_(self):
|
|
1798
|
+
r"""
|
|
1799
|
+
Return a latex representation of ``self``.
|
|
1800
|
+
|
|
1801
|
+
OUTPUT: string
|
|
1802
|
+
|
|
1803
|
+
EXAMPLES::
|
|
1804
|
+
|
|
1805
|
+
sage: A = AffineSpace(2, QQ)
|
|
1806
|
+
sage: a = A(1,2)
|
|
1807
|
+
sage: latex(a) == a._latex_()
|
|
1808
|
+
True
|
|
1809
|
+
sage: a._latex_()
|
|
1810
|
+
'\\left(1, 2\\right)'
|
|
1811
|
+
"""
|
|
1812
|
+
return self._codomain.ambient_space()._latex_generic_point(self._coords)
|
|
1813
|
+
|
|
1814
|
+
def __getitem__(self, n):
|
|
1815
|
+
"""
|
|
1816
|
+
Return the ``n``-th coordinate.
|
|
1817
|
+
|
|
1818
|
+
OUTPUT: the coordinate values as an element of the base ring
|
|
1819
|
+
|
|
1820
|
+
EXAMPLES::
|
|
1821
|
+
|
|
1822
|
+
sage: A = AffineSpace(2, QQ)
|
|
1823
|
+
sage: a = A(1,2)
|
|
1824
|
+
sage: a[0]
|
|
1825
|
+
1
|
|
1826
|
+
sage: a[1]
|
|
1827
|
+
2
|
|
1828
|
+
"""
|
|
1829
|
+
return self._coords[n]
|
|
1830
|
+
|
|
1831
|
+
def __iter__(self):
|
|
1832
|
+
"""
|
|
1833
|
+
Iterate over the coordinates of the point.
|
|
1834
|
+
|
|
1835
|
+
OUTPUT: an iterator
|
|
1836
|
+
|
|
1837
|
+
EXAMPLES::
|
|
1838
|
+
|
|
1839
|
+
sage: A = AffineSpace(2, QQ)
|
|
1840
|
+
sage: a = A(1,2)
|
|
1841
|
+
sage: iter = a.__iter__()
|
|
1842
|
+
sage: next(iter)
|
|
1843
|
+
1
|
|
1844
|
+
sage: next(iter)
|
|
1845
|
+
2
|
|
1846
|
+
sage: list(a)
|
|
1847
|
+
[1, 2]
|
|
1848
|
+
"""
|
|
1849
|
+
return iter(self._coords)
|
|
1850
|
+
|
|
1851
|
+
def __tuple__(self):
|
|
1852
|
+
"""
|
|
1853
|
+
Return the coordinates as a tuple.
|
|
1854
|
+
|
|
1855
|
+
OUTPUT: a tuple
|
|
1856
|
+
|
|
1857
|
+
EXAMPLES::
|
|
1858
|
+
|
|
1859
|
+
sage: A = AffineSpace(2, QQ)
|
|
1860
|
+
sage: a = A(1,2)
|
|
1861
|
+
sage: tuple(a)
|
|
1862
|
+
(1, 2)
|
|
1863
|
+
"""
|
|
1864
|
+
return self._coords
|
|
1865
|
+
|
|
1866
|
+
def __len__(self):
|
|
1867
|
+
"""
|
|
1868
|
+
Return the number of coordinates.
|
|
1869
|
+
|
|
1870
|
+
OUTPUT: integer. The number of coordinates used to describe the point
|
|
1871
|
+
|
|
1872
|
+
EXAMPLES::
|
|
1873
|
+
|
|
1874
|
+
sage: A = AffineSpace(2, QQ)
|
|
1875
|
+
sage: a = A(1,2)
|
|
1876
|
+
sage: len(a)
|
|
1877
|
+
2
|
|
1878
|
+
"""
|
|
1879
|
+
return len(self._coords)
|
|
1880
|
+
|
|
1881
|
+
def _richcmp_(self, other, op):
|
|
1882
|
+
"""
|
|
1883
|
+
Compare two scheme morphisms.
|
|
1884
|
+
|
|
1885
|
+
INPUT:
|
|
1886
|
+
|
|
1887
|
+
- ``other`` -- anything; to compare against the scheme
|
|
1888
|
+
morphism ``self``
|
|
1889
|
+
|
|
1890
|
+
OUTPUT: boolean
|
|
1891
|
+
|
|
1892
|
+
EXAMPLES::
|
|
1893
|
+
|
|
1894
|
+
sage: A = AffineSpace(2, QQ)
|
|
1895
|
+
sage: a = A(1,2)
|
|
1896
|
+
sage: b = A(3,4)
|
|
1897
|
+
sage: a < b
|
|
1898
|
+
True
|
|
1899
|
+
sage: a != b
|
|
1900
|
+
True
|
|
1901
|
+
"""
|
|
1902
|
+
if not isinstance(other, SchemeMorphism_point):
|
|
1903
|
+
try:
|
|
1904
|
+
other = self._codomain.ambient_space()(other)
|
|
1905
|
+
except TypeError:
|
|
1906
|
+
return NotImplemented
|
|
1907
|
+
return richcmp(self._coords, other._coords, op)
|
|
1908
|
+
|
|
1909
|
+
def scheme(self):
|
|
1910
|
+
"""
|
|
1911
|
+
Return the scheme whose point is represented.
|
|
1912
|
+
|
|
1913
|
+
OUTPUT: a scheme
|
|
1914
|
+
|
|
1915
|
+
EXAMPLES::
|
|
1916
|
+
|
|
1917
|
+
sage: A = AffineSpace(2, QQ)
|
|
1918
|
+
sage: a = A(1,2)
|
|
1919
|
+
sage: a.scheme()
|
|
1920
|
+
Affine Space of dimension 2 over Rational Field
|
|
1921
|
+
"""
|
|
1922
|
+
return self._codomain
|
|
1923
|
+
|
|
1924
|
+
def change_ring(self, R, check=True):
|
|
1925
|
+
r"""
|
|
1926
|
+
Return a new :class:`SchemeMorphism_point` which is this point coerced
|
|
1927
|
+
to ``R``.
|
|
1928
|
+
|
|
1929
|
+
If ``check`` is true, then the initialization checks are performed.
|
|
1930
|
+
|
|
1931
|
+
INPUT:
|
|
1932
|
+
|
|
1933
|
+
- ``R`` -- ring or morphism
|
|
1934
|
+
|
|
1935
|
+
- ``check`` -- boolean
|
|
1936
|
+
|
|
1937
|
+
OUTPUT: :class:`SchemeMorphism_point`
|
|
1938
|
+
|
|
1939
|
+
EXAMPLES::
|
|
1940
|
+
|
|
1941
|
+
sage: P.<x,y,z> = ProjectiveSpace(ZZ, 2)
|
|
1942
|
+
sage: X = P.subscheme(x^2 - y^2)
|
|
1943
|
+
sage: X(23,23,1).change_ring(GF(13))
|
|
1944
|
+
(10 : 10 : 1)
|
|
1945
|
+
|
|
1946
|
+
::
|
|
1947
|
+
|
|
1948
|
+
sage: P.<x,y> = ProjectiveSpace(QQ, 1)
|
|
1949
|
+
sage: P(-2/3,1).change_ring(CC) # needs sage.rings.real_mpfr
|
|
1950
|
+
(-0.666666666666667 : 1.00000000000000)
|
|
1951
|
+
|
|
1952
|
+
::
|
|
1953
|
+
|
|
1954
|
+
sage: P.<x,y> = ProjectiveSpace(ZZ, 1)
|
|
1955
|
+
sage: P(152,113).change_ring(Zp(5)) # needs sage.rings.padics
|
|
1956
|
+
(2 + 5^2 + 5^3 + O(5^20) : 3 + 2*5 + 4*5^2 + O(5^20))
|
|
1957
|
+
|
|
1958
|
+
::
|
|
1959
|
+
|
|
1960
|
+
sage: # needs sage.rings.number_field
|
|
1961
|
+
sage: K.<v> = QuadraticField(-7)
|
|
1962
|
+
sage: O = K.maximal_order()
|
|
1963
|
+
sage: P.<x,y> = ProjectiveSpace(O, 1)
|
|
1964
|
+
sage: H = End(P)
|
|
1965
|
+
sage: F = H([x^2 + O(v)*y^2, y^2])
|
|
1966
|
+
sage: F.change_ring(K).change_ring(K.embeddings(QQbar)[0])
|
|
1967
|
+
Scheme endomorphism of Projective Space of dimension 1
|
|
1968
|
+
over Algebraic Field
|
|
1969
|
+
Defn: Defined on coordinates by sending (x : y) to
|
|
1970
|
+
(x^2 + (-2.645751311064591?*I)*y^2 : y^2)
|
|
1971
|
+
|
|
1972
|
+
::
|
|
1973
|
+
|
|
1974
|
+
sage: # needs sage.rings.number_field
|
|
1975
|
+
sage: R.<x> = PolynomialRing(QQ)
|
|
1976
|
+
sage: K.<a> = NumberField(x^2 - x + 1)
|
|
1977
|
+
sage: P.<x,y> = ProjectiveSpace(K, 1)
|
|
1978
|
+
sage: Q = P([a + 1, 1])
|
|
1979
|
+
sage: emb = K.embeddings(QQbar)
|
|
1980
|
+
sage: Q.change_ring(emb[0])
|
|
1981
|
+
(1.5000000000000000? - 0.866025403784439?*I : 1)
|
|
1982
|
+
sage: Q.change_ring(emb[1])
|
|
1983
|
+
(1.5000000000000000? + 0.866025403784439?*I : 1)
|
|
1984
|
+
|
|
1985
|
+
::
|
|
1986
|
+
|
|
1987
|
+
sage: # needs sage.rings.number_field
|
|
1988
|
+
sage: K.<v> = QuadraticField(2)
|
|
1989
|
+
sage: P.<x,y> = ProjectiveSpace(K, 1)
|
|
1990
|
+
sage: Q = P([v,1])
|
|
1991
|
+
sage: Q.change_ring(K.embeddings(QQbar)[0])
|
|
1992
|
+
(-1.414213562373095? : 1)
|
|
1993
|
+
|
|
1994
|
+
::
|
|
1995
|
+
|
|
1996
|
+
sage: # needs sage.rings.number_field
|
|
1997
|
+
sage: R.<x> = QQ[]
|
|
1998
|
+
sage: f = x^6 - 2
|
|
1999
|
+
sage: L.<b> = NumberField(f, embedding=f.roots(QQbar)[1][0])
|
|
2000
|
+
sage: A.<x,y> = AffineSpace(L, 2)
|
|
2001
|
+
sage: P = A([b,1])
|
|
2002
|
+
sage: P.change_ring(QQbar)
|
|
2003
|
+
(1.122462048309373?, 1)
|
|
2004
|
+
"""
|
|
2005
|
+
S = self.codomain().change_ring(R)
|
|
2006
|
+
Q = [R(t) for t in self]
|
|
2007
|
+
return S.point(Q, check=check)
|
|
2008
|
+
|
|
2009
|
+
def __copy__(self):
|
|
2010
|
+
r"""
|
|
2011
|
+
Return a copy of the :class:`SchemeMorphism_point` ``self`` coerced to
|
|
2012
|
+
`R`.
|
|
2013
|
+
|
|
2014
|
+
OUTPUT: :class:`SchemeMorphism_point`
|
|
2015
|
+
|
|
2016
|
+
EXAMPLES::
|
|
2017
|
+
|
|
2018
|
+
sage: P.<x,y> = ProjectiveSpace(ZZ, 1)
|
|
2019
|
+
sage: Q = P(152, 113)
|
|
2020
|
+
sage: Q2 = copy(Q)
|
|
2021
|
+
sage: Q2 is Q
|
|
2022
|
+
False
|
|
2023
|
+
sage: Q2 == Q
|
|
2024
|
+
True
|
|
2025
|
+
"""
|
|
2026
|
+
return self._codomain.point(self._coords, check=False)
|
|
2027
|
+
|
|
2028
|
+
def specialization(self, D=None, phi=None, ambient=None):
|
|
2029
|
+
r"""
|
|
2030
|
+
Specialization of this point.
|
|
2031
|
+
|
|
2032
|
+
Given a family of points defined over a polynomial ring. A specialization
|
|
2033
|
+
is a particular member of that family. The specialization can be specified either
|
|
2034
|
+
by a dictionary or a :class:`SpecializationMorphism`.
|
|
2035
|
+
|
|
2036
|
+
INPUT:
|
|
2037
|
+
|
|
2038
|
+
- ``D`` -- dictionary (optional)
|
|
2039
|
+
|
|
2040
|
+
- ``phi`` -- SpecializationMorphism (optional)
|
|
2041
|
+
|
|
2042
|
+
- ``ambient`` -- ambient space of specialized point (optional)
|
|
2043
|
+
|
|
2044
|
+
OUTPUT: :class:`SchemeMorphism_polynomial`
|
|
2045
|
+
|
|
2046
|
+
EXAMPLES::
|
|
2047
|
+
|
|
2048
|
+
sage: R.<c> = PolynomialRing(QQ)
|
|
2049
|
+
sage: P.<x,y> = ProjectiveSpace(R, 1)
|
|
2050
|
+
sage: Q = P([c,1])
|
|
2051
|
+
sage: Q.specialization({c: 1})
|
|
2052
|
+
(1 : 1)
|
|
2053
|
+
|
|
2054
|
+
::
|
|
2055
|
+
|
|
2056
|
+
sage: R.<a,b> = PolynomialRing(QQ)
|
|
2057
|
+
sage: P.<x,y> = ProjectiveSpace(R, 1)
|
|
2058
|
+
sage: Q = P([a^2 + 2*a*b + 34, 1])
|
|
2059
|
+
sage: from sage.rings.polynomial.flatten import SpecializationMorphism
|
|
2060
|
+
sage: phi = SpecializationMorphism(P.coordinate_ring(), {a: 2, b: -1})
|
|
2061
|
+
sage: T = Q.specialization(phi=phi); T
|
|
2062
|
+
(34 : 1)
|
|
2063
|
+
sage: Q2 = P([a,1])
|
|
2064
|
+
sage: T2 = Q2.specialization(phi=phi)
|
|
2065
|
+
sage: T2.codomain() is T.codomain()
|
|
2066
|
+
True
|
|
2067
|
+
sage: T3 = Q2.specialization(phi=phi, ambient=T.codomain())
|
|
2068
|
+
sage: T3.codomain() is T.codomain()
|
|
2069
|
+
True
|
|
2070
|
+
|
|
2071
|
+
::
|
|
2072
|
+
|
|
2073
|
+
sage: R.<c> = PolynomialRing(QQ)
|
|
2074
|
+
sage: P.<x,y> = ProjectiveSpace(R, 1)
|
|
2075
|
+
sage: X = P.subscheme([x - c*y])
|
|
2076
|
+
sage: Q = X([c, 1])
|
|
2077
|
+
sage: Q2 = Q.specialization({c:2}); Q2
|
|
2078
|
+
(2 : 1)
|
|
2079
|
+
sage: Q2.codomain()
|
|
2080
|
+
Closed subscheme of Projective Space of dimension 1 over Rational Field
|
|
2081
|
+
defined by: x - 2*y
|
|
2082
|
+
|
|
2083
|
+
::
|
|
2084
|
+
|
|
2085
|
+
sage: R.<l> = PolynomialRing(QQ)
|
|
2086
|
+
sage: S.<k,j> = PolynomialRing(R)
|
|
2087
|
+
sage: K.<a,b,c,d> = S[]
|
|
2088
|
+
sage: P.<x,y> = ProjectiveSpace(K, 1)
|
|
2089
|
+
sage: H = End(P)
|
|
2090
|
+
sage: Q = P([a^2, b^2])
|
|
2091
|
+
sage: Q.specialization({a: 2})
|
|
2092
|
+
(4 : b^2)
|
|
2093
|
+
"""
|
|
2094
|
+
if D is None:
|
|
2095
|
+
if phi is None:
|
|
2096
|
+
raise ValueError("either the dictionary or the specialization must be provided")
|
|
2097
|
+
else:
|
|
2098
|
+
from sage.rings.polynomial.flatten import SpecializationMorphism
|
|
2099
|
+
phi = SpecializationMorphism(self.codomain().ambient_space().coordinate_ring(), D)
|
|
2100
|
+
if ambient is None:
|
|
2101
|
+
ambient = self.codomain()
|
|
2102
|
+
if isinstance(ambient, AlgebraicScheme_subscheme):
|
|
2103
|
+
ambient = ambient.specialization(phi=phi)
|
|
2104
|
+
else:
|
|
2105
|
+
ambient = ambient.change_ring(phi.codomain().base_ring())
|
|
2106
|
+
psi = ambient.ambient_space().coordinate_ring().hom([0 for i in range(ambient.ambient_space().ngens())], ambient.base_ring())
|
|
2107
|
+
return ambient([psi(phi(t)) for t in self])
|