Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/schemes/hyperelliptic_curves/hyperelliptic_g2_generic.py
4128 views
1
#*****************************************************************************
2
# Copyright (C) 2006 David Kohel <[email protected]>
3
# Distributed under the terms of the GNU General Public License (GPL)
4
# http://www.gnu.org/licenses/
5
#*****************************************************************************
6
7
import hyperelliptic_generic
8
import jacobian_g2
9
10
import invariants
11
12
13
class HyperellipticCurve_g2_generic(hyperelliptic_generic.HyperellipticCurve_generic):
14
def is_odd_degree(self):
15
"""
16
Returns True if the curve is an odd degree model.
17
"""
18
f, h = self.hyperelliptic_polynomials()
19
df = f.degree()
20
if h.degree() < 3:
21
return df%2 == 1
22
elif df < 6:
23
return False
24
else:
25
a0 = f.leading_coefficient()
26
c0 = h.leading_coefficient()
27
return (c0**2 + 4*a0) == 0
28
29
def jacobian(self):
30
return jacobian_g2.HyperellipticJacobian_g2(self)
31
32
def kummer_morphism(self):
33
"""
34
Returns the morphism of an odd degree hyperelliptic curve to the Kummer
35
surface of its Jacobian. (This could be extended to an even degree model
36
if a prescribed embedding in its Jacobian is fixed.)
37
"""
38
try:
39
return self._kummer_morphism
40
except AttributeError:
41
pass
42
if not self.is_odd_degree():
43
raise TypeError, \
44
"Kummer embedding not determined for even degree model curves."
45
J = self.jacobian()
46
K = J.kummer_surface()
47
return self._kummer_morphism
48
49
def clebsch_invariants(self):
50
r"""
51
Return the Clebsch invariants `(A, B, C, D)` of Mestre, p 317, [M]_.
52
53
SEEALSO::
54
55
.. sage.schemes.hyperelliptic_curves.invariants
56
57
EXAMPLES::
58
59
sage: R.<x> = QQ[]
60
sage: f = x^5 - x^4 + 3
61
sage: HyperellipticCurve(f).clebsch_invariants()
62
(0, -2048/375, -4096/25, -4881645568/84375)
63
sage: HyperellipticCurve(f(2*x)).clebsch_invariants()
64
(0, -8388608/375, -1073741824/25, -5241627016305836032/84375)
65
66
sage: HyperellipticCurve(f, x).clebsch_invariants()
67
(-8/15, 17504/5625, -23162896/140625, -420832861216768/7119140625)
68
sage: HyperellipticCurve(f(2*x), 2*x).clebsch_invariants()
69
(-512/15, 71696384/5625, -6072014209024/140625, -451865844002031331704832/7119140625)
70
71
TESTS::
72
73
sage: magma(HyperellipticCurve(f)).ClebschInvariants() # optional - magma
74
[ 0, -2048/375, -4096/25, -4881645568/84375 ]
75
sage: magma(HyperellipticCurve(f(2*x))).ClebschInvariants() # optional - magma
76
[ 0, -8388608/375, -1073741824/25, -5241627016305836032/84375 ]
77
sage: magma(HyperellipticCurve(f, x)).ClebschInvariants() # optional - magma
78
[ -8/15, 17504/5625, -23162896/140625, -420832861216768/7119140625 ]
79
sage: magma(HyperellipticCurve(f(2*x), 2*x)).ClebschInvariants() # optional - magma
80
[ -512/15, 71696384/5625, -6072014209024/140625, -451865844002031331704832/7119140625 ]
81
"""
82
f, h = self.hyperelliptic_polynomials()
83
return invariants.clebsch_invariants(4*f + h**2)
84
85
def igusa_clebsch_invariants(self):
86
r"""
87
Return the Igusa-Clebsch invariants `I_2, I_4, I_6, I_{10}` of Igusa and Clebsch [I]_.
88
89
SEEALSO::
90
91
.. sage.schemes.hyperelliptic_curves.invariants
92
93
EXAMPLES::
94
95
sage: R.<x> = QQ[]
96
sage: f = x^5 - x + 2
97
sage: HyperellipticCurve(f).igusa_clebsch_invariants()
98
(-640, -20480, 1310720, 52160364544)
99
sage: HyperellipticCurve(f(2*x)).igusa_clebsch_invariants()
100
(-40960, -83886080, 343597383680, 56006764965979488256)
101
102
sage: HyperellipticCurve(f, x).igusa_clebsch_invariants()
103
(-640, 17920, -1966656, 52409511936)
104
sage: HyperellipticCurve(f(2*x), 2*x).igusa_clebsch_invariants()
105
(-40960, 73400320, -515547070464, 56274284941110411264)
106
107
TESTS::
108
109
sage: magma(HyperellipticCurve(f)).IgusaClebschInvariants() # optional - magma
110
[ -640, -20480, 1310720, 52160364544 ]
111
sage: magma(HyperellipticCurve(f(2*x))).IgusaClebschInvariants() # optional - magma
112
[ -40960, -83886080, 343597383680, 56006764965979488256 ]
113
sage: magma(HyperellipticCurve(f, x)).IgusaClebschInvariants() # optional - magma
114
[ -640, 17920, -1966656, 52409511936 ]
115
sage: magma(HyperellipticCurve(f(2*x), 2*x)).IgusaClebschInvariants() # optional - magma
116
[ -40960, 73400320, -515547070464, 56274284941110411264 ]
117
"""
118
f, h = self.hyperelliptic_polynomials()
119
return invariants.igusa_clebsch_invariants(4*f + h**2)
120
121
def absolute_igusa_invariants_wamelen(self):
122
r"""
123
Return the three absolute Igusa invariants used by van Wamelen [W]_.
124
125
EXAMPLES::
126
127
sage: R.<x> = QQ[]
128
sage: HyperellipticCurve(x^5 - 1).absolute_igusa_invariants_wamelen()
129
(0, 0, 0)
130
sage: HyperellipticCurve((x^5 - 1)(x - 2), (x^2)(x - 2)).absolute_igusa_invariants_wamelen()
131
(0, 0, 0)
132
"""
133
f, h = self.hyperelliptic_polynomials()
134
return invariants.absolute_igusa_invariants_wamelen(4*f + h**2)
135
136
def absolute_igusa_invariants_kohel(self):
137
r"""
138
Return the three absolute Igusa invariants used by Kohel [K]_.
139
140
SEEALSO::
141
142
.. sage.schemes.hyperelliptic_curves.invariants
143
144
EXAMPLES::
145
146
sage: R.<x> = QQ[]
147
sage: HyperellipticCurve(x^5 - 1).absolute_igusa_invariants_kohel()
148
(0, 0, 0)
149
sage: HyperellipticCurve(x^5 - x + 1, x^2).absolute_igusa_invariants_kohel()
150
(-1030567/178769, 259686400/178769, 20806400/178769)
151
sage: HyperellipticCurve((x^5 - x + 1)(3*x + 1), (x^2)(3*x + 1)).absolute_igusa_invariants_kohel()
152
(-1030567/178769, 259686400/178769, 20806400/178769)
153
"""
154
f, h = self.hyperelliptic_polynomials()
155
return invariants.absolute_igusa_invariants_kohel(4*f + h**2)
156
157
def clebsch_invariants(self):
158
r"""
159
Return the Clebsch invariants `(A, B, C, D)` of Mestre, p 317, [M]_.
160
161
SEEALSO::
162
163
.. sage.schemes.hyperelliptic_curves.invariants
164
165
EXAMPLES::
166
167
sage: R.<x> = QQ[]
168
sage: f = x^5 - x^4 + 3
169
sage: HyperellipticCurve(f).clebsch_invariants()
170
(0, -2048/375, -4096/25, -4881645568/84375)
171
sage: HyperellipticCurve(f(2*x)).clebsch_invariants()
172
(0, -8388608/375, -1073741824/25, -5241627016305836032/84375)
173
174
sage: HyperellipticCurve(f, x).clebsch_invariants()
175
(-8/15, 17504/5625, -23162896/140625, -420832861216768/7119140625)
176
sage: HyperellipticCurve(f(2*x), 2*x).clebsch_invariants()
177
(-512/15, 71696384/5625, -6072014209024/140625, -451865844002031331704832/7119140625)
178
179
TESTS::
180
181
sage: magma(HyperellipticCurve(f)).ClebschInvariants() # optional - magma
182
[ 0, -2048/375, -4096/25, -4881645568/84375 ]
183
sage: magma(HyperellipticCurve(f(2*x))).ClebschInvariants() # optional - magma
184
[ 0, -8388608/375, -1073741824/25, -5241627016305836032/84375 ]
185
sage: magma(HyperellipticCurve(f, x)).ClebschInvariants() # optional - magma
186
[ -8/15, 17504/5625, -23162896/140625, -420832861216768/7119140625 ]
187
sage: magma(HyperellipticCurve(f(2*x), 2*x)).ClebschInvariants() # optional - magma
188
[ -512/15, 71696384/5625, -6072014209024/140625, -451865844002031331704832/7119140625 ]
189
"""
190
f, h = self.hyperelliptic_polynomials()
191
return invariants.clebsch_invariants(4*f + h**2)
192
193
def igusa_clebsch_invariants(self):
194
r"""
195
Return the Igusa-Clebsch invariants `I_2, I_4, I_6, I_{10}` of Igusa and Clebsch [I]_.
196
197
SEEALSO::
198
199
.. sage.schemes.hyperelliptic_curves.invariants
200
201
EXAMPLES::
202
203
sage: R.<x> = QQ[]
204
sage: f = x^5 - x + 2
205
sage: HyperellipticCurve(f).igusa_clebsch_invariants()
206
(-640, -20480, 1310720, 52160364544)
207
sage: HyperellipticCurve(f(2*x)).igusa_clebsch_invariants()
208
(-40960, -83886080, 343597383680, 56006764965979488256)
209
210
sage: HyperellipticCurve(f, x).igusa_clebsch_invariants()
211
(-640, 17920, -1966656, 52409511936)
212
sage: HyperellipticCurve(f(2*x), 2*x).igusa_clebsch_invariants()
213
(-40960, 73400320, -515547070464, 56274284941110411264)
214
215
TESTS::
216
217
sage: magma(HyperellipticCurve(f)).IgusaClebschInvariants() # optional - magma
218
[ -640, -20480, 1310720, 52160364544 ]
219
sage: magma(HyperellipticCurve(f(2*x))).IgusaClebschInvariants() # optional - magma
220
[ -40960, -83886080, 343597383680, 56006764965979488256 ]
221
222
sage: magma(HyperellipticCurve(f, x)).IgusaClebschInvariants() # optional - magma
223
[ -640, 17920, -1966656, 52409511936 ]
224
sage: magma(HyperellipticCurve(f(2*x), 2*x)).IgusaClebschInvariants() # optional - magma
225
[ -40960, 73400320, -515547070464, 56274284941110411264 ]
226
"""
227
f, h = self.hyperelliptic_polynomials()
228
return invariants.igusa_clebsch_invariants(4*f + h**2)
229
230
def absolute_igusa_invariants_wamelen(self):
231
r"""
232
Return the three absolute Igusa invariants used by van Wamelen [W]_.
233
234
EXAMPLES::
235
236
sage: R.<x> = QQ[]
237
sage: HyperellipticCurve(x^5 - 1).absolute_igusa_invariants_wamelen()
238
(0, 0, 0)
239
sage: HyperellipticCurve((x^5 - 1)(x - 2), (x^2)(x - 2)).absolute_igusa_invariants_wamelen()
240
(0, 0, 0)
241
"""
242
f, h = self.hyperelliptic_polynomials()
243
return invariants.absolute_igusa_invariants_wamelen(4*f + h**2)
244
245
def absolute_igusa_invariants_kohel(self):
246
r"""
247
Return the three absolute Igusa invariants used by Kohel [K]_.
248
249
SEEALSO::
250
251
.. sage.schemes.hyperelliptic_curves.invariants
252
253
EXAMPLES::
254
255
sage: R.<x> = QQ[]
256
sage: HyperellipticCurve(x^5 - 1).absolute_igusa_invariants_kohel()
257
(0, 0, 0)
258
sage: HyperellipticCurve(x^5 - x + 1, x^2).absolute_igusa_invariants_kohel()
259
(-1030567/178769, 259686400/178769, 20806400/178769)
260
sage: HyperellipticCurve((x^5 - x + 1)(3*x + 1), (x^2)(3*x + 1)).absolute_igusa_invariants_kohel()
261
(-1030567/178769, 259686400/178769, 20806400/178769)
262
"""
263
f, h = self.hyperelliptic_polynomials()
264
return invariants.absolute_igusa_invariants_kohel(4*f + h**2)
265
266