Path: blob/master/src/sage/schemes/hyperelliptic_curves/jacobian_generic.py
8821 views
"""1Jacobian of a General Hyperelliptic Curve2"""34#*****************************************************************************5# Copyright (C) 2006 David Kohel <[email protected]>6# Distributed under the terms of the GNU General Public License (GPL)7# http://www.gnu.org/licenses/8#*****************************************************************************910from sage.rings.all import Integer11from sage.schemes.jacobians.abstract_jacobian import Jacobian_generic12import jacobian_homset13import jacobian_morphism1415class HyperellipticJacobian_generic(Jacobian_generic):16"""17EXAMPLES::1819sage: FF = FiniteField(2003)20sage: R.<x> = PolynomialRing(FF)21sage: f = x**5 + 1184*x**3 + 1846*x**2 + 956*x + 56022sage: C = HyperellipticCurve(f)23sage: J = C.jacobian()24sage: a = x**2 + 376*x + 245; b = 1015*x + 136825sage: X = J(FF)26sage: D = X([a,b])27sage: D28(x^2 + 376*x + 245, y + 988*x + 635)29sage: J(0)30(1)31sage: D == J([a,b])32True33sage: D == D + J(0)34True3536An more extended example, demonstrating arithmetic in J(QQ) and37J(K) for a number field K/QQ.3839::4041sage: P.<x> = PolynomialRing(QQ)42sage: f = x^5 - x + 1; h = x43sage: C = HyperellipticCurve(f,h,'u,v')44sage: C45Hyperelliptic Curve over Rational Field defined by v^2 + u*v = u^5 - u + 146sage: PP = C.ambient_space()47sage: PP48Projective Space of dimension 2 over Rational Field49sage: C.defining_polynomial()50-x0^5 + x0*x1*x2^3 + x1^2*x2^3 + x0*x2^4 - x2^551sage: C(QQ)52Set of rational points of Hyperelliptic Curve over Rational Field defined by v^2 + u*v = u^5 - u + 153sage: K.<t> = NumberField(x^2-2)54sage: C(K)55Set of rational points of Hyperelliptic Curve over Number Field in t with defining polynomial x^2 - 2 defined by v^2 + u*v = u^5 - u + 156sage: P = C(QQ)(0,1,1); P57(0 : 1 : 1)58sage: P == C(0,1,1)59True60sage: C(0,1,1).parent()61Set of rational points of Hyperelliptic Curve over Rational Field defined by v^2 + u*v = u^5 - u + 162sage: P1 = C(K)(P)63sage: P2 = C(K)([2,4*t-1,1])64sage: P3 = C(K)([-1/2,1/8*(7*t+2),1])65sage: P1, P2, P366((0 : 1 : 1), (2 : 4*t - 1 : 1), (-1/2 : 7/8*t + 1/4 : 1))67sage: J = C.jacobian()68sage: J69Jacobian of Hyperelliptic Curve over Rational Field defined by v^2 + u*v = u^5 - u + 170sage: Q = J(QQ)(P); Q71(u, v - 1)72sage: for i in range(6): Q*i73(1)74(u, v - 1)75(u^2, v + u - 1)76(u^2, v + 1)77(u, v + 1)78(1)79sage: Q1 = J(K)(P1); print "%s -> %s"%( P1, Q1 )80(0 : 1 : 1) -> (u, v - 1)81sage: Q2 = J(K)(P2); print "%s -> %s"%( P2, Q2 )82(2 : 4*t - 1 : 1) -> (u - 2, v - 4*t + 1)83sage: Q3 = J(K)(P3); print "%s -> %s"%( P3, Q3 )84(-1/2 : 7/8*t + 1/4 : 1) -> (u + 1/2, v - 7/8*t - 1/4)85sage: R.<x> = PolynomialRing(K)86sage: Q4 = J(K)([x^2-t,R(1)])87sage: for i in range(4): Q4*i88(1)89(u^2 - t, v - 1)90(u^2 + (-3/4*t - 9/16)*u + 1/2*t + 1/4, v + (-1/32*t - 57/64)*u + 1/2*t + 9/16)91(u^2 + (1352416/247009*t - 1636930/247009)*u - 1156544/247009*t + 1900544/247009, v + (-2326345442/122763473*t + 3233153137/122763473)*u + 2439343104/122763473*t - 3350862929/122763473)92sage: R2 = Q2*5; R293(u^2 - 3789465233/116983808*u - 267915823/58491904, v + (-233827256513849/1789384327168*t + 1/2)*u - 15782925357447/894692163584*t)94sage: R3 = Q3*5; R395(u^2 + 5663300808399913890623/14426454798950909645952*u - 26531814176395676231273/28852909597901819291904, v + (253155440321645614070860868199103/2450498420175733688903836378159104*t + 1/2)*u + 2427708505064902611513563431764311/4900996840351467377807672756318208*t)96sage: R4 = Q4*5; R497(u^2 - 3789465233/116983808*u - 267915823/58491904, v + (233827256513849/1789384327168*t + 1/2)*u + 15782925357447/894692163584*t)98sage: # Thus we find the following identity:99sage: 5*Q2 + 5*Q4100(1)101sage: # Moreover the following relation holds in the 5-torsion subgroup:102sage: Q2 + Q4 == 2*Q1103True104"""105106def dimension(self):107"""108Return the dimension of this Jacobian.109110OUTPUT:111Integer112113EXAMPLES::114115sage: k.<a> = GF(9); R.<x> = k[]116sage: HyperellipticCurve(x^3 + x - 1, x+a).jacobian().dimension()1171118sage: g = HyperellipticCurve(x^6 + x - 1, x+a).jacobian().dimension(); g1192120sage: type(g)121<type 'sage.rings.integer.Integer'>122"""123return Integer(self.curve().genus())124125def point(self, mumford, check=True):126try:127return self(self.base_ring())(mumford)128except AttributeError:129raise ValueError, "Arguments must determine a valid Mumford divisor."130131def _point_homset(self, *args, **kwds):132return jacobian_homset.JacobianHomset_divisor_classes(*args, **kwds)133134def _point(self, *args, **kwds):135return jacobian_morphism.JacobianMorphism_divisor_class_field(*args, **kwds)136137def _cmp_(self,other):138if self.curve() == other.curve():139return 0140else:141return -1142143144145