Skip to content

Commit

Permalink
Trac #17118: Added multiplier computation to affine morphism
Browse files Browse the repository at this point in the history
Implement function to compute multipliers for periodic points of affine
morphisms.

URL: http://trac.sagemath.org/17118
Reported by: gjorgenson
Ticket author(s): Grayson Jorgenson
Reviewer(s): Ben Hutz
  • Loading branch information
Release Manager authored and vbraun committed Oct 29, 2014
2 parents 22f3e28 + e83be23 commit 9b0995d
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 8 deletions.
86 changes: 84 additions & 2 deletions src/sage/schemes/affine/affine_morphism.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@

from sage.calculus.functions import jacobian
from sage.categories.homset import Hom
from sage.matrix.constructor import matrix, identity_matrix
from sage.misc.misc import prod
from sage.rings.all import Integer, moebius
from sage.rings.arith import lcm, gcd
from sage.rings.complex_field import ComplexField
from sage.rings.finite_rings.constructor import GF, is_PrimeFiniteField
from sage.rings.fraction_field import FractionField
from sage.rings.integer_ring import ZZ
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.quotient_ring import QuotientRing_generic
Expand Down Expand Up @@ -704,7 +706,7 @@ def global_height(self,prec=None):
def jacobian (self):
r"""
Returns the Jacobian matrix of partial derivitive of ``self`` in which the
``(i,j)`` entry of the Jacobian matrix is the partial derivative ``diff(functions[i], variables[j]``.
``(i,j)`` entry of the Jacobian matrix is the partial derivative ``diff(functions[i], variables[j])``.
OUTPUT:
Expand Down Expand Up @@ -740,9 +742,89 @@ def jacobian (self):
return self.__jacobian
except AttributeError:
pass
self.__jacobian = jacobian(list(self),self.domain().gens())
self.__jacobian = jacobian(list(self),self.domain().ambient_space().gens())
return self.__jacobian

def multiplier(self, P, n, check=True):
r"""
Returns the multiplier of ``self`` at the point ``P`` of period ``n``.
``self`` must be an endomorphism.
INPUT:
- ``P`` - a point on domain of ``self``
- ``n`` - a positive integer, the period of ``P``
- ``check`` -- verify that ``P`` has period ``n``, Default:True
OUTPUT:
- a square matrix of size ``self.codomain().dimension_relative()`` in the ``base_ring`` of ``self``
EXAMPLES::
sage: P.<x,y> = AffineSpace(QQ,2)
sage: H = End(P)
sage: f = H([x^2,y^2])
sage: f.multiplier(P([1,1]),1)
[2 0]
[0 2]
::
sage: P.<x,y,z> = AffineSpace(QQ,3)
sage: H = End(P)
sage: f = H([x,y^2,z^2 - y])
sage: f.multiplier(P([1/2,1,0]),2)
[1 0 0]
[0 4 0]
[0 0 0]
::
sage: P.<x> = AffineSpace(CC,1)
sage: H = End(P)
sage: f = H([x^2 + 1/2])
sage: f.multiplier(P([0.5 + 0.5*I]),1)
[1.00000000000000 + 1.00000000000000*I]
::
sage: R.<t> = PolynomialRing(CC,1)
sage: P.<x> = AffineSpace(R,1)
sage: H = End(P)
sage: f = H([x^2 - t^2 + t])
sage: f.multiplier(P([-t + 1]),1)
[(-2.00000000000000)*t + 2.00000000000000]
::
sage: P.<x,y> = AffineSpace(QQ,2)
sage: X=P.subscheme([x^2-y^2])
sage: H = End(X)
sage: f = H([x^2,y^2])
sage: f.multiplier(X([1,1]),1)
[2 0]
[0 2]
"""
if not self.is_endomorphism():
raise TypeError("Must be an endomorphism")
if check:
if self.nth_iterate(P, n) != P:
raise ValueError("%s is not periodic of period %s" % (P, n))
if n < 1:
raise ValueError("Period must be a positive integer")
N = self.domain().ambient_space().dimension_relative()
l = identity_matrix(FractionField(self.codomain().base_ring()), N, N)
Q = P
J = self.jacobian()
for i in range(0, n):
R = self(Q)
l = J(tuple(Q))*l #chain rule matrix multiplication
Q = R
return l

class SchemeMorphism_polynomial_affine_space_field(SchemeMorphism_polynomial_affine_space):
pass

Expand Down
12 changes: 6 additions & 6 deletions src/sage/schemes/projective/projective_morphism.py
Original file line number Diff line number Diff line change
Expand Up @@ -1699,8 +1699,8 @@ def height_difference_bound(self, prec=None):

def multiplier(self, P, n, check=True):
r"""
Returns the multiplier of ``self`` at the `QQ`-rational point ``P`` of period ``n``.
``self`` must be an endomorphism of projective space
Returns the multiplier of ``self`` point ``P`` of period ``n``.
``self`` must be an endomorphism.
INPUT:
Expand Down Expand Up @@ -1767,15 +1767,15 @@ def multiplier(self, P, n, check=True):
Traceback (most recent call last):
...
ValueError: (0 : 1) is not periodic of period 1
.. TODO:: would be better to keep the dehomogenizations for reuse
"""
if not self.is_endomorphism():
raise NotImplementedError("Must be an endomorphism of projective space")
raise TypeError("Must be an endomorphism")
if check:
if self.nth_iterate(P, n) != P:
raise ValueError("%s is not periodic of period %s" % (P, n))
N = self.domain().dimension_relative()
if n < 1:
raise ValueError("Period must be a positive integer")
N = self.domain().ambient_space().dimension_relative()
l = identity_matrix(FractionField(self.codomain().base_ring()), N, N)
Q = P
Q.normalize_coordinates()
Expand Down

0 comments on commit 9b0995d

Please sign in to comment.