Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/schemes/elliptic_curves/ell_number_field.py
4162 views
1
# -*- coding: utf-8 -*-
2
r"""
3
Elliptic curves over number fields
4
5
An elliptic curve `E` over a number field `K` can be given
6
by a Weierstrass equation whose coefficients lie in `K` or by
7
using ``base_extend`` on an elliptic curve defined over a subfield.
8
9
One major difference to elliptic curves over `\QQ` is that there
10
might not exist a global minimal equation over `K`, when `K` does
11
not have class number one.
12
Another difference is the lack of understanding of modularity for
13
general elliptic curves over general number fields.
14
15
Currently Sage can obtain local information about `E/K_v` for finite places
16
`v`, it has an interface to Denis Simon's script for 2-descent, it can compute
17
the torsion subgroup of the Mordell-Weil group `E(K)`, and it can work with
18
isogenies defined over `K`.
19
20
EXAMPLE::
21
22
sage: K.<i> = NumberField(x^2+1)
23
sage: E = EllipticCurve([0,4+i])
24
sage: E.discriminant()
25
-3456*i - 6480
26
sage: P= E([i,2])
27
sage: P+P
28
(-2*i + 9/16 : -9/4*i - 101/64 : 1)
29
30
::
31
32
sage: E.has_good_reduction(2+i)
33
True
34
sage: E.local_data(4+i)
35
Local data at Fractional ideal (i + 4):
36
Reduction type: bad additive
37
Local minimal model: Elliptic Curve defined by y^2 = x^3 + (i+4) over Number Field in i with defining polynomial x^2 + 1
38
Minimal discriminant valuation: 2
39
Conductor exponent: 2
40
Kodaira Symbol: II
41
Tamagawa Number: 1
42
sage: E.tamagawa_product_bsd()
43
1
44
45
::
46
47
sage: E.simon_two_descent()
48
(1, 1, [(i : 2 : 1)])
49
50
::
51
52
sage: E.torsion_order()
53
1
54
55
::
56
57
sage: E.isogenies_prime_degree(3)
58
[Isogeny of degree 3 from Elliptic Curve defined by y^2 = x^3 + (i+4) over Number Field in i with defining polynomial x^2 + 1 to Elliptic Curve defined by y^2 = x^3 + (-27*i-108) over Number Field in i with defining polynomial x^2 + 1]
59
60
AUTHORS:
61
62
- Robert Bradshaw 2007
63
64
- John Cremona
65
66
- Chris Wuthrich
67
68
REFERENCE:
69
70
- [Sil] Silverman, Joseph H. The arithmetic of elliptic curves. Second edition. Graduate Texts in
71
Mathematics, 106. Springer, 2009.
72
73
- [Sil2] Silverman, Joseph H. Advanced topics in the arithmetic of elliptic curves. Graduate Texts in
74
Mathematics, 151. Springer, 1994.
75
"""
76
77
#*****************************************************************************
78
# Copyright (C) 2007 Robert Bradshaw <[email protected]>
79
# William Stein <[email protected]>
80
#
81
# Distributed under the terms of the GNU General Public License (GPL)
82
#
83
# This code is distributed in the hope that it will be useful,
84
# but WITHOUT ANY WARRANTY; without even the implied warranty of
85
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
86
# General Public License for more details.
87
#
88
# The full text of the GPL is available at:
89
#
90
# http://www.gnu.org/licenses/
91
#*****************************************************************************
92
93
from ell_field import EllipticCurve_field
94
import ell_point
95
import sage.matrix.all as matrix
96
from sage.rings.ring import Ring
97
from sage.rings.arith import gcd, prime_divisors
98
from sage.misc.misc import prod
99
import sage.databases.cremona
100
import ell_torsion
101
from ell_generic import is_EllipticCurve
102
103
from gp_simon import simon_two_descent
104
from constructor import EllipticCurve
105
from sage.rings.all import PolynomialRing, ZZ, RealField
106
from sage.misc.misc import verbose, forall
107
from sage.rings.integer import Integer
108
from sage.rings.infinity import Infinity # just for verbose output
109
from sage.rings.arith import valuation
110
111
class EllipticCurve_number_field(EllipticCurve_field):
112
r"""
113
Elliptic curve over a number field.
114
115
EXAMPLES::
116
117
sage: K.<i>=NumberField(x^2+1)
118
sage: EllipticCurve([i, i - 1, i + 1, 24*i + 15, 14*i + 35])
119
Elliptic Curve defined by y^2 + i*x*y + (i+1)*y = x^3 + (i-1)*x^2 + (24*i+15)*x + (14*i+35) over Number Field in i with defining polynomial x^2 + 1
120
"""
121
def __init__(self, x, y=None):
122
r"""
123
Allow some ways to create an elliptic curve over a number
124
field in addition to the generic ones.
125
126
INPUT:
127
128
- ``x``, ``y`` -- see examples.
129
130
EXAMPLES:
131
132
A curve from the database of curves over `\QQ`, but over a larger field:
133
134
sage: K.<i>=NumberField(x^2+1)
135
sage: EllipticCurve(K,'389a1')
136
Elliptic Curve defined by y^2 + y = x^3 + x^2 + (-2)*x over Number Field in i with defining polynomial x^2 + 1
137
138
Making the field of definition explicitly larger::
139
140
sage: EllipticCurve(K,[0,-1,1,0,0])
141
Elliptic Curve defined by y^2 + y = x^3 + (-1)*x^2 over Number Field in i with defining polynomial x^2 + 1
142
143
"""
144
if y is None:
145
if isinstance(x, list):
146
ainvs = x
147
field = ainvs[0].parent()
148
else:
149
if isinstance(y, str):
150
field = x
151
X = sage.databases.cremona.CremonaDatabase()[y]
152
ainvs = list(X.a_invariants())
153
else:
154
field = x
155
ainvs = y
156
if not (isinstance(field, Ring) and isinstance(ainvs,list)):
157
raise TypeError
158
159
EllipticCurve_field.__init__(self, [field(x) for x in ainvs])
160
self._point = ell_point.EllipticCurvePoint_number_field
161
162
def simon_two_descent(self, verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30):
163
r"""
164
Computes lower and upper bounds on the rank of the Mordell-Weil group,
165
and a list of independent points. Used internally by the :meth:`~rank`,
166
:meth:`~rank_bounds` and :meth:`~gens` methods.
167
168
INPUT:
169
170
- ``verbose`` -- 0, 1, 2, or 3 (default: 0), the verbosity level
171
172
- ``lim1`` -- (default: 5) limit on trivial points on quartics
173
174
- ``lim3`` -- (default: 50) limit on points on ELS quartics
175
176
- ``limtriv`` -- (default: 10) limit on trivial points on elliptic curve
177
178
- ``maxprob`` -- (default: 20)
179
180
- ``limbigprime`` -- (default: 30) to distinguish between
181
small and large prime numbers. Use probabilistic tests for
182
large primes. If 0, don't use probabilistic tests.
183
184
OUTPUT:
185
186
``(lower, upper, list)`` where ``lower`` is a lower bound on
187
the rank, ``upper`` is an upper bound (the 2-Selmer rank) and
188
``list`` is a list of independent points on the Weierstrass
189
model. The length of ``list`` is equal to either ``lower``,
190
or ``lower-1``, since when ``lower`` is less than ``upper``
191
and of different parity, the value of ``lower`` is increased by
192
1.
193
194
.. note::
195
196
For non-quadratic number fields, this code does return, but
197
it takes a long time.
198
199
ALGORITHM:
200
201
Uses Denis Simon's PARI/GP scripts from
202
http://www.math.unicaen.fr/~simon/.
203
204
EXAMPLES::
205
206
sage: K.<a> = NumberField(x^2 + 23, 'a')
207
sage: E = EllipticCurve(K, '37')
208
sage: E == loads(dumps(E))
209
True
210
sage: E.simon_two_descent()
211
(2, 2, [(-1 : 0 : 1), (1/2*a - 5/2 : -1/2*a - 13/2 : 1)])
212
213
::
214
215
sage: K.<a> = NumberField(x^2 + 7, 'a')
216
sage: E = EllipticCurve(K, [0,0,0,1,a]); E
217
Elliptic Curve defined by y^2 = x^3 + x + a over Number Field in a with defining polynomial x^2 + 7
218
219
sage: v = E.simon_two_descent(verbose=1); v
220
courbe elliptique : Y^2 = x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)
221
points triviaux sur la courbe = [[1, 1, 0], [Mod(1/2*y + 3/2, y^2 + 7), Mod(-y - 2, y^2 + 7), 1]]
222
#S(E/K)[2] = 2
223
#E(K)/2E(K) = 2
224
#III(E/K)[2] = 1
225
rang(E/K) = 1
226
listpointsmwr = [[Mod(1/2*y + 3/2, y^2 + 7), Mod(-y - 2, y^2 + 7), 1]]
227
(1, 1, [(1/2*a + 3/2 : -a - 2 : 1)])
228
229
sage: v = E.simon_two_descent(verbose=2) # random output
230
K = bnfinit(y^2 + 7);
231
a = Mod(y,K.pol);
232
bnfellrank(K, [0,0,0,1,a]);
233
courbe elliptique : Y^2 = x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)
234
A = 0
235
B = Mod(1, y^2 + 7)
236
C = Mod(y, y^2 + 7)
237
LS2gen = [Mod(Mod(-5, y^2 + 7)*x^2 + Mod(-3*y, y^2 + 7)*x + Mod(8, y^2 + 7), x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)), Mod(Mod(1, y^2 + 7)*x^2 + Mod(1/2*y - 1/2, y^2 + 7)*x - 1, x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7))]
238
#LS2gen = 2
239
Recherche de points triviaux sur la courbe
240
points triviaux sur la courbe = [[1, 1, 0], [Mod(1/2*y + 3/2, y^2 + 7), Mod(-y - 2, y^2 + 7), 1]]
241
zc = Mod(Mod(-5, y^2 + 7)*x^2 + Mod(-3*y, y^2 + 7)*x + Mod(8, y^2 + 7), x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7))
242
symbole de Hilbert (Mod(2, y^2 + 7),Mod(-5, y^2 + 7)) = -1
243
zc = Mod(Mod(1, y^2 + 7)*x^2 + Mod(1/2*y - 1/2, y^2 + 7)*x + Mod(-1, y^2 + 7), x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7))
244
symbole de Hilbert (Mod(-2*y + 2, y^2 + 7),Mod(1, y^2 + 7)) = 0
245
sol de Legendre = [1, 0, 1]~
246
zc*z1^2 = Mod(Mod(2*y - 2, y^2 + 7)*x + Mod(2*y + 10, y^2 + 7), x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7))
247
quartique : (-1/2*y + 1/2)*Y^2 = x^4 + (-3*y - 15)*x^2 + (-8*y - 16)*x + (-11/2*y - 15/2)
248
reduite: Y^2 = (-1/2*y + 1/2)*x^4 - 4*x^3 + (-3*y + 3)*x^2 + (2*y - 2)*x + (1/2*y + 3/2)
249
non ELS en [2, [0, 1]~, 1, 1, [1, 1]~]
250
zc = Mod(Mod(1, y^2 + 7)*x^2 + Mod(1/2*y + 1/2, y^2 + 7)*x + Mod(-1, y^2 + 7), x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7))
251
vient du point trivial [Mod(1/2*y + 3/2, y^2 + 7), Mod(-y - 2, y^2 + 7), 1]
252
m1 = 1
253
m2 = 1
254
#S(E/K)[2] = 2
255
#E(K)/2E(K) = 2
256
#III(E/K)[2] = 1
257
rang(E/K) = 1
258
listpointsmwr = [[Mod(1/2*y + 3/2, y^2 + 7), Mod(-y - 2, y^2 + 7), 1]]
259
v = [1, 1, [[Mod(1/2*y + 3/2, y^2 + 7), Mod(-y - 2, y^2 + 7)]]]
260
sage: v
261
(1, 1, [(1/2*a + 3/2 : -a - 2 : 1)])
262
263
264
A curve with 2-torsion::
265
266
sage: K.<a> = NumberField(x^2 + 7, 'a')
267
sage: E = EllipticCurve(K, '15a')
268
sage: v = E.simon_two_descent(); v # long time (about 10 seconds), points can vary
269
(1, 3, [...])
270
"""
271
272
try:
273
result = self._simon_two_descent_data[lim1,lim3,limtriv,maxprob,limbigprime]
274
if verbose == 0:
275
return result
276
except AttributeError:
277
self._simon_two_descent_data = {}
278
279
x = PolynomialRing(self.base_ring(), 'x').gen(0)
280
t = simon_two_descent(self,
281
verbose=verbose, lim1=lim1, lim3=lim3, limtriv=limtriv,
282
maxprob=maxprob, limbigprime=limbigprime)
283
prob_rank = Integer(t[0])
284
two_selmer_rank = Integer(t[1])
285
prob_gens = [self(P) for P in t[2]]
286
self._simon_two_descent_data[lim1,lim3,limtriv,maxprob,limbigprime] = (prob_rank, two_selmer_rank, prob_gens)
287
return prob_rank, two_selmer_rank, prob_gens
288
289
def height_pairing_matrix(self, points=None, precision=None):
290
r"""
291
Returns the height pairing matrix of the given points.
292
293
INPUT:
294
295
- points - either a list of points, which must be on this
296
curve, or (default) None, in which case self.gens() will be
297
used.
298
299
- precision - number of bits of precision of result
300
(default: None, for default RealField precision)
301
302
EXAMPLES::
303
304
sage: E = EllipticCurve([0, 0, 1, -1, 0])
305
sage: E.height_pairing_matrix()
306
[0.0511114082399688]
307
308
For rank 0 curves, the result is a valid 0x0 matrix::
309
310
sage: EllipticCurve('11a').height_pairing_matrix()
311
[]
312
sage: E=EllipticCurve('5077a1')
313
sage: E.height_pairing_matrix([E.lift_x(x) for x in [-2,-7/4,1]], precision=100)
314
[ 1.3685725053539301120518194471 -1.3095767070865761992624519454 -0.63486715783715592064475542573]
315
[ -1.3095767070865761992624519454 2.7173593928122930896610589220 1.0998184305667292139777571432]
316
[-0.63486715783715592064475542573 1.0998184305667292139777571432 0.66820516565192793503314205089]
317
318
sage: E = EllipticCurve('389a1')
319
sage: E = EllipticCurve('389a1')
320
sage: P,Q = E.point([-1,1,1]),E.point([0,-1,1])
321
sage: E.height_pairing_matrix([P,Q])
322
[0.686667083305587 0.268478098806726]
323
[0.268478098806726 0.327000773651605]
324
325
Over a number field::
326
327
sage: x = polygen(QQ)
328
sage: K.<t> = NumberField(x^2+47)
329
sage: EK = E.base_extend(K)
330
sage: EK.height_pairing_matrix([EK(P),EK(Q)])
331
[0.686667083305586 0.268478098806726]
332
[0.268478098806726 0.327000773651605]
333
334
::
335
336
sage: K.<i> = QuadraticField(-1)
337
sage: E = EllipticCurve([0,0,0,i,i])
338
sage: P = E(-9+4*i,-18-25*i)
339
sage: Q = E(i,-i)
340
sage: E.height_pairing_matrix([P,Q])
341
[ 2.16941934493768 -0.870059380421505]
342
[-0.870059380421505 0.424585837470709]
343
sage: E.regulator_of_points([P,Q])
344
0.164101403936070
345
"""
346
if points is None:
347
points = self.gens()
348
else:
349
for P in points:
350
assert P.curve() == self
351
352
r = len(points)
353
if precision is None:
354
RR = RealField()
355
else:
356
RR = RealField(precision)
357
M = matrix.MatrixSpace(RR, r)
358
mat = M()
359
for j in range(r):
360
mat[j,j] = points[j].height(precision=precision)
361
for j in range(r):
362
for k in range(j+1,r):
363
mat[j,k]=((points[j]+points[k]).height(precision=precision) - mat[j,j] - mat[k,k])/2
364
mat[k,j]=mat[j,k]
365
return mat
366
367
def regulator_of_points(self, points=[], precision=None):
368
"""
369
Returns the regulator of the given points on this curve.
370
371
INPUT:
372
373
- ``points`` -(default: empty list) a list of points on this curve
374
375
- ``precision`` - int or None (default: None): the precision
376
in bits of the result (default real precision if None)
377
378
EXAMPLES::
379
380
sage: E = EllipticCurve('37a1')
381
sage: P = E(0,0)
382
sage: Q = E(1,0)
383
sage: E.regulator_of_points([P,Q])
384
0.000000000000000
385
sage: 2*P==Q
386
True
387
388
::
389
390
sage: E = EllipticCurve('5077a1')
391
sage: points = [E.lift_x(x) for x in [-2,-7/4,1]]
392
sage: E.regulator_of_points(points)
393
0.417143558758384
394
sage: E.regulator_of_points(points,precision=100)
395
0.41714355875838396981711954462
396
397
::
398
399
sage: E = EllipticCurve('389a')
400
sage: E.regulator_of_points()
401
1.00000000000000
402
sage: points = [P,Q] = [E(-1,1),E(0,-1)]
403
sage: E.regulator_of_points(points)
404
0.152460177943144
405
sage: E.regulator_of_points(points, precision=100)
406
0.15246017794314375162432475705
407
sage: E.regulator_of_points(points, precision=200)
408
0.15246017794314375162432475704945582324372707748663081784028
409
sage: E.regulator_of_points(points, precision=300)
410
0.152460177943143751624324757049455823243727077486630817840280980046053225683562463604114816
411
412
Examples over number fields::
413
414
sage: K.<a> = QuadraticField(97)
415
sage: E = EllipticCurve(K,[1,1])
416
sage: P = E(0,1)
417
sage: P.height()
418
0.476223106404866
419
sage: E.regulator_of_points([P])
420
0.476223106404866
421
422
::
423
424
sage: E = EllipticCurve('11a1')
425
sage: x = polygen(QQ)
426
sage: K.<t> = NumberField(x^2+47)
427
sage: EK = E.base_extend(K)
428
sage: T = EK(5,5)
429
sage: T.order()
430
5
431
sage: P = EK(-2, -1/2*t - 1/2)
432
sage: P.order()
433
+Infinity
434
sage: EK.regulator_of_points([P,T]) # random very small output
435
-1.23259516440783e-32
436
sage: EK.regulator_of_points([P,T]).abs() < 1e-30
437
True
438
439
::
440
441
sage: E = EllipticCurve('389a1')
442
sage: P,Q = E.gens()
443
sage: E.regulator_of_points([P,Q])
444
0.152460177943144
445
sage: K.<t> = NumberField(x^2+47)
446
sage: EK = E.base_extend(K)
447
sage: EK.regulator_of_points([EK(P),EK(Q)])
448
0.152460177943144
449
450
::
451
452
sage: K.<i> = QuadraticField(-1)
453
sage: E = EllipticCurve([0,0,0,i,i])
454
sage: P = E(-9+4*i,-18-25*i)
455
sage: Q = E(i,-i)
456
sage: E.height_pairing_matrix([P,Q])
457
[ 2.16941934493768 -0.870059380421505]
458
[-0.870059380421505 0.424585837470709]
459
sage: E.regulator_of_points([P,Q])
460
0.164101403936070
461
462
"""
463
if points is None:
464
points = []
465
mat = self.height_pairing_matrix(points=points, precision=precision)
466
return mat.det(algorithm="hessenberg")
467
468
469
def is_local_integral_model(self,*P):
470
r"""
471
Tests if self is integral at the prime ideal `P`, or at all the
472
primes if `P` is a list or tuple.
473
474
INPUT:
475
476
- ``*P`` -- a prime ideal, or a list or tuple of primes.
477
478
EXAMPLES::
479
480
sage: K.<i> = NumberField(x^2+1)
481
sage: P1,P2 = K.primes_above(5)
482
sage: E = EllipticCurve([i/5,i/5,i/5,i/5,i/5])
483
sage: E.is_local_integral_model(P1,P2)
484
False
485
sage: Emin = E.local_integral_model(P1,P2)
486
sage: Emin.is_local_integral_model(P1,P2)
487
True
488
"""
489
if len(P)==1: P=P[0]
490
if isinstance(P,(tuple,list)):
491
return forall(P, lambda x : self.is_local_integral_model(x))[0]
492
return forall(self.ainvs(), lambda x : x.valuation(P) >= 0)[0]
493
494
def local_integral_model(self,*P):
495
r"""
496
Return a model of self which is integral at the prime ideal
497
`P`.
498
499
.. note::
500
501
The integrality at other primes is not affected, even if
502
`P` is non-principal.
503
504
INPUT:
505
506
- ``*P`` -- a prime ideal, or a list or tuple of primes.
507
508
EXAMPLES::
509
510
sage: K.<i> = NumberField(x^2+1)
511
sage: P1,P2 = K.primes_above(5)
512
sage: E = EllipticCurve([i/5,i/5,i/5,i/5,i/5])
513
sage: E.local_integral_model((P1,P2))
514
Elliptic Curve defined by y^2 + (-i)*x*y + (-25*i)*y = x^3 + 5*i*x^2 + 125*i*x + 3125*i over Number Field in i with defining polynomial x^2 + 1
515
"""
516
if len(P)==1: P=P[0]
517
if isinstance(P,(tuple,list)):
518
E=self
519
for Pi in P: E=E.local_integral_model(Pi)
520
return E
521
ai = self.a_invariants()
522
e = min([(ai[i].valuation(P)/[1,2,3,4,6][i]) for i in range(5)]).floor()
523
pi = self.base_field().uniformizer(P, 'negative')
524
return EllipticCurve([ai[i]/pi**(e*[1,2,3,4,6][i]) for i in range(5)])
525
526
def is_global_integral_model(self):
527
r"""
528
Return true iff self is integral at all primes.
529
530
EXAMPLES::
531
532
sage: K.<i> = NumberField(x^2+1)
533
sage: E = EllipticCurve([i/5,i/5,i/5,i/5,i/5])
534
sage: P1,P2 = K.primes_above(5)
535
sage: Emin = E.global_integral_model()
536
sage: Emin.is_global_integral_model()
537
True
538
"""
539
return forall(self.a_invariants(), lambda x : x.is_integral())[0]
540
541
def global_integral_model(self):
542
r"""
543
Return a model of self which is integral at all primes.
544
545
EXAMPLES::
546
547
sage: K.<i> = NumberField(x^2+1)
548
sage: E = EllipticCurve([i/5,i/5,i/5,i/5,i/5])
549
sage: P1,P2 = K.primes_above(5)
550
sage: E.global_integral_model()
551
Elliptic Curve defined by y^2 + (-i)*x*y + (-25*i)*y = x^3 + 5*i*x^2 + 125*i*x + 3125*i over Number Field in i with defining polynomial x^2 + 1
552
553
trac #7935::
554
555
sage: K.<a> = NumberField(x^2-38)
556
sage: E = EllipticCurve([a,1/2])
557
sage: E.global_integral_model()
558
Elliptic Curve defined by y^2 = x^3 + 1444*a*x + 27436 over Number Field in a with defining polynomial x^2 - 38
559
560
trac #9266::
561
562
sage: K.<s> = NumberField(x^2-5)
563
sage: w = (1+s)/2
564
sage: E = EllipticCurve(K,[2,w])
565
sage: E.global_integral_model()
566
Elliptic Curve defined by y^2 = x^3 + 2*x + (1/2*s+1/2) over Number Field in s with defining polynomial x^2 - 5
567
568
trac #12151::
569
570
sage: K.<v> = NumberField(x^2 + 161*x - 150)
571
sage: E = EllipticCurve([25105/216*v - 3839/36, 634768555/7776*v - 98002625/1296, 634768555/7776*v - 98002625/1296, 0, 0])
572
sage: E.global_integral_model()
573
Elliptic Curve defined by y^2 + (33872485050625*v-31078224284250)*x*y + (2020602604156076340058146664245468750000*v-1871778534673615560803175189398437500000)*y = x^3 + (6933305282258321342920781250*v-6422644400723486559914062500)*x^2 over Number Field in v with defining polynomial x^2 + 161*x - 150
574
"""
575
K = self.base_field()
576
ai = self.a_invariants()
577
for a in ai:
578
if not a.is_integral():
579
for P, _ in a.denominator_ideal().factor():
580
pi = K.uniformizer(P,'positive')
581
e = min([(ai[i].valuation(P)/[1,2,3,4,6][i]) for i in range(5)]).floor()
582
ai = [ai[i]/pi**(e*[1,2,3,4,6][i]) for i in range(5)]
583
for z in ai:
584
assert z.is_integral(), "bug in global_integral_model: %s" % list(ai)
585
return EllipticCurve(list(ai))
586
587
integral_model = global_integral_model
588
589
def _reduce_model(self):
590
r"""
591
592
Transforms the elliptic curve to a model in which `a_1`,
593
`a_2`, `a_3` are reduced modulo 2, 3, 2 respectively.
594
595
.. note::
596
597
This only works on integral models, i.e. it requires that
598
`a_1`, `a_2` and `a_3` lie in the ring of integers of the base
599
field.
600
601
EXAMPLES::
602
603
sage: K.<a>=NumberField(x^2-38)
604
sage: E=EllipticCurve([a, -5*a + 19, -39*a + 237, 368258520200522046806318224*a - 2270097978636731786720858047, 8456608930180227786550494643437985949781*a - 52130038506835491453281450568107193773505])
605
sage: E.ainvs()
606
(a,
607
-5*a + 19,
608
-39*a + 237,
609
368258520200522046806318224*a - 2270097978636731786720858047,
610
8456608930180227786550494643437985949781*a - 52130038506835491453281450568107193773505)
611
sage: E._reduce_model().ainvs()
612
(a,
613
a + 1,
614
a + 1,
615
368258520200522046806318444*a - 2270097978636731786720859345,
616
8456608930173478039472018047583706316424*a - 52130038506793883217874390501829588391299)
617
sage: EllipticCurve([101,202,303,404,505])._reduce_model().ainvs()
618
(1, 1, 0, -2509254, 1528863051)
619
sage: EllipticCurve([-101,-202,-303,-404,-505])._reduce_model().ainvs()
620
(1, -1, 0, -1823195, 947995262)
621
"""
622
ZK = self.base_ring().maximal_order()
623
try:
624
(a1, a2, a3, a4, a6) = [ZK(a) for a in self.a_invariants()]
625
except TypeError:
626
raise TypeError, "_reduce_model() requires an integral model."
627
# N.B. Must define s, r, t in the right order.
628
if ZK.degree() == 1:
629
s = ((-a1)/2).round('up')
630
r = ((-a2 + s*a1 +s*s)/3).round()
631
t = ((-a3 - r*a1)/2).round('up')
632
else:
633
s = ZK([(a/2).round('up') for a in (-a1).list()])
634
r = ZK([(a/3).round() for a in (-a2 + s*a1 +s*s).list()])
635
t = ZK([(a/2).round('up') for a in (-a3 - r*a1).list()])
636
637
return self.rst_transform(r, s, t)
638
639
def local_information(self, P=None, proof=None):
640
r"""
641
\code{local_information} has been renamed \code{local_data}
642
and is being deprecated.
643
"""
644
raise DeprecationWarning, "local_information is deprecated; use local_data instead"
645
return self.local_data(P,proof)
646
647
def local_data(self, P=None, proof = None, algorithm="pari"):
648
r"""
649
Local data for this elliptic curve at the prime `P`.
650
651
INPUT:
652
653
- ``P`` -- either None or a prime ideal of the base field of self.
654
655
- ``proof`` -- whether to only use provably correct methods
656
(default controlled by global proof module). Note that the
657
proof module is number_field, not elliptic_curves, since the
658
functions that actually need the flag are in number fields.
659
660
- ``algorithm`` (string, default: "pari") -- Ignored unless the
661
base field is `\QQ`. If "pari", use the PARI C-library
662
``ellglobalred`` implementation of Tate's algorithm over
663
`\QQ`. If "generic", use the general number field
664
implementation.
665
666
OUTPUT:
667
668
If `P` is specified, returns the ``EllipticCurveLocalData``
669
object associated to the prime `P` for this curve. Otherwise,
670
returns a list of such objects, one for each prime `P` in the
671
support of the discriminant of this model.
672
673
.. note::
674
675
The model is not required to be integral on input.
676
677
For principal `P`, a generator is used as a uniformizer,
678
and integrality or minimality at other primes is not
679
affected. For non-principal `P`, the minimal model
680
returned will preserve integrality at other primes, but not
681
minimality.
682
683
EXAMPLES::
684
685
sage: K.<i> = NumberField(x^2+1)
686
sage: E = EllipticCurve([1 + i, 0, 1, 0, 0])
687
sage: E.local_data()
688
[Local data at Fractional ideal (i - 2):
689
Reduction type: bad non-split multiplicative
690
Local minimal model: Elliptic Curve defined by y^2 + (i+1)*x*y + y = x^3 over Number Field in i with defining polynomial x^2 + 1
691
Minimal discriminant valuation: 1
692
Conductor exponent: 1
693
Kodaira Symbol: I1
694
Tamagawa Number: 1,
695
Local data at Fractional ideal (-3*i - 2):
696
Reduction type: bad split multiplicative
697
Local minimal model: Elliptic Curve defined by y^2 + (i+1)*x*y + y = x^3 over Number Field in i with defining polynomial x^2 + 1
698
Minimal discriminant valuation: 2
699
Conductor exponent: 1
700
Kodaira Symbol: I2
701
Tamagawa Number: 2]
702
sage: E.local_data(K.ideal(3))
703
Local data at Fractional ideal (3):
704
Reduction type: good
705
Local minimal model: Elliptic Curve defined by y^2 + (i+1)*x*y + y = x^3 over Number Field in i with defining polynomial x^2 + 1
706
Minimal discriminant valuation: 0
707
Conductor exponent: 0
708
Kodaira Symbol: I0
709
Tamagawa Number: 1
710
711
An example raised in \#3897::
712
713
sage: E = EllipticCurve([1,1])
714
sage: E.local_data(3)
715
Local data at Principal ideal (3) of Integer Ring:
716
Reduction type: good
717
Local minimal model: Elliptic Curve defined by y^2 = x^3 + x + 1 over Rational Field
718
Minimal discriminant valuation: 0
719
Conductor exponent: 0
720
Kodaira Symbol: I0
721
Tamagawa Number: 1
722
"""
723
if proof is None:
724
import sage.structure.proof.proof
725
# We use the "number_field" flag because the actual proof dependence is in PARI's number field functions.
726
proof = sage.structure.proof.proof.get_flag(None, "number_field")
727
728
if P is None:
729
primes = self.base_ring()(self.integral_model().discriminant()).support()
730
return [self._get_local_data(pr, proof) for pr in primes]
731
732
from sage.schemes.elliptic_curves.ell_local_data import check_prime
733
P = check_prime(self.base_field(),P)
734
735
return self._get_local_data(P,proof,algorithm)
736
737
def _get_local_data(self, P, proof, algorithm="pari"):
738
r"""
739
Internal function to create data for this elliptic curve at the prime `P`.
740
741
This function handles the caching of local data. It is called
742
by local_data() which is the user interface and which parses
743
the input parameters `P` and proof.
744
745
INPUT:
746
747
- ``P`` -- either None or a prime ideal of the base field of self.
748
749
- ``proof`` -- whether to only use provably correct methods
750
(default controlled by global proof module). Note that the
751
proof module is number_field, not elliptic_curves, since the
752
functions that actually need the flag are in number fields.
753
754
- ``algorithm`` (string, default: "pari") -- Ignored unless the
755
base field is `\QQ`. If "pari", use the PARI C-library
756
``ellglobalred`` implementation of Tate's algorithm over
757
`\QQ`. If "generic", use the general number field
758
implementation.
759
760
EXAMPLES::
761
762
sage: K.<i> = NumberField(x^2+1)
763
sage: E = EllipticCurve(K,[0,1,0,-160,308])
764
sage: p = K.ideal(i+1)
765
sage: E._get_local_data(p, False)
766
Local data at Fractional ideal (i + 1):
767
Reduction type: good
768
Local minimal model: Elliptic Curve defined by y^2 + x*y + y = x^3 + x^2 + (-10)*x + (-10) over Number Field in i with defining polynomial x^2 + 1
769
Minimal discriminant valuation: 0
770
Conductor exponent: 0
771
Kodaira Symbol: I0
772
Tamagawa Number: 1
773
774
Verify that we cache based on the proof value and the algorithm choice::
775
776
sage: E._get_local_data(p, False) is E._get_local_data(p, True)
777
False
778
779
sage: E._get_local_data(p, None, "pari") is E._get_local_data(p, None, "generic")
780
False
781
"""
782
try:
783
return self._local_data[P, proof, algorithm]
784
except AttributeError:
785
self._local_data = {}
786
except KeyError:
787
pass
788
from sage.schemes.elliptic_curves.ell_local_data import EllipticCurveLocalData
789
self._local_data[P, proof, algorithm] = EllipticCurveLocalData(self, P, proof, algorithm)
790
return self._local_data[P, proof, algorithm]
791
792
def local_minimal_model(self, P, proof = None, algorithm="pari"):
793
r"""
794
Returns a model which is integral at all primes and minimal at `P`.
795
796
INPUT:
797
798
- ``P`` -- either None or a prime ideal of the base field of self.
799
800
- ``proof`` -- whether to only use provably correct methods
801
(default controlled by global proof module). Note that the
802
proof module is number_field, not elliptic_curves, since the
803
functions that actually need the flag are in number fields.
804
805
- ``algorithm`` (string, default: "pari") -- Ignored unless the
806
base field is `\QQ`. If "pari", use the PARI C-library
807
``ellglobalred`` implementation of Tate's algorithm over
808
`\QQ`. If "generic", use the general number field
809
implementation.
810
811
OUTPUT:
812
813
A model of the curve which is minimal (and integral) at `P`.
814
815
.. note::
816
817
The model is not required to be integral on input.
818
819
For principal `P`, a generator is used as a uniformizer,
820
and integrality or minimality at other primes is not
821
affected. For non-principal `P`, the minimal model
822
returned will preserve integrality at other primes, but not
823
minimality.
824
825
EXAMPLES::
826
827
sage: K.<a>=NumberField(x^2-5)
828
sage: E=EllipticCurve([20, 225, 750, 625*a + 6875, 31250*a + 46875])
829
sage: P=K.ideal(a)
830
sage: E.local_minimal_model(P).ainvs()
831
(0, 1, 0, a - 33, -2*a + 64)
832
"""
833
if proof is None:
834
import sage.structure.proof.proof
835
# We use the "number_field" flag because the actual proof dependence is in PARI's number field functions.
836
proof = sage.structure.proof.proof.get_flag(None, "number_field")
837
838
return self.local_data(P, proof, algorithm).minimal_model()
839
840
def has_good_reduction(self, P):
841
r"""
842
Return True if this elliptic curve has good reduction at the prime `P`.
843
844
INPUT:
845
846
- ``P`` -- a prime ideal of the base field of self, or a field
847
element generating such an ideal.
848
849
OUTPUT:
850
851
(bool) -- True if the curve has good reduction at `P`, else False.
852
853
.. note::
854
855
This requires determining a local integral minimal model;
856
we do not just check that the discriminant of the current
857
model has valuation zero.
858
859
EXAMPLES::
860
861
sage: E=EllipticCurve('14a1')
862
sage: [(p,E.has_good_reduction(p)) for p in prime_range(15)]
863
[(2, False), (3, True), (5, True), (7, False), (11, True), (13, True)]
864
865
sage: K.<a>=NumberField(x^3-2)
866
sage: P17a, P17b = [P for P,e in K.factor(17)]
867
sage: E = EllipticCurve([0,0,0,0,2*a+1])
868
sage: [(p,E.has_good_reduction(p)) for p in [P17a,P17b]]
869
[(Fractional ideal (4*a^2 - 2*a + 1), True),
870
(Fractional ideal (2*a + 1), False)]
871
"""
872
return self.local_data(P).has_good_reduction()
873
874
def has_bad_reduction(self, P):
875
r"""
876
Return True if this elliptic curve has bad reduction at the prime `P`.
877
878
INPUT:
879
880
- ``P`` -- a prime ideal of the base field of self, or a field
881
element generating such an ideal.
882
883
OUTPUT:
884
885
(bool) True if the curve has bad reduction at `P`, else False.
886
887
.. note::
888
889
This requires determining a local integral minimal model;
890
we do not just check that the discriminant of the current
891
model has valuation zero.
892
893
EXAMPLES::
894
895
sage: E=EllipticCurve('14a1')
896
sage: [(p,E.has_bad_reduction(p)) for p in prime_range(15)]
897
[(2, True), (3, False), (5, False), (7, True), (11, False), (13, False)]
898
899
sage: K.<a>=NumberField(x^3-2)
900
sage: P17a, P17b = [P for P,e in K.factor(17)]
901
sage: E = EllipticCurve([0,0,0,0,2*a+1])
902
sage: [(p,E.has_bad_reduction(p)) for p in [P17a,P17b]]
903
[(Fractional ideal (4*a^2 - 2*a + 1), False),
904
(Fractional ideal (2*a + 1), True)]
905
"""
906
return self.local_data(P).has_bad_reduction()
907
908
def has_multiplicative_reduction(self, P):
909
r"""
910
Return True if this elliptic curve has (bad) multiplicative reduction at the prime `P`.
911
912
.. note::
913
914
See also ``has_split_multiplicative_reduction()`` and
915
``has_nonsplit_multiplicative_reduction()``.
916
917
INPUT:
918
919
- ``P`` -- a prime ideal of the base field of self, or a field
920
element generating such an ideal.
921
922
OUTPUT:
923
924
(bool) True if the curve has multiplicative reduction at `P`,
925
else False.
926
927
EXAMPLES::
928
929
sage: E=EllipticCurve('14a1')
930
sage: [(p,E.has_multiplicative_reduction(p)) for p in prime_range(15)]
931
[(2, True), (3, False), (5, False), (7, True), (11, False), (13, False)]
932
933
sage: K.<a>=NumberField(x^3-2)
934
sage: P17a, P17b = [P for P,e in K.factor(17)]
935
sage: E = EllipticCurve([0,0,0,0,2*a+1])
936
sage: [(p,E.has_multiplicative_reduction(p)) for p in [P17a,P17b]]
937
[(Fractional ideal (4*a^2 - 2*a + 1), False), (Fractional ideal (2*a + 1), False)]
938
"""
939
return self.local_data(P).has_multiplicative_reduction()
940
941
def has_split_multiplicative_reduction(self, P):
942
r"""
943
Return True if this elliptic curve has (bad) split multiplicative reduction at the prime `P`.
944
945
INPUT:
946
947
- ``P`` -- a prime ideal of the base field of self, or a field
948
element generating such an ideal.
949
950
OUTPUT:
951
952
(bool) True if the curve has split multiplicative reduction at
953
`P`, else False.
954
955
EXAMPLES::
956
957
sage: E=EllipticCurve('14a1')
958
sage: [(p,E.has_split_multiplicative_reduction(p)) for p in prime_range(15)]
959
[(2, False), (3, False), (5, False), (7, True), (11, False), (13, False)]
960
961
sage: K.<a>=NumberField(x^3-2)
962
sage: P17a, P17b = [P for P,e in K.factor(17)]
963
sage: E = EllipticCurve([0,0,0,0,2*a+1])
964
sage: [(p,E.has_split_multiplicative_reduction(p)) for p in [P17a,P17b]]
965
[(Fractional ideal (4*a^2 - 2*a + 1), False), (Fractional ideal (2*a + 1), False)]
966
"""
967
return self.local_data(P).has_split_multiplicative_reduction()
968
969
def has_nonsplit_multiplicative_reduction(self, P):
970
r"""
971
Return True if this elliptic curve has (bad) non-split multiplicative reduction at the prime `P`.
972
973
INPUT:
974
975
- ``P`` -- a prime ideal of the base field of self, or a field
976
element generating such an ideal.
977
978
OUTPUT:
979
980
(bool) True if the curve has non-split multiplicative
981
reduction at `P`, else False.
982
983
EXAMPLES::
984
985
sage: E=EllipticCurve('14a1')
986
sage: [(p,E.has_nonsplit_multiplicative_reduction(p)) for p in prime_range(15)]
987
[(2, True), (3, False), (5, False), (7, False), (11, False), (13, False)]
988
989
sage: K.<a>=NumberField(x^3-2)
990
sage: P17a, P17b = [P for P,e in K.factor(17)]
991
sage: E = EllipticCurve([0,0,0,0,2*a+1])
992
sage: [(p,E.has_nonsplit_multiplicative_reduction(p)) for p in [P17a,P17b]]
993
[(Fractional ideal (4*a^2 - 2*a + 1), False), (Fractional ideal (2*a + 1), False)]
994
"""
995
return self.local_data(P).has_nonsplit_multiplicative_reduction()
996
997
def has_additive_reduction(self, P):
998
r"""
999
Return True if this elliptic curve has (bad) additive reduction at the prime `P`.
1000
1001
INPUT:
1002
1003
- ``P`` -- a prime ideal of the base field of self, or a field
1004
element generating such an ideal.
1005
1006
OUTPUT:
1007
1008
(bool) True if the curve has additive reduction at `P`, else False.
1009
1010
EXAMPLES::
1011
1012
sage: E=EllipticCurve('27a1')
1013
sage: [(p,E.has_additive_reduction(p)) for p in prime_range(15)]
1014
[(2, False), (3, True), (5, False), (7, False), (11, False), (13, False)]
1015
1016
sage: K.<a>=NumberField(x^3-2)
1017
sage: P17a, P17b = [P for P,e in K.factor(17)]
1018
sage: E = EllipticCurve([0,0,0,0,2*a+1])
1019
sage: [(p,E.has_additive_reduction(p)) for p in [P17a,P17b]]
1020
[(Fractional ideal (4*a^2 - 2*a + 1), False),
1021
(Fractional ideal (2*a + 1), True)]
1022
"""
1023
return self.local_data(P).has_additive_reduction()
1024
1025
def tamagawa_number(self, P, proof = None):
1026
r"""
1027
Returns the Tamagawa number of this elliptic curve at the prime `P`.
1028
1029
INPUT:
1030
1031
- ``P`` -- either None or a prime ideal of the base field of self.
1032
1033
- ``proof`` -- whether to only use provably correct methods
1034
(default controlled by global proof module). Note that the
1035
proof module is number_field, not elliptic_curves, since the
1036
functions that actually need the flag are in number fields.
1037
1038
OUTPUT:
1039
1040
(positive integer) The Tamagawa number of the curve at `P`.
1041
1042
EXAMPLES::
1043
1044
sage: K.<a>=NumberField(x^2-5)
1045
sage: E=EllipticCurve([20, 225, 750, 625*a + 6875, 31250*a + 46875])
1046
sage: [E.tamagawa_number(P) for P in E.discriminant().support()]
1047
[1, 1, 1, 1]
1048
sage: K.<a> = QuadraticField(-11)
1049
sage: E = EllipticCurve('11a1').change_ring(K)
1050
sage: [E.tamagawa_number(P) for P in K(11).support()]
1051
[10]
1052
"""
1053
if proof is None:
1054
import sage.structure.proof.proof
1055
# We use the "number_field" flag because the actual proof dependence is in PARI's number field functions.
1056
proof = sage.structure.proof.proof.get_flag(None, "number_field")
1057
1058
return self.local_data(P, proof).tamagawa_number()
1059
1060
def tamagawa_numbers(self):
1061
"""
1062
Return a list of all Tamagawa numbers for all prime divisors of the
1063
conductor (in order).
1064
1065
EXAMPLES::
1066
1067
sage: e = EllipticCurve('30a1')
1068
sage: e.tamagawa_numbers()
1069
[2, 3, 1]
1070
sage: vector(e.tamagawa_numbers())
1071
(2, 3, 1)
1072
sage: K.<a>=NumberField(x^2+3)
1073
sage: eK = e.base_extend(K)
1074
sage: eK.tamagawa_numbers()
1075
[4, 6, 1]
1076
"""
1077
return [self.tamagawa_number(p) for p in prime_divisors(self.conductor())]
1078
1079
def tamagawa_exponent(self, P, proof = None):
1080
r"""
1081
Returns the Tamagawa index of this elliptic curve at the prime `P`.
1082
1083
INPUT:
1084
1085
- ``P`` -- either None or a prime ideal of the base field of self.
1086
1087
- ``proof`` -- whether to only use provably correct methods
1088
(default controlled by global proof module). Note that the
1089
proof module is number_field, not elliptic_curves, since the
1090
functions that actually need the flag are in number fields.
1091
1092
OUTPUT:
1093
1094
(positive integer) The Tamagawa index of the curve at P.
1095
1096
EXAMPLES::
1097
1098
sage: K.<a>=NumberField(x^2-5)
1099
sage: E=EllipticCurve([20, 225, 750, 625*a + 6875, 31250*a + 46875])
1100
sage: [E.tamagawa_exponent(P) for P in E.discriminant().support()]
1101
[1, 1, 1, 1]
1102
sage: K.<a> = QuadraticField(-11)
1103
sage: E = EllipticCurve('11a1').change_ring(K)
1104
sage: [E.tamagawa_exponent(P) for P in K(11).support()]
1105
[10]
1106
"""
1107
if proof is None:
1108
import sage.structure.proof.proof
1109
# We use the "number_field" flag because the actual proof dependence is in PARI's number field functions.
1110
proof = sage.structure.proof.proof.get_flag(None, "number_field")
1111
1112
return self.local_data(P, proof).tamagawa_exponent()
1113
1114
def tamagawa_product_bsd(self):
1115
r"""
1116
Given an elliptic curve `E` over a number field `K`, this function returns the
1117
integer `C(E/K)` that appears in the Birch and Swinnerton-Dyer conjecture accounting
1118
for the local information at finite places. If the model is a global minimal model then `C(E/K)` is
1119
simply the product of the Tamagawa numbers `c_v` where `v` runs over all prime ideals of `K`. Otherwise, if the model has to be changed at a place `v` a correction factor appears.
1120
The definition is such that `C(E/K)` times the periods at the infinite places is invariant
1121
under change of the Weierstrass model. See [Ta2] and [Do] for details.
1122
1123
.. note::
1124
1125
This definition is slightly different from the definition of ``tamagawa_product``
1126
for curves defined over `\QQ`. Over the rational number it is always defined to be the product
1127
of the Tamagawa numbers, so the two definitions only agree when the model is global minimal.
1128
1129
OUTPUT:
1130
1131
A rational number
1132
1133
EXAMPLES::
1134
1135
sage: K.<i> = NumberField(x^2+1)
1136
sage: E = EllipticCurve([0,2+i])
1137
sage: E.tamagawa_product_bsd()
1138
1
1139
1140
sage: E = EllipticCurve([(2*i+1)^2,i*(2*i+1)^7])
1141
sage: E.tamagawa_product_bsd()
1142
4
1143
1144
An example where the Neron model changes over K::
1145
1146
sage: K.<t> = NumberField(x^5-10*x^3+5*x^2+10*x+1)
1147
sage: E = EllipticCurve(K,'75a1')
1148
sage: E.tamagawa_product_bsd()
1149
5
1150
sage: da = E.local_data()
1151
sage: [dav.tamagawa_number() for dav in da]
1152
[1, 1]
1153
1154
An example over `\mathbb{Q}` (trac #9413)::
1155
1156
sage: E = EllipticCurve('30a')
1157
sage: E.tamagawa_product_bsd()
1158
6
1159
1160
REFERENCES:
1161
1162
- [Ta2] Tate, John, On the conjectures of Birch and Swinnerton-Dyer and a geometric analog. Seminaire Bourbaki, Vol. 9, Exp. No. 306.
1163
1164
- [Do] Dokchitser, Tim and Vladimir, On the Birch-Swinnerton-Dyer quotients modulo squares, Annals of Math., 2010.
1165
1166
"""
1167
da = self.local_data()
1168
pr = 1
1169
for dav in da:
1170
pp = dav.prime()
1171
cv = dav.tamagawa_number()
1172
# uu is the quotient of the Neron differential at pp divided by
1173
# the differential associated to this particular equation E
1174
uu = self.isomorphism_to(dav.minimal_model()).u
1175
if self.base_field().degree() == 1:
1176
p = pp.gens_reduced()[0]
1177
f = 1
1178
v = valuation(ZZ(uu),p)
1179
else:
1180
p = pp.smallest_integer()
1181
f = pp.residue_class_degree()
1182
v = valuation(uu,pp)
1183
uu_abs_val = p**(f*v)
1184
pr *= cv * uu_abs_val
1185
return pr
1186
1187
def kodaira_symbol(self, P, proof = None):
1188
r"""
1189
Returns the Kodaira Symbol of this elliptic curve at the prime `P`.
1190
1191
INPUT:
1192
1193
- ``P`` -- either None or a prime ideal of the base field of self.
1194
1195
- ``proof`` -- whether to only use provably correct methods
1196
(default controlled by global proof module). Note that the
1197
proof module is number_field, not elliptic_curves, since the
1198
functions that actually need the flag are in number fields.
1199
1200
OUTPUT:
1201
1202
The Kodaira Symbol of the curve at P, represented as a string.
1203
1204
EXAMPLES::
1205
1206
sage: K.<a>=NumberField(x^2-5)
1207
sage: E=EllipticCurve([20, 225, 750, 625*a + 6875, 31250*a + 46875])
1208
sage: bad_primes = E.discriminant().support(); bad_primes
1209
[Fractional ideal (-a), Fractional ideal (7/2*a - 81/2), Fractional ideal (-a - 52), Fractional ideal (2)]
1210
sage: [E.kodaira_symbol(P) for P in bad_primes]
1211
[I0, I1, I1, II]
1212
sage: K.<a> = QuadraticField(-11)
1213
sage: E = EllipticCurve('11a1').change_ring(K)
1214
sage: [E.kodaira_symbol(P) for P in K(11).support()]
1215
[I10]
1216
"""
1217
if proof is None:
1218
import sage.structure.proof.proof
1219
# We use the "number_field" flag because the actual proof dependence is in PARI's number field functions.
1220
proof = sage.structure.proof.proof.get_flag(None, "number_field")
1221
1222
return self.local_data(P, proof).kodaira_symbol()
1223
1224
1225
def conductor(self):
1226
r"""
1227
Returns the conductor of this elliptic curve as a fractional
1228
ideal of the base field.
1229
1230
OUTPUT:
1231
1232
(fractional ideal) The conductor of the curve.
1233
1234
EXAMPLES::
1235
1236
sage: K.<i>=NumberField(x^2+1)
1237
sage: EllipticCurve([i, i - 1, i + 1, 24*i + 15, 14*i + 35]).conductor()
1238
Fractional ideal (21*i - 3)
1239
sage: K.<a>=NumberField(x^2-x+3)
1240
sage: EllipticCurve([1 + a , -1 + a , 1 + a , -11 + a , 5 -9*a ]).conductor()
1241
Fractional ideal (6*a)
1242
1243
A not so well known curve with everywhere good reduction::
1244
1245
sage: K.<a>=NumberField(x^2-38)
1246
sage: E=EllipticCurve([0,0,0, 21796814856932765568243810*a - 134364590724198567128296995, 121774567239345229314269094644186997594*a - 750668847495706904791115375024037711300])
1247
sage: E.conductor()
1248
Fractional ideal (1)
1249
1250
An example which used to fail (see trac #5307)::
1251
1252
sage: K.<w>=NumberField(x^2+x+6)
1253
sage: E=EllipticCurve([w,-1,0,-w-6,0])
1254
sage: E.conductor()
1255
Fractional ideal (86304, w + 5898)
1256
1257
An example raised in \#11346::
1258
1259
sage: K.<g> = NumberField(x^2 - x - 1)
1260
sage: E1 = EllipticCurve(K,[0,0,0,-1/48,-161/864])
1261
sage: [(p.smallest_integer(),e) for p,e in E1.conductor().factor()]
1262
[(2, 4), (3, 1), (5, 1)]
1263
"""
1264
try:
1265
return self._conductor
1266
except AttributeError:
1267
pass
1268
1269
# Note: for number fields other than QQ we could initialize
1270
# N=K.ideal(1) or N=OK.ideal(1), which are the same, but for
1271
# K==QQ it has to be ZZ.ideal(1).
1272
OK = self.base_ring().ring_of_integers()
1273
self._conductor = prod([d.prime()**(d.conductor_valuation()) \
1274
for d in self.local_data()],\
1275
OK.ideal(1))
1276
return self._conductor
1277
1278
def global_minimal_model(self, proof = None):
1279
r"""
1280
Returns a model of self that is integral, minimal at all primes.
1281
1282
.. note::
1283
1284
This is only implemented for class number 1. In general,
1285
such a model may or may not exist.
1286
1287
INPUT:
1288
1289
- ``proof`` -- whether to only use provably correct methods
1290
(default controlled by global proof module). Note that the
1291
proof module is number_field, not elliptic_curves, since the
1292
functions that actually need the flag are in number fields.
1293
1294
OUTPUT:
1295
1296
A global integral and minimal model.
1297
1298
EXAMPLES::
1299
1300
sage: K.<a> = NumberField(x^2-38)
1301
sage: E = EllipticCurve([0,0,0, 21796814856932765568243810*a - 134364590724198567128296995, 121774567239345229314269094644186997594*a - 750668847495706904791115375024037711300])
1302
1303
sage: E2 = E.global_minimal_model()
1304
sage: E2 # random (the global minimal model is not unique)
1305
Elliptic Curve defined by y^2 + a*x*y + (a+1)*y = x^3 + (a+1)*x^2 + (368258520200522046806318444*a-2270097978636731786720859345)*x + (8456608930173478039472018047583706316424*a-52130038506793883217874390501829588391299) over Number Field in a with defining polynomial x^2 - 38
1306
1307
sage: E2.local_data()
1308
[]
1309
1310
See trac \#11347::
1311
1312
sage: K.<g> = NumberField(x^2 - x - 1)
1313
sage: E = EllipticCurve(K,[0,0,0,-1/48,161/864]).integral_model().global_minimal_model(); E
1314
Elliptic Curve defined by y^2 + x*y + y = x^3 + x^2 over Number Field in g with defining polynomial x^2 - x - 1
1315
sage: [(p.norm(), e) for p, e in E.conductor().factor()]
1316
[(9, 1), (5, 1)]
1317
sage: [(p.norm(), e) for p, e in E.discriminant().factor()]
1318
[(9, 1), (-5, 2)]
1319
"""
1320
if proof is None:
1321
import sage.structure.proof.proof
1322
# We use the "number_field" flag because the actual proof dependence is in PARI's number field functions.
1323
proof = sage.structure.proof.proof.get_flag(None, "number_field")
1324
K = self.base_ring()
1325
if K.class_number() != 1:
1326
raise ValueError, "global minimal models only exist in general for class number 1"
1327
1328
E = self.global_integral_model()
1329
primes = E.base_ring()(E.discriminant()).support()
1330
for P in primes:
1331
E = E.local_data(P,proof).minimal_model()
1332
return E._reduce_model()
1333
1334
def reduction(self,place):
1335
r"""
1336
Return the reduction of the elliptic curve at a place of good reduction.
1337
1338
INPUT:
1339
1340
- ``place`` -- a prime ideal in the base field of the curve
1341
1342
OUTPUT:
1343
1344
An elliptic curve over a finite field, the residue field of the place.
1345
1346
EXAMPLES::
1347
1348
sage: K.<i> = QuadraticField(-1)
1349
sage: EK = EllipticCurve([0,0,0,i,i+3])
1350
sage: v = K.fractional_ideal(2*i+3)
1351
sage: EK.reduction(v)
1352
Elliptic Curve defined by y^2 = x^3 + 5*x + 8 over Residue field of Fractional ideal (2*i + 3)
1353
sage: EK.reduction(K.ideal(1+i))
1354
Traceback (most recent call last):
1355
...
1356
ValueError: The curve must have good reduction at the place.
1357
sage: EK.reduction(K.ideal(2))
1358
Traceback (most recent call last):
1359
...
1360
ValueError: The ideal must be prime.
1361
sage: K=QQ.extension(x^2+x+1,"a")
1362
sage: E=EllipticCurve([1024*K.0,1024*K.0])
1363
sage: E.reduction(2*K)
1364
Elliptic Curve defined by y^2 + (abar+1)*y = x^3 over Residue field in abar of Fractional ideal (2)
1365
"""
1366
K = self.base_field()
1367
OK = K.ring_of_integers()
1368
try:
1369
place = K.ideal(place)
1370
except TypeError:
1371
raise TypeError, "The parameter must be an ideal of the base field of the elliptic curve"
1372
if not place.is_prime():
1373
raise ValueError, "The ideal must be prime."
1374
disc = self.discriminant()
1375
if not K.ideal(disc).valuation(place) == 0:
1376
local_data=self.local_data(place)
1377
if local_data.has_good_reduction():
1378
Fv = OK.residue_field(place)
1379
return local_data.minimal_model().change_ring(Fv)
1380
raise ValueError, "The curve must have good reduction at the place."
1381
Fv = OK.residue_field(place)
1382
return self.change_ring(Fv)
1383
1384
def _torsion_bound(self,number_of_places = 20):
1385
r"""
1386
An upper bound on the order of the torsion subgroup.
1387
1388
INPUT:
1389
1390
- ``number_of_places`` (positive integer, default = 20) -- the
1391
number of places that will be used to find the bound.
1392
1393
OUTPUT:
1394
1395
(integer) An upper bound on the torsion order.
1396
1397
ALGORITHM:
1398
1399
An upper bound on the order of the torsion.group of the
1400
elliptic curve is obtained by counting points modulo several
1401
primes of good reduction. Note that the upper bound returned
1402
by this function is a multiple of the order of the torsion
1403
group, and in general will be greater than the order.
1404
1405
EXAMPLES::
1406
1407
sage: CDB=CremonaDatabase()
1408
sage: [E._torsion_bound() for E in CDB.iter([14])]
1409
[6, 6, 6, 6, 6, 6]
1410
sage: [E.torsion_order() for E in CDB.iter([14])]
1411
[6, 6, 2, 6, 2, 6]
1412
"""
1413
E = self
1414
bound = 0
1415
k = 0
1416
K = E.base_field()
1417
OK = K.ring_of_integers()
1418
disc = E.discriminant()
1419
p = Integer(1)
1420
# runs through primes, decomposes them into prime ideals
1421
while k < number_of_places :
1422
p = p.next_prime()
1423
f = K.primes_above(p)
1424
# runs through prime ideals above p
1425
for qq in f:
1426
fqq = qq.residue_class_degree()
1427
charqq = qq.smallest_integer()
1428
# take only places with small residue field (so that the
1429
# number of points will be small)
1430
if fqq == 1 or charqq**fqq < 3*number_of_places:
1431
# check if the model is integral at the place
1432
if min([K.ideal(a).valuation(qq) for a in E.a_invariants()]) >= 0:
1433
eqq = qq.ramification_index()
1434
# check if the formal group at the place is torsion-free
1435
# if so the torsion injects into the reduction
1436
if eqq < charqq - 1 and disc.valuation(qq) == 0:
1437
Etilda = E.reduction(qq)
1438
Npp = Etilda.cardinality()
1439
bound = gcd(bound,Npp)
1440
if bound == 1:
1441
return bound
1442
k += 1
1443
return bound
1444
1445
def torsion_subgroup(self):
1446
r"""
1447
Returns the torsion subgroup of this elliptic curve.
1448
1449
OUTPUT:
1450
1451
(``EllipticCurveTorsionSubgroup``) The
1452
``EllipticCurveTorsionSubgroup`` associated to this elliptic
1453
curve.
1454
1455
EXAMPLES::
1456
1457
sage: E = EllipticCurve('11a1')
1458
sage: K.<t>=NumberField(x^4 + x^3 + 11*x^2 + 41*x + 101)
1459
sage: EK=E.base_extend(K)
1460
sage: tor = EK.torsion_subgroup()
1461
sage: tor
1462
Torsion Subgroup isomorphic to Z/5 + Z/5 associated to the Elliptic Curve defined by y^2 + y = x^3 + (-1)*x^2 + (-10)*x + (-20) over Number Field in t with defining polynomial x^4 + x^3 + 11*x^2 + 41*x + 101
1463
sage: tor.gens()
1464
((16 : 60 : 1), (t : 1/11*t^3 + 6/11*t^2 + 19/11*t + 48/11 : 1))
1465
1466
::
1467
1468
sage: E = EllipticCurve('15a1')
1469
sage: K.<t>=NumberField(x^2 + 2*x + 10)
1470
sage: EK=E.base_extend(K)
1471
sage: EK.torsion_subgroup()
1472
Torsion Subgroup isomorphic to Z/4 + Z/4 associated to the Elliptic Curve defined by y^2 + x*y + y = x^3 + x^2 + (-10)*x + (-10) over Number Field in t with defining polynomial x^2 + 2*x + 10
1473
1474
::
1475
1476
sage: E = EllipticCurve('19a1')
1477
sage: K.<t>=NumberField(x^9-3*x^8-4*x^7+16*x^6-3*x^5-21*x^4+5*x^3+7*x^2-7*x+1)
1478
sage: EK=E.base_extend(K)
1479
sage: EK.torsion_subgroup()
1480
Torsion Subgroup isomorphic to Z/9 associated to the Elliptic Curve defined by y^2 + y = x^3 + x^2 + (-9)*x + (-15) over Number Field in t with defining polynomial x^9 - 3*x^8 - 4*x^7 + 16*x^6 - 3*x^5 - 21*x^4 + 5*x^3 + 7*x^2 - 7*x + 1
1481
1482
::
1483
1484
sage: K.<i> = QuadraticField(-1)
1485
sage: EK = EllipticCurve([0,0,0,i,i+3])
1486
sage: EK.torsion_subgroup ()
1487
Torsion Subgroup isomorphic to Trivial group associated to the Elliptic Curve defined by y^2 = x^3 + i*x + (i+3) over Number Field in i with defining polynomial x^2 + 1
1488
"""
1489
try:
1490
return self.__torsion_subgroup
1491
except AttributeError:
1492
self.__torsion_subgroup = ell_torsion.EllipticCurveTorsionSubgroup(self)
1493
return self.__torsion_subgroup
1494
1495
def torsion_order(self):
1496
r"""
1497
Returns the order of the torsion subgroup of this elliptic curve.
1498
1499
OUTPUT:
1500
1501
(integer) the order of the torsion subgroup of this elliptic curve.
1502
1503
EXAMPLES::
1504
1505
sage: E = EllipticCurve('11a1')
1506
sage: K.<t> = NumberField(x^4 + x^3 + 11*x^2 + 41*x + 101)
1507
sage: EK = E.base_extend(K)
1508
sage: EK.torsion_order()
1509
25
1510
1511
::
1512
1513
sage: E = EllipticCurve('15a1')
1514
sage: K.<t> = NumberField(x^2 + 2*x + 10)
1515
sage: EK = E.base_extend(K)
1516
sage: EK.torsion_order()
1517
16
1518
1519
::
1520
1521
sage: E = EllipticCurve('19a1')
1522
sage: K.<t> = NumberField(x^9-3*x^8-4*x^7+16*x^6-3*x^5-21*x^4+5*x^3+7*x^2-7*x+1)
1523
sage: EK = E.base_extend(K)
1524
sage: EK.torsion_order()
1525
9
1526
1527
::
1528
1529
sage: K.<i> = QuadraticField(-1)
1530
sage: EK = EllipticCurve([0,0,0,i,i+3])
1531
sage: EK.torsion_order()
1532
1
1533
"""
1534
try:
1535
return self.__torsion_order
1536
except AttributeError:
1537
self.__torsion_order = self.torsion_subgroup().order()
1538
return self.__torsion_order
1539
1540
def torsion_points(self):
1541
r"""
1542
Returns a list of the torsion points of this elliptic curve.
1543
1544
OUTPUT:
1545
1546
(list) A sorted list of the torsion points.
1547
1548
EXAMPLES::
1549
1550
sage: E = EllipticCurve('11a1')
1551
sage: E.torsion_points()
1552
[(0 : 1 : 0), (5 : -6 : 1), (5 : 5 : 1), (16 : -61 : 1), (16 : 60 : 1)]
1553
sage: K.<t> = NumberField(x^4 + x^3 + 11*x^2 + 41*x + 101)
1554
sage: EK = E.base_extend(K)
1555
sage: EK.torsion_points()
1556
[(16 : 60 : 1),
1557
(5 : 5 : 1),
1558
(5 : -6 : 1),
1559
(16 : -61 : 1),
1560
(t : 1/11*t^3 + 6/11*t^2 + 19/11*t + 48/11 : 1),
1561
(-3/55*t^3 - 7/55*t^2 - 2/55*t - 133/55 : 6/55*t^3 + 3/55*t^2 + 25/11*t + 156/55 : 1),
1562
(-9/121*t^3 - 21/121*t^2 - 127/121*t - 377/121 : -7/121*t^3 + 24/121*t^2 + 197/121*t + 16/121 : 1),
1563
(5/121*t^3 - 14/121*t^2 - 158/121*t - 453/121 : -49/121*t^3 - 129/121*t^2 - 315/121*t - 207/121 : 1),
1564
(10/121*t^3 + 49/121*t^2 + 168/121*t + 73/121 : 32/121*t^3 + 60/121*t^2 - 261/121*t - 807/121 : 1),
1565
(1/11*t^3 - 5/11*t^2 + 19/11*t - 40/11 : -6/11*t^3 - 3/11*t^2 - 26/11*t - 321/11 : 1),
1566
(14/121*t^3 - 15/121*t^2 + 90/121*t + 232/121 : 16/121*t^3 - 69/121*t^2 + 293/121*t - 46/121 : 1),
1567
(3/55*t^3 + 7/55*t^2 + 2/55*t + 78/55 : 7/55*t^3 - 24/55*t^2 + 9/11*t + 17/55 : 1),
1568
(-5/121*t^3 + 36/121*t^2 - 84/121*t + 24/121 : 34/121*t^3 - 27/121*t^2 + 305/121*t + 708/121 : 1),
1569
(-26/121*t^3 + 20/121*t^2 - 219/121*t - 995/121 : 15/121*t^3 + 156/121*t^2 - 232/121*t + 2766/121 : 1),
1570
(1/11*t^3 - 5/11*t^2 + 19/11*t - 40/11 : 6/11*t^3 + 3/11*t^2 + 26/11*t + 310/11 : 1),
1571
(-26/121*t^3 + 20/121*t^2 - 219/121*t - 995/121 : -15/121*t^3 - 156/121*t^2 + 232/121*t - 2887/121 : 1),
1572
(-5/121*t^3 + 36/121*t^2 - 84/121*t + 24/121 : -34/121*t^3 + 27/121*t^2 - 305/121*t - 829/121 : 1),
1573
(3/55*t^3 + 7/55*t^2 + 2/55*t + 78/55 : -7/55*t^3 + 24/55*t^2 - 9/11*t - 72/55 : 1),
1574
(14/121*t^3 - 15/121*t^2 + 90/121*t + 232/121 : -16/121*t^3 + 69/121*t^2 - 293/121*t - 75/121 : 1),
1575
(t : -1/11*t^3 - 6/11*t^2 - 19/11*t - 59/11 : 1),
1576
(10/121*t^3 + 49/121*t^2 + 168/121*t + 73/121 : -32/121*t^3 - 60/121*t^2 + 261/121*t + 686/121 : 1),
1577
(5/121*t^3 - 14/121*t^2 - 158/121*t - 453/121 : 49/121*t^3 + 129/121*t^2 + 315/121*t + 86/121 : 1),
1578
(-9/121*t^3 - 21/121*t^2 - 127/121*t - 377/121 : 7/121*t^3 - 24/121*t^2 - 197/121*t - 137/121 : 1),
1579
(-3/55*t^3 - 7/55*t^2 - 2/55*t - 133/55 : -6/55*t^3 - 3/55*t^2 - 25/11*t - 211/55 : 1),
1580
(0 : 1 : 0)]
1581
1582
::
1583
1584
sage: E = EllipticCurve('15a1')
1585
sage: K.<t> = NumberField(x^2 + 2*x + 10)
1586
sage: EK = E.base_extend(K)
1587
sage: EK.torsion_points()
1588
[(8 : 18 : 1),
1589
(3 : -2 : 1),
1590
(8 : -27 : 1),
1591
(t : t - 5 : 1),
1592
(1/2 : 5/4*t + 1/2 : 1),
1593
(-t - 2 : 2*t + 8 : 1),
1594
(-7 : -5*t - 2 : 1),
1595
(-1 : 0 : 1),
1596
(-2 : 3 : 1),
1597
(-13/4 : 9/8 : 1),
1598
(-2 : -2 : 1),
1599
(t : -2*t + 4 : 1),
1600
(-7 : 5*t + 8 : 1),
1601
(-t - 2 : -t - 7 : 1),
1602
(1/2 : -5/4*t - 2 : 1),
1603
(0 : 1 : 0)]
1604
1605
::
1606
1607
sage: K.<i> = QuadraticField(-1)
1608
sage: EK = EllipticCurve(K,[0,0,0,0,-1])
1609
sage: EK.torsion_points ()
1610
[(-2 : -3*i : 1), (0 : -i : 1), (1 : 0 : 1), (0 : i : 1), (-2 : 3*i : 1), (0 : 1 : 0)]
1611
"""
1612
T = self.torsion_subgroup() # make sure it is cached
1613
return sorted(T.points()) # these are also cached in T
1614
1615
def rank_bounds(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30):
1616
r"""
1617
Returns the lower and upper bounds using :meth:`~simon_two_descent`.
1618
The results of :meth:`~simon_two_descent` are cached.
1619
1620
.. NOTE::
1621
1622
The optional parameters control the Simon two descent algorithm;
1623
see the documentation of :meth:`~simon_two_descent` for more
1624
details.
1625
1626
INPUT:
1627
1628
- ``verbose`` -- 0, 1, 2, or 3 (default: 0), the verbosity level
1629
1630
- ``lim1`` -- (default: 5) limit on trivial points on quartics
1631
1632
- ``lim3`` -- (default: 50) limit on points on ELS quartics
1633
1634
- ``limtriv`` -- (default: 10) limit on trivial points on elliptic curve
1635
1636
- ``maxprob`` -- (default: 20)
1637
1638
- ``limbigprime`` -- (default: 30) to distinguish between
1639
small and large prime numbers. Use probabilistic tests for
1640
large primes. If 0, don't use probabilistic tests.
1641
1642
OUTPUT:
1643
1644
lower and upper bounds
1645
1646
1647
.. NOTE::
1648
1649
For non-quadratic number fields, this code does
1650
return, but it takes a long time.
1651
1652
EXAMPLES::
1653
1654
sage: K.<a> = NumberField(x^2 + 23, 'a')
1655
sage: E = EllipticCurve(K, '37')
1656
sage: E == loads(dumps(E))
1657
True
1658
sage: E.rank_bounds()
1659
(2, 2)
1660
1661
Here is a curve with two-torsion, so here the algorithm gives
1662
bounds on the rank::
1663
1664
sage: Qrt5.<rt5>=NumberField(x^2-5)
1665
sage: E=EllipticCurve([0,5-rt5,0,rt5,0])
1666
sage: E.rank_bounds()
1667
(1, 2)
1668
1669
IMPLEMENTATION:
1670
1671
Uses Denis Simon's PARI/GP scripts from
1672
http://www.math.unicaen.fr/~simon/.
1673
1674
"""
1675
1676
lower, upper, gens = self.simon_two_descent(verbose=verbose,lim1=lim1,lim3=lim3,limtriv=limtriv,maxprob=maxprob,limbigprime=limbigprime)
1677
return lower,upper
1678
1679
def rank(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30):
1680
r"""
1681
Return the rank of this elliptic curve, if it can be determined.
1682
1683
.. NOTE::
1684
1685
The optional parameters control the Simon two descent algorithm;
1686
see the documentation of :meth:`~simon_two_descent` for more
1687
details.
1688
1689
INPUT:
1690
1691
- ``verbose`` -- 0, 1, 2, or 3 (default: 0), the verbosity level
1692
1693
- ``lim1`` -- (default: 5) limit on trivial points on quartics
1694
1695
- ``lim3`` -- (default: 50) limit on points on ELS quartics
1696
1697
- ``limtriv`` -- (default: 10) limit on trivial points on elliptic curve
1698
1699
- ``maxprob`` -- (default: 20)
1700
1701
- ``limbigprime`` -- (default: 30) to distinguish between
1702
small and large prime numbers. Use probabilistic tests for
1703
large primes. If 0, don't use probabilistic tests.
1704
1705
OUTPUT:
1706
1707
If the upper and lower bounds given by Simon two-descent are
1708
the same, then the rank has been uniquely identified and we
1709
return this. Otherwise, we raise a ValueError with an error
1710
message specifying the upper and lower bounds.
1711
1712
.. NOTE::
1713
1714
For non-quadratic number fields, this code does return, but it takes
1715
a long time.
1716
1717
EXAMPLES::
1718
1719
sage: K.<a> = NumberField(x^2 + 23, 'a')
1720
sage: E = EllipticCurve(K, '37')
1721
sage: E == loads(dumps(E))
1722
True
1723
sage: E.rank()
1724
2
1725
1726
Here is a curve with two-torsion, so here the bounds given by the
1727
algorithm do not uniquely determine the rank::
1728
1729
sage: Qrt5.<rt5>=NumberField(x^2-5)
1730
sage: E=EllipticCurve([0,5-rt5,0,rt5,0])
1731
sage: E.rank()
1732
Traceback (most recent call last):
1733
...
1734
ValueError: There is insufficient data to determine the rank -
1735
2-descent gave lower bound 1 and upper bound 2
1736
1737
IMPLEMENTATION:
1738
1739
Uses Denis Simon's PARI/GP scripts from
1740
http://www.math.unicaen.fr/~simon/.
1741
1742
"""
1743
1744
lower,upper = self.rank_bounds(verbose=verbose,lim1=lim1,lim3=lim3,limtriv=limtriv,maxprob=maxprob,limbigprime=limbigprime)
1745
if lower == upper:
1746
return lower
1747
else:
1748
raise ValueError, 'There is insufficient data to determine the rank - 2-descent gave lower bound %s and upper bound %s' % (lower, upper)
1749
1750
def gens(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30):
1751
r"""
1752
Returns some generators of this elliptic curve. Check :meth:`~rank` or
1753
:meth:`~rank_bounds` to verify the number of generators.
1754
1755
.. NOTE::
1756
1757
The optional parameters control the Simon two descent algorithm;
1758
see the documentation of :meth:`~simon_two_descent` for more
1759
details.
1760
1761
INPUT:
1762
1763
- ``verbose`` -- 0, 1, 2, or 3 (default: 0), the verbosity level
1764
1765
- ``lim1`` -- (default: 5) limit on trivial points on quartics
1766
1767
- ``lim3`` -- (default: 50) limit on points on ELS quartics
1768
1769
- ``limtriv`` -- (default: 10) limit on trivial points on elliptic curve
1770
1771
- ``maxprob`` -- (default: 20)
1772
1773
- ``limbigprime`` -- (default: 30) to distinguish between
1774
small and large prime numbers. Use probabilistic tests for
1775
large primes. If 0, don't use probabilistic tests.
1776
1777
OUTPUT:
1778
1779
The linearly independent elements given by the Simon two-descent.
1780
1781
.. NOTE::
1782
1783
For non-quadratic number fields, this code does return, but it takes
1784
a long time.
1785
1786
EXAMPLES::
1787
1788
sage: K.<a> = NumberField(x^2 + 23, 'a')
1789
sage: E = EllipticCurve(K, '37')
1790
sage: E == loads(dumps(E))
1791
True
1792
sage: E.gens()
1793
[(-1 : 0 : 1), (1/2*a - 5/2 : -1/2*a - 13/2 : 1)]
1794
1795
1796
Here is a curve with two-torsion, so here the algorithm does not
1797
uniquely determine the rank::
1798
1799
sage: Qrt5.<rt5>=NumberField(x^2-5)
1800
sage: E=EllipticCurve([0,5-rt5,0,rt5,0])
1801
sage: E.gens()
1802
[(3/2*rt5 + 5/2 : -9/2*rt5 - 15/2 : 1), (-1/2*rt5 + 3/2 : 3/2*rt5 - 9/2 : 1), (0 : 0 : 1)]
1803
1804
IMPLEMENTATION:
1805
1806
Uses Denis Simon's PARI/GP scripts from
1807
http://www.math.unicaen.fr/~simon/.
1808
"""
1809
1810
lower,upper,gens = self.simon_two_descent(verbose=verbose,lim1=lim1,lim3=lim3,limtriv=limtriv,maxprob=maxprob,limbigprime=limbigprime)
1811
return gens
1812
1813
1814
def period_lattice(self, embedding):
1815
r"""
1816
Returns the period lattice of the elliptic curve for the given
1817
embedding of its base field with respect to the differential
1818
`dx/(2y + a_1x + a_3)`.
1819
1820
INPUT:
1821
1822
- ``embedding`` - an embedding of the base number field into `\RR` or `\CC`.
1823
1824
.. note::
1825
1826
The precision of the embedding is ignored: we only use the
1827
given embedding to determine which embedding into ``QQbar``
1828
to use. Once the lattice has been initialized, periods can
1829
be computed to arbitrary precision.
1830
1831
1832
EXAMPLES:
1833
1834
First define a field with two real embeddings::
1835
1836
sage: K.<a> = NumberField(x^3-2)
1837
sage: E=EllipticCurve([0,0,0,a,2])
1838
sage: embs=K.embeddings(CC); len(embs)
1839
3
1840
1841
For each embedding we have a different period lattice::
1842
1843
sage: E.period_lattice(embs[0])
1844
Period lattice associated to Elliptic Curve defined by y^2 = x^3 + a*x + 2 over Number Field in a with defining polynomial x^3 - 2 with respect to the embedding Ring morphism:
1845
From: Number Field in a with defining polynomial x^3 - 2
1846
To: Algebraic Field
1847
Defn: a |--> -0.6299605249474365? - 1.091123635971722?*I
1848
1849
sage: E.period_lattice(embs[1])
1850
Period lattice associated to Elliptic Curve defined by y^2 = x^3 + a*x + 2 over Number Field in a with defining polynomial x^3 - 2 with respect to the embedding Ring morphism:
1851
From: Number Field in a with defining polynomial x^3 - 2
1852
To: Algebraic Field
1853
Defn: a |--> -0.6299605249474365? + 1.091123635971722?*I
1854
1855
sage: E.period_lattice(embs[2])
1856
Period lattice associated to Elliptic Curve defined by y^2 = x^3 + a*x + 2 over Number Field in a with defining polynomial x^3 - 2 with respect to the embedding Ring morphism:
1857
From: Number Field in a with defining polynomial x^3 - 2
1858
To: Algebraic Field
1859
Defn: a |--> 1.259921049894873?
1860
1861
Although the original embeddings have only the default
1862
precision, we can obtain the basis with higher precision
1863
later::
1864
1865
sage: L=E.period_lattice(embs[0])
1866
sage: L.basis()
1867
(1.86405007647981 - 0.903761485143226*I, -0.149344633143919 - 2.06619546272945*I)
1868
1869
sage: L.basis(prec=100)
1870
(1.8640500764798108425920506200 - 0.90376148514322594749786960975*I, -0.14934463314391922099120107422 - 2.0661954627294548995621225062*I)
1871
"""
1872
from sage.schemes.elliptic_curves.period_lattice import PeriodLattice_ell
1873
return PeriodLattice_ell(self,embedding)
1874
1875
def is_isogenous(self, other, proof=True, maxnorm=100):
1876
"""
1877
Returns whether or not self is isogenous to other.
1878
1879
INPUT:
1880
1881
- ``other`` -- another elliptic curve.
1882
1883
- ``proof`` (default True) -- If ``False``, the function will
1884
return ``True`` whenever the two curves have the same
1885
conductor and are isogenous modulo `p` for all primes `p` of
1886
norm up to ``maxp``. If ``True``, the function returns
1887
False when the previous condition does not hold, and if it
1888
does hold we attempt to see if the curves are indeed
1889
isogenous. However, this has not been fully implemented
1890
(see examples below), so we may not be able to determine
1891
whether or not the curves are isogenous..
1892
1893
- ``maxnorm`` (integer, default 100) -- The maximum norm of
1894
primes `p` for which isogeny modulo `p` will be checked.
1895
1896
OUTPUT:
1897
1898
(bool) True if there is an isogeny from curve ``self`` to
1899
curve ``other``.
1900
1901
EXAMPLES::
1902
1903
sage: x = polygen(QQ, 'x')
1904
sage: F = NumberField(x^2 -2, 's'); F
1905
Number Field in s with defining polynomial x^2 - 2
1906
sage: E1 = EllipticCurve(F, [7,8])
1907
sage: E2 = EllipticCurve(F, [0,5,0,1,0])
1908
sage: E3 = EllipticCurve(F, [0,-10,0,21,0])
1909
sage: E1.is_isogenous(E2)
1910
False
1911
sage: E1.is_isogenous(E1)
1912
True
1913
sage: E2.is_isogenous(E2)
1914
True
1915
sage: E2.is_isogenous(E1)
1916
False
1917
sage: E2.is_isogenous(E3)
1918
True
1919
1920
::
1921
1922
sage: x = polygen(QQ, 'x')
1923
sage: F = NumberField(x^2 -2, 's'); F
1924
Number Field in s with defining polynomial x^2 - 2
1925
sage: E = EllipticCurve('14a1')
1926
sage: EE = EllipticCurve('14a2')
1927
sage: E1 = E.change_ring(F)
1928
sage: E2 = EE.change_ring(F)
1929
sage: E1.is_isogenous(E2)
1930
True
1931
1932
::
1933
1934
sage: x = polygen(QQ, 'x')
1935
sage: F = NumberField(x^2 -2, 's'); F
1936
Number Field in s with defining polynomial x^2 - 2
1937
sage: k.<a> = NumberField(x^3+7)
1938
sage: E = EllipticCurve(F, [7,8])
1939
sage: EE = EllipticCurve(k, [2, 2])
1940
sage: E.is_isogenous(EE)
1941
Traceback (most recent call last):
1942
...
1943
ValueError: Second argument must be defined over the same number field.
1944
1945
Some examples from Cremona's 1981 tables::
1946
1947
sage: K.<i> = QuadraticField(-1)
1948
sage: E1 = EllipticCurve([i + 1, 0, 1, -240*i - 400, -2869*i - 2627])
1949
sage: E1.conductor()
1950
Fractional ideal (4*i + 7)
1951
sage: E2 = EllipticCurve([1+i,0,1,0,0])
1952
sage: E2.conductor()
1953
Fractional ideal (4*i + 7)
1954
sage: E1.is_isogenous(E2)
1955
Traceback (most recent call last):
1956
...
1957
NotImplementedError: Curves appear to be isogenous (same conductor, isogenous modulo all primes of norm up to 1000), but no isogeny has been constructed.
1958
sage: E1.is_isogenous(E2, proof=False)
1959
True
1960
1961
In this case E1 and E2 are in fact 9-isogenous, as may be
1962
deduced from the following::
1963
1964
sage: E3 = EllipticCurve([i + 1, 0, 1, -5*i - 5, -2*i - 5])
1965
sage: E3.is_isogenous(E1)
1966
True
1967
sage: E3.is_isogenous(E2)
1968
True
1969
sage: E1.isogeny_degree(E2)
1970
9
1971
1972
"""
1973
if not is_EllipticCurve(other):
1974
raise ValueError, "Second argument is not an Elliptic Curve."
1975
if self.is_isomorphic(other):
1976
return True
1977
K = self.base_field()
1978
if K != other.base_field():
1979
raise ValueError, "Second argument must be defined over the same number field."
1980
1981
E1 = self.integral_model()
1982
E2 = other.integral_model()
1983
N = E1.conductor()
1984
if N != E2.conductor():
1985
return False
1986
1987
PI = K.primes_of_degree_one_iter()
1988
while True:
1989
P = PI.next()
1990
if P.norm() > maxnorm: break
1991
if not P.divides(N):
1992
OP = K.residue_field(P)
1993
if E1.change_ring(OP).cardinality() != E2.change_ring(OP).cardinality():
1994
return False
1995
1996
if not proof:
1997
return True
1998
1999
# We have not yet implemented isogenies of all possible
2000
# degrees, and do not know a bound on the possible degrees
2001
# over general number fields. But here we do at least try
2002
# some easy cases:
2003
2004
for l in [2,3,5,7,13]:
2005
if any([E2.is_isomorphic(f.codomain()) for f in E1.isogenies_prime_degree(l)]):
2006
return True
2007
2008
# Next we try looking modulo some more primes:
2009
2010
while True:
2011
if P.norm() > 10*maxnorm: break
2012
if not P.divides(N):
2013
OP = K.residue_field(P)
2014
if E1.change_ring(OP).cardinality() != E2.change_ring(OP).cardinality():
2015
return False
2016
P = PI.next()
2017
2018
# At this point is is highly likely that the curves are
2019
# isogenous, but we have not proved it.
2020
2021
raise NotImplementedError, "Curves appear to be isogenous (same conductor, isogenous modulo all primes of norm up to %s), but no isogeny has been constructed." % (10*maxnorm)
2022
2023
def isogeny_degree(self, other):
2024
"""
2025
Returns the minimal degree of an isogeny between self and
2026
other, or 0 if no isogeny exists.
2027
2028
INPUT:
2029
2030
- ``other`` -- another elliptic curve.
2031
2032
OUTPUT:
2033
2034
(int) The degree of an isogeny from ``self`` to ``other``, or 0.
2035
2036
.. warning::
2037
2038
Not all isogenies over number fields are yet implemented.
2039
Currently the code only works if there is a chain of
2040
isogenies from ``self`` to ``other`` of degrees 2, 3, 5, 7
2041
and 13.
2042
2043
EXAMPLES::
2044
2045
sage: x = QQ['x'].0
2046
sage: F = NumberField(x^2 -2, 's'); F
2047
Number Field in s with defining polynomial x^2 - 2
2048
sage: E = EllipticCurve('14a1')
2049
sage: EE = EllipticCurve('14a2')
2050
sage: E1 = E.change_ring(F)
2051
sage: E2 = EE.change_ring(F)
2052
sage: E1.isogeny_degree(E2)
2053
2
2054
sage: E2.isogeny_degree(E2)
2055
1
2056
sage: E5 = EllipticCurve('14a5').change_ring(F)
2057
sage: E1.isogeny_degree(E5)
2058
6
2059
"""
2060
if self.conductor() != other.conductor():
2061
return Integer(0)
2062
2063
if self.is_isomorphic(other):
2064
return Integer(1)
2065
2066
from sage.sets.set import Set
2067
2068
curves = [self]
2069
degrees = [Integer(1)]
2070
l_list = [l for l in Set([ZZ(f.degree()) for f in self.isogenies_prime_degree([2,3,5,7,13])])]
2071
2072
newcurves = []
2073
newdegs = []
2074
k = 0
2075
while k<len(curves):
2076
newcurves.extend([f.codomain() for f in curves[k].isogenies_prime_degree(l_list)])
2077
newdegs.extend([degrees[k]*f.degree() for f in curves[k].isogenies_prime_degree(l_list)])
2078
newisogpairs = dict(zip(newcurves, newdegs))
2079
i = 0
2080
while i<len(curves):
2081
j = 0
2082
while j<len(newcurves):
2083
if curves[i].is_isomorphic(newcurves[j]):
2084
newdegs.remove(newisogpairs[newcurves[j]])
2085
newcurves.remove(newcurves[j])
2086
else:
2087
j = j+1
2088
i = i+1
2089
2090
m = 0
2091
newisogpairs = dict(zip(newcurves, newdegs))
2092
while m<len(newcurves):
2093
if other.is_isomorphic(newcurves[m]):
2094
return newisogpairs[newcurves[m]]
2095
m = m+1
2096
2097
curves.extend(newcurves)
2098
degrees.extend(newdegs)
2099
k = k+1
2100
2101
raise NotImplementedError, "Not all isogenies implemented over general number fields."
2102
2103