Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
AndrewVSutherland
GitHub Repository: AndrewVSutherland/lmfdb
Path: blob/main/scripts/abvar/g1_char23_j_0.sage
1128 views
1
from sage.schemes.elliptic_curves.ell_finite_field import curves_with_j_0_char2, curves_with_j_0_char3
2
from sage.databases.cremona import cremona_letter_code
3
from collections import defaultdict
4
5
output_filename = "output23_0_1728.txt"
6
counts_filename = "counts23_0_1728.txt"
7
8
qs = [2^r for r in range(1,11)] + [3^r for r in range(1,7)]
9
10
def signed_cremona_letter_code(m):
11
if m >= 0:
12
return cremona_letter_code(m)
13
else:
14
return 'a' + cremona_letter_code(-m)
15
16
def get_label(f,q):
17
g=1
18
return '%s.%s.%s' % (g, q, '_'.join(signed_cremona_letter_code(f[i]) for i in range(1,g+1)))
19
20
21
def output_data():
22
with open(output_filename, "w") as file:
23
file.write("")
24
25
with open(counts_filename, "w") as file:
26
file.write("")
27
28
for q in qs:
29
with open(output_filename, "a") as file:
30
file.write("\n")
31
to_write = "(g,q) = %s,%s\n" % (1, q)
32
file.write(to_write)
33
34
F.<a> = GF(q, name='a')
35
label_to_curves = defaultdict(set)
36
37
if q%2 == 0:
38
curves = curves_with_j_0_char2(F)
39
else:
40
curves = curves_with_j_0_char3(F)
41
42
for curve in curves:
43
Lpoly = curve.frobenius_polynomial()
44
to_output = (curve._equation_string()).replace(" ", "")
45
label_to_curves[get_label(Lpoly,q)].add(to_output)
46
47
for label, equations in label_to_curves.items():
48
with open(output_filename, "a") as file:
49
to_write = "%s|{%s}\n" % (label, ','.join(equations))
50
file.write(to_write)
51
52
with open(counts_filename, "a") as file:
53
to_write = "%s,%s\n" % (q, len(label_to_curves.keys()))
54
file.write(to_write)
55
56
output_data()
57