Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Add some methods to projective morphisms
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu committed Jun 11, 2022
1 parent 59226b1 commit 4c2e151
Show file tree
Hide file tree
Showing 5 changed files with 229 additions and 70 deletions.
1 change: 0 additions & 1 deletion src/doc/en/reference/documentation/conf.py

This file was deleted.

30 changes: 30 additions & 0 deletions src/sage/schemes/elliptic_curves/ell_curve_isogeny.py
Original file line number Diff line number Diff line change
Expand Up @@ -2768,6 +2768,36 @@ def x_rational_map(self):
self.__initialize_rational_maps()
return self.__X_coord_rational_map

def morphism(self):
r"""
Return this isogeny as a morphism of projective schemes.
EXAMPLES::
sage: k = GF(11)
sage: E = EllipticCurve(k, [1,1])
sage: Q = E(6,5)
sage: phi = E.isogeny(Q)
sage: mor = phi.morphism()
sage: mor.domain() == E
True
sage: mor.codomain() == phi.codomain()
True
sage: mor(Q) == phi(Q)
True
TESTS::
sage: mor(0*Q)
(0 : 1 : 0)
sage: mor(1*Q)
(0 : 1 : 0)
"""
from sage.schemes.curves.constructor import Curve
X_affine = Curve(self.domain()).affine_patch(2)
Y_affine = Curve(self.codomain()).affine_patch(2)
return X_affine.hom(self.rational_maps(), Y_affine).homogenize(2)

def kernel_polynomial(self):
r"""
Return the kernel polynomial of this isogeny.
Expand Down
4 changes: 0 additions & 4 deletions src/sage/schemes/plane_conics/con_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,10 +874,6 @@ def parametrization(self, point=None, morphism=True):
sage: f([1,1])
(0 : 0 : 1)
sage: g([0,0,1])
Traceback (most recent call last):
...
ValueError: [0, 0] does not define a point in Projective Space of dimension 1 over Finite Field of size 2 since all entries are zero
sage: g.representatives()[1]([0,0,1])
(1 : 1)
An example with ``morphism = False`` ::
Expand Down
102 changes: 47 additions & 55 deletions src/sage/schemes/product_projective/space.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
r"""
Products of projective spaces
This class builds on the projective space class and its point and morphism classes.
This class builds on the projective space class and its point and morphism
classes.
Products of projective spaces of varying dimension are convenient
ambient spaces for complete intersections.
Products of projective spaces of varying dimension are convenient ambient
spaces for complete intersections.
Group actions on them, and
the interplay with representation theory, provide many interesting
examples of algebraic varieties.
Group actions on them, and the interplay with representation theory, provide
many interesting examples of algebraic varieties.
EXAMPLES:
Expand All @@ -28,6 +28,7 @@
sage: P2xP2.coordinate_ring().inject_variables()
Defining x0, x1, x2, y0, y1, y2
"""

#*****************************************************************************
# Copyright (C) 2014 Volker Braun <[email protected]>
# Copyright (C) 2014 Ben Hutz <[email protected]>
Expand All @@ -39,7 +40,6 @@
# http://www.gnu.org/licenses/
#*****************************************************************************


from sage.misc.cachefunc import cached_method
from sage.misc.misc_c import prod
from sage.rings.all import (PolynomialRing, QQ, Integer, CommutativeRing)
Expand Down Expand Up @@ -81,16 +81,17 @@ def ProductProjectiveSpaces(n, R=None, names='x'):
r"""
Return the Cartesian product of projective spaces.
Can input either a list of projective space over the same base \
ring or the list of dimensions, the base ring, and the variable names.
The input ``n`` is either a list of projective space over the same base
ring or the list of dimensions, ``R`` the base ring, and ``names`` the
variable names.
INPUT:
- ``n`` -- a list of integers or a list of projective spaces.
- ``n`` -- a list of integers or a list of projective spaces
- ``R`` -- a ring.
- ``R`` -- a ring
- ``names`` -- a string or list of strings.
- ``names`` -- a string or list of strings
EXAMPLES::
Expand Down Expand Up @@ -120,7 +121,7 @@ def ProductProjectiveSpaces(n, R=None, names='x'):
if R is None:
R = QQ # default is the rationals
if isinstance(n[0], ProjectiveSpace_ring):
#this should be a list of projective spaces
# this should be a list of projective spaces
names = []
N = []
R = None
Expand All @@ -146,15 +147,15 @@ def ProductProjectiveSpaces(n, R=None, names='x'):
if not isinstance(R, CommutativeRing):
raise ValueError("must be a commutative ring")
from sage.structure.category_object import normalize_names
n_vars = sum(d+1 for d in n)
n_vars = sum(d + 1 for d in n)
if isinstance(names, str):
names = normalize_names(n_vars, names)
else:
name_list = list(names)
if len(name_list) == len(n):
names = []
for name, dim in zip(name_list, n):
names += normalize_names(dim+1, name)
names += normalize_names(dim + 1, name)
else:
n_vars = sum(1+d for d in n)
names = normalize_names(n_vars, name_list)
Expand Down Expand Up @@ -196,12 +197,12 @@ def __init__(self, N, R = QQ, names = None):
INPUT:
- ``N`` - a list or tuple of positive integers.
- ``N`` -- a list or tuple of positive integers
- ``R`` - a ring.
- ``R`` -- a ring
- ``names`` - a tuple or list of strings. This must either be a single variable name
or the complete list of variables.
- ``names`` -- a tuple or list of strings; this must either be a single
variable name or the complete list of variables
EXAMPLES::
Expand Down Expand Up @@ -236,38 +237,33 @@ def __init__(self, N, R = QQ, names = None):
for i in range(len(N)):
self._components.append(ProjectiveSpace(N[i],R,names[start:start+N[i]+1]))
start += N[i]+1
#Note that the coordinate ring should really be the tensor product of the component
#coordinate rings. But we just deal with them as multihomogeneous polynomial rings
# Note that the coordinate ring should really be the tensor product of
# the component coordinate rings. But we just deal with them as
# multihomogeneous polynomial rings.
self._coordinate_ring = PolynomialRing(R,sum(N)+ len(N),names)
self._assign_names(names)

