Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/schemes/elliptic_curves/constructor.py
4099 views
1
"""
2
Elliptic curve constructor
3
4
AUTHORS:
5
6
- William Stein (2005): Initial version
7
8
- John Cremona (2008-01): EllipticCurve(j) fixed for all cases
9
"""
10
11
#*****************************************************************************
12
# Copyright (C) 2005 William Stein <[email protected]>
13
#
14
# Distributed under the terms of the GNU General Public License (GPL)
15
#
16
# This code is distributed in the hope that it will be useful,
17
# but WITHOUT ANY WARRANTY; without even the implied warranty of
18
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19
# General Public License for more details.
20
#
21
# The full text of the GPL is available at:
22
#
23
# http://www.gnu.org/licenses/
24
#*****************************************************************************
25
26
27
import sage.rings.all as rings
28
29
from sage.structure.sequence import Sequence
30
from sage.structure.element import parent
31
from sage.symbolic.ring import SR
32
from sage.symbolic.expression import is_SymbolicEquation
33
34
35
def EllipticCurve(x=None, y=None, j=None):
36
r"""
37
There are several ways to construct an elliptic curve:
38
39
.. math::
40
41
y^2 + a_1 xy + a_3 y = x^3 + a_2 x^2 + a_4 x + a_6.
42
43
44
- EllipticCurve([a1,a2,a3,a4,a6]): Elliptic curve with given
45
a-invariants. The invariants are coerced into the parent of the
46
first element. If all are integers, they are coerced into the
47
rational numbers.
48
49
- EllipticCurve([a4,a6]): Same as above, but a1=a2=a3=0.
50
51
- EllipticCurve(label): Returns the elliptic curve over Q from the
52
Cremona database with the given label. The label is a string, such
53
as "11a" or "37b2". The letters in the label *must* be lower case
54
(Cremona's new labeling).
55
56
- EllipticCurve(R, [a1,a2,a3,a4,a6]): Create the elliptic curve
57
over R with given a-invariants. Here R can be an arbitrary ring.
58
Note that addition need not be defined.
59
60
61
- EllipticCurve(j): Return an elliptic curve with j-invariant
62
`j`. Warning: this is deprecated. Use ``EllipticCurve_from_j(j)``
63
or ``EllipticCurve(j=j)`` instead.
64
65
In each case above where the input is a list of length 2 or 5, one
66
can instead give a 2 or 5-tuple instead.
67
68
EXAMPLES: We illustrate creating elliptic curves.
69
70
::
71
72
sage: EllipticCurve([0,0,1,-1,0])
73
Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field
74
75
We create a curve from a Cremona label::
76
77
sage: EllipticCurve('37b2')
78
Elliptic Curve defined by y^2 + y = x^3 + x^2 - 1873*x - 31833 over Rational Field
79
sage: EllipticCurve('5077a')
80
Elliptic Curve defined by y^2 + y = x^3 - 7*x + 6 over Rational Field
81
sage: EllipticCurve('389a')
82
Elliptic Curve defined by y^2 + y = x^3 + x^2 - 2*x over Rational Field
83
84
Unicode labels are allowed::
85
86
sage: EllipticCurve(u'389a')
87
Elliptic Curve defined by y^2 + y = x^3 + x^2 - 2*x over Rational Field
88
89
We create curves over a finite field as follows::
90
91
sage: EllipticCurve([GF(5)(0),0,1,-1,0])
92
Elliptic Curve defined by y^2 + y = x^3 + 4*x over Finite Field of size 5
93
sage: EllipticCurve(GF(5), [0, 0,1,-1,0])
94
Elliptic Curve defined by y^2 + y = x^3 + 4*x over Finite Field of size 5
95
96
Elliptic curves over `\ZZ/N\ZZ` with `N` prime are of type
97
"elliptic curve over a finite field"::
98
99
sage: F = Zmod(101)
100
sage: EllipticCurve(F, [2, 3])
101
Elliptic Curve defined by y^2 = x^3 + 2*x + 3 over Ring of integers modulo 101
102
sage: E = EllipticCurve([F(2), F(3)])
103
sage: type(E)
104
<class 'sage.schemes.elliptic_curves.ell_finite_field.EllipticCurve_finite_field_with_category'>
105
sage: E.category()
106
Category of schemes over Ring of integers modulo 101
107
108
In contrast, elliptic curves over `\ZZ/N\ZZ` with `N` composite
109
are of type "generic elliptic curve"::
110
111
sage: F = Zmod(95)
112
sage: EllipticCurve(F, [2, 3])
113
Elliptic Curve defined by y^2 = x^3 + 2*x + 3 over Ring of integers modulo 95
114
sage: E = EllipticCurve([F(2), F(3)])
115
sage: type(E)
116
<class 'sage.schemes.elliptic_curves.ell_generic.EllipticCurve_generic_with_category'>
117
sage: E.category()
118
Category of schemes over Ring of integers modulo 95
119
120
The following is a curve over the complex numbers::
121
122
sage: E = EllipticCurve(CC, [0,0,1,-1,0])
123
sage: E
124
Elliptic Curve defined by y^2 + 1.00000000000000*y = x^3 + (-1.00000000000000)*x over Complex Field with 53 bits of precision
125
sage: E.j_invariant()
126
2988.97297297297
127
128
We can also create elliptic curves by giving the Weierstrass equation::
129
130
sage: x, y = var('x,y')
131
sage: EllipticCurve(y^2 + y == x^3 + x - 9)
132
Elliptic Curve defined by y^2 + y = x^3 + x - 9 over Rational Field
133
134
sage: R.<x,y> = GF(5)[]
135
sage: EllipticCurve(x^3 + x^2 + 2 - y^2 - y*x)
136
Elliptic Curve defined by y^2 + x*y = x^3 + x^2 + 2 over Finite Field of size 5
137
138
We can explicitly specify the `j`-invariant::
139
140
sage: E = EllipticCurve(j=1728); E; E.j_invariant(); E.label()
141
Elliptic Curve defined by y^2 = x^3 - x over Rational Field
142
1728
143
'32a2'
144
145
sage: E = EllipticCurve(j=GF(5)(2)); E; E.j_invariant()
146
Elliptic Curve defined by y^2 = x^3 + x + 1 over Finite Field of size 5
147
2
148
149
See trac #6657::
150
151
sage: EllipticCurve(GF(144169),j=1728)
152
Elliptic Curve defined by y^2 = x^3 + x over Finite Field of size 144169
153
154
155
TESTS::
156
157
sage: R = ZZ['u', 'v']
158
sage: EllipticCurve(R, [1,1])
159
Elliptic Curve defined by y^2 = x^3 + x + 1 over Multivariate Polynomial Ring in u, v
160
over Integer Ring
161
162
We create a curve and a point over QQbar (see #6879)::
163
164
sage: E = EllipticCurve(QQbar,[0,1])
165
sage: E(0)
166
(0 : 1 : 0)
167
sage: E.base_field()
168
Algebraic Field
169
170
sage: E = EllipticCurve(RR,[1,2]); E; E.base_field()
171
Elliptic Curve defined by y^2 = x^3 + 1.00000000000000*x + 2.00000000000000 over Real Field with 53 bits of precision
172
Real Field with 53 bits of precision
173
sage: EllipticCurve(CC,[3,4]); E; E.base_field()
174
Elliptic Curve defined by y^2 = x^3 + 3.00000000000000*x + 4.00000000000000 over Complex Field with 53 bits of precision
175
Elliptic Curve defined by y^2 = x^3 + 1.00000000000000*x + 2.00000000000000 over Real Field with 53 bits of precision
176
Real Field with 53 bits of precision
177
sage: E = EllipticCurve(QQbar,[5,6]); E; E.base_field()
178
Elliptic Curve defined by y^2 = x^3 + 5*x + 6 over Algebraic Field
179
Algebraic Field
180
181
See trac #6657::
182
183
sage: EllipticCurve(3,j=1728)
184
Traceback (most recent call last):
185
...
186
ValueError: First parameter (if present) must be a ring when j is specified
187
188
sage: EllipticCurve(GF(5),j=3/5)
189
Traceback (most recent call last):
190
...
191
ValueError: First parameter must be a ring containing 3/5
192
193
If the universe of the coefficients is a general field, the object
194
constructed has type EllipticCurve_field. Otherwise it is
195
EllipticCurve_generic. See trac #9816::
196
197
sage: E = EllipticCurve([QQbar(1),3]); E
198
Elliptic Curve defined by y^2 = x^3 + x + 3 over Algebraic Field
199
sage: type(E)
200
<class 'sage.schemes.elliptic_curves.ell_field.EllipticCurve_field_with_category'>
201
202
sage: E = EllipticCurve([RR(1),3]); E
203
Elliptic Curve defined by y^2 = x^3 + 1.00000000000000*x + 3.00000000000000 over Real Field with 53 bits of precision
204
sage: type(E)
205
<class 'sage.schemes.elliptic_curves.ell_field.EllipticCurve_field_with_category'>
206
207
sage: E = EllipticCurve([i,i]); E
208
Elliptic Curve defined by y^2 = x^3 + I*x + I over Symbolic Ring
209
sage: type(E)
210
<class 'sage.schemes.elliptic_curves.ell_field.EllipticCurve_field_with_category'>
211
sage: E.category()
212
Category of schemes over Symbolic Ring
213
sage: is_field(SR)
214
True
215
216
sage: F = FractionField(PolynomialRing(QQ,'t'))
217
sage: t = F.gen()
218
sage: E = EllipticCurve([t,0]); E
219
Elliptic Curve defined by y^2 = x^3 + t*x over Fraction Field of Univariate Polynomial Ring in t over Rational Field
220
sage: type(E)
221
<class 'sage.schemes.elliptic_curves.ell_field.EllipticCurve_field_with_category'>
222
sage: E.category()
223
Category of schemes over Fraction Field of Univariate Polynomial Ring in t over Rational Field
224
225
See :trac:`12517`::
226
227
sage: E = EllipticCurve([1..5])
228
sage: EllipticCurve(E.a_invariants())
229
Elliptic Curve defined by y^2 + x*y + 3*y = x^3 + 2*x^2 + 4*x + 5 over Rational Field
230
"""
231
import ell_generic, ell_field, ell_finite_field, ell_number_field, ell_rational_field, ell_padic_field # here to avoid circular includes
232
233
if j is not None:
234
if not x is None:
235
if rings.is_Ring(x):
236
try:
237
j = x(j)
238
except (ZeroDivisionError, ValueError, TypeError):
239
raise ValueError, "First parameter must be a ring containing %s"%j
240
else:
241
raise ValueError, "First parameter (if present) must be a ring when j is specified"
242
return EllipticCurve_from_j(j)
243
244
assert x is not None
245
246
if is_SymbolicEquation(x):
247
x = x.lhs() - x.rhs()
248
249
if parent(x) is SR:
250
x = x._polynomial_(rings.QQ['x', 'y'])
251
252
if rings.is_MPolynomial(x) and y is None:
253
f = x
254
if f.degree() != 3:
255
raise ValueError, "Elliptic curves must be defined by a cubic polynomial."
256
if f.degrees() == (3,2):
257
x, y = f.parent().gens()
258
elif f.degree() == (2,3):
259
y, x = f.parent().gens()
260
elif len(f.parent().gens()) == 2 or len(f.parent().gens()) == 3 and f.is_homogeneous():
261
# We'd need a point too...
262
raise NotImplementedError, "Construction of an elliptic curve from a generic cubic not yet implemented."
263
else:
264
raise ValueError, "Defining polynomial must be a cubic polynomial in two variables."
265
266
try:
267
if f.coefficient(x**3) < 0:
268
f = -f
269
# is there a nicer way to extract the coefficients?
270
a1 = a2 = a3 = a4 = a6 = 0
271
for coeff, mon in f:
272
if mon == x**3:
273
assert coeff == 1
274
elif mon == x**2:
275
a2 = coeff
276
elif mon == x:
277
a4 = coeff
278
elif mon == 1:
279
a6 = coeff
280
elif mon == y**2:
281
assert coeff == -1
282
elif mon == x*y:
283
a1 = -coeff
284
elif mon == y:
285
a3 = -coeff
286
else:
287
assert False
288
return EllipticCurve([a1, a2, a3, a4, a6])
289
except AssertionError:
290
raise NotImplementedError, "Construction of an elliptic curve from a generic cubic not yet implemented."
291
292
if rings.is_Ring(x):
293
if rings.is_RationalField(x):
294
return ell_rational_field.EllipticCurve_rational_field(x, y)
295
elif rings.is_FiniteField(x) or (rings.is_IntegerModRing(x) and x.characteristic().is_prime()):
296
return ell_finite_field.EllipticCurve_finite_field(x, y)
297
elif rings.is_pAdicField(x):
298
return ell_padic_field.EllipticCurve_padic_field(x, y)
299
elif rings.is_NumberField(x):
300
return ell_number_field.EllipticCurve_number_field(x, y)
301
elif rings.is_Field(x):
302
return ell_field.EllipticCurve_field(x, y)
303
return ell_generic.EllipticCurve_generic(x, y)
304
305
if isinstance(x, unicode):
306
x = str(x)
307
308
if isinstance(x, str):
309
return ell_rational_field.EllipticCurve_rational_field(x)
310
311
if rings.is_RingElement(x) and y is None:
312
from sage.misc.misc import deprecation
313
deprecation("'EllipticCurve(j)' is deprecated; use 'EllipticCurve_from_j(j)' or 'EllipticCurve(j=j)' instead.")
314
# Fixed for all characteristics and cases by John Cremona
315
j=x
316
F=j.parent().fraction_field()
317
char=F.characteristic()
318
if char==2:
319
if j==0:
320
return EllipticCurve(F, [ 0, 0, 1, 0, 0 ])
321
else:
322
return EllipticCurve(F, [ 1, 0, 0, 0, 1/j ])
323
if char==3:
324
if j==0:
325
return EllipticCurve(F, [ 0, 0, 0, 1, 0 ])
326
else:
327
return EllipticCurve(F, [ 0, j, 0, 0, -j**2 ])
328
if j == 0:
329
return EllipticCurve(F, [ 0, 0, 0, 0, 1 ])
330
if j == 1728:
331
return EllipticCurve(F, [ 0, 0, 0, 1, 0 ])
332
k=j-1728
333
return EllipticCurve(F, [0,0,0,-3*j*k, -2*j*k**2])
334
335
if not isinstance(x, (list, tuple)):
336
raise TypeError, "invalid input to EllipticCurve constructor"
337
338
x = Sequence(x)
339
if not (len(x) in [2,5]):
340
raise ValueError, "sequence of coefficients must have length 2 or 5"
341
R = x.universe()
342
343
if isinstance(x[0], (rings.Rational, rings.Integer, int, long)):
344
return ell_rational_field.EllipticCurve_rational_field(x, y)
345
346
elif rings.is_NumberField(R):
347
return ell_number_field.EllipticCurve_number_field(x, y)
348
349
elif rings.is_pAdicField(R):
350
return ell_padic_field.EllipticCurve_padic_field(x, y)
351
352
elif rings.is_FiniteField(R) or (rings.is_IntegerModRing(R) and R.characteristic().is_prime()):
353
return ell_finite_field.EllipticCurve_finite_field(x, y)
354
355
elif rings.is_Field(R):
356
return ell_field.EllipticCurve_field(x, y)
357
358
return ell_generic.EllipticCurve_generic(x, y)
359
360
361
def EllipticCurve_from_c4c6(c4, c6):
362
"""
363
Return an elliptic curve with given `c_4` and
364
`c_6` invariants.
365
366
EXAMPLES::
367
368
sage: E = EllipticCurve_from_c4c6(17, -2005)
369
sage: E
370
Elliptic Curve defined by y^2 = x^3 - 17/48*x + 2005/864 over Rational Field
371
sage: E.c_invariants()
372
(17, -2005)
373
"""
374
try:
375
K = c4.parent()
376
except AttributeError:
377
K = rings.RationalField()
378
if not rings.is_Field(K):
379
K = K.fraction_field()
380
return EllipticCurve([-K(c4)/K(48), -K(c6)/K(864)])
381
382
def EllipticCurve_from_j(j):
383
"""
384
Return an elliptic curve with given `j`-invariant.
385
386
EXAMPLES::
387
388
sage: E = EllipticCurve_from_j(0); E; E.j_invariant(); E.label()
389
Elliptic Curve defined by y^2 + y = x^3 over Rational Field
390
0
391
'27a3'
392
393
sage: E = EllipticCurve_from_j(1728); E; E.j_invariant(); E.label()
394
Elliptic Curve defined by y^2 = x^3 - x over Rational Field
395
1728
396
'32a2'
397
398
sage: E = EllipticCurve_from_j(1); E; E.j_invariant()
399
Elliptic Curve defined by y^2 + x*y = x^3 + 36*x + 3455 over Rational Field
400
1
401
402
"""
403
try:
404
K = j.parent()
405
except AttributeError:
406
K = rings.RationalField()
407
if not rings.is_Field(K):
408
K = K.fraction_field()
409
410
char=K.characteristic()
411
if char==2:
412
if j == 0:
413
return EllipticCurve(K, [ 0, 0, 1, 0, 0 ])
414
else:
415
return EllipticCurve(K, [ 1, 0, 0, 0, 1/j ])
416
if char == 3:
417
if j==0:
418
return EllipticCurve(K, [ 0, 0, 0, 1, 0 ])
419
else:
420
return EllipticCurve(K, [ 0, j, 0, 0, -j**2 ])
421
422
if K is rings.RationalField():
423
# we construct the minimal twist, i.e. the curve with minimal
424
# conductor with this j_invariant:
425
426
if j == 0:
427
return EllipticCurve(K, [ 0, 0, 1, 0, 0 ]) # 27a3
428
if j == 1728:
429
return EllipticCurve(K, [ 0, 0, 0, -1, 0 ]) # 32a2
430
431
n = j.numerator()
432
m = n-1728*j.denominator()
433
a4 = -3*n*m
434
a6 = -2*n*m**2
435
436
# Now E=[0,0,0,a4,a6] has j-invariant j=n/d
437
438
from sage.sets.set import Set
439
for p in Set(n.prime_divisors()+m.prime_divisors()):
440
e = min(a4.valuation(p)//2,a6.valuation(p)//3)
441
if e>0:
442
p = p**e
443
a4 /= p**2
444
a6 /= p**3
445
446
# Now E=[0,0,0,a4,a6] is minimal at all p != 2,3
447
448
tw = [-1,2,-2,3,-3,6,-6]
449
E1 = EllipticCurve([0,0,0,a4,a6])
450
Elist = [E1] + [E1.quadratic_twist(t) for t in tw]
451
crv_cmp = lambda E,F: cmp(E.conductor(),F.conductor())
452
Elist.sort(cmp=crv_cmp)
453
return Elist[0]
454
455
# defaults for all other fields:
456
if j == 0:
457
return EllipticCurve(K, [ 0, 0, 0, 0, 1 ])
458
if j == 1728:
459
return EllipticCurve(K, [ 0, 0, 0, 1, 0 ])
460
k=j-1728
461
return EllipticCurve(K, [0,0,0,-3*j*k, -2*j*k**2])
462
463
def EllipticCurve_from_cubic(F, P):
464
r"""
465
Construct an elliptic curve from a ternary cubic with a rational point.
466
467
INPUT:
468
469
- ``F`` -- a homogeneous cubic in three variables with rational
470
coefficients (either as a polynomial ring element or as a
471
string) defining a smooth plane cubic curve.
472
473
- ``P`` -- a 3-tuple `(x,y,z)` defining a projective point on the
474
curve `F=0`.
475
476
OUTPUT:
477
478
(elliptic curve) An elliptic curve (in minimal Weierstrass form)
479
isomorphic to the curve `F=0`.
480
481
.. note::
482
483
USES MAGMA - This function will not work on computers that
484
do not have magma installed.
485
486
TO DO: implement this without using MAGMA.
487
488
For a more general version, see the function
489
``EllipticCurve_from_plane_curve()``.
490
491
EXAMPLES:
492
493
First we find that the Fermat cubic is isomorphic to the curve
494
with Cremona label 27a1::
495
496
sage: E = EllipticCurve_from_cubic('x^3 + y^3 + z^3', [1,-1,0]) # optional - magma
497
sage: E # optional - magma
498
Elliptic Curve defined by y^2 + y = x^3 - 7 over Rational Field
499
sage: E.cremona_label() # optional - magma
500
'27a1'
501
502
Next we find the minimal model and conductor of the Jacobian of the
503
Selmer curve.
504
505
::
506
507
sage: E = EllipticCurve_from_cubic('u^3 + v^3 + 60*w^3', [1,-1,0]) # optional - magma
508
sage: E # optional - magma
509
Elliptic Curve defined by y^2 = x^3 - 24300 over Rational Field
510
sage: E.conductor() # optional - magma
511
24300
512
"""
513
from sage.interfaces.all import magma
514
cmd = "P<%s,%s,%s> := ProjectivePlane(RationalField());"%SR(F).variables()
515
magma.eval(cmd)
516
cmd = 'aInvariants(MinimalModel(EllipticCurve(Curve(Scheme(P, %s)),P!%s)));'%(F, P)
517
s = magma.eval(cmd)
518
return EllipticCurve(rings.RationalField(), eval(s))
519
520
def EllipticCurve_from_plane_curve(C, P):
521
r"""
522
Construct an elliptic curve from a smooth plane cubic with a rational point.
523
524
INPUT:
525
526
- ``C`` -- a plane curve of genus one.
527
528
- ``P`` -- a 3-tuple `(x,y,z)` defining a projective point on the
529
curve ``C``.
530
531
OUTPUT:
532
533
(elliptic curve) An elliptic curve (in minimal Weierstrass form)
534
isomorphic to ``C``.
535
536
537
.. note::
538
539
USES MAGMA - This function will not work on computers that
540
do not have magma installed.
541
542
TO DO: implement this without using MAGMA.
543
544
EXAMPLES:
545
546
First we check that the Fermat cubic is isomorphic to the curve
547
with Cremona label '27a1'::
548
549
sage: x,y,z=PolynomialRing(QQ,3,'xyz').gens() # optional - magma
550
sage: C=Curve(x^3+y^3+z^3) # optional - magma
551
sage: P=C(1,-1,0) # optional - magma
552
sage: E=EllipticCurve_from_plane_curve(C,P) # optional - magma
553
sage: E # optional - magma
554
Elliptic Curve defined by y^2 + y = x^3 - 7 over Rational Field
555
sage: E.label() # optional - magma
556
'27a1'
557
558
Now we try a quartic example::
559
560
sage: u,v,w=PolynomialRing(QQ,3,'uvw').gens() # optional - magma
561
sage: C=Curve(u^4+u^2*v^2-w^4) # optional - magma
562
sage: P=C(1,0,1) # optional - magma
563
sage: E=EllipticCurve_from_plane_curve(C,P) # optional - magma
564
sage: E # optional - magma
565
Elliptic Curve defined by y^2 = x^3 + 4*x over Rational Field
566
sage: E.label() # optional - magma
567
'32a1'
568
569
"""
570
from sage.interfaces.all import magma
571
if C.genus()!=1:
572
raise TypeError, "The curve C must have genus 1"
573
elif P.parent()!=C.point_set(C.base_ring()):
574
raise TypeError, "The point P must be on the curve C"
575
dp=C.defining_polynomial()
576
x,y,z = dp.parent().variable_names()
577
cmd = "PR<%s,%s,%s>:=ProjectivePlane(RationalField());"%(x,y,z)
578
magma.eval(cmd)
579
cmd = 'CC:=Curve(PR, %s);'%(dp)
580
magma.eval(cmd)
581
cmd='aInvariants(MinimalModel(EllipticCurve(CC,CC!%s)));'%([P[0],P[1],P[2]])
582
s=magma.eval(cmd)
583
return EllipticCurve(rings.RationalField(), eval(s))
584
585
def EllipticCurves_with_good_reduction_outside_S(S=[], proof=None, verbose=False):
586
r"""
587
Returns a sorted list of all elliptic curves defined over `Q`
588
with good reduction outside the set `S` of primes.
589
590
INPUT:
591
592
- ``S`` - list of primes (default: empty list).
593
594
- ``proof`` - True/False (default True): the MW basis for
595
auxiliary curves will be computed with this proof flag.
596
597
- ``verbose`` - True/False (default False): if True, some
598
details of the computation will be output.
599
600
.. note::
601
602
Proof flag: The algorithm used requires determining all
603
S-integral points on several auxiliary curves, which in turn
604
requires the computation of their generators. This is not
605
always possible (even in theory) using current knowledge.
606
607
The value of this flag is passed to the function which
608
computes generators of various auxiliary elliptic curves, in
609
order to find their S-integral points. Set to False if the
610
default (True) causes warning messages, but note that you can
611
then not rely on the set of curves returned being
612
complete.
613
614
EXAMPLES::
615
616
sage: EllipticCurves_with_good_reduction_outside_S([])
617
[]
618
sage: elist = EllipticCurves_with_good_reduction_outside_S([2])
619
sage: elist
620
[Elliptic Curve defined by y^2 = x^3 + 4*x over Rational Field,
621
Elliptic Curve defined by y^2 = x^3 - x over Rational Field,
622
...
623
Elliptic Curve defined by y^2 = x^3 - x^2 - 13*x + 21 over Rational Field]
624
sage: len(elist)
625
24
626
sage: ', '.join([e.label() for e in elist])
627
'32a1, 32a2, 32a3, 32a4, 64a1, 64a2, 64a3, 64a4, 128a1, 128a2, 128b1, 128b2, 128c1, 128c2, 128d1, 128d2, 256a1, 256a2, 256b1, 256b2, 256c1, 256c2, 256d1, 256d2'
628
629
Without ``Proof=False``, this example gives two warnings::
630
631
sage: elist = EllipticCurves_with_good_reduction_outside_S([11],proof=False) # long time (14s on sage.math, 2011)
632
sage: len(elist) # long time
633
12
634
sage: ', '.join([e.label() for e in elist]) # long time
635
'11a1, 11a2, 11a3, 121a1, 121a2, 121b1, 121b2, 121c1, 121c2, 121d1, 121d2, 121d3'
636
637
sage: elist = EllipticCurves_with_good_reduction_outside_S([2,3]) # long time (26s on sage.math, 2011)
638
sage: len(elist) # long time
639
752
640
sage: max([e.conductor() for e in elist]) # long time
641
62208
642
sage: [N.factor() for N in Set([e.conductor() for e in elist])] # long time
643
[2^7,
644
2^8,
645
2^3 * 3^4,
646
2^2 * 3^3,
647
2^8 * 3^4,
648
2^4 * 3^4,
649
2^3 * 3,
650
2^7 * 3,
651
2^3 * 3^5,
652
3^3,
653
2^8 * 3,
654
2^5 * 3^4,
655
2^4 * 3,
656
2 * 3^4,
657
2^2 * 3^2,
658
2^6 * 3^4,
659
2^6,
660
2^7 * 3^2,
661
2^4 * 3^5,
662
2^4 * 3^3,
663
2 * 3^3,
664
2^6 * 3^3,
665
2^6 * 3,
666
2^5,
667
2^2 * 3^4,
668
2^3 * 3^2,
669
2^5 * 3,
670
2^7 * 3^4,
671
2^2 * 3^5,
672
2^8 * 3^2,
673
2^5 * 3^2,
674
2^7 * 3^5,
675
2^8 * 3^5,
676
2^3 * 3^3,
677
2^8 * 3^3,
678
2^5 * 3^5,
679
2^4 * 3^2,
680
2 * 3^5,
681
2^5 * 3^3,
682
2^6 * 3^5,
683
2^7 * 3^3,
684
3^5,
685
2^6 * 3^2]
686
"""
687
from ell_egros import (egros_from_jlist, egros_get_j)
688
return egros_from_jlist(egros_get_j(S, proof=proof, verbose=verbose), S)
689
690