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

Commit

Permalink
Added functionality and example for subschemes
Browse files Browse the repository at this point in the history
  • Loading branch information
albjoao committed Nov 12, 2014
1 parent 325da8b commit 964c524
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/sage/schemes/projective/projective_morphism.py
Expand Up @@ -1149,17 +1149,27 @@ def is_morphism(self):
sage: f = H([x*z-t*y^2,x^2-y^2,t*z^2])
sage: f.is_morphism()
True
::
sage: P.<x,y,z> = ProjectiveSpace(QQ,2)
sage: X = P.subscheme([x^2 - z^2])
sage: H = Hom(X,X)
sage: f= H([x^2 + z^2, 3*y^2, z^2 - 2*x^2])
sage: f.is_morphism()
True
"""
from sage.schemes.projective.projective_space import is_ProjectiveSpace
if is_ProjectiveSpace(self.domain()) is False or is_ProjectiveSpace(self.codomain()) is False:
if is_ProjectiveSpace(self.domain().ambient_space()) is False or is_ProjectiveSpace(self.codomain().ambient_space()) is False:
raise NotImplementedError
R = self.coordinate_ring()
F = self._polys
defpolys = self.domain().defining_polynomials()
if R.base_ring().is_field():
J = R.ideal(F)
J = R.ideal(F + defpolys)
else:
S = PolynomialRing(R.base_ring().fraction_field(), R.gens(), R.ngens())
J = S.ideal([S.coerce(F[i]) for i in range(R.ngens())])
J = S.ideal([S.coerce(F[i]) for i in range(R.ngens())] + defpolys)
if J.dimension() > 0:
return False
else:
Expand Down

0 comments on commit 964c524

Please sign in to comment.