Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
241818 views
1
from sage.all import *
2
3
4
def examples():
5
r"""
6
Some more examples of xxx_rankbound() on high rank curves.
7
(See source for more.)
8
9
EXAMPLES:
10
11
We make sure that the examples all work.
12
13
::
14
15
sage: from psage.ellcurve.xxx.rankbound_examples import examples
16
sage: examples() # LONG TIME (lack of output indicates success)
17
18
"""
19
from psage.ellcurve.xxx.rankbound import xxx_rankbound
20
21
def check(E, Delta, answer, bad_primes = None):
22
# TODO: Is there a way to quickly compute the root number
23
# given the bad primes?
24
if bad_primes is not None:
25
# check that we actually have all of the bad primes
26
D = E.discriminant()
27
for p in bad_primes:
28
p = Integer(p)
29
assert(p.divides(D)), "p is not bad"
30
while p.divides(D):
31
D = D/p
32
33
assert abs(D) == 1, "Missing a bad prime."
34
35
36
a = xxx_rankbound(E, Delta, bad_primes)
37
38
assert abs(a - answer) < 1e-3, "FAIL"
39
40
E20 = EllipticCurve([1, 0, 0, -431092980766333677958362095891166, 5156283555366643659035652799871176909391533088196])
41
E21 = EllipticCurve([1, 1, 1, -215843772422443922015169952702159835, -19474361277787151947255961435459054151501792241320535])
42
E22 = EllipticCurve([1, 0, 1, -940299517776391362903023121165864, 10707363070719743033425295515449274534651125011362])
43
E23 = EllipticCurve([1, 0, 1, -19252966408674012828065964616418441723, 32685500727716376257923347071452044295907443056345614006])
44
E24 = EllipticCurve([1, 0, 1, -120039822036992245303534619191166796374, 504224992484910670010801799168082726759443756222911415116])
45
E28 = EllipticCurve([1, -1, 1, -20067762415575526585033208209338542750930230312178956502,
46
34481611795030556467032985690390720374855944359319180361266008296291939448732243429])
47
48
E23_bad_primes = [2, 3, 5, 11, 13, 17, 19, 23, 199, 17858193374841750901974789649, 1006218106634655545344494448610726356220703995276273]
49
E24_bad_primes = [2, 3, 5, 11, 13, 17, 29, 31, 41, 458619970494582607679296750333015081, 264240973182971699094661154229360236070105974082503]
50
E28_bad_primes = [2, 3, 5, 7, 11, 13, 17, 19, 48463, 20650099, 315574902691581877528345013999136728634663121, 376018840263193489397987439236873583997122096511452343225772113000611087671413]
51
52
check(E20, 2.0, 21.6907)
53
54
check(E21, 2.5, 22.6727)
55
56
check(E22, 2.0, 23.7047)
57
58
check(E23, 2.5, 24.4834, E23_bad_primes)
59
60
check(E24, 2.5, 25.5682, E24_bad_primes)
61
62
check(E28, 2.5, 33.4304, E28_bad_primes) # needs a larger delta to get a
63
# good bound, but that takes a
64
# while.
65
66
#check(E28, 3.2, 31.2984, E28_bad_primes) # this works, but takes about
67
# 6 minutes on my fast machine.
68
# (Is that too long for LONG?)
69
70