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

Commit

Permalink
Fixes for reviewer comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu committed Aug 22, 2022
1 parent 3947c02 commit ac60efe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/sage/schemes/elliptic_curves/ell_curve_isogeny.py
Original file line number Diff line number Diff line change
Expand Up @@ -2652,7 +2652,7 @@ def scaling_factor(self):
sc *= self.__post_isomorphism.scaling_factor()
return sc

def morphism(self):
def as_morphism(self):
r"""
Return this isogeny as a morphism of projective schemes.
Expand All @@ -2662,7 +2662,7 @@ def morphism(self):
sage: E = EllipticCurve(k, [1,1])
sage: Q = E(6,5)
sage: phi = E.isogeny(Q)
sage: mor = phi.morphism()
sage: mor = phi.as_morphism()
sage: mor.domain() == E
True
sage: mor.codomain() == phi.codomain()
Expand Down
26 changes: 16 additions & 10 deletions src/sage/schemes/projective/projective_morphism.py
Original file line number Diff line number Diff line change
Expand Up @@ -2268,8 +2268,11 @@ def __call__(self, x):
"""
try:
reprs = self.representatives()
except NotImplementedError:
reprs = [self.defining_polynomials()]
except NotImplementedError: # Singular does not support the base field
try:
return super(SchemeMorphism_polynomial_projective_subscheme_field, self).__call__(x)
except ValueError:
raise ValueError('cannot apply the morphism to this point')

for m in reprs:
try:
Expand Down Expand Up @@ -2382,13 +2385,13 @@ def representatives(self):
reprs.append(hom([f / f0 for f in r[1:]]))
return reprs

if not X.is_irreducible():
raise ValueError("domain is not an irreducible scheme")

if not (X.base_ring() in _NumberFields or
X.base_ring() in _FiniteFields):
raise NotImplementedError("base ring {} is not supported by Singular".format(X.base_ring()))

if not X.is_irreducible():
raise ValueError("domain is not an irreducible scheme")

# prepare homogeneous coordinate ring of X in Singular
from sage.rings.polynomial.term_order import TermOrder
T = TermOrder('degrevlex')
Expand Down Expand Up @@ -2595,6 +2598,7 @@ def image(self):
gens = [g.subs(dict(zip(R.gens()[n:],T.gens()))) for g in j]
return AY.subscheme(gens)

@cached_method
def graph(self):
"""
Return the graph of this morphism.
Expand Down Expand Up @@ -2648,13 +2652,15 @@ def graph(self):
# I + (y_iF_j - y_jF_i : 0 <= i, j <= m)
#
# saturated with respect to (F_0, F_1, ..., F_m).
n1 = n + 1; m1 = m + 1
n1 = n + 1
m1 = m + 1
I = X.defining_ideal().change_ring(R)
h = [g[n1 + i] * F[j] - g[n1 + j] * F[i] for i in range(m1) for j in range(i + 1, m1)]
J, _ = (I + R.ideal(h)).saturation(R.ideal(F))

return AXY.subscheme(J)

@cached_method
def projective_degrees(self):
"""
Return the projective degrees of this rational map.
Expand All @@ -2665,9 +2671,9 @@ def projective_degrees(self):
sage: E = EllipticCurve(k,[1,1])
sage: Q = E(6,5)
sage: phi = E.multiplication_by_m_isogeny(2)
sage: mor = phi.morphism()
sage: mor = phi.as_morphism()
sage: mor.projective_degrees()
[12, 3]
(12, 3)
"""
X = self.domain()
Y = self.codomain()
Expand Down Expand Up @@ -2695,7 +2701,7 @@ def projective_degrees(self):
n = AX.dimension()
m = AY.dimension()
k = X.dimension()
return [poly.monomial_coefficient(L.monomial(n - i, m - k + i)) for i in range(k + 1)]
return tuple(poly.monomial_coefficient(L.monomial(n - i, m - k + i)) for i in range(k + 1))

def degree(self):
"""
Expand All @@ -2707,7 +2713,7 @@ def degree(self):
sage: E = EllipticCurve(k,[1,1])
sage: Q = E(6,5)
sage: phi = E.multiplication_by_m_isogeny(2)
sage: mor = phi.morphism()
sage: mor = phi.as_morphism()
sage: mor.degree()
4
"""
Expand Down

0 comments on commit ac60efe

Please sign in to comment.