def _repr_(self):
r"""
Return a string representation of this space.
OUTPUT: String.
EXAMPLES::
sage: ProductProjectiveSpaces([1, 1, 1], ZZ, ['x', 'y', 'z', 'u', 'v', 'w'])
Product of projective spaces P^1 x P^1 x P^1 over Integer Ring
"""
return ''.join([
'Product of projective spaces ',
' x '.join('P^{0}'.format(d) for d in self._dims),
' over ',
str(self.base_ring())])
return ''.join(['Product of projective spaces ',
' x '.join('P^{0}'.format(d) for d in self._dims),
' over ', str(self.base_ring())])

def _repr_generic_point(self, v=None):
"""
Return a string representation of the generic point
on this product space.
If ``v`` is None, the representation of the generic point of
If ``v`` is ``None``, the representation of the generic point of
the product space is returned.
OUTPUT: String.
EXAMPLES::
sage: T = ProductProjectiveSpaces([1, 2, 1], QQ, 'x')
Expand Down Expand Up @@ -318,9 +314,9 @@ def __getitem__(self, i):
INPUT:
- ``i`` - a positive integer.
- ``i`` -- a positive integer
OUTPUT: A projective space.
OUTPUT: a projective space
EXAMPLES::
Expand Down Expand Up @@ -416,7 +412,7 @@ def __mul__(self, right):
INPUT:
- ``right`` - a projective space, product of projective spaces, or subscheme.
- ``right`` -- a projective space, product of projective spaces, or subscheme
OUTPUT: a product of projective spaces or subscheme
Expand Down Expand Up @@ -476,7 +472,7 @@ def components(self):
r"""
Return the components of this product of projective spaces.
OUTPUT: A list of projective spaces.
OUTPUT: a list of projective spaces
EXAMPLES::
Expand All @@ -491,7 +487,7 @@ def dimension_relative(self):
r"""
Return the relative dimension of the product of projective spaces.
OUTPUT: A positive integer.
OUTPUT: a positive integer
EXAMPLES::
Expand All @@ -505,7 +501,7 @@ def dimension_absolute(self):
r"""
Return the absolute dimension of the product of projective spaces.
OUTPUT: A positive integer.
OUTPUT: a positive integer
EXAMPLES::
Expand All @@ -526,7 +522,7 @@ def dimension_relative_components(self):
r"""
Return the relative dimension of the product of projective spaces.
OUTPUT: A list of positive integers.
OUTPUT: a list of positive integers
EXAMPLES::
Expand All @@ -540,7 +536,7 @@ def dimension_absolute_components(self):
r"""
Return the absolute dimension of the product of projective spaces.
OUTPUT: A list of positive integers.
OUTPUT: a list of positive integers
EXAMPLES::
Expand All @@ -561,7 +557,7 @@ def num_components(self):
r"""
Returns the number of components of this space.
OUTPUT: An integer.
OUTPUT: an integer
EXAMPLES::
Expand All @@ -578,7 +574,7 @@ def ngens(self):
This is the number of variables in the coordinate ring of the
projective space.
OUTPUT: An integer.
OUTPUT: an integer
EXAMPLES::
Expand All @@ -594,9 +590,9 @@ def _factors(self, v):
INPUT:
- ``v`` -- a list or tuple.
- ``v`` -- a list or tuple
OUTPUT: A list of lists.
OUTPUT: a list of lists
EXAMPLES::
Expand All @@ -622,11 +618,9 @@ def _degree(self, polynomial):
INPUT:
A polynomial in :meth:`coordinate_ring`.
- ``polynomial`` -- a polynomial in the coordinate_ring
OUTPUT:
A tuple of integers, one for each projective space component. A
OUTPUT: A tuple of integers, one for each projective space component. A
``ValueError`` is raised if the polynomial is not multihomogeneous.
EXAMPLES::
Expand Down Expand Up @@ -832,7 +826,7 @@ def subscheme(self, X):
INPUT:
- ``X`` - a list or tuple of equations.
- ``X`` -- a list or tuple of equations
OUTPUT:
Expand Down Expand Up @@ -872,7 +866,7 @@ def change_ring(self, R):
INPUT:
- ``R`` -- commutative ring or morphism.
- ``R`` -- commutative ring or morphism
OUTPUT:
Expand Down Expand Up @@ -1152,15 +1146,13 @@ def points_of_bounded_height(self, **kwds):
INPUT:
- ``bound`` - a real number
- ``bound`` -- a real number
- ``tolerance`` - a rational number in (0,1] used in doyle-krumm algorithm-4
- ``tolerance`` -- a rational number in (0,1] used in doyle-krumm algorithm-4
- ``precision`` - the precision to use for computing the elements of bounded height of number fields.
OUTPUT:
- ``precision`` -- the precision to use for computing the elements of bounded height of number fields.
- an iterator of points in this space
OUTPUT: an iterator of points in this space
EXAMPLES::
Expand Down
Loading

0 comments on commit 4c2e151

Please sign in to comment.