Skip to content

Commit

Permalink
Fixes for reviewer comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu committed Nov 22, 2023
1 parent f96f952 commit 741fbc7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
13 changes: 7 additions & 6 deletions src/sage/schemes/curves/affine_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -2194,18 +2194,19 @@ def pull_from_function_field(self, f):
sage: C.function(C.pull_from_function_field(f2)) == f2
True
"""
return self._pull_from_function_field(f)
return self._map_from_function_field(f)

@lazy_attribute
def _nonsingular_model(self):
"""
Return the data of a nonsingular model of the curve.
The data consists of an abstract function field `M` and a map from the
The data consists of an abstract function field `M`, a map from the
fraction field of the coordinate ring `R` of the ambient space of the
curve to the function field. The coordinate ring of the curve is the
quotient of `R` by the kernel of the map restricted to `R`.
curve to the function field, and the inverse map.
The coordinate ring of the curve is the quotient of `R` by the kernel
of the map restricted to `R`.
TESTS::
Expand Down Expand Up @@ -2406,15 +2407,15 @@ def _coordinate_functions(self):
return self._nonsingular_model[1].im_gens()

@lazy_attribute
def _pull_from_function_field(self):
def _map_from_function_field(self):
"""
Return the map from the function field of the curve.
TESTS::
sage: A.<x,y,z> = AffineSpace(GF(11), 3)
sage: C = Curve([x*z - y^2, y - z^2, x - y*z], A)
sage: C._pull_from_function_field
sage: C._map_from_function_field
Ring morphism:
From: Function field in z defined by z^3 + 10*x
To: Fraction Field of Multivariate Polynomial Ring in x, y, z
Expand Down
10 changes: 5 additions & 5 deletions src/sage/schemes/curves/projective_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -2410,7 +2410,7 @@ def pull_from_function_field(self, f):
sage: C.function(C.pull_from_function_field(f2)) == f2
True
"""
return self._pull_from_function_field(f)
return self._map_from_function_field(f)

@lazy_attribute
def _function_field(self):
Expand Down Expand Up @@ -2465,7 +2465,7 @@ def _coordinate_functions(self):
return tuple(coords)

@lazy_attribute
def _pull_from_function_field(self):
def _map_from_function_field(self):
"""
Return the map to the function field of the curve.
Expand All @@ -2475,21 +2475,21 @@ def _pull_from_function_field(self):
sage: C = Curve(y^2*z^7 - x^9 - x*z^8)
sage: F = C.function_field()
sage: f = F.random_element()
sage: C.function(C._pull_from_function_field(f)) == f
sage: C.function(C._map_from_function_field(f)) == f
True
"""
F = self._function_field
S = self.ambient_space().coordinate_ring()
phi = self._open_affine._nonsingular_model[2]
i = self._open_affine_index

def pull(f):
def m(f):
pf = phi(f)
num = S(pf.numerator()).homogenize(i)
den = S(pf.denominator()).homogenize(i)
return num / den * S.gen(i) ** (den.total_degree() - num.total_degree())

return pull
return m

@lazy_attribute
def _singularities(self):
Expand Down

0 comments on commit 741fbc7

Please sign in to comment.