Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/src/sage/schemes/elliptic_curves/ell_number_field.py
8820 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 ell_torsion
100
from ell_generic import is_EllipticCurve
101
102
from gp_simon import simon_two_descent
103
from constructor import EllipticCurve
104
from sage.rings.all import PolynomialRing, ZZ, RealField
105
import sage.misc.misc
106
from sage.misc.misc import verbose, forall
107
from sage.rings.integer import Integer
108
from sage.rings.arith import valuation
109
110
import gal_reps_number_field
111
112
class EllipticCurve_number_field(EllipticCurve_field):
113
r"""
114
Elliptic curve over a number field.
115
116
EXAMPLES::
117
118
sage: K.<i>=NumberField(x^2+1)
119
sage: EllipticCurve([i, i - 1, i + 1, 24*i + 15, 14*i + 35])
120
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
121
"""
122
def __init__(self, x, y=None):
123
r"""
124
Allow some ways to create an elliptic curve over a number
125
field in addition to the generic ones.
126
127
INPUT:
128
129
- ``x``, ``y`` -- see examples.
130
131
EXAMPLES:
132
133
A curve from the database of curves over `\QQ`, but over a larger field:
134
135
sage: K.<i>=NumberField(x^2+1)
136
sage: EllipticCurve(K,'389a1')
137
Elliptic Curve defined by y^2 + y = x^3 + x^2 + (-2)*x over Number Field in i with defining polynomial x^2 + 1
138
139
Making the field of definition explicitly larger::
140
141
sage: EllipticCurve(K,[0,-1,1,0,0])
142
Elliptic Curve defined by y^2 + y = x^3 + (-1)*x^2 over Number Field in i with defining polynomial x^2 + 1
143
144
"""
145
if y is None:
146
if isinstance(x, list):
147
ainvs = x
148
field = ainvs[0].parent()
149
else:
150
if isinstance(y, str):
151
from sage.databases.cremona import CremonaDatabase
152
field = x
153
X = CremonaDatabase()[y]
154
ainvs = list(X.a_invariants())
155
else:
156
field = x
157
ainvs = y
158
if not (isinstance(field, Ring) and isinstance(ainvs,list)):
159
raise TypeError
160
161
EllipticCurve_field.__init__(self, [field(x) for x in ainvs])
162
self._point = ell_point.EllipticCurvePoint_number_field
163
164
def simon_two_descent(self, verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30):
165
r"""
166
Computes lower and upper bounds on the rank of the Mordell-Weil group,
167
and a list of independent points. Used internally by the :meth:`~rank`,
168
:meth:`~rank_bounds` and :meth:`~gens` methods.
169
170
INPUT:
171
172
- ``verbose`` -- 0, 1, 2, or 3 (default: 0), the verbosity level
173
174
- ``lim1`` -- (default: 5) limit on trivial points on quartics
175
176
- ``lim3`` -- (default: 50) limit on points on ELS quartics
177
178
- ``limtriv`` -- (default: 10) limit on trivial points on elliptic curve
179
180
- ``maxprob`` -- (default: 20)
181
182
- ``limbigprime`` -- (default: 30) to distinguish between
183
small and large prime numbers. Use probabilistic tests for
184
large primes. If 0, don't use probabilistic tests.
185
186
OUTPUT:
187
188
``(lower, upper, list)`` where ``lower`` is a lower bound on
189
the rank, ``upper`` is an upper bound (the dimension of the
190
2-Selmer group) and
191
``list`` is a list of points of infinite order on the Weierstrass
192
model.
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
sage: E.simon_two_descent(lim1=3, lim3=20, limtriv=5, maxprob=7, limbigprime=10)
213
(2, 2, [(-1 : 0 : 1), (-1/8*a + 5/8 : -3/16*a - 9/16 : 1)])
214
215
::
216
217
sage: K.<a> = NumberField(x^2 + 7, 'a')
218
sage: E = EllipticCurve(K, [0,0,0,1,a]); E
219
Elliptic Curve defined by y^2 = x^3 + x + a over Number Field in a with defining polynomial x^2 + 7
220
221
sage: v = E.simon_two_descent(verbose=1); v
222
courbe elliptique : Y^2 = x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)
223
points triviaux sur la courbe = [[1, 1, 0], [Mod(1/2*y + 3/2, y^2 + 7), Mod(-y - 2, y^2 + 7), 1]]
224
#S(E/K)[2] = 2
225
#E(K)/2E(K) = 2
226
#III(E/K)[2] = 1
227
rang(E/K) = 1
228
listpointsmwr = [[Mod(1/2*y + 3/2, y^2 + 7), Mod(-y - 2, y^2 + 7), 1]]
229
(1, 1, [(1/2*a + 3/2 : -a - 2 : 1)])
230
231
sage: v = E.simon_two_descent(verbose=2) # random output
232
K = bnfinit(y^2 + 7);
233
a = Mod(y,K.pol);
234
bnfellrank(K, [0,0,0,1,a]);
235
courbe elliptique : Y^2 = x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)
236
A = 0
237
B = Mod(1, y^2 + 7)
238
C = Mod(y, y^2 + 7)
239
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))]
240
#LS2gen = 2
241
Recherche de points triviaux sur la courbe
242
points triviaux sur la courbe = [[1, 1, 0], [Mod(1/2*y + 3/2, y^2 + 7), Mod(-y - 2, y^2 + 7), 1]]
243
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))
244
symbole de Hilbert (Mod(2, y^2 + 7),Mod(-5, y^2 + 7)) = -1
245
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))
246
symbole de Hilbert (Mod(-2*y + 2, y^2 + 7),Mod(1, y^2 + 7)) = 0
247
sol de Legendre = [1, 0, 1]~
248
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))
249
quartique : (-1/2*y + 1/2)*Y^2 = x^4 + (-3*y - 15)*x^2 + (-8*y - 16)*x + (-11/2*y - 15/2)
250
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)
251
non ELS en [2, [0, 1]~, 1, 1, [1, 1]~]
252
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))
253
vient du point trivial [Mod(1/2*y + 3/2, y^2 + 7), Mod(-y - 2, y^2 + 7), 1]
254
m1 = 1
255
m2 = 1
256
#S(E/K)[2] = 2
257
#E(K)/2E(K) = 2
258
#III(E/K)[2] = 1
259
rang(E/K) = 1
260
listpointsmwr = [[Mod(1/2*y + 3/2, y^2 + 7), Mod(-y - 2, y^2 + 7), 1]]
261
v = [1, 1, [[Mod(1/2*y + 3/2, y^2 + 7), Mod(-y - 2, y^2 + 7)]]]
262
sage: v
263
(1, 1, [(1/2*a + 3/2 : -a - 2 : 1)])
264
265
266
A curve with 2-torsion::
267
268
sage: K.<a> = NumberField(x^2 + 7)
269
sage: E = EllipticCurve(K, '15a')
270
sage: E.simon_two_descent() # long time (3s on sage.math, 2013), points can vary
271
(1, 3, [...])
272
273
A failure in the PARI/GP script ell.gp (VERSION 25/03/2009) is reported::
274
275
sage: K = CyclotomicField(43).subfields(3)[0][0]
276
sage: E = EllipticCurve(K, '37')
277
sage: E.simon_two_descent() # long time (4s on sage.math, 2013)
278
Traceback (most recent call last):
279
...
280
RuntimeError:
281
*** at top-level: ans=bnfellrank(K,[0,0,1,
282
*** ^--------------------
283
*** in function bnfellrank: ...eqtheta,rnfeq,bbnf];rang=
284
*** bnfell2descent_gen(b
285
*** ^--------------------
286
*** in function bnfell2descent_gen: ...riv,r=nfsqrt(nf,norm(zc))
287
*** [1];if(DEBUGLEVEL_el
288
*** ^--------------------
289
*** array index (1) out of allowed range [none].
290
An error occurred while running Simon's 2-descent program
291
292
"""
293
294
try:
295
result = self._simon_two_descent_data[lim1,lim3,limtriv,maxprob,limbigprime]
296
if verbose == 0:
297
return result
298
except AttributeError:
299
self._simon_two_descent_data = {}
300
except KeyError:
301
pass
302
303
t = simon_two_descent(self,
304
verbose=verbose, lim1=lim1, lim3=lim3, limtriv=limtriv,
305
maxprob=maxprob, limbigprime=limbigprime)
306
prob_rank = Integer(t[0])
307
two_selmer_rank = Integer(t[1])
308
prob_gens = [self(P) for P in t[2]]
309
self._simon_two_descent_data[lim1,lim3,limtriv,maxprob,limbigprime] = (prob_rank, two_selmer_rank, prob_gens)
310
return prob_rank, two_selmer_rank, prob_gens
311
312
def division_field(self, p, names, map=False, **kwds):
313
"""
314
Given an elliptic curve over a number field `F` and a prime number `p`,
315
construct the field `F(E[p])`.
316
317
INPUT:
318
319
- ``p`` -- a prime number (an element of `\ZZ`)
320
321
- ``names`` -- a variable name for the number field
322
323
- ``map`` -- (default: ``False``) also return an embedding of
324
the :meth:`base_field` into the resulting field.
325
326
- ``kwds`` -- additional keywords passed to
327
:func:`sage.rings.number_field.splitting_field.splitting_field`.
328
329
OUTPUT:
330
331
If ``map`` is ``False``, the division field as an absolute number
332
field. If ``map`` is ``True``, a tuple ``(K, phi)`` where ``phi``
333
is an embedding of the base field in the division field ``K``.
334
335
.. WARNING::
336
337
This takes a very long time when the degree of the division
338
field is large (e.g. when `p` is large or when the Galois
339
representation is surjective). The ``simplify`` flag also
340
has a big influence on the running time: sometimes
341
``simplify=False`` is faster, sometimes ``simplify=True``
342
(the default) is faster.
343
344
EXAMPLES:
345
346
The 2-division field is the same as the splitting field of
347
the 2-division polynomial (therefore, it has degree 1, 2, 3 or 6)::
348
349
sage: E = EllipticCurve('15a1')
350
sage: K.<b> = E.division_field(2); K
351
Number Field in b with defining polynomial x
352
sage: E = EllipticCurve('14a1')
353
sage: K.<b> = E.division_field(2); K
354
Number Field in b with defining polynomial x^2 + 5*x + 92
355
sage: E = EllipticCurve('196b1')
356
sage: K.<b> = E.division_field(2); K
357
Number Field in b with defining polynomial x^3 + x^2 - 114*x - 127
358
sage: E = EllipticCurve('19a1')
359
sage: K.<b> = E.division_field(2); K
360
Number Field in b with defining polynomial x^6 + 10*x^5 + 24*x^4 - 212*x^3 + 1364*x^2 + 24072*x + 104292
361
362
For odd primes `p`, the division field is either the splitting
363
field of the `p`-division polynomial, or a quadratic extension
364
of it. ::
365
366
sage: E = EllipticCurve('50a1')
367
sage: F.<a> = E.division_polynomial(3).splitting_field(simplify_all=True); F
368
Number Field in a with defining polynomial x^6 - 3*x^5 + 4*x^4 - 3*x^3 - 2*x^2 + 3*x + 3
369
sage: K.<b> = E.division_field(3, simplify_all=True); K
370
Number Field in b with defining polynomial x^6 - 3*x^5 + 4*x^4 - 3*x^3 - 2*x^2 + 3*x + 3
371
372
If we take any quadratic twist, the splitting field of the
373
3-division polynomial remains the same, but the 3-division field
374
becomes a quadratic extension::
375
376
sage: E = E.quadratic_twist(5) # 50b3
377
sage: F.<a> = E.division_polynomial(3).splitting_field(simplify_all=True); F
378
Number Field in a with defining polynomial x^6 - 3*x^5 + 4*x^4 - 3*x^3 - 2*x^2 + 3*x + 3
379
sage: K.<b> = E.division_field(3, simplify_all=True); K
380
Number Field in b with defining polynomial x^12 - 3*x^11 + 8*x^10 - 15*x^9 + 30*x^8 - 63*x^7 + 109*x^6 - 144*x^5 + 150*x^4 - 120*x^3 + 68*x^2 - 24*x + 4
381
382
Try another quadratic twist, this time over a subfield of `F`::
383
384
sage: G.<c>,_,_ = F.subfields(3)[0]
385
sage: E = E.base_extend(G).quadratic_twist(c); E
386
Elliptic Curve defined by y^2 = x^3 + 5*a0*x^2 + (-200*a0^2)*x + (-42000*a0^2+42000*a0+126000) over Number Field in a0 with defining polynomial x^3 - 3*x^2 + 3*x + 9
387
sage: K.<b> = E.division_field(3, simplify_all=True); K
388
Number Field in b with defining polynomial x^12 - 10*x^10 + 55*x^8 - 60*x^6 + 75*x^4 + 1350*x^2 + 2025
389
390
Some higher-degree examples::
391
392
sage: E = EllipticCurve('11a1')
393
sage: K.<b> = E.division_field(2); K
394
Number Field in b with defining polynomial x^6 + 2*x^5 - 48*x^4 - 436*x^3 + 1668*x^2 + 28792*x + 73844
395
sage: K.<b> = E.division_field(3); K # long time (3s on sage.math, 2014)
396
Number Field in b with defining polynomial x^48 ...
397
sage: K.<b> = E.division_field(5); K
398
Number Field in b with defining polynomial x^4 - x^3 + x^2 - x + 1
399
sage: E.division_field(5, 'b', simplify=False)
400
Number Field in b with defining polynomial x^4 + x^3 + 11*x^2 + 41*x + 101
401
sage: E.base_extend(K).torsion_subgroup() # long time (2s on sage.math, 2014)
402
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 b with defining polynomial x^4 - x^3 + x^2 - x + 1
403
404
sage: E = EllipticCurve('27a1')
405
sage: K.<b> = E.division_field(3); K
406
Number Field in b with defining polynomial x^2 + 3*x + 9
407
sage: K.<b> = E.division_field(2); K
408
Number Field in b with defining polynomial x^6 + 6*x^5 + 24*x^4 - 52*x^3 - 228*x^2 + 744*x + 3844
409
sage: K.<b> = E.division_field(2, simplify_all=True); K
410
Number Field in b with defining polynomial x^6 - 3*x^5 + 5*x^3 - 3*x + 1
411
sage: K.<b> = E.division_field(5); K # long time (4s on sage.math, 2014)
412
Number Field in b with defining polynomial x^48 ...
413
sage: K.<b> = E.division_field(7); K # long time (8s on sage.math, 2014)
414
Number Field in b with defining polynomial x^72 ...
415
416
Over a number field::
417
418
sage: R.<x> = PolynomialRing(QQ)
419
sage: K.<i> = NumberField(x^2 + 1)
420
sage: E = EllipticCurve([0,0,0,0,i])
421
sage: L.<b> = E.division_field(2); L
422
Number Field in b with defining polynomial x^4 - x^2 + 1
423
sage: L.<b>, phi = E.division_field(2, map=True); phi
424
Ring morphism:
425
From: Number Field in i with defining polynomial x^2 + 1
426
To: Number Field in b with defining polynomial x^4 - x^2 + 1
427
Defn: i |--> -b^3
428
sage: L.<b>, phi = E.division_field(3, map=True)
429
sage: L
430
Number Field in b with defining polynomial x^24 - 6*x^22 - 12*x^21 - 21*x^20 + 216*x^19 + 48*x^18 + 804*x^17 + 1194*x^16 - 13488*x^15 + 21222*x^14 + 44196*x^13 - 47977*x^12 - 102888*x^11 + 173424*x^10 - 172308*x^9 + 302046*x^8 + 252864*x^7 - 931182*x^6 + 180300*x^5 + 879567*x^4 - 415896*x^3 + 1941012*x^2 + 650220*x + 443089
431
sage: phi
432
Ring morphism:
433
From: Number Field in i with defining polynomial x^2 + 1
434
To: Number Field in b with defining polynomial x^24 ...
435
Defn: i |--> -215621657062634529/183360797284413355040732*b^23 ...
436
437
AUTHORS:
438
439
- Jeroen Demeyer (2014-01-06): :trac:`11905`, use
440
``splitting_field`` method, moved from ``gal_reps.py``, make
441
it work over number fields.
442
"""
443
p = Integer(p)
444
if not p.is_prime():
445
raise ValueError("p must be a prime number")
446
447
verbose("Adjoining X-coordinates of %s-torsion points"%p)
448
F = self.base_ring()
449
f = self.division_polynomial(p)
450
if p == 2:
451
# For p = 2, the division field is the splitting field of
452
# the division polynomial.
453
return f.splitting_field(names, map=map, **kwds)
454
455
# Compute splitting field of X-coordinates.
456
# The Galois group of the division field is a subgroup of GL(2,p).
457
# The Galois group of the X-coordinates is a subgroup of GL(2,p)/{-1,+1}.
458
# We need the map to change the elliptic curve invariants to K.
459
deg_mult = F.degree()*p*(p+1)*(p-1)*(p-1)//2
460
K, F_to_K = f.splitting_field(names, degree_multiple=deg_mult, map=True, **kwds)
461
462
verbose("Adjoining Y-coordinates of %s-torsion points"%p)
463
464
# THEOREM (Cremona, http://trac.sagemath.org/ticket/11905#comment:21).
465
# Let K be a field, E an elliptic curve over K and p an odd
466
# prime number. Assume that K contains all roots of the
467
# p-division polynomial of E. Then either K contains all
468
# p-torsion points on E, or it doesn't contain any p-torsion
469
# point.
470
#
471
# PROOF. Let G be the absolute Galois group of K (every element
472
# in it fixes all elements of K). For any p-torsion point P
473
# over the algebraic closure and any sigma in G, we must have
474
# either sigma(P) = P or sigma(P) = -P (since K contains the
475
# X-coordinate of P). Now assume that K does not contain all
476
# p-torsion points. Then there exists a point P1 and a sigma in
477
# G such that sigma(P1) = -P1. Now take a different p-torsion
478
# point P2. Since sigma(P2) must be P2 or -P2 and
479
# sigma(P1+P2) = sigma(P1)+sigma(P2) = sigma(P1)-P2 must
480
# be P1+P2 or -(P1+P2), it follows that sigma(P2) = -sigma(P2).
481
# Therefore, K cannot contain any p-torsion point.
482
#
483
# This implies that it suffices to adjoin the Y-coordinate
484
# of just one point.
485
486
# First factor f over F and then compute a root X of f over K.
487
g = prime_divisors(f)[0]
488
X = g.map_coefficients(F_to_K).roots(multiplicities=False)[0]
489
490
# Polynomial defining the corresponding Y-coordinate
491
a1,a2,a3,a4,a6 = (F_to_K(ai) for ai in self.a_invariants())
492
rhs = X*(X*(X + a2) + a4) + a6
493
RK = PolynomialRing(K, 'x')
494
ypol = RK([-rhs, a1*X + a3, 1])
495
L = ypol.splitting_field(names, map=map, **kwds)
496
if map:
497
L, K_to_L = L
498
return L, F_to_K.post_compose(K_to_L)
499
else:
500
return L
501
502
def height_pairing_matrix(self, points=None, precision=None):
503
r"""
504
Returns the height pairing matrix of the given points.
505
506
INPUT:
507
508
- points - either a list of points, which must be on this
509
curve, or (default) None, in which case self.gens() will be
510
used.
511
512
- precision - number of bits of precision of result
513
(default: None, for default RealField precision)
514
515
EXAMPLES::
516
517
sage: E = EllipticCurve([0, 0, 1, -1, 0])
518
sage: E.height_pairing_matrix()
519
[0.0511114082399688]
520
521
For rank 0 curves, the result is a valid 0x0 matrix::
522
523
sage: EllipticCurve('11a').height_pairing_matrix()
524
[]
525
sage: E=EllipticCurve('5077a1')
526
sage: E.height_pairing_matrix([E.lift_x(x) for x in [-2,-7/4,1]], precision=100)
527
[ 1.3685725053539301120518194471 -1.3095767070865761992624519454 -0.63486715783715592064475542573]
528
[ -1.3095767070865761992624519454 2.7173593928122930896610589220 1.0998184305667292139777571432]
529
[-0.63486715783715592064475542573 1.0998184305667292139777571432 0.66820516565192793503314205089]
530
531
sage: E = EllipticCurve('389a1')
532
sage: E = EllipticCurve('389a1')
533
sage: P,Q = E.point([-1,1,1]),E.point([0,-1,1])
534
sage: E.height_pairing_matrix([P,Q])
535
[0.686667083305587 0.268478098806726]
536
[0.268478098806726 0.327000773651605]
537
538
Over a number field::
539
540
sage: x = polygen(QQ)
541
sage: K.<t> = NumberField(x^2+47)
542
sage: EK = E.base_extend(K)
543
sage: EK.height_pairing_matrix([EK(P),EK(Q)])
544
[0.686667083305587 0.268478098806726]
545
[0.268478098806726 0.327000773651605]
546
547
::
548
549
sage: K.<i> = QuadraticField(-1)
550
sage: E = EllipticCurve([0,0,0,i,i])
551
sage: P = E(-9+4*i,-18-25*i)
552
sage: Q = E(i,-i)
553
sage: E.height_pairing_matrix([P,Q])
554
[ 2.16941934493768 -0.870059380421505]
555
[-0.870059380421505 0.424585837470709]
556
sage: E.regulator_of_points([P,Q])
557
0.164101403936070
558
"""
559
if points is None:
560
points = self.gens()
561
else:
562
for P in points:
563
assert P.curve() == self
564
565
r = len(points)
566
if precision is None:
567
RR = RealField()
568
else:
569
RR = RealField(precision)
570
M = matrix.MatrixSpace(RR, r)
571
mat = M()
572
for j in range(r):
573
mat[j,j] = points[j].height(precision=precision)
574
for j in range(r):
575
for k in range(j+1,r):
576
mat[j,k]=((points[j]+points[k]).height(precision=precision) - mat[j,j] - mat[k,k])/2
577
mat[k,j]=mat[j,k]
578
return mat
579
580
def regulator_of_points(self, points=[], precision=None):
581
"""
582
Returns the regulator of the given points on this curve.
583
584
INPUT:
585
586
- ``points`` -(default: empty list) a list of points on this curve
587
588
- ``precision`` - int or None (default: None): the precision
589
in bits of the result (default real precision if None)
590
591
EXAMPLES::
592
593
sage: E = EllipticCurve('37a1')
594
sage: P = E(0,0)
595
sage: Q = E(1,0)
596
sage: E.regulator_of_points([P,Q])
597
0.000000000000000
598
sage: 2*P==Q
599
True
600
601
::
602
603
sage: E = EllipticCurve('5077a1')
604
sage: points = [E.lift_x(x) for x in [-2,-7/4,1]]
605
sage: E.regulator_of_points(points)
606
0.417143558758384
607
sage: E.regulator_of_points(points,precision=100)
608
0.41714355875838396981711954462
609
610
::
611
612
sage: E = EllipticCurve('389a')
613
sage: E.regulator_of_points()
614
1.00000000000000
615
sage: points = [P,Q] = [E(-1,1),E(0,-1)]
616
sage: E.regulator_of_points(points)
617
0.152460177943144
618
sage: E.regulator_of_points(points, precision=100)
619
0.15246017794314375162432475705
620
sage: E.regulator_of_points(points, precision=200)
621
0.15246017794314375162432475704945582324372707748663081784028
622
sage: E.regulator_of_points(points, precision=300)
623
0.152460177943143751624324757049455823243727077486630817840280980046053225683562463604114816
624
625
Examples over number fields::
626
627
sage: K.<a> = QuadraticField(97)
628
sage: E = EllipticCurve(K,[1,1])
629
sage: P = E(0,1)
630
sage: P.height()
631
0.476223106404866
632
sage: E.regulator_of_points([P])
633
0.476223106404866
634
635
::
636
637
sage: E = EllipticCurve('11a1')
638
sage: x = polygen(QQ)
639
sage: K.<t> = NumberField(x^2+47)
640
sage: EK = E.base_extend(K)
641
sage: T = EK(5,5)
642
sage: T.order()
643
5
644
sage: P = EK(-2, -1/2*t - 1/2)
645
sage: P.order()
646
+Infinity
647
sage: EK.regulator_of_points([P,T]) # random very small output
648
-1.23259516440783e-32
649
sage: EK.regulator_of_points([P,T]).abs() < 1e-30
650
True
651
652
::
653
654
sage: E = EllipticCurve('389a1')
655
sage: P,Q = E.gens()
656
sage: E.regulator_of_points([P,Q])
657
0.152460177943144
658
sage: K.<t> = NumberField(x^2+47)
659
sage: EK = E.base_extend(K)
660
sage: EK.regulator_of_points([EK(P),EK(Q)])
661
0.152460177943144
662
663
::
664
665
sage: K.<i> = QuadraticField(-1)
666
sage: E = EllipticCurve([0,0,0,i,i])
667
sage: P = E(-9+4*i,-18-25*i)
668
sage: Q = E(i,-i)
669
sage: E.height_pairing_matrix([P,Q])
670
[ 2.16941934493768 -0.870059380421505]
671
[-0.870059380421505 0.424585837470709]
672
sage: E.regulator_of_points([P,Q])
673
0.164101403936070
674
675
"""
676
if points is None:
677
points = []
678
mat = self.height_pairing_matrix(points=points, precision=precision)
679
return mat.det(algorithm="hessenberg")
680
681
682
def is_local_integral_model(self,*P):
683
r"""
684
Tests if self is integral at the prime ideal `P`, or at all the
685
primes if `P` is a list or tuple.
686
687
INPUT:
688
689
- ``*P`` -- a prime ideal, or a list or tuple of primes.
690
691
EXAMPLES::
692
693
sage: K.<i> = NumberField(x^2+1)
694
sage: P1,P2 = K.primes_above(5)
695
sage: E = EllipticCurve([i/5,i/5,i/5,i/5,i/5])
696
sage: E.is_local_integral_model(P1,P2)
697
False
698
sage: Emin = E.local_integral_model(P1,P2)
699
sage: Emin.is_local_integral_model(P1,P2)
700
True
701
"""
702
if len(P)==1: P=P[0]
703
if isinstance(P,(tuple,list)):
704
return forall(P, lambda x : self.is_local_integral_model(x))[0]
705
return forall(self.ainvs(), lambda x : x.valuation(P) >= 0)[0]
706
707
def local_integral_model(self,*P):
708
r"""
709
Return a model of self which is integral at the prime ideal
710
`P`.
711
712
.. note::
713
714
The integrality at other primes is not affected, even if
715
`P` is non-principal.
716
717
INPUT:
718
719
- ``*P`` -- a prime ideal, or a list or tuple of primes.
720
721
EXAMPLES::
722
723
sage: K.<i> = NumberField(x^2+1)
724
sage: P1,P2 = K.primes_above(5)
725
sage: E = EllipticCurve([i/5,i/5,i/5,i/5,i/5])
726
sage: E.local_integral_model((P1,P2))
727
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
728
"""
729
if len(P)==1: P=P[0]
730
if isinstance(P,(tuple,list)):
731
E=self
732
for Pi in P: E=E.local_integral_model(Pi)
733
return E
734
ai = self.a_invariants()
735
e = min([(ai[i].valuation(P)/[1,2,3,4,6][i]) for i in range(5)]).floor()
736
pi = self.base_field().uniformizer(P, 'negative')
737
return EllipticCurve([ai[i]/pi**(e*[1,2,3,4,6][i]) for i in range(5)])
738
739
def is_global_integral_model(self):
740
r"""
741
Return true iff self is integral at all primes.
742
743
EXAMPLES::
744
745
sage: K.<i> = NumberField(x^2+1)
746
sage: E = EllipticCurve([i/5,i/5,i/5,i/5,i/5])
747
sage: P1,P2 = K.primes_above(5)
748
sage: Emin = E.global_integral_model()
749
sage: Emin.is_global_integral_model()
750
True
751
"""
752
return forall(self.a_invariants(), lambda x : x.is_integral())[0]
753
754
def global_integral_model(self):
755
r"""
756
Return a model of self which is integral at all primes.
757
758
EXAMPLES::
759
760
sage: K.<i> = NumberField(x^2+1)
761
sage: E = EllipticCurve([i/5,i/5,i/5,i/5,i/5])
762
sage: P1,P2 = K.primes_above(5)
763
sage: E.global_integral_model()
764
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
765
766
:trac:`7935`::
767
768
sage: K.<a> = NumberField(x^2-38)
769
sage: E = EllipticCurve([a,1/2])
770
sage: E.global_integral_model()
771
Elliptic Curve defined by y^2 = x^3 + 1444*a*x + 27436 over Number Field in a with defining polynomial x^2 - 38
772
773
:trac:`9266`::
774
775
sage: K.<s> = NumberField(x^2-5)
776
sage: w = (1+s)/2
777
sage: E = EllipticCurve(K,[2,w])
778
sage: E.global_integral_model()
779
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
780
781
:trac:`12151`::
782
783
sage: K.<v> = NumberField(x^2 + 161*x - 150)
784
sage: E = EllipticCurve([25105/216*v - 3839/36, 634768555/7776*v - 98002625/1296, 634768555/7776*v - 98002625/1296, 0, 0])
785
sage: E.global_integral_model()
786
Elliptic Curve defined by y^2 + (-502639783*v+465618899)*x*y + (-6603604211463489399460860*v+6117229527723443603191500)*y = x^3 + (1526887622075335620*v-1414427901517840500)*x^2 over Number Field in v with defining polynomial x^2 + 161*x - 150
787
788
:trac:`14476`::
789
790
sage: R.<t> = QQ[]
791
sage: K.<g> = NumberField(t^4 - t^3 - 3*t^2 - t + 1)
792
sage: E = EllipticCurve([ -43/625*g^3 + 14/625*g^2 - 4/625*g + 706/625, -4862/78125*g^3 - 4074/78125*g^2 - 711/78125*g + 10304/78125, -4862/78125*g^3 - 4074/78125*g^2 - 711/78125*g + 10304/78125, 0,0])
793
sage: E.global_integral_model()
794
Elliptic Curve defined by y^2 + (15*g^3-48*g-42)*x*y + (-111510*g^3-162162*g^2-44145*g+37638)*y = x^3 + (-954*g^3-1134*g^2+81*g+576)*x^2 over Number Field in g with defining polynomial t^4 - t^3 - 3*t^2 - t + 1
795
796
"""
797
K = self.base_field()
798
ai = self.a_invariants()
799
Ps = [[ ff[0] for ff in a.denominator_ideal().factor() ] for a in ai if not a.is_integral() ]
800
Ps = sage.misc.misc.union(sage.misc.flatten.flatten(Ps))
801
for P in Ps:
802
pi = K.uniformizer(P,'positive')
803
e = min([(ai[i].valuation(P)/[1,2,3,4,6][i]) for i in range(5)]).floor()
804
if e < 0 :
805
ai = [ai[i]/pi**(e*[1,2,3,4,6][i]) for i in range(5)]
806
if all(a.is_integral() for a in ai):
807
break
808
for z in ai:
809
assert z.is_integral(), "bug in global_integral_model: %s" % list(ai)
810
return EllipticCurve(list(ai))
811
812
integral_model = global_integral_model
813
814
def _reduce_model(self):
815
r"""
816
817
Transforms the elliptic curve to a model in which `a_1`,
818
`a_2`, `a_3` are reduced modulo 2, 3, 2 respectively.
819
820
.. note::
821
822
This only works on integral models, i.e. it requires that
823
`a_1`, `a_2` and `a_3` lie in the ring of integers of the base
824
field.
825
826
EXAMPLES::
827
828
sage: K.<a>=NumberField(x^2-38)
829
sage: E=EllipticCurve([a, -5*a + 19, -39*a + 237, 368258520200522046806318224*a - 2270097978636731786720858047, 8456608930180227786550494643437985949781*a - 52130038506835491453281450568107193773505])
830
sage: E.ainvs()
831
(a,
832
-5*a + 19,
833
-39*a + 237,
834
368258520200522046806318224*a - 2270097978636731786720858047,
835
8456608930180227786550494643437985949781*a - 52130038506835491453281450568107193773505)
836
sage: E._reduce_model().ainvs()
837
(a,
838
a + 1,
839
a + 1,
840
368258520200522046806318444*a - 2270097978636731786720859345,
841
8456608930173478039472018047583706316424*a - 52130038506793883217874390501829588391299)
842
sage: EllipticCurve([101,202,303,404,505])._reduce_model().ainvs()
843
(1, 1, 0, -2509254, 1528863051)
844
sage: EllipticCurve([-101,-202,-303,-404,-505])._reduce_model().ainvs()
845
(1, -1, 0, -1823195, 947995262)
846
847
sage: E = EllipticCurve([a/4, 1])
848
sage: E._reduce_model()
849
Traceback (most recent call last):
850
...
851
TypeError: _reduce_model() requires an integral model.
852
"""
853
K = self.base_ring()
854
ZK = K.maximal_order()
855
try:
856
(a1, a2, a3, a4, a6) = [ZK(a) for a in self.a_invariants()]
857
except TypeError:
858
import sys
859
raise TypeError, "_reduce_model() requires an integral model.", sys.exc_info()[2]
860
861
# N.B. Must define s, r, t in the right order.
862
if ZK.absolute_degree() == 1:
863
s = ((-a1)/2).round('up')
864
r = ((-a2 + s*a1 +s*s)/3).round()
865
t = ((-a3 - r*a1)/2).round('up')
866
else:
867
pariK = K._pari_()
868
s = K(pariK.nfeltdiveuc(-a1, 2))
869
r = K(pariK.nfeltdiveuc(-a2 + s*a1 + s*s, 3))
870
t = K(pariK.nfeltdiveuc(-a3 - r*a1, 2))
871
872
return self.rst_transform(r, s, t)
873
874
def local_data(self, P=None, proof=None, algorithm="pari", globally=False):
875
r"""
876
Local data for this elliptic curve at the prime `P`.
877
878
INPUT:
879
880
- ``P`` -- either None or a prime ideal of the base field of self.
881
882
- ``proof`` -- whether to only use provably correct methods
883
(default controlled by global proof module). Note that the
884
proof module is number_field, not elliptic_curves, since the
885
functions that actually need the flag are in number fields.
886
887
- ``algorithm`` (string, default: "pari") -- Ignored unless the
888
base field is `\QQ`. If "pari", use the PARI C-library
889
``ellglobalred`` implementation of Tate's algorithm over
890
`\QQ`. If "generic", use the general number field
891
implementation.
892
893
- ``globally`` -- whether the local algorithm uses global generators
894
for the prime ideals. Default is False, which won't require any
895
information about the class group. If True, a generator for `P`
896
will be used if `P` is principal. Otherwise, or if ``globally``
897
is False, the minimal model returned will preserve integrality
898
at other primes, but not minimality.
899
900
OUTPUT:
901
902
If `P` is specified, returns the ``EllipticCurveLocalData``
903
object associated to the prime `P` for this curve. Otherwise,
904
returns a list of such objects, one for each prime `P` in the
905
support of the discriminant of this model.
906
907
.. note::
908
909
The model is not required to be integral on input.
910
911
EXAMPLES::
912
913
sage: K.<i> = NumberField(x^2+1)
914
sage: E = EllipticCurve([1 + i, 0, 1, 0, 0])
915
sage: E.local_data()
916
[Local data at Fractional ideal (i - 2):
917
Reduction type: bad non-split multiplicative
918
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
919
Minimal discriminant valuation: 1
920
Conductor exponent: 1
921
Kodaira Symbol: I1
922
Tamagawa Number: 1,
923
Local data at Fractional ideal (-3*i - 2):
924
Reduction type: bad split multiplicative
925
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
926
Minimal discriminant valuation: 2
927
Conductor exponent: 1
928
Kodaira Symbol: I2
929
Tamagawa Number: 2]
930
sage: E.local_data(K.ideal(3))
931
Local data at Fractional ideal (3):
932
Reduction type: good
933
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
934
Minimal discriminant valuation: 0
935
Conductor exponent: 0
936
Kodaira Symbol: I0
937
Tamagawa Number: 1
938
939
An example raised in :trac:`3897`::
940
941
sage: E = EllipticCurve([1,1])
942
sage: E.local_data(3)
943
Local data at Principal ideal (3) of Integer Ring:
944
Reduction type: good
945
Local minimal model: Elliptic Curve defined by y^2 = x^3 + x + 1 over Rational Field
946
Minimal discriminant valuation: 0
947
Conductor exponent: 0
948
Kodaira Symbol: I0
949
Tamagawa Number: 1
950
"""
951
if proof is None:
952
import sage.structure.proof.proof
953
# We use the "number_field" flag because the actual proof dependence is in PARI's number field functions.
954
proof = sage.structure.proof.proof.get_flag(None, "number_field")
955
956
if P is None:
957
primes = self.base_ring()(self.integral_model().discriminant()).support()
958
return [self._get_local_data(pr, proof) for pr in primes]
959
960
from sage.schemes.elliptic_curves.ell_local_data import check_prime
961
P = check_prime(self.base_field(),P)
962
963
return self._get_local_data(P,proof,algorithm,globally)
964
965
def _get_local_data(self, P, proof, algorithm="pari", globally=False):
966
r"""
967
Internal function to create data for this elliptic curve at the prime `P`.
968
969
This function handles the caching of local data. It is called
970
by local_data() which is the user interface and which parses
971
the input parameters `P` and proof.
972
973
INPUT:
974
975
- ``P`` -- either None or a prime ideal of the base field of self.
976
977
- ``proof`` -- whether to only use provably correct methods
978
(default controlled by global proof module). Note that the
979
proof module is number_field, not elliptic_curves, since the
980
functions that actually need the flag are in number fields.
981
982
- ``algorithm`` (string, default: "pari") -- Ignored unless the
983
base field is `\QQ`. If "pari", use the PARI C-library
984
``ellglobalred`` implementation of Tate's algorithm over
985
`\QQ`. If "generic", use the general number field
986
implementation.
987
988
- ``globally`` -- whether the local algorithm uses global generators
989
for the prime ideals. Default is False, which won't require any
990
information about the class group. If True, a generator for `P`
991
will be used if `P` is principal. Otherwise, or if ``globally``
992
is False, the minimal model returned will preserve integrality
993
at other primes, but not minimality.
994
995
EXAMPLES::
996
997
sage: K.<i> = NumberField(x^2+1)
998
sage: E = EllipticCurve(K,[0,1,0,-160,308])
999
sage: p = K.ideal(i+1)
1000
sage: E._get_local_data(p, False)
1001
Local data at Fractional ideal (i + 1):
1002
Reduction type: good
1003
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
1004
Minimal discriminant valuation: 0
1005
Conductor exponent: 0
1006
Kodaira Symbol: I0
1007
Tamagawa Number: 1
1008
1009
Verify that we cache based on the proof value and the algorithm choice::
1010
1011
sage: E._get_local_data(p, False) is E._get_local_data(p, True)
1012
False
1013
1014
sage: E._get_local_data(p, None, "pari") is E._get_local_data(p, None, "generic")
1015
False
1016
"""
1017
try:
1018
return self._local_data[P, proof, algorithm, globally]
1019
except AttributeError:
1020
self._local_data = {}
1021
except KeyError:
1022
pass
1023
from sage.schemes.elliptic_curves.ell_local_data import EllipticCurveLocalData
1024
self._local_data[P, proof, algorithm, globally] = EllipticCurveLocalData(self, P, proof, algorithm, globally)
1025
return self._local_data[P, proof, algorithm, globally]
1026
1027
def local_minimal_model(self, P, proof = None, algorithm="pari"):
1028
r"""
1029
Returns a model which is integral at all primes and minimal at `P`.
1030
1031
INPUT:
1032
1033
- ``P`` -- either None or a prime ideal of the base field of self.
1034
1035
- ``proof`` -- whether to only use provably correct methods
1036
(default controlled by global proof module). Note that the
1037
proof module is number_field, not elliptic_curves, since the
1038
functions that actually need the flag are in number fields.
1039
1040
- ``algorithm`` (string, default: "pari") -- Ignored unless the
1041
base field is `\QQ`. If "pari", use the PARI C-library
1042
``ellglobalred`` implementation of Tate's algorithm over
1043
`\QQ`. If "generic", use the general number field
1044
implementation.
1045
1046
OUTPUT:
1047
1048
A model of the curve which is minimal (and integral) at `P`.
1049
1050
.. note::
1051
1052
The model is not required to be integral on input.
1053
1054
For principal `P`, a generator is used as a uniformizer,
1055
and integrality or minimality at other primes is not
1056
affected. For non-principal `P`, the minimal model
1057
returned will preserve integrality at other primes, but not
1058
minimality.
1059
1060
EXAMPLES::
1061
1062
sage: K.<a>=NumberField(x^2-5)
1063
sage: E=EllipticCurve([20, 225, 750, 1250*a + 6250, 62500*a + 15625])
1064
sage: P=K.ideal(a)
1065
sage: E.local_minimal_model(P).ainvs()
1066
(0, 1, 0, 2*a - 34, -4*a + 66)
1067
"""
1068
if proof is None:
1069
import sage.structure.proof.proof
1070
# We use the "number_field" flag because the actual proof dependence is in PARI's number field functions.
1071
proof = sage.structure.proof.proof.get_flag(None, "number_field")
1072
1073
return self.local_data(P, proof, algorithm).minimal_model()
1074
1075
def has_good_reduction(self, P):
1076
r"""
1077
Return True if this elliptic curve has good reduction at the prime `P`.
1078
1079
INPUT:
1080
1081
- ``P`` -- a prime ideal of the base field of self, or a field
1082
element generating such an ideal.
1083
1084
OUTPUT:
1085
1086
(bool) -- True if the curve has good reduction at `P`, else False.
1087
1088
.. note::
1089
1090
This requires determining a local integral minimal model;
1091
we do not just check that the discriminant of the current
1092
model has valuation zero.
1093
1094
EXAMPLES::
1095
1096
sage: E=EllipticCurve('14a1')
1097
sage: [(p,E.has_good_reduction(p)) for p in prime_range(15)]
1098
[(2, False), (3, True), (5, True), (7, False), (11, True), (13, True)]
1099
1100
sage: K.<a>=NumberField(x^3-2)
1101
sage: P17a, P17b = [P for P,e in K.factor(17)]
1102
sage: E = EllipticCurve([0,0,0,0,2*a+1])
1103
sage: [(p,E.has_good_reduction(p)) for p in [P17a,P17b]]
1104
[(Fractional ideal (4*a^2 - 2*a + 1), True),
1105
(Fractional ideal (2*a + 1), False)]
1106
"""
1107
return self.local_data(P).has_good_reduction()
1108
1109
def has_bad_reduction(self, P):
1110
r"""
1111
Return True if this elliptic curve has bad reduction at the prime `P`.
1112
1113
INPUT:
1114
1115
- ``P`` -- a prime ideal of the base field of self, or a field
1116
element generating such an ideal.
1117
1118
OUTPUT:
1119
1120
(bool) True if the curve has bad reduction at `P`, else False.
1121
1122
.. note::
1123
1124
This requires determining a local integral minimal model;
1125
we do not just check that the discriminant of the current
1126
model has valuation zero.
1127
1128
EXAMPLES::
1129
1130
sage: E=EllipticCurve('14a1')
1131
sage: [(p,E.has_bad_reduction(p)) for p in prime_range(15)]
1132
[(2, True), (3, False), (5, False), (7, True), (11, False), (13, False)]
1133
1134
sage: K.<a>=NumberField(x^3-2)
1135
sage: P17a, P17b = [P for P,e in K.factor(17)]
1136
sage: E = EllipticCurve([0,0,0,0,2*a+1])
1137
sage: [(p,E.has_bad_reduction(p)) for p in [P17a,P17b]]
1138
[(Fractional ideal (4*a^2 - 2*a + 1), False),
1139
(Fractional ideal (2*a + 1), True)]
1140
"""
1141
return self.local_data(P).has_bad_reduction()
1142
1143
def has_multiplicative_reduction(self, P):
1144
r"""
1145
Return True if this elliptic curve has (bad) multiplicative reduction at the prime `P`.
1146
1147
.. note::
1148
1149
See also ``has_split_multiplicative_reduction()`` and
1150
``has_nonsplit_multiplicative_reduction()``.
1151
1152
INPUT:
1153
1154
- ``P`` -- a prime ideal of the base field of self, or a field
1155
element generating such an ideal.
1156
1157
OUTPUT:
1158
1159
(bool) True if the curve has multiplicative reduction at `P`,
1160
else False.
1161
1162
EXAMPLES::
1163
1164
sage: E=EllipticCurve('14a1')
1165
sage: [(p,E.has_multiplicative_reduction(p)) for p in prime_range(15)]
1166
[(2, True), (3, False), (5, False), (7, True), (11, False), (13, False)]
1167
1168
sage: K.<a>=NumberField(x^3-2)
1169
sage: P17a, P17b = [P for P,e in K.factor(17)]
1170
sage: E = EllipticCurve([0,0,0,0,2*a+1])
1171
sage: [(p,E.has_multiplicative_reduction(p)) for p in [P17a,P17b]]
1172
[(Fractional ideal (4*a^2 - 2*a + 1), False), (Fractional ideal (2*a + 1), False)]
1173
"""
1174
return self.local_data(P).has_multiplicative_reduction()
1175
1176
def has_split_multiplicative_reduction(self, P):
1177
r"""
1178
Return True if this elliptic curve has (bad) split multiplicative reduction at the prime `P`.
1179
1180
INPUT:
1181
1182
- ``P`` -- a prime ideal of the base field of self, or a field
1183
element generating such an ideal.
1184
1185
OUTPUT:
1186
1187
(bool) True if the curve has split multiplicative reduction at
1188
`P`, else False.
1189
1190
EXAMPLES::
1191
1192
sage: E=EllipticCurve('14a1')
1193
sage: [(p,E.has_split_multiplicative_reduction(p)) for p in prime_range(15)]
1194
[(2, False), (3, False), (5, False), (7, True), (11, False), (13, False)]
1195
1196
sage: K.<a>=NumberField(x^3-2)
1197
sage: P17a, P17b = [P for P,e in K.factor(17)]
1198
sage: E = EllipticCurve([0,0,0,0,2*a+1])
1199
sage: [(p,E.has_split_multiplicative_reduction(p)) for p in [P17a,P17b]]
1200
[(Fractional ideal (4*a^2 - 2*a + 1), False), (Fractional ideal (2*a + 1), False)]
1201
"""
1202
return self.local_data(P).has_split_multiplicative_reduction()
1203
1204
def has_nonsplit_multiplicative_reduction(self, P):
1205
r"""
1206
Return True if this elliptic curve has (bad) non-split multiplicative reduction at the prime `P`.
1207
1208
INPUT:
1209
1210
- ``P`` -- a prime ideal of the base field of self, or a field
1211
element generating such an ideal.
1212
1213
OUTPUT:
1214
1215
(bool) True if the curve has non-split multiplicative
1216
reduction at `P`, else False.
1217
1218
EXAMPLES::
1219
1220
sage: E=EllipticCurve('14a1')
1221
sage: [(p,E.has_nonsplit_multiplicative_reduction(p)) for p in prime_range(15)]
1222
[(2, True), (3, False), (5, False), (7, False), (11, False), (13, False)]
1223
1224
sage: K.<a>=NumberField(x^3-2)
1225
sage: P17a, P17b = [P for P,e in K.factor(17)]
1226
sage: E = EllipticCurve([0,0,0,0,2*a+1])
1227
sage: [(p,E.has_nonsplit_multiplicative_reduction(p)) for p in [P17a,P17b]]
1228
[(Fractional ideal (4*a^2 - 2*a + 1), False), (Fractional ideal (2*a + 1), False)]
1229
"""
1230
return self.local_data(P).has_nonsplit_multiplicative_reduction()
1231
1232
def has_additive_reduction(self, P):
1233
r"""
1234
Return True if this elliptic curve has (bad) additive reduction at the prime `P`.
1235
1236
INPUT:
1237
1238
- ``P`` -- a prime ideal of the base field of self, or a field
1239
element generating such an ideal.
1240
1241
OUTPUT:
1242
1243
(bool) True if the curve has additive reduction at `P`, else False.
1244
1245
EXAMPLES::
1246
1247
sage: E=EllipticCurve('27a1')
1248
sage: [(p,E.has_additive_reduction(p)) for p in prime_range(15)]
1249
[(2, False), (3, True), (5, False), (7, False), (11, False), (13, False)]
1250
1251
sage: K.<a>=NumberField(x^3-2)
1252
sage: P17a, P17b = [P for P,e in K.factor(17)]
1253
sage: E = EllipticCurve([0,0,0,0,2*a+1])
1254
sage: [(p,E.has_additive_reduction(p)) for p in [P17a,P17b]]
1255
[(Fractional ideal (4*a^2 - 2*a + 1), False),
1256
(Fractional ideal (2*a + 1), True)]
1257
"""
1258
return self.local_data(P).has_additive_reduction()
1259
1260
def tamagawa_number(self, P, proof = None):
1261
r"""
1262
Returns the Tamagawa number of this elliptic curve at the prime `P`.
1263
1264
INPUT:
1265
1266
- ``P`` -- either None or a prime ideal of the base field of self.
1267
1268
- ``proof`` -- whether to only use provably correct methods
1269
(default controlled by global proof module). Note that the
1270
proof module is number_field, not elliptic_curves, since the
1271
functions that actually need the flag are in number fields.
1272
1273
OUTPUT:
1274
1275
(positive integer) The Tamagawa number of the curve at `P`.
1276
1277
EXAMPLES::
1278
1279
sage: K.<a>=NumberField(x^2-5)
1280
sage: E=EllipticCurve([20, 225, 750, 625*a + 6875, 31250*a + 46875])
1281
sage: [E.tamagawa_number(P) for P in E.discriminant().support()]
1282
[1, 1, 1, 1]
1283
sage: K.<a> = QuadraticField(-11)
1284
sage: E = EllipticCurve('11a1').change_ring(K)
1285
sage: [E.tamagawa_number(P) for P in K(11).support()]
1286
[10]
1287
"""
1288
if proof is None:
1289
import sage.structure.proof.proof
1290
# We use the "number_field" flag because the actual proof dependence is in PARI's number field functions.
1291
proof = sage.structure.proof.proof.get_flag(None, "number_field")
1292
1293
return self.local_data(P, proof).tamagawa_number()
1294
1295
def tamagawa_numbers(self):
1296
"""
1297
Return a list of all Tamagawa numbers for all prime divisors of the
1298
conductor (in order).
1299
1300
EXAMPLES::
1301
1302
sage: e = EllipticCurve('30a1')
1303
sage: e.tamagawa_numbers()
1304
[2, 3, 1]
1305
sage: vector(e.tamagawa_numbers())
1306
(2, 3, 1)
1307
sage: K.<a>=NumberField(x^2+3)
1308
sage: eK = e.base_extend(K)
1309
sage: eK.tamagawa_numbers()
1310
[4, 6, 1]
1311
"""
1312
return [self.tamagawa_number(p) for p in prime_divisors(self.conductor())]
1313
1314
def tamagawa_exponent(self, P, proof = None):
1315
r"""
1316
Returns the Tamagawa index of this elliptic curve at the prime `P`.
1317
1318
INPUT:
1319
1320
- ``P`` -- either None or a prime ideal of the base field of self.
1321
1322
- ``proof`` -- whether to only use provably correct methods
1323
(default controlled by global proof module). Note that the
1324
proof module is number_field, not elliptic_curves, since the
1325
functions that actually need the flag are in number fields.
1326
1327
OUTPUT:
1328
1329
(positive integer) The Tamagawa index of the curve at P.
1330
1331
EXAMPLES::
1332
1333
sage: K.<a>=NumberField(x^2-5)
1334
sage: E=EllipticCurve([20, 225, 750, 625*a + 6875, 31250*a + 46875])
1335
sage: [E.tamagawa_exponent(P) for P in E.discriminant().support()]
1336
[1, 1, 1, 1]
1337
sage: K.<a> = QuadraticField(-11)
1338
sage: E = EllipticCurve('11a1').change_ring(K)
1339
sage: [E.tamagawa_exponent(P) for P in K(11).support()]
1340
[10]
1341
"""
1342
if proof is None:
1343
import sage.structure.proof.proof
1344
# We use the "number_field" flag because the actual proof dependence is in PARI's number field functions.
1345
proof = sage.structure.proof.proof.get_flag(None, "number_field")
1346
1347
return self.local_data(P, proof).tamagawa_exponent()
1348
1349
def tamagawa_product_bsd(self):
1350
r"""
1351
Given an elliptic curve `E` over a number field `K`, this function returns the
1352
integer `C(E/K)` that appears in the Birch and Swinnerton-Dyer conjecture accounting
1353
for the local information at finite places. If the model is a global minimal model then `C(E/K)` is
1354
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.
1355
The definition is such that `C(E/K)` times the periods at the infinite places is invariant
1356
under change of the Weierstrass model. See [Ta2] and [Do] for details.
1357
1358
.. note::
1359
1360
This definition is slightly different from the definition of ``tamagawa_product``
1361
for curves defined over `\QQ`. Over the rational number it is always defined to be the product
1362
of the Tamagawa numbers, so the two definitions only agree when the model is global minimal.
1363
1364
OUTPUT:
1365
1366
A rational number
1367
1368
EXAMPLES::
1369
1370
sage: K.<i> = NumberField(x^2+1)
1371
sage: E = EllipticCurve([0,2+i])
1372
sage: E.tamagawa_product_bsd()
1373
1
1374
1375
sage: E = EllipticCurve([(2*i+1)^2,i*(2*i+1)^7])
1376
sage: E.tamagawa_product_bsd()
1377
4
1378
1379
An example where the Neron model changes over K::
1380
1381
sage: K.<t> = NumberField(x^5-10*x^3+5*x^2+10*x+1)
1382
sage: E = EllipticCurve(K,'75a1')
1383
sage: E.tamagawa_product_bsd()
1384
5
1385
sage: da = E.local_data()
1386
sage: [dav.tamagawa_number() for dav in da]
1387
[1, 1]
1388
1389
An example over `\mathbb{Q}` (:trac:`9413`)::
1390
1391
sage: E = EllipticCurve('30a')
1392
sage: E.tamagawa_product_bsd()
1393
6
1394
1395
REFERENCES:
1396
1397
- [Ta2] Tate, John, On the conjectures of Birch and Swinnerton-Dyer and a geometric analog. Seminaire Bourbaki, Vol. 9, Exp. No. 306.
1398
1399
- [Do] Dokchitser, Tim and Vladimir, On the Birch-Swinnerton-Dyer quotients modulo squares, Annals of Math., 2010.
1400
1401
"""
1402
da = self.local_data()
1403
pr = 1
1404
for dav in da:
1405
pp = dav.prime()
1406
cv = dav.tamagawa_number()
1407
# uu is the quotient of the Neron differential at pp divided by
1408
# the differential associated to this particular equation E
1409
uu = self.isomorphism_to(dav.minimal_model()).u
1410
if self.base_field().absolute_degree() == 1:
1411
p = pp.gens_reduced()[0]
1412
f = 1
1413
v = valuation(ZZ(uu),p)
1414
else:
1415
p = pp.smallest_integer()
1416
f = pp.residue_class_degree()
1417
v = valuation(uu,pp)
1418
uu_abs_val = p**(f*v)
1419
pr *= cv * uu_abs_val
1420
return pr
1421
1422
def kodaira_symbol(self, P, proof = None):
1423
r"""
1424
Returns the Kodaira Symbol of this elliptic curve at the prime `P`.
1425
1426
INPUT:
1427
1428
- ``P`` -- either None or a prime ideal of the base field of self.
1429
1430
- ``proof`` -- whether to only use provably correct methods
1431
(default controlled by global proof module). Note that the
1432
proof module is number_field, not elliptic_curves, since the
1433
functions that actually need the flag are in number fields.
1434
1435
OUTPUT:
1436
1437
The Kodaira Symbol of the curve at P, represented as a string.
1438
1439
EXAMPLES::
1440
1441
sage: K.<a>=NumberField(x^2-5)
1442
sage: E=EllipticCurve([20, 225, 750, 625*a + 6875, 31250*a + 46875])
1443
sage: bad_primes = E.discriminant().support(); bad_primes
1444
[Fractional ideal (-a), Fractional ideal (7/2*a - 81/2), Fractional ideal (-a - 52), Fractional ideal (2)]
1445
sage: [E.kodaira_symbol(P) for P in bad_primes]
1446
[I0, I1, I1, II]
1447
sage: K.<a> = QuadraticField(-11)
1448
sage: E = EllipticCurve('11a1').change_ring(K)
1449
sage: [E.kodaira_symbol(P) for P in K(11).support()]
1450
[I10]
1451
"""
1452
if proof is None:
1453
import sage.structure.proof.proof
1454
# We use the "number_field" flag because the actual proof dependence is in PARI's number field functions.
1455
proof = sage.structure.proof.proof.get_flag(None, "number_field")
1456
1457
return self.local_data(P, proof).kodaira_symbol()
1458
1459
1460
def conductor(self):
1461
r"""
1462
Returns the conductor of this elliptic curve as a fractional
1463
ideal of the base field.
1464
1465
OUTPUT:
1466
1467
(fractional ideal) The conductor of the curve.
1468
1469
EXAMPLES::
1470
1471
sage: K.<i>=NumberField(x^2+1)
1472
sage: EllipticCurve([i, i - 1, i + 1, 24*i + 15, 14*i + 35]).conductor()
1473
Fractional ideal (21*i - 3)
1474
sage: K.<a>=NumberField(x^2-x+3)
1475
sage: EllipticCurve([1 + a , -1 + a , 1 + a , -11 + a , 5 -9*a ]).conductor()
1476
Fractional ideal (6*a)
1477
1478
A not so well known curve with everywhere good reduction::
1479
1480
sage: K.<a>=NumberField(x^2-38)
1481
sage: E=EllipticCurve([0,0,0, 21796814856932765568243810*a - 134364590724198567128296995, 121774567239345229314269094644186997594*a - 750668847495706904791115375024037711300])
1482
sage: E.conductor()
1483
Fractional ideal (1)
1484
1485
An example which used to fail (see :trac:`5307`)::
1486
1487
sage: K.<w>=NumberField(x^2+x+6)
1488
sage: E=EllipticCurve([w,-1,0,-w-6,0])
1489
sage: E.conductor()
1490
Fractional ideal (86304, w + 5898)
1491
1492
An example raised in :trac:`11346`::
1493
1494
sage: K.<g> = NumberField(x^2 - x - 1)
1495
sage: E1 = EllipticCurve(K,[0,0,0,-1/48,-161/864])
1496
sage: [(p.smallest_integer(),e) for p,e in E1.conductor().factor()]
1497
[(2, 4), (3, 1), (5, 1)]
1498
"""
1499
try:
1500
return self._conductor
1501
except AttributeError:
1502
pass
1503
1504
# Note: for number fields other than QQ we could initialize
1505
# N=K.ideal(1) or N=OK.ideal(1), which are the same, but for
1506
# K==QQ it has to be ZZ.ideal(1).
1507
OK = self.base_ring().ring_of_integers()
1508
self._conductor = prod([d.prime()**(d.conductor_valuation()) \
1509
for d in self.local_data()],\
1510
OK.ideal(1))
1511
return self._conductor
1512
1513
def global_minimal_model(self, proof = None):
1514
r"""
1515
Returns a model of self that is integral, minimal at all primes.
1516
1517
.. note::
1518
1519
This is only implemented for class number 1. In general,
1520
such a model may or may not exist.
1521
1522
INPUT:
1523
1524
- ``proof`` -- whether to only use provably correct methods
1525
(default controlled by global proof module). Note that the
1526
proof module is number_field, not elliptic_curves, since the
1527
functions that actually need the flag are in number fields.
1528
1529
OUTPUT:
1530
1531
A global integral and minimal model.
1532
1533
EXAMPLES::
1534
1535
sage: K.<a> = NumberField(x^2-38)
1536
sage: E = EllipticCurve([0,0,0, 21796814856932765568243810*a - 134364590724198567128296995, 121774567239345229314269094644186997594*a - 750668847495706904791115375024037711300])
1537
1538
sage: E2 = E.global_minimal_model()
1539
sage: E2 # random (the global minimal model is not unique)
1540
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
1541
1542
sage: E2.local_data()
1543
[]
1544
1545
See :trac:`11347`::
1546
1547
sage: K.<g> = NumberField(x^2 - x - 1)
1548
sage: E = EllipticCurve(K,[0,0,0,-1/48,161/864]).integral_model().global_minimal_model(); E
1549
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
1550
sage: [(p.norm(), e) for p, e in E.conductor().factor()]
1551
[(9, 1), (5, 1)]
1552
sage: [(p.norm(), e) for p, e in E.discriminant().factor()]
1553
[(-5, 2), (9, 1)]
1554
1555
See :trac:`14472`, this used not to work over a relative extension::
1556
1557
sage: K1.<w> = NumberField(x^2+x+1)
1558
sage: m = polygen(K1)
1559
sage: K2.<v> = K1.extension(m^2-w+1)
1560
sage: E = EllipticCurve([0*v,-432])
1561
sage: E.global_minimal_model()
1562
Elliptic Curve defined by y^2 + (v+w+1)*y = x^3 + ((6*w-10)*v+16*w+20) over Number Field in v with defining polynomial x^2 - w + 1 over its base field
1563
"""
1564
if proof is None:
1565
import sage.structure.proof.proof
1566
# We use the "number_field" flag because the actual proof dependence is in PARI's number field functions.
1567
proof = sage.structure.proof.proof.get_flag(None, "number_field")
1568
K = self.base_ring()
1569
if K.class_number() != 1:
1570
raise ValueError, "global minimal models only exist in general for class number 1"
1571
1572
E = self.global_integral_model()
1573
primes = E.base_ring()(E.discriminant()).support()
1574
for P in primes:
1575
E = E.local_data(P,proof, globally=True).minimal_model()
1576
return E._reduce_model()
1577
1578
def reduction(self,place):
1579
r"""
1580
Return the reduction of the elliptic curve at a place of good reduction.
1581
1582
INPUT:
1583
1584
- ``place`` -- a prime ideal in the base field of the curve
1585
1586
OUTPUT:
1587
1588
An elliptic curve over a finite field, the residue field of the place.
1589
1590
EXAMPLES::
1591
1592
sage: K.<i> = QuadraticField(-1)
1593
sage: EK = EllipticCurve([0,0,0,i,i+3])
1594
sage: v = K.fractional_ideal(2*i+3)
1595
sage: EK.reduction(v)
1596
Elliptic Curve defined by y^2 = x^3 + 5*x + 8 over Residue field of Fractional ideal (2*i + 3)
1597
sage: EK.reduction(K.ideal(1+i))
1598
Traceback (most recent call last):
1599
...
1600
ValueError: The curve must have good reduction at the place.
1601
sage: EK.reduction(K.ideal(2))
1602
Traceback (most recent call last):
1603
...
1604
ValueError: The ideal must be prime.
1605
sage: K=QQ.extension(x^2+x+1,"a")
1606
sage: E=EllipticCurve([1024*K.0,1024*K.0])
1607
sage: E.reduction(2*K)
1608
Elliptic Curve defined by y^2 + (abar+1)*y = x^3 over Residue field in abar of Fractional ideal (2)
1609
"""
1610
K = self.base_field()
1611
OK = K.ring_of_integers()
1612
try:
1613
place = K.ideal(place)
1614
except TypeError:
1615
raise TypeError, "The parameter must be an ideal of the base field of the elliptic curve"
1616
if not place.is_prime():
1617
raise ValueError, "The ideal must be prime."
1618
disc = self.discriminant()
1619
if not K.ideal(disc).valuation(place) == 0:
1620
local_data=self.local_data(place)
1621
if local_data.has_good_reduction():
1622
Fv = OK.residue_field(place)
1623
return local_data.minimal_model().change_ring(Fv)
1624
raise ValueError, "The curve must have good reduction at the place."
1625
Fv = OK.residue_field(place)
1626
return self.change_ring(Fv)
1627
1628
def _torsion_bound(self,number_of_places = 20):
1629
r"""
1630
An upper bound on the order of the torsion subgroup.
1631
1632
INPUT:
1633
1634
- ``number_of_places`` (positive integer, default = 20) -- the
1635
number of places that will be used to find the bound.
1636
1637
OUTPUT:
1638
1639
(integer) An upper bound on the torsion order.
1640
1641
ALGORITHM:
1642
1643
An upper bound on the order of the torsion.group of the
1644
elliptic curve is obtained by counting points modulo several
1645
primes of good reduction. Note that the upper bound returned
1646
by this function is a multiple of the order of the torsion
1647
group, and in general will be greater than the order.
1648
1649
EXAMPLES::
1650
1651
sage: CDB=CremonaDatabase()
1652
sage: [E._torsion_bound() for E in CDB.iter([14])]
1653
[6, 6, 6, 6, 6, 6]
1654
sage: [E.torsion_order() for E in CDB.iter([14])]
1655
[6, 6, 2, 6, 2, 6]
1656
"""
1657
E = self
1658
bound = 0
1659
k = 0
1660
K = E.base_field()
1661
OK = K.ring_of_integers()
1662
disc = E.discriminant()
1663
p = Integer(1)
1664
# runs through primes, decomposes them into prime ideals
1665
while k < number_of_places :
1666
p = p.next_prime()
1667
f = K.primes_above(p)
1668
# runs through prime ideals above p
1669
for qq in f:
1670
fqq = qq.residue_class_degree()
1671
charqq = qq.smallest_integer()
1672
# take only places with small residue field (so that the
1673
# number of points will be small)
1674
if fqq == 1 or charqq**fqq < 3*number_of_places:
1675
# check if the model is integral at the place
1676
if min([K.ideal(a).valuation(qq) for a in E.a_invariants()]) >= 0:
1677
eqq = qq.ramification_index()
1678
# check if the formal group at the place is torsion-free
1679
# if so the torsion injects into the reduction
1680
if eqq < charqq - 1 and disc.valuation(qq) == 0:
1681
Etilda = E.reduction(qq)
1682
Npp = Etilda.cardinality()
1683
bound = gcd(bound,Npp)
1684
if bound == 1:
1685
return bound
1686
k += 1
1687
return bound
1688
1689
def torsion_subgroup(self):
1690
r"""
1691
Returns the torsion subgroup of this elliptic curve.
1692
1693
OUTPUT:
1694
1695
(``EllipticCurveTorsionSubgroup``) The
1696
``EllipticCurveTorsionSubgroup`` associated to this elliptic
1697
curve.
1698
1699
EXAMPLES::
1700
1701
sage: E = EllipticCurve('11a1')
1702
sage: K.<t>=NumberField(x^4 + x^3 + 11*x^2 + 41*x + 101)
1703
sage: EK = E.base_extend(K)
1704
sage: tor = EK.torsion_subgroup() # long time (2s on sage.math, 2014)
1705
sage: tor # long time
1706
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
1707
sage: tor.gens() # long time
1708
((16 : 60 : 1), (t : 1/11*t^3 + 6/11*t^2 + 19/11*t + 48/11 : 1))
1709
1710
::
1711
1712
sage: E = EllipticCurve('15a1')
1713
sage: K.<t>=NumberField(x^2 + 2*x + 10)
1714
sage: EK=E.base_extend(K)
1715
sage: EK.torsion_subgroup()
1716
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
1717
1718
::
1719
1720
sage: E = EllipticCurve('19a1')
1721
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)
1722
sage: EK=E.base_extend(K)
1723
sage: EK.torsion_subgroup()
1724
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
1725
1726
::
1727
1728
sage: K.<i> = QuadraticField(-1)
1729
sage: EK = EllipticCurve([0,0,0,i,i+3])
1730
sage: EK.torsion_subgroup ()
1731
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
1732
"""
1733
try:
1734
return self.__torsion_subgroup
1735
except AttributeError:
1736
self.__torsion_subgroup = ell_torsion.EllipticCurveTorsionSubgroup(self)
1737
return self.__torsion_subgroup
1738
1739
def torsion_order(self):
1740
r"""
1741
Returns the order of the torsion subgroup of this elliptic curve.
1742
1743
OUTPUT:
1744
1745
(integer) the order of the torsion subgroup of this elliptic curve.
1746
1747
EXAMPLES::
1748
1749
sage: E = EllipticCurve('11a1')
1750
sage: K.<t> = NumberField(x^4 + x^3 + 11*x^2 + 41*x + 101)
1751
sage: EK = E.base_extend(K)
1752
sage: EK.torsion_order() # long time (2s on sage.math, 2014)
1753
25
1754
1755
::
1756
1757
sage: E = EllipticCurve('15a1')
1758
sage: K.<t> = NumberField(x^2 + 2*x + 10)
1759
sage: EK = E.base_extend(K)
1760
sage: EK.torsion_order()
1761
16
1762
1763
::
1764
1765
sage: E = EllipticCurve('19a1')
1766
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)
1767
sage: EK = E.base_extend(K)
1768
sage: EK.torsion_order()
1769
9
1770
1771
::
1772
1773
sage: K.<i> = QuadraticField(-1)
1774
sage: EK = EllipticCurve([0,0,0,i,i+3])
1775
sage: EK.torsion_order()
1776
1
1777
"""
1778
try:
1779
return self.__torsion_order
1780
except AttributeError:
1781
self.__torsion_order = self.torsion_subgroup().order()
1782
return self.__torsion_order
1783
1784
def torsion_points(self):
1785
r"""
1786
Returns a list of the torsion points of this elliptic curve.
1787
1788
OUTPUT:
1789
1790
(list) A sorted list of the torsion points.
1791
1792
EXAMPLES::
1793
1794
sage: E = EllipticCurve('11a1')
1795
sage: E.torsion_points()
1796
[(0 : 1 : 0), (5 : -6 : 1), (5 : 5 : 1), (16 : -61 : 1), (16 : 60 : 1)]
1797
sage: K.<t> = NumberField(x^4 + x^3 + 11*x^2 + 41*x + 101)
1798
sage: EK = E.base_extend(K)
1799
sage: EK.torsion_points() # long time (1s on sage.math, 2014)
1800
[(16 : 60 : 1),
1801
(5 : 5 : 1),
1802
(5 : -6 : 1),
1803
(16 : -61 : 1),
1804
(t : 1/11*t^3 + 6/11*t^2 + 19/11*t + 48/11 : 1),
1805
(-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),
1806
(-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),
1807
(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),
1808
(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),
1809
(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),
1810
(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),
1811
(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),
1812
(-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),
1813
(-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),
1814
(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),
1815
(-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),
1816
(-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),
1817
(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),
1818
(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),
1819
(t : -1/11*t^3 - 6/11*t^2 - 19/11*t - 59/11 : 1),
1820
(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),
1821
(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),
1822
(-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),
1823
(-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),
1824
(0 : 1 : 0)]
1825
1826
::
1827
1828
sage: E = EllipticCurve('15a1')
1829
sage: K.<t> = NumberField(x^2 + 2*x + 10)
1830
sage: EK = E.base_extend(K)
1831
sage: EK.torsion_points()
1832
[(-7 : -5*t - 2 : 1),
1833
(-7 : 5*t + 8 : 1),
1834
(-13/4 : 9/8 : 1),
1835
(-2 : -2 : 1),
1836
(-2 : 3 : 1),
1837
(-t - 2 : -t - 7 : 1),
1838
(-t - 2 : 2*t + 8 : 1),
1839
(-1 : 0 : 1),
1840
(t : t - 5 : 1),
1841
(t : -2*t + 4 : 1),
1842
(0 : 1 : 0),
1843
(1/2 : -5/4*t - 2 : 1),
1844
(1/2 : 5/4*t + 1/2 : 1),
1845
(3 : -2 : 1),
1846
(8 : -27 : 1),
1847
(8 : 18 : 1)]
1848
1849
::
1850
1851
sage: K.<i> = QuadraticField(-1)
1852
sage: EK = EllipticCurve(K,[0,0,0,0,-1])
1853
sage: EK.torsion_points ()
1854
[(-2 : -3*i : 1), (-2 : 3*i : 1), (0 : -i : 1), (0 : i : 1), (0 : 1 : 0), (1 : 0 : 1)]
1855
"""
1856
T = self.torsion_subgroup() # make sure it is cached
1857
return sorted(T.points()) # these are also cached in T
1858
1859
def rank_bounds(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30):
1860
r"""
1861
Returns the lower and upper bounds using :meth:`~simon_two_descent`.
1862
The results of :meth:`~simon_two_descent` are cached.
1863
1864
.. NOTE::
1865
1866
The optional parameters control the Simon two descent algorithm;
1867
see the documentation of :meth:`~simon_two_descent` for more
1868
details.
1869
1870
INPUT:
1871
1872
- ``verbose`` -- 0, 1, 2, or 3 (default: 0), the verbosity level
1873
1874
- ``lim1`` -- (default: 5) limit on trivial points on quartics
1875
1876
- ``lim3`` -- (default: 50) limit on points on ELS quartics
1877
1878
- ``limtriv`` -- (default: 10) limit on trivial points on elliptic curve
1879
1880
- ``maxprob`` -- (default: 20)
1881
1882
- ``limbigprime`` -- (default: 30) to distinguish between
1883
small and large prime numbers. Use probabilistic tests for
1884
large primes. If 0, don't use probabilistic tests.
1885
1886
OUTPUT:
1887
1888
lower and upper bounds for the rank of the Mordell-Weil group
1889
1890
1891
.. NOTE::
1892
1893
For non-quadratic number fields, this code does
1894
return, but it takes a long time.
1895
1896
EXAMPLES::
1897
1898
sage: K.<a> = NumberField(x^2 + 23, 'a')
1899
sage: E = EllipticCurve(K, '37')
1900
sage: E == loads(dumps(E))
1901
True
1902
sage: E.rank_bounds()
1903
(2, 2)
1904
1905
Here is a curve with two-torsion, again the bounds coincide::
1906
1907
sage: Qrt5.<rt5>=NumberField(x^2-5)
1908
sage: E=EllipticCurve([0,5-rt5,0,rt5,0])
1909
sage: E.rank_bounds()
1910
(1, 1)
1911
1912
Finally an example with non-trivial 2-torsion in Sha. So the
1913
2-descent will not be able to determine the rank, but can only
1914
give bounds::
1915
1916
sage: E = EllipticCurve("15a5")
1917
sage: K.<t> = NumberField(x^2-6)
1918
sage: EK = E.base_extend(K)
1919
sage: EK.rank_bounds(lim1=1,lim3=1,limtriv=1)
1920
(0, 2)
1921
1922
IMPLEMENTATION:
1923
1924
Uses Denis Simon's PARI/GP scripts from
1925
http://www.math.unicaen.fr/~simon/.
1926
1927
"""
1928
1929
lower, upper, gens = self.simon_two_descent(verbose=verbose,lim1=lim1,lim3=lim3,limtriv=limtriv,maxprob=maxprob,limbigprime=limbigprime)
1930
# this was corrected in trac 13593. upper is the dimension
1931
# of the 2-selmer group, so we can certainly remove the
1932
# 2-torsion of the Mordell-Weil group.
1933
upper -= self.two_torsion_rank()
1934
return lower, upper
1935
1936
def rank(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30):
1937
r"""
1938
Return the rank of this elliptic curve, if it can be determined.
1939
1940
.. NOTE::
1941
1942
The optional parameters control the Simon two descent algorithm;
1943
see the documentation of :meth:`~simon_two_descent` for more
1944
details.
1945
1946
INPUT:
1947
1948
- ``verbose`` -- 0, 1, 2, or 3 (default: 0), the verbosity level
1949
1950
- ``lim1`` -- (default: 5) limit on trivial points on quartics
1951
1952
- ``lim3`` -- (default: 50) limit on points on ELS quartics
1953
1954
- ``limtriv`` -- (default: 10) limit on trivial points on elliptic curve
1955
1956
- ``maxprob`` -- (default: 20)
1957
1958
- ``limbigprime`` -- (default: 30) to distinguish between
1959
small and large prime numbers. Use probabilistic tests for
1960
large primes. If 0, don't use probabilistic tests.
1961
1962
OUTPUT:
1963
1964
If the upper and lower bounds given by Simon two-descent are
1965
the same, then the rank has been uniquely identified and we
1966
return this. Otherwise, we raise a ValueError with an error
1967
message specifying the upper and lower bounds.
1968
1969
.. NOTE::
1970
1971
For non-quadratic number fields, this code does return, but it takes
1972
a long time.
1973
1974
EXAMPLES::
1975
1976
sage: K.<a> = NumberField(x^2 + 23, 'a')
1977
sage: E = EllipticCurve(K, '37')
1978
sage: E == loads(dumps(E))
1979
True
1980
sage: E.rank()
1981
2
1982
1983
Here is a curve with two-torsion in the Tate-Shafarevich group,
1984
so here the bounds given by the algorithm do not uniquely
1985
determine the rank::
1986
1987
sage: E = EllipticCurve("15a5")
1988
sage: K.<t> = NumberField(x^2-6)
1989
sage: EK = E.base_extend(K)
1990
sage: EK.rank(lim1=1, lim3=1, limtriv=1)
1991
Traceback (most recent call last):
1992
...
1993
ValueError: There is insufficient data to determine the rank -
1994
2-descent gave lower bound 0 and upper bound 2
1995
1996
IMPLEMENTATION:
1997
1998
Uses Denis Simon's PARI/GP scripts from
1999
http://www.math.unicaen.fr/~simon/.
2000
2001
"""
2002
2003
lower,upper = self.rank_bounds(verbose=verbose,lim1=lim1,lim3=lim3,limtriv=limtriv,maxprob=maxprob,limbigprime=limbigprime)
2004
if lower == upper:
2005
return lower
2006
else:
2007
raise ValueError, 'There is insufficient data to determine the rank - 2-descent gave lower bound %s and upper bound %s' % (lower, upper)
2008
2009
def gens(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30):
2010
r"""
2011
Returns some points of infinite order on this elliptic curve.
2012
They are not necessarily linearly independent.
2013
2014
Check :meth:`~rank` or
2015
:meth:`~rank_bounds` to verify the number of generators.
2016
2017
.. NOTE::
2018
2019
The optional parameters control the Simon two descent algorithm;
2020
see the documentation of :meth:`~simon_two_descent` for more
2021
details.
2022
2023
INPUT:
2024
2025
- ``verbose`` -- 0, 1, 2, or 3 (default: 0), the verbosity level
2026
2027
- ``lim1`` -- (default: 5) limit on trivial points on quartics
2028
2029
- ``lim3`` -- (default: 50) limit on points on ELS quartics
2030
2031
- ``limtriv`` -- (default: 10) limit on trivial points on elliptic curve
2032
2033
- ``maxprob`` -- (default: 20)
2034
2035
- ``limbigprime`` -- (default: 30) to distinguish between
2036
small and large prime numbers. Use probabilistic tests for
2037
large primes. If 0, don't use probabilistic tests.
2038
2039
OUTPUT:
2040
2041
A set of points of infinite order given by the Simon two-descent.
2042
2043
.. NOTE::
2044
2045
For non-quadratic number fields, this code does return, but it takes
2046
a long time.
2047
2048
EXAMPLES::
2049
2050
sage: K.<a> = NumberField(x^2 + 23, 'a')
2051
sage: E = EllipticCurve(K, '37')
2052
sage: E == loads(dumps(E))
2053
True
2054
sage: E.gens()
2055
[(-1 : 0 : 1), (1/2*a - 5/2 : -1/2*a - 13/2 : 1)]
2056
2057
2058
Here is a curve of rank 2, yet the list contains many points::
2059
2060
sage: K.<t> = NumberField(x^2-17)
2061
sage: E = EllipticCurve(K,[-4,0])
2062
sage: E.gens()
2063
[(-1/2*t + 1/2 : -1/2*t + 1/2 : 1),
2064
(-2*t + 8 : -8*t + 32 : 1),
2065
(1/2*t + 3/2 : -1/2*t - 7/2 : 1),
2066
(-1/8*t - 7/8 : -1/16*t - 23/16 : 1),
2067
(1/8*t - 7/8 : -1/16*t + 23/16 : 1),
2068
(t + 3 : -2*t - 10 : 1),
2069
(2*t + 8 : -8*t - 32 : 1),
2070
(1/2*t + 1/2 : -1/2*t - 1/2 : 1),
2071
(-1/2*t + 3/2 : -1/2*t + 7/2 : 1),
2072
(t + 7 : -4*t - 20 : 1),
2073
(-t + 7 : -4*t + 20 : 1),
2074
(-t + 3 : -2*t + 10 : 1)]
2075
sage: E.rank()
2076
2
2077
2078
Test that the points of finite order are not included :trac: `13593` ::
2079
2080
sage: E = EllipticCurve("17a3")
2081
sage: K.<t> = NumberField(x^2+3)
2082
sage: EK = E.base_extend(K)
2083
sage: EK.rank()
2084
0
2085
sage: EK.gens()
2086
[]
2087
2088
2089
IMPLEMENTATION:
2090
2091
Uses Denis Simon's PARI/GP scripts from
2092
http://www.math.unicaen.fr/~simon/.
2093
"""
2094
2095
lower,upper,gens = self.simon_two_descent(verbose=verbose,lim1=lim1,lim3=lim3,limtriv=limtriv,maxprob=maxprob,limbigprime=limbigprime)
2096
res = [P for P in gens if P.has_infinite_order()]
2097
return res
2098
2099
2100
def period_lattice(self, embedding):
2101
r"""
2102
Returns the period lattice of the elliptic curve for the given
2103
embedding of its base field with respect to the differential
2104
`dx/(2y + a_1x + a_3)`.
2105
2106
INPUT:
2107
2108
- ``embedding`` - an embedding of the base number field into `\RR` or `\CC`.
2109
2110
.. note::
2111
2112
The precision of the embedding is ignored: we only use the
2113
given embedding to determine which embedding into ``QQbar``
2114
to use. Once the lattice has been initialized, periods can
2115
be computed to arbitrary precision.
2116
2117
2118
EXAMPLES:
2119
2120
First define a field with two real embeddings::
2121
2122
sage: K.<a> = NumberField(x^3-2)
2123
sage: E=EllipticCurve([0,0,0,a,2])
2124
sage: embs=K.embeddings(CC); len(embs)
2125
3
2126
2127
For each embedding we have a different period lattice::
2128
2129
sage: E.period_lattice(embs[0])
2130
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:
2131
From: Number Field in a with defining polynomial x^3 - 2
2132
To: Algebraic Field
2133
Defn: a |--> -0.6299605249474365? - 1.091123635971722?*I
2134
2135
sage: E.period_lattice(embs[1])
2136
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:
2137
From: Number Field in a with defining polynomial x^3 - 2
2138
To: Algebraic Field
2139
Defn: a |--> -0.6299605249474365? + 1.091123635971722?*I
2140
2141
sage: E.period_lattice(embs[2])
2142
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:
2143
From: Number Field in a with defining polynomial x^3 - 2
2144
To: Algebraic Field
2145
Defn: a |--> 1.259921049894873?
2146
2147
Although the original embeddings have only the default
2148
precision, we can obtain the basis with higher precision
2149
later::
2150
2151
sage: L=E.period_lattice(embs[0])
2152
sage: L.basis()
2153
(1.86405007647981 - 0.903761485143226*I, -0.149344633143919 - 2.06619546272945*I)
2154
2155
sage: L.basis(prec=100)
2156
(1.8640500764798108425920506200 - 0.90376148514322594749786960975*I, -0.14934463314391922099120107422 - 2.0661954627294548995621225062*I)
2157
"""
2158
from sage.schemes.elliptic_curves.period_lattice import PeriodLattice_ell
2159
return PeriodLattice_ell(self,embedding)
2160
2161
def is_isogenous(self, other, proof=True, maxnorm=100):
2162
"""
2163
Returns whether or not self is isogenous to other.
2164
2165
INPUT:
2166
2167
- ``other`` -- another elliptic curve.
2168
2169
- ``proof`` (default True) -- If ``False``, the function will
2170
return ``True`` whenever the two curves have the same
2171
conductor and are isogenous modulo `p` for all primes `p` of
2172
norm up to ``maxp``. If ``True``, the function returns
2173
False when the previous condition does not hold, and if it
2174
does hold we attempt to see if the curves are indeed
2175
isogenous. However, this has not been fully implemented
2176
(see examples below), so we may not be able to determine
2177
whether or not the curves are isogenous..
2178
2179
- ``maxnorm`` (integer, default 100) -- The maximum norm of
2180
primes `p` for which isogeny modulo `p` will be checked.
2181
2182
OUTPUT:
2183
2184
(bool) True if there is an isogeny from curve ``self`` to
2185
curve ``other``.
2186
2187
EXAMPLES::
2188
2189
sage: x = polygen(QQ, 'x')
2190
sage: F = NumberField(x^2 -2, 's'); F
2191
Number Field in s with defining polynomial x^2 - 2
2192
sage: E1 = EllipticCurve(F, [7,8])
2193
sage: E2 = EllipticCurve(F, [0,5,0,1,0])
2194
sage: E3 = EllipticCurve(F, [0,-10,0,21,0])
2195
sage: E1.is_isogenous(E2)
2196
False
2197
sage: E1.is_isogenous(E1)
2198
True
2199
sage: E2.is_isogenous(E2)
2200
True
2201
sage: E2.is_isogenous(E1)
2202
False
2203
sage: E2.is_isogenous(E3)
2204
True
2205
2206
::
2207
2208
sage: x = polygen(QQ, 'x')
2209
sage: F = NumberField(x^2 -2, 's'); F
2210
Number Field in s with defining polynomial x^2 - 2
2211
sage: E = EllipticCurve('14a1')
2212
sage: EE = EllipticCurve('14a2')
2213
sage: E1 = E.change_ring(F)
2214
sage: E2 = EE.change_ring(F)
2215
sage: E1.is_isogenous(E2)
2216
True
2217
2218
::
2219
2220
sage: x = polygen(QQ, 'x')
2221
sage: F = NumberField(x^2 -2, 's'); F
2222
Number Field in s with defining polynomial x^2 - 2
2223
sage: k.<a> = NumberField(x^3+7)
2224
sage: E = EllipticCurve(F, [7,8])
2225
sage: EE = EllipticCurve(k, [2, 2])
2226
sage: E.is_isogenous(EE)
2227
Traceback (most recent call last):
2228
...
2229
ValueError: Second argument must be defined over the same number field.
2230
2231
Some examples from Cremona's 1981 tables::
2232
2233
sage: K.<i> = QuadraticField(-1)
2234
sage: E1 = EllipticCurve([i + 1, 0, 1, -240*i - 400, -2869*i - 2627])
2235
sage: E1.conductor()
2236
Fractional ideal (4*i + 7)
2237
sage: E2 = EllipticCurve([1+i,0,1,0,0])
2238
sage: E2.conductor()
2239
Fractional ideal (4*i + 7)
2240
sage: E1.is_isogenous(E2) # long time (2s on sage.math, 2014)
2241
Traceback (most recent call last):
2242
...
2243
NotImplementedError: Curves appear to be isogenous (same conductor, isogenous modulo all primes of norm up to 1000), but no isogeny has been constructed.
2244
sage: E1.is_isogenous(E2, proof=False)
2245
True
2246
2247
In this case E1 and E2 are in fact 9-isogenous, as may be
2248
deduced from the following::
2249
2250
sage: E3 = EllipticCurve([i + 1, 0, 1, -5*i - 5, -2*i - 5])
2251
sage: E3.is_isogenous(E1)
2252
True
2253
sage: E3.is_isogenous(E2)
2254
True
2255
sage: E1.isogeny_degree(E2)
2256
9
2257
2258
"""
2259
if not is_EllipticCurve(other):
2260
raise ValueError, "Second argument is not an Elliptic Curve."
2261
if self.is_isomorphic(other):
2262
return True
2263
K = self.base_field()
2264
if K != other.base_field():
2265
raise ValueError, "Second argument must be defined over the same number field."
2266
2267
E1 = self.integral_model()
2268
E2 = other.integral_model()
2269
N = E1.conductor()
2270
if N != E2.conductor():
2271
return False
2272
2273
PI = K.primes_of_degree_one_iter()
2274
while True:
2275
P = PI.next()
2276
if P.norm() > maxnorm: break
2277
if not P.divides(N):
2278
OP = K.residue_field(P)
2279
if E1.change_ring(OP).cardinality() != E2.change_ring(OP).cardinality():
2280
return False
2281
2282
if not proof:
2283
return True
2284
2285
# We have not yet implemented isogenies of all possible
2286
# degrees, and do not know a bound on the possible degrees
2287
# over general number fields. But here we do at least try
2288
# some easy cases:
2289
2290
for l in [2,3,5,7,13]:
2291
if any([E2.is_isomorphic(f.codomain()) for f in E1.isogenies_prime_degree(l)]):
2292
return True
2293
2294
# Next we try looking modulo some more primes:
2295
2296
while True:
2297
if P.norm() > 10*maxnorm: break
2298
if not P.divides(N):
2299
OP = K.residue_field(P)
2300
if E1.change_ring(OP).cardinality() != E2.change_ring(OP).cardinality():
2301
return False
2302
P = PI.next()
2303
2304
# At this point is is highly likely that the curves are
2305
# isogenous, but we have not proved it.
2306
2307
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)
2308
2309
def isogeny_degree(self, other):
2310
"""
2311
Returns the minimal degree of an isogeny between self and
2312
other, or 0 if no isogeny exists.
2313
2314
INPUT:
2315
2316
- ``other`` -- another elliptic curve.
2317
2318
OUTPUT:
2319
2320
(int) The degree of an isogeny from ``self`` to ``other``, or 0.
2321
2322
.. warning::
2323
2324
Not all isogenies over number fields are yet implemented.
2325
Currently the code only works if there is a chain of
2326
isogenies from ``self`` to ``other`` of degrees 2, 3, 5, 7
2327
and 13.
2328
2329
EXAMPLES::
2330
2331
sage: x = QQ['x'].0
2332
sage: F = NumberField(x^2 -2, 's'); F
2333
Number Field in s with defining polynomial x^2 - 2
2334
sage: E = EllipticCurve('14a1')
2335
sage: EE = EllipticCurve('14a2')
2336
sage: E1 = E.change_ring(F)
2337
sage: E2 = EE.change_ring(F)
2338
sage: E1.isogeny_degree(E2)
2339
2
2340
sage: E2.isogeny_degree(E2)
2341
1
2342
sage: E5 = EllipticCurve('14a5').change_ring(F)
2343
sage: E1.isogeny_degree(E5)
2344
6
2345
"""
2346
if self.conductor() != other.conductor():
2347
return Integer(0)
2348
2349
if self.is_isomorphic(other):
2350
return Integer(1)
2351
2352
from sage.sets.set import Set
2353
2354
curves = [self]
2355
degrees = [Integer(1)]
2356
l_list = [l for l in Set([ZZ(f.degree()) for f in self.isogenies_prime_degree([2,3,5,7,13])])]
2357
2358
newcurves = []
2359
newdegs = []
2360
k = 0
2361
while k<len(curves):
2362
newcurves.extend([f.codomain() for f in curves[k].isogenies_prime_degree(l_list)])
2363
newdegs.extend([degrees[k]*f.degree() for f in curves[k].isogenies_prime_degree(l_list)])
2364
newisogpairs = dict(zip(newcurves, newdegs))
2365
i = 0
2366
while i<len(curves):
2367
j = 0
2368
while j<len(newcurves):
2369
if curves[i].is_isomorphic(newcurves[j]):
2370
newdegs.remove(newisogpairs[newcurves[j]])
2371
newcurves.remove(newcurves[j])
2372
else:
2373
j = j+1
2374
i = i+1
2375
2376
m = 0
2377
newisogpairs = dict(zip(newcurves, newdegs))
2378
while m<len(newcurves):
2379
if other.is_isomorphic(newcurves[m]):
2380
return newisogpairs[newcurves[m]]
2381
m = m+1
2382
2383
curves.extend(newcurves)
2384
degrees.extend(newdegs)
2385
k = k+1
2386
2387
raise NotImplementedError("Not all isogenies implemented over general number fields.")
2388
2389
def lll_reduce(self, points, height_matrix=None, precision=None):
2390
"""
2391
Returns an LLL-reduced basis from a given basis, with transform
2392
matrix.
2393
2394
INPUT:
2395
2396
- ``points`` - a list of points on this elliptic
2397
curve, which should be independent.
2398
2399
- ``height_matrix`` - the height-pairing matrix of
2400
the points, or ``None``. If ``None``, it will be computed.
2401
2402
- ``precision`` - number of bits of precision of intermediate
2403
computations (default: ``None``, for default RealField
2404
precision; ignored if ``height_matrix`` is supplied)
2405
2406
OUTPUT: A tuple (newpoints, U) where U is a unimodular integer
2407
matrix, new_points is the transform of points by U, such that
2408
new_points has LLL-reduced height pairing matrix
2409
2410
.. note::
2411
2412
If the input points are not independent, the output
2413
depends on the undocumented behaviour of PARI's
2414
``qflllgram()`` function when applied to a gram matrix which
2415
is not positive definite.
2416
2417
EXAMPLES:
2418
2419
Some examples over `\QQ`::
2420
2421
sage: E = EllipticCurve([0, 1, 1, -2, 42])
2422
sage: Pi = E.gens(); Pi
2423
[(-4 : 1 : 1), (-3 : 5 : 1), (-11/4 : 43/8 : 1), (-2 : 6 : 1)]
2424
sage: Qi, U = E.lll_reduce(Pi)
2425
sage: all(sum(U[i,j]*Pi[i] for i in range(4)) == Qi[j] for j in range(4))
2426
True
2427
sage: sorted(Qi)
2428
[(-4 : 1 : 1), (-3 : 5 : 1), (-2 : 6 : 1), (0 : 6 : 1)]
2429
sage: U.det()
2430
1
2431
sage: E.regulator_of_points(Pi)
2432
4.59088036960573
2433
sage: E.regulator_of_points(Qi)
2434
4.59088036960574
2435
2436
::
2437
2438
sage: E = EllipticCurve([1,0,1,-120039822036992245303534619191166796374,504224992484910670010801799168082726759443756222911415116])
2439
sage: xi = [2005024558054813068,\
2440
-4690836759490453344,\
2441
4700156326649806635,\
2442
6785546256295273860,\
2443
6823803569166584943,\
2444
7788809602110240789,\
2445
27385442304350994620556,\
2446
54284682060285253719/4,\
2447
-94200235260395075139/25,\
2448
-3463661055331841724647/576,\
2449
-6684065934033506970637/676,\
2450
-956077386192640344198/2209,\
2451
-27067471797013364392578/2809,\
2452
-25538866857137199063309/3721,\
2453
-1026325011760259051894331/108241,\
2454
9351361230729481250627334/1366561,\
2455
10100878635879432897339615/1423249,\
2456
11499655868211022625340735/17522596,\
2457
110352253665081002517811734/21353641,\
2458
414280096426033094143668538257/285204544,\
2459
36101712290699828042930087436/4098432361,\
2460
45442463408503524215460183165/5424617104,\
2461
983886013344700707678587482584/141566320009,\
2462
1124614335716851053281176544216033/152487126016]
2463
sage: points = [E.lift_x(x) for x in xi]
2464
sage: newpoints, U = E.lll_reduce(points) # long time (35s on sage.math, 2011)
2465
sage: [P[0] for P in newpoints] # long time
2466
[6823803569166584943, 5949539878899294213, 2005024558054813068, 5864879778877955778, 23955263915878682727/4, 5922188321411938518, 5286988283823825378, 175620639884534615751/25, -11451575907286171572, 3502708072571012181, 1500143935183238709184/225, 27180522378120223419/4, -5811874164190604461581/625, 26807786527159569093, 7404442636649562303, 475656155255883588, 265757454726766017891/49, 7272142121019825303, 50628679173833693415/4, 6951643522366348968, 6842515151518070703, 111593750389650846885/16, 2607467890531740394315/9, -1829928525835506297]
2467
2468
An example to show the explicit use of the height pairing matrix::
2469
2470
sage: E = EllipticCurve([0, 1, 1, -2, 42])
2471
sage: Pi = E.gens()
2472
sage: H = E.height_pairing_matrix(Pi,3)
2473
sage: E.lll_reduce(Pi,height_matrix=H)
2474
(
2475
[1 0 0 1]
2476
[0 1 0 1]
2477
[0 0 0 1]
2478
[(-4 : 1 : 1), (-3 : 5 : 1), (-2 : 6 : 1), (1 : -7 : 1)], [0 0 1 1]
2479
)
2480
2481
Some examples over number fields (see :trac:`9411`)::
2482
2483
sage: K.<a> = QuadraticField(-23, 'a')
2484
sage: E = EllipticCurve(K, '37')
2485
sage: E.lll_reduce(E.gens())
2486
(
2487
[1 1]
2488
[(-1 : 0 : 1), (-2 : 1/2*a - 1/2 : 1)], [0 1]
2489
)
2490
2491
::
2492
2493
sage: K.<a> = QuadraticField(-5)
2494
sage: E = EllipticCurve(K,[0,a])
2495
sage: points = [E.point([-211/841*a - 6044/841,-209584/24389*a + 53634/24389]),E.point([-17/18*a - 1/9, -109/108*a - 277/108]) ]
2496
sage: E.lll_reduce(points)
2497
(
2498
[(-a + 4 : -3*a + 7 : 1), (-17/18*a - 1/9 : 109/108*a + 277/108 : 1)],
2499
[ 1 0]
2500
[ 1 -1]
2501
)
2502
"""
2503
r = len(points)
2504
if height_matrix is None:
2505
height_matrix = self.height_pairing_matrix(points, precision)
2506
U = height_matrix._pari_().lllgram().python()
2507
new_points = [sum([U[j, i]*points[j] for j in range(r)])
2508
for i in range(r)]
2509
return new_points, U
2510
2511
def galois_representation(self):
2512
r"""
2513
The compatible family of the Galois representation
2514
attached to this elliptic curve.
2515
2516
Given an elliptic curve `E` over a number field `K`
2517
and a rational prime number `p`, the `p^n`-torsion
2518
`E[p^n]` points of `E` is a representation of the
2519
absolute Galois group of `K`. As `n` varies
2520
we obtain the Tate module `T_p E` which is a
2521
a representation of `G_K` on a free `\ZZ_p`-module
2522
of rank `2`. As `p` varies the representations
2523
are compatible.
2524
2525
EXAMPLES::
2526
2527
sage: K = NumberField(x**2 + 1, 'a')
2528
sage: E = EllipticCurve('11a1').change_ring(K)
2529
sage: rho = E.galois_representation()
2530
sage: rho
2531
Compatible family of Galois representations associated to the Elliptic Curve defined by y^2 + y = x^3 + (-1)*x^2 + (-10)*x + (-20) over Number Field in a with defining polynomial x^2 + 1
2532
sage: rho.is_surjective(3)
2533
True
2534
sage: rho.is_surjective(5) # long time (4s on sage.math, 2014)
2535
False
2536
sage: rho.non_surjective()
2537
[5]
2538
"""
2539
return gal_reps_number_field.GaloisRepresentation(self)
2540
2541