Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/src/sage/schemes/hyperelliptic_curves/jacobian_generic.py
8821 views
1
"""
2
Jacobian of a General Hyperelliptic Curve
3
"""
4
5
#*****************************************************************************
6
# Copyright (C) 2006 David Kohel <[email protected]>
7
# Distributed under the terms of the GNU General Public License (GPL)
8
# http://www.gnu.org/licenses/
9
#*****************************************************************************
10
11
from sage.rings.all import Integer
12
from sage.schemes.jacobians.abstract_jacobian import Jacobian_generic
13
import jacobian_homset
14
import jacobian_morphism
15
16
class HyperellipticJacobian_generic(Jacobian_generic):
17
"""
18
EXAMPLES::
19
20
sage: FF = FiniteField(2003)
21
sage: R.<x> = PolynomialRing(FF)
22
sage: f = x**5 + 1184*x**3 + 1846*x**2 + 956*x + 560
23
sage: C = HyperellipticCurve(f)
24
sage: J = C.jacobian()
25
sage: a = x**2 + 376*x + 245; b = 1015*x + 1368
26
sage: X = J(FF)
27
sage: D = X([a,b])
28
sage: D
29
(x^2 + 376*x + 245, y + 988*x + 635)
30
sage: J(0)
31
(1)
32
sage: D == J([a,b])
33
True
34
sage: D == D + J(0)
35
True
36
37
An more extended example, demonstrating arithmetic in J(QQ) and
38
J(K) for a number field K/QQ.
39
40
::
41
42
sage: P.<x> = PolynomialRing(QQ)
43
sage: f = x^5 - x + 1; h = x
44
sage: C = HyperellipticCurve(f,h,'u,v')
45
sage: C
46
Hyperelliptic Curve over Rational Field defined by v^2 + u*v = u^5 - u + 1
47
sage: PP = C.ambient_space()
48
sage: PP
49
Projective Space of dimension 2 over Rational Field
50
sage: C.defining_polynomial()
51
-x0^5 + x0*x1*x2^3 + x1^2*x2^3 + x0*x2^4 - x2^5
52
sage: C(QQ)
53
Set of rational points of Hyperelliptic Curve over Rational Field defined by v^2 + u*v = u^5 - u + 1
54
sage: K.<t> = NumberField(x^2-2)
55
sage: C(K)
56
Set 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 + 1
57
sage: P = C(QQ)(0,1,1); P
58
(0 : 1 : 1)
59
sage: P == C(0,1,1)
60
True
61
sage: C(0,1,1).parent()
62
Set of rational points of Hyperelliptic Curve over Rational Field defined by v^2 + u*v = u^5 - u + 1
63
sage: P1 = C(K)(P)
64
sage: P2 = C(K)([2,4*t-1,1])
65
sage: P3 = C(K)([-1/2,1/8*(7*t+2),1])
66
sage: P1, P2, P3
67
((0 : 1 : 1), (2 : 4*t - 1 : 1), (-1/2 : 7/8*t + 1/4 : 1))
68
sage: J = C.jacobian()
69
sage: J
70
Jacobian of Hyperelliptic Curve over Rational Field defined by v^2 + u*v = u^5 - u + 1
71
sage: Q = J(QQ)(P); Q
72
(u, v - 1)
73
sage: for i in range(6): Q*i
74
(1)
75
(u, v - 1)
76
(u^2, v + u - 1)
77
(u^2, v + 1)
78
(u, v + 1)
79
(1)
80
sage: Q1 = J(K)(P1); print "%s -> %s"%( P1, Q1 )
81
(0 : 1 : 1) -> (u, v - 1)
82
sage: Q2 = J(K)(P2); print "%s -> %s"%( P2, Q2 )
83
(2 : 4*t - 1 : 1) -> (u - 2, v - 4*t + 1)
84
sage: Q3 = J(K)(P3); print "%s -> %s"%( P3, Q3 )
85
(-1/2 : 7/8*t + 1/4 : 1) -> (u + 1/2, v - 7/8*t - 1/4)
86
sage: R.<x> = PolynomialRing(K)
87
sage: Q4 = J(K)([x^2-t,R(1)])
88
sage: for i in range(4): Q4*i
89
(1)
90
(u^2 - t, v - 1)
91
(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)
92
(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)
93
sage: R2 = Q2*5; R2
94
(u^2 - 3789465233/116983808*u - 267915823/58491904, v + (-233827256513849/1789384327168*t + 1/2)*u - 15782925357447/894692163584*t)
95
sage: R3 = Q3*5; R3
96
(u^2 + 5663300808399913890623/14426454798950909645952*u - 26531814176395676231273/28852909597901819291904, v + (253155440321645614070860868199103/2450498420175733688903836378159104*t + 1/2)*u + 2427708505064902611513563431764311/4900996840351467377807672756318208*t)
97
sage: R4 = Q4*5; R4
98
(u^2 - 3789465233/116983808*u - 267915823/58491904, v + (233827256513849/1789384327168*t + 1/2)*u + 15782925357447/894692163584*t)
99
sage: # Thus we find the following identity:
100
sage: 5*Q2 + 5*Q4
101
(1)
102
sage: # Moreover the following relation holds in the 5-torsion subgroup:
103
sage: Q2 + Q4 == 2*Q1
104
True
105
"""
106
107
def dimension(self):
108
"""
109
Return the dimension of this Jacobian.
110
111
OUTPUT:
112
Integer
113
114
EXAMPLES::
115
116
sage: k.<a> = GF(9); R.<x> = k[]
117
sage: HyperellipticCurve(x^3 + x - 1, x+a).jacobian().dimension()
118
1
119
sage: g = HyperellipticCurve(x^6 + x - 1, x+a).jacobian().dimension(); g
120
2
121
sage: type(g)
122
<type 'sage.rings.integer.Integer'>
123
"""
124
return Integer(self.curve().genus())
125
126
def point(self, mumford, check=True):
127
try:
128
return self(self.base_ring())(mumford)
129
except AttributeError:
130
raise ValueError, "Arguments must determine a valid Mumford divisor."
131
132
def _point_homset(self, *args, **kwds):
133
return jacobian_homset.JacobianHomset_divisor_classes(*args, **kwds)
134
135
def _point(self, *args, **kwds):
136
return jacobian_morphism.JacobianMorphism_divisor_class_field(*args, **kwds)
137
138
def _cmp_(self,other):
139
if self.curve() == other.curve():
140
return 0
141
else:
142
return -1
143
144
145