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

Commit

Permalink
19552: forward and preimages of projective subschemes
Browse files Browse the repository at this point in the history
  • Loading branch information
bhutz committed Nov 9, 2015
1 parent 8a972ca commit 28404d4
Show file tree
Hide file tree
Showing 5 changed files with 383 additions and 82 deletions.
108 changes: 107 additions & 1 deletion src/sage/schemes/generic/algebraic_scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
# class AlgebraicScheme_subscheme_affine_toric
# class AlgebraicScheme_quasi


from copy import copy
from sage.categories.number_fields import NumberFields

from sage.rings.all import ZZ
Expand Down Expand Up @@ -2208,6 +2208,112 @@ def is_smooth(self, point=None):
self._smooth = (sing_dim <= 0)
return self._smooth

def orbit(self, f, N):
r"""
Returns the orbit of `self` by ``f``. If `N` is an integer it returns `[self,f(self),\ldots,f^N(self)]`.
If `N` is a list or tuple `N=[m,k]` it returns `[f^m(self),\ldots,f^k(self)`].
Perform the checks on subscheme initialization if ``check=True``
INPUT:
- ``f`` -- a :class:`SchemeMorphism_polynomial` with ``self`` in ``f.domain()``
- ``N`` -- a non-negative integer or list or tuple of two non-negative integers
OUTPUT:
- a proejctive subscheme
EXAMPLES::
sage: P.<x,y,z,w> = ProjectiveSpace(QQ, 3)
sage: H = End(P)
sage: f = H([(x-2*y)^2,(x-2*z)^2,(x-2*w)^2,x^2])
sage: f.orbit(P.subscheme([x]),5)
[Closed subscheme of Projective Space of dimension 3 over Rational Field
defined by:
x,
Closed subscheme of Projective Space of dimension 3 over Rational Field
defined by:
w,
Closed subscheme of Projective Space of dimension 3 over Rational Field
defined by:
z - w,
Closed subscheme of Projective Space of dimension 3 over Rational Field
defined by:
y - z,
Closed subscheme of Projective Space of dimension 3 over Rational Field
defined by:
x - y,
Closed subscheme of Projective Space of dimension 3 over Rational Field
defined by:
x - w]
"""
if not f.is_endomorphism():
raise TypeError("Map must be an endomorphism for iteration.")
if (isinstance(N,(list,tuple)) == False):
N = [0,N]
try:
N[0] = ZZ(N[0])
N[1] = ZZ(N[1])
except TypeError:
raise TypeError("Orbit bounds must be integers")
if N[0] < 0 or N[1] < 0:
raise TypeError("Orbit bounds must be non-negative")
if N[0] > N[1]:
return([])

Q = copy(self)
for i in range(1, N[0]+1):
Q = f(Q)
Orb = [Q]

for i in range(N[0]+1, N[1]+1):
Q = f(Q)
Orb.append(Q)
return(Orb)

def nth_iterate(self, f, n , **kwds):
r"""
For a subscheme ``self`` and a map `f` this function returns
the nth iterate of `self` by ``f``.
INPUT:
- ``f`` -- a SchmemMorphism_polynomial with ``self`` in ``f.domain()``
- ``n`` -- a positive integer.
OUTPUT:
- A subscheme in ``f.codomain()``
EXAMPLES::
sage: P.<x,y,z,w> = ProjectiveSpace(QQ, 3)
sage: H = End(P)
sage: f = H([y^2, z^2, x^2, w^2])
sage: f.nth_iterate(P.subscheme([x-w,y-z]), 3)
Closed subscheme of Projective Space of dimension 3 over Rational Field
defined by:
y - z,
x - w
"""
if not f.is_endomorphism():
raise TypeError("Map must be an endomorphism for iteration.")
try:
n = ZZ(n)
except TypeError:
raise TypeError("Iterate number must be an integer")
if n < 0:
raise TypeError("Must be a forward orbit")
if n == 0:
return(self)
else:
Q = f(self)
for i in range(2,n+1):
Q = f(Q)
return(Q)

class AlgebraicScheme_subscheme_product_projective(AlgebraicScheme_subscheme_projective):

Expand Down
23 changes: 9 additions & 14 deletions src/sage/schemes/generic/morphism.py
Original file line number Diff line number Diff line change
Expand Up @@ -1050,12 +1050,7 @@ def _call_(self, x):
sage: H=Hom(X,X)
sage: f=H([x^2,y^2,z^2]);
sage: f(P([4,4,1]))
Traceback (most recent call last):
...
TypeError: (4 : 4 : 1) fails to convert into the map's domain
Closed subscheme of Projective Space of dimension 2 over Integer
Ring defined by:
x^2 - y^2, but a `pushforward` method is not properly implemented
(16 : 16 : 1)
"""
# Checks were done in __call__
P = [f(x._coords) for f in self.defining_polynomials()]
Expand Down Expand Up @@ -1134,16 +1129,16 @@ def _call_with_args(self, x, args, kwds):
::
sage: P.<x,y,z>=ProjectiveSpace(ZZ,2)
sage: X=P.subscheme(x^2-y^2);
sage: H=Hom(X,X)
sage: f=H([x^2,y^2,z^2]);
sage: f(P([4,4,1]))
sage: P.<x,y,z> = ProjectiveSpace(ZZ, 2)
sage: P2.<u,v,w,t> = ProjectiveSpace(ZZ, 3)
sage: X = P.subscheme(x^2-y^2);
sage: H = Hom(X, X)
sage: f = H([x^2, y^2, z^2]);
sage: f(P2([4,4,1,1]))
Traceback (most recent call last):
...
TypeError: (4 : 4 : 1) fails to convert into the map's domain
Closed subscheme of Projective Space of dimension 2 over
Integer Ring defined by:
TypeError: (4 : 4 : 1 : 1) fails to convert into the map's domain Closed subscheme of
Projective Space of dimension 2 over Integer Ring defined by:
x^2 - y^2, but a `pushforward` method is not properly implemented
"""
if args:
Expand Down

0 comments on commit 28404d4

Please sign in to comment.