Skip to content

Commit 7c657eb

Browse files
committed
src/sage/schemes/elliptic_curves: add "needs sage.libs.eclib"
Unsurprisingly, a lot of the tests in sage.schemes.elliptic_curves use eclib. After a day of running sage -t followed by emacs followed by sage -t followed by emacs... I think I've found them all. This commit marks them as "needs sage.libs.eclib" so that they will be skipped if eclib is unavailable or explicitly disabled.
1 parent 7e3270a commit 7c657eb

15 files changed

+404
-118
lines changed

src/sage/schemes/elliptic_curves/BSD.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def mwrank_two_descent_work(E, two_tor_rk) -> tuple:
8686
8787
EXAMPLES::
8888
89+
sage: # needs sage.libs.eclib
8990
sage: from sage.schemes.elliptic_curves.BSD import mwrank_two_descent_work
9091
sage: E = EllipticCurve('14a')
9192
sage: mwrank_two_descent_work(E, E.two_torsion_rank())
@@ -130,7 +131,7 @@ def pari_two_descent_work(E) -> tuple:
130131
sage: pari_two_descent_work(E)
131132
(0, 0, 0, 0, [])
132133
sage: E = EllipticCurve('37a')
133-
sage: pari_two_descent_work(E) # random, up to sign
134+
sage: pari_two_descent_work(E) # random, up to sign, needs sage.libs.eclib
134135
(1, 1, 0, 0, [(0 : -1 : 1)])
135136
sage: E = EllipticCurve('210e7')
136137
sage: pari_two_descent_work(E)
@@ -215,6 +216,7 @@ def heegner_index_work(E) -> tuple:
215216
216217
EXAMPLES::
217218
219+
sage: # needs sage.libs.eclib
218220
sage: from sage.schemes.elliptic_curves.BSD import heegner_index_work
219221
sage: heegner_index_work(EllipticCurve('14a'))
220222
(1, -31)
@@ -298,27 +300,31 @@ def prove_BSD(E, verbosity=0, two_desc='mwrank', proof=None, secs_hi=5,
298300
299301
EXAMPLES::
300302
303+
sage: # needs sage.libs.eclib
301304
sage: EllipticCurve('11a').prove_BSD(verbosity=2)
302305
p = 2: True by 2-descent
303306
True for p not in {2, 5} by Kolyvagin.
304307
Kolyvagin's bound for p = 5 applies by Lawson-Wuthrich
305308
True for p = 5 by Kolyvagin bound
306309
[]
307310
311+
sage: # needs sage.libs.eclib
308312
sage: EllipticCurve('14a').prove_BSD(verbosity=2)
309313
p = 2: True by 2-descent
310314
True for p not in {2, 3} by Kolyvagin.
311315
Kolyvagin's bound for p = 3 applies by Lawson-Wuthrich
312316
True for p = 3 by Kolyvagin bound
313317
[]
314318
319+
sage: # needs sage.libs.eclib
315320
sage: E = EllipticCurve("20a1")
316321
sage: E.prove_BSD(verbosity=2)
317322
p = 2: True by 2-descent
318323
True for p not in {2, 3} by Kolyvagin.
319324
Kato further implies that #Sha[3] is trivial.
320325
[]
321326
327+
sage: # needs sage.libs.eclib
322328
sage: E = EllipticCurve("50b1")
323329
sage: E.prove_BSD(verbosity=2)
324330
p = 2: True by 2-descent
@@ -337,16 +343,19 @@ def prove_BSD(E, verbosity=0, two_desc='mwrank', proof=None, secs_hi=5,
337343
338344
We know nothing with proof=True::
339345
346+
sage: # needs sage.libs.eclib
340347
sage: E.prove_BSD()
341348
Set of all prime numbers: 2, 3, 5, 7, ...
342349
343350
We (think we) know everything with proof=False::
344351
352+
sage: # needs sage.libs.eclib
345353
sage: E.prove_BSD(proof=False)
346354
[]
347355
348356
A curve of rank 0 and prime conductor::
349357
358+
sage: # needs sage.libs.eclib
350359
sage: E = EllipticCurve('19a')
351360
sage: E.prove_BSD(verbosity=2)
352361
p = 2: True by 2-descent
@@ -355,6 +364,7 @@ def prove_BSD(E, verbosity=0, two_desc='mwrank', proof=None, secs_hi=5,
355364
True for p = 3 by Kolyvagin bound
356365
[]
357366
367+
sage: # needs sage.libs.eclib
358368
sage: E = EllipticCurve('37a')
359369
sage: E.rank()
360370
1
@@ -370,6 +380,7 @@ def prove_BSD(E, verbosity=0, two_desc='mwrank', proof=None, secs_hi=5,
370380
371381
We test the consistency check for the 2-part of Sha::
372382
383+
sage: # needs sage.libs.eclib
373384
sage: E = EllipticCurve('37a')
374385
sage: S = E.sha(); S
375386
Tate-Shafarevich group for the Elliptic Curve defined by y^2 + y = x^3 - x
@@ -384,6 +395,7 @@ def prove_BSD(E, verbosity=0, two_desc='mwrank', proof=None, secs_hi=5,
384395
385396
An example with a Tamagawa number at 5::
386397
398+
sage: # needs sage.libs.eclib
387399
sage: E = EllipticCurve('123a1')
388400
sage: E.prove_BSD(verbosity=2)
389401
p = 2: True by 2-descent
@@ -394,8 +406,9 @@ def prove_BSD(E, verbosity=0, two_desc='mwrank', proof=None, secs_hi=5,
394406
395407
A curve for which 3 divides the order of the Tate-Shafarevich group::
396408
409+
sage: # long time, needs sage.libs.eclib
397410
sage: E = EllipticCurve('681b')
398-
sage: E.prove_BSD(verbosity=2) # long time
411+
sage: E.prove_BSD(verbosity=2)
399412
p = 2: True by 2-descent...
400413
True for p not in {2, 3} by Kolyvagin....
401414
Remaining primes:
@@ -406,6 +419,7 @@ def prove_BSD(E, verbosity=0, two_desc='mwrank', proof=None, secs_hi=5,
406419
407420
A curve for which we need to use ``heegner_index_bound``::
408421
422+
sage: # needs sage.libs.eclib
409423
sage: E = EllipticCurve('198b')
410424
sage: E.prove_BSD(verbosity=1, secs_hi=1)
411425
p = 2: True by 2-descent
@@ -415,6 +429,7 @@ def prove_BSD(E, verbosity=0, two_desc='mwrank', proof=None, secs_hi=5,
415429
The ``return_BSD`` option gives an object with detailed information
416430
about the proof::
417431
432+
sage: # needs sage.libs.eclib
418433
sage: E = EllipticCurve('26b')
419434
sage: B = E.prove_BSD(return_BSD=True)
420435
sage: B.two_tor_rk
@@ -432,21 +447,24 @@ def prove_BSD(E, verbosity=0, two_desc='mwrank', proof=None, secs_hi=5,
432447
433448
This was fixed by :issue:`8184` and :issue:`7575`::
434449
450+
sage: # needs sage.libs.eclib
435451
sage: EllipticCurve('438e1').prove_BSD(verbosity=1)
436452
p = 2: True by 2-descent...
437453
True for p not in {2} by Kolyvagin.
438454
[]
439455
440456
::
441457
458+
sage: # long time, needs sage.libs.eclib
442459
sage: E = EllipticCurve('960d1')
443-
sage: E.prove_BSD(verbosity=1) # long time (4s on sage.math, 2011)
460+
sage: E.prove_BSD(verbosity=1)
444461
p = 2: True by 2-descent
445462
True for p not in {2} by Kolyvagin.
446463
[]
447464
448465
::
449466
467+
sage: # needs sage.libs.eclib
450468
sage: E = EllipticCurve('66b3')
451469
sage: E.prove_BSD(two_desc="pari",verbosity=1)
452470
p = 2: True by 2-descent

src/sage/schemes/elliptic_curves/constructor.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -472,9 +472,11 @@ def create_object(self, version, key, *, names=None, **kwds):
472472
473473
``names`` is ignored at the moment, however it is used to support a convenient way to get a generator::
474474
475+
sage: # needs sage.libs.eclib
475476
sage: E.<P> = EllipticCurve(QQ, [1, 3])
476477
sage: P
477478
(-1 : 1 : 1)
479+
478480
sage: E.<P> = EllipticCurve(GF(5), [1, 3])
479481
sage: P
480482
(4 : 1 : 1)
@@ -958,13 +960,15 @@ def EllipticCurve_from_cubic(F, P=None, morphism=True):
958960
the generator::
959961
960962
sage: E = f.codomain()
963+
sage: finv = f.inverse()
964+
965+
sage: # needs sage.libs.eclib
961966
sage: E.label()
962967
'720e2'
963968
sage: E.rank()
964969
1
965970
sage: R = E.gens()[0]; R
966971
(-17280000/2527 : 9331200000/6859 : 1)
967-
sage: finv = f.inverse()
968972
sage: [finv(k*R) for k in range(1,10)]
969973
[(-4 : 1 : 0),
970974
(-1 : 4 : 1),
@@ -1469,6 +1473,7 @@ def EllipticCurves_with_good_reduction_outside_S(S=[], proof=None, verbose=False
14691473
14701474
EXAMPLES::
14711475
1476+
sage: # needs sage.libs.eclib
14721477
sage: EllipticCurves_with_good_reduction_outside_S([])
14731478
[]
14741479
sage: elist = EllipticCurves_with_good_reduction_outside_S([2])
@@ -1484,14 +1489,15 @@ def EllipticCurves_with_good_reduction_outside_S(S=[], proof=None, verbose=False
14841489
14851490
Without ``Proof=False``, this example gives two warnings::
14861491
1487-
sage: elist = EllipticCurves_with_good_reduction_outside_S([11], proof=False) # long time (14s on sage.math, 2011)
1488-
sage: len(elist) # long time
1492+
sage: # long time, needs sage.libs.eclib
1493+
sage: elist = EllipticCurves_with_good_reduction_outside_S([11], proof=False)
1494+
sage: len(elist)
14891495
12
1490-
sage: ', '.join(e.label() for e in elist) # long time
1496+
sage: ', '.join(e.label() for e in elist)
14911497
'11a1, 11a2, 11a3, 121a1, 121a2, 121b1, 121b2, 121c1, 121c2, 121d1, 121d2, 121d3'
14921498
1493-
sage: # long time
1494-
sage: elist = EllipticCurves_with_good_reduction_outside_S([2,3]) # long time (26s on sage.math, 2011)
1499+
sage: # long time, needs sage.libs.eclib
1500+
sage: elist = EllipticCurves_with_good_reduction_outside_S([2,3])
14951501
sage: len(elist)
14961502
752
14971503
sage: conds = sorted(set([e.conductor() for e in elist]))

src/sage/schemes/elliptic_curves/ell_egros.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
EXAMPLES: We find all elliptic curves with good reduction outside 2,
3535
listing the label of each::
3636
37-
sage: [e.label() for e in EllipticCurves_with_good_reduction_outside_S([2])] # long time (5s on sage.math, 2013)
37+
sage: # long time, needs sage.libs.eclib
38+
sage: [e.label() for e in EllipticCurves_with_good_reduction_outside_S([2])]
3839
['32a1',
3940
'32a2',
4041
'32a3',
@@ -65,7 +66,8 @@
6566
installed: two of the auxiliary curves whose Mordell-Weil bases are
6667
required have conductors 13068 and 52272 so are in the database)::
6768
68-
sage: [e.label() for e in EllipticCurves_with_good_reduction_outside_S([11], proof=False)] # long time (13s on sage.math, 2011)
69+
sage: # long time, needs sage.libs.eclib
70+
sage: [e.label() for e in EllipticCurves_with_good_reduction_outside_S([11], proof=False)]
6971
['11a1', '11a2', '11a3', '121a1', '121a2', '121b1', '121b2', '121c1', '121c2', '121d1', '121d2', '121d3']
7072
7173
AUTHORS:
@@ -319,6 +321,7 @@ def egros_from_jlist(jlist, S=[]):
319321
320322
EXAMPLES::
321323
324+
sage: # needs sage.libs.eclib
322325
sage: from sage.schemes.elliptic_curves.ell_egros import egros_get_j, egros_from_jlist
323326
sage: jlist=egros_get_j([3])
324327
sage: elist=egros_from_jlist(jlist,[3])
@@ -371,14 +374,17 @@ def egros_get_j(S=[], proof=None, verbose=False):
371374
372375
EXAMPLES::
373376
377+
sage: # needs sage.libs.eclib
374378
sage: from sage.schemes.elliptic_curves.ell_egros import egros_get_j
375379
sage: egros_get_j([])
376380
[1728]
377-
sage: egros_get_j([2]) # long time (3s on sage.math, 2013)
381+
382+
sage: # long time, needs sage.libs.eclib
383+
sage: egros_get_j([2])
378384
[128, 432, -864, 1728, 3375/2, -3456, 6912, 8000, 10976, -35937/4, 287496, -784446336, -189613868625/128]
379-
sage: egros_get_j([3]) # long time (3s on sage.math, 2013)
385+
sage: egros_get_j([3])
380386
[0, -576, 1536, 1728, -5184, -13824, 21952/9, -41472, 140608/3, -12288000]
381-
sage: jlist=egros_get_j([2,3]); len(jlist) # long time (30s)
387+
sage: jlist=egros_get_j([2,3]); len(jlist)
382388
83
383389
"""
384390
if not all(p.is_prime() for p in S):

src/sage/schemes/elliptic_curves/ell_generic.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,7 @@ def gens(self):
15111511
...
15121512
NotImplementedError: not implemented.
15131513
sage: E = EllipticCurve(QQ, [1,1])
1514-
sage: E.gens()
1514+
sage: E.gens() # needs sage.libs.eclib
15151515
[(0 : 1 : 1)]
15161516
"""
15171517
raise NotImplementedError("not implemented.")
@@ -2188,12 +2188,14 @@ def _multiple_x_numerator(self, n, x=None):
21882188
21892189
::
21902190
2191+
sage: # needs sage.libs.eclib
21912192
sage: E = EllipticCurve("37a")
21922193
sage: P = E.gens()[0]
21932194
sage: x = P[0]
21942195
21952196
::
21962197
2198+
sage: # needs sage.libs.eclib
21972199
sage: (35*P)[0]
21982200
-804287518035141565236193151/1063198259901027900600665796
21992201
sage: E._multiple_x_numerator(35, x)
@@ -2203,6 +2205,7 @@ def _multiple_x_numerator(self, n, x=None):
22032205
22042206
::
22052207
2208+
sage: # needs sage.libs.eclib
22062209
sage: (36*P)[0]
22072210
54202648602164057575419038802/15402543997324146892198790401
22082211
sage: E._multiple_x_numerator(36, x)
@@ -2310,6 +2313,7 @@ def _multiple_x_denominator(self, n, x=None):
23102313
23112314
::
23122315
2316+
sage: # needs sage.libs.eclib
23132317
sage: E = EllipticCurve("43a")
23142318
sage: P = E.gens()[0]
23152319
sage: x = P[0]

0 commit comments

Comments
 (0)