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

Commit

Permalink
20676: changes from review, and spacing fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Grayson Jorgenson committed Jun 4, 2016
1 parent 0039d7b commit 9262ae5
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 11 deletions.
19 changes: 15 additions & 4 deletions src/sage/schemes/curves/affine_curve.py
Expand Up @@ -91,14 +91,17 @@ def __init__(self, A, X):
if d != 1:
raise ValueError("defining equations (=%s) define a scheme of dimension %s != 1"%(X,d))

def projective_closure(self, i=0):
def projective_closure(self, i=0, PP=None):
r"""
Return the projective closure of this affine curve.
INPUT:
- ``i`` - (default: 0) the index of the affine coordinate chart of the projective space that the affine ambient space
of this curve embeds into.
- ``i`` -- (default: 0) the index of the affine coordinate chart of the projective space that the affine
ambient space of this curve embeds into.
- ``PP`` -- (default: None) ambient projective space to compute the projective closure in. This is
constructed if it is not given.
OUTPUT:
Expand Down Expand Up @@ -127,9 +130,17 @@ def projective_closure(self, i=0):
sage: C.projective_closure(1)
Projective Plane Curve over Complex Field with 53 bits of precision defined by
x0^3 - x0*x1^2 + x1^3 - x1^2*x2
::
sage: A.<x,y> = AffineSpace(QQ, 2)
sage: P.<u,v,w> = ProjectiveSpace(QQ, 2)
sage: C = Curve([y - x^2], A)
sage: C.projective_closure(1, P).ambient_space() == P
True
"""
from constructor import Curve
return Curve(AlgebraicScheme_subscheme_affine.projective_closure(self, i))
return Curve(AlgebraicScheme_subscheme_affine.projective_closure(self, i, PP))

class AffinePlaneCurve(AffineCurve):
def __init__(self, A, f):
Expand Down
16 changes: 13 additions & 3 deletions src/sage/schemes/curves/projective_curve.py
Expand Up @@ -87,15 +87,17 @@ def __init__(self, A, X):
if d != 1:
raise ValueError("defining equations (=%s) define a scheme of dimension %s != 1"%(X,d))

def affine_patch(self, i):
def affine_patch(self, i, AA=None):
r"""
Return the i-th affine patch of this projective curve.
INPUT:
- ``i`` - affine coordinate chart of the projective ambient space of this curve to compute affine patch
- ``i`` -- affine coordinate chart of the projective ambient space of this curve to compute affine patch
with respect to.
- ``AA`` -- (default: None) ambient affine space, this is constructed if it is not given.
OUTPUT:
- a curve in affine space.
Expand All @@ -114,9 +116,17 @@ def affine_patch(self, i):
sage: C = Curve(x^3 - x^2*y + y^3 - x^2*z, P)
sage: C.affine_patch(1)
Affine Plane Curve over Rational Field defined by x0^3 - x0^2*x1 - x0^2 + 1
::
sage: A.<x,y> = AffineSpace(QQ, 2)
sage: P.<u,v,w> = ProjectiveSpace(QQ, 2)
sage: C = Curve([u^2 - v^2], P)
sage: C.affine_patch(1, A).ambient_space() == A
True
"""
from constructor import Curve
return Curve(AlgebraicScheme_subscheme_projective.affine_patch(self, i))
return Curve(AlgebraicScheme_subscheme_projective.affine_patch(self, i, AA))

class ProjectivePlaneCurve(ProjectiveCurve):
def __init__(self, A, f):
Expand Down
22 changes: 18 additions & 4 deletions src/sage/schemes/generic/algebraic_scheme.py
Expand Up @@ -1825,6 +1825,9 @@ def projective_embedding(self, i=None, PP=None):
Returns a morphism from this affine scheme into an ambient
projective space of the same dimension.
The codomain of this morphism is the projective closure of this affine scheme in ``PP``,
if given, or otherwise in a new projective space that is constructed.
INPUT:
- ``i`` -- integer (default: dimension of self = last
Expand Down Expand Up @@ -1912,8 +1915,8 @@ def projective_embedding(self, i=None, PP=None):
# Groebner basis w.r.t. a graded monomial order computed here to ensure
# after homogenization, the basis elements will generate the defining
# ideal of the projective closure of this affine subscheme
R = AA.coordinate_ring().change_ring(order='degrevlex')
G = R.ideal([R(f) for f in self.defining_polynomials()]).groebner_basis()
R = AA.coordinate_ring()
G = self.defining_ideal().groebner_basis()
v = list(PP.gens())
z = v.pop(i)
phi = R.hom(v,PR)
Expand All @@ -1925,7 +1928,7 @@ def projective_embedding(self, i=None, PP=None):
self.__projective_embedding[i] = phi
return phi

def projective_closure(self,i=None):
def projective_closure(self, i=None, PP=None):
r"""
Return the projective closure of this affine subscheme.
Expand All @@ -1935,6 +1938,9 @@ def projective_closure(self,i=None):
closure of this affine subscheme. The embedding used is the one which has a 1 in the
i-th coordinate, numbered from 0.
- ``PP`` -- (default: None) ambient projective space, i.e., ambient space
of codomain of morphism; this is constructed if it is not given.
OUTPUT:
- a projective subscheme.
Expand All @@ -1952,8 +1958,16 @@ def projective_closure(self,i=None):
x0*x2 - x3*x4,
x1*x2 - x0*x3,
x2^2 - x1*x3
::
sage: A.<x,y,z> = AffineSpace(QQ, 3)
sage: P.<a,b,c,d> = ProjectiveSpace(QQ, 3)
sage: X = A.subscheme([z - x^2 - y^2])
sage: X.projective_closure(1, P).ambient_space() == P
True
"""
return self.projective_embedding(i).codomain()
return self.projective_embedding(i, PP).codomain()

def is_smooth(self, point=None):
r"""
Expand Down

0 comments on commit 9262ae5

Please sign in to comment.