Skip to content

Commit b495bc2

Browse files
authored
Merge pull request #6267 from roed314/datasets
Add SW and BHKSSW elliptic curve datasets
2 parents cf61e53 + 388c9d5 commit b495bc2

File tree

11 files changed

+434
-12
lines changed

11 files changed

+434
-12
lines changed

lmfdb/api/api.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ def options():
6161
return render_template(
6262
"database_options.html",
6363
title="Access options for the LMFDB database",
64-
learnmore=[("API", url_for(".index")),
65-
("Table statistics", url_for(".stats")),
66-
("lmfdb-lite", "https://www.github.com/roed314/lmfdb-lite"),
67-
("Install the LMFDB locally", "https://github.com/LMFDB/lmfdb/blob/main/GettingStarted.md")],
64+
learnmore=[
65+
("Auxiliary datasets", url_for("datasets")),
66+
("API", url_for(".index")),
67+
("Table statistics", url_for(".stats")),
68+
("lmfdb-lite", "https://www.github.com/roed314/lmfdb-lite"),
69+
("Install the LMFDB locally", "https://github.com/LMFDB/lmfdb/blob/main/GettingStarted.md")],
6870
bread=[("Access options", " ")],
6971
)
7072

lmfdb/api/templates/database_options.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<div style="max-width:700px;">
66
<p>
7-
There are three options available to access large amounts of data from the LMFDB.
7+
The LMFDB contains two types of underlying data: the main PostgreSQL database and a collection of <a href="{{url_for('datasets')}}">auxiliary datasets</a>. There are three options available for accessing large parts of the main database.
88
</p>
99
</div>
1010

lmfdb/app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,10 @@ def groups():
556556

557557
# @app.route("/Group/history")
558558

559+
@app.route('/datasets')
560+
@app.route('/datasets/')
561+
def datasets():
562+
return render_template('datasets.html', title='Auxiliary datasets', bread=[("Datasets", " ")])
559563

560564
def groups_history():
561565
t = 'Groups'

lmfdb/elliptic_curves/elliptic_curve.py

Lines changed: 110 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ def learnmore_list():
6767
('Completeness of the data', url_for(".completeness_page")),
6868
('Reliability of the data', url_for(".reliability_page")),
6969
('Elliptic curve labels', url_for(".labels_page")),
70-
('Congruent number curves', url_for(".render_congruent_number_data"))]
70+
('Congruent number curves', url_for(".render_congruent_number_data")),
71+
('Stein-Watkins dataset', url_for(".render_sw_ecdb")),
72+
('BHKSSW dataset', url_for(".render_bhkssw"))]
7173

7274

7375
def learnmore_list_add(learnmore_label, learnmore_url):
@@ -931,14 +933,14 @@ def render_congruent_number_data():
931933
return redirect(url_for(".render_single_congruent_number", n=info['lookup']))
932934
learnmore = learnmore_list_remove('Congruent numbers and curves')
933935
t = 'Congruent numbers and congruent number curves'
934-
bread = get_bread(t)
936+
bread = [("Datasets", url_for("datasets")), (t, " ")]
935937
if 'filename' in info:
936938
filepath = os.path.join(congruent_number_data_directory,info['filename'])
937939
if os.path.isfile(filepath) and os.access(filepath, os.R_OK):
938940
return send_file(filepath, as_attachment=True)
939941
else:
940942
flash_error('File {} not found'.format(info['filename']))
941-
return redirect(url_for(".rational_elliptic_curves"))
943+
return redirect(url_for(".render_congruent_number_data"))
942944

943945
return render_template("congruent_number_data.html", info=info, title=t, bread=bread, learnmore=learnmore)
944946

@@ -952,6 +954,111 @@ def render_single_congruent_number(n):
952954
bread = get_bread() + [("Congruent numbers", url_for(".render_congruent_number_data")), (n, "")]
953955
return render_template("single_congruent_number.html", info=info, title=t, bread=bread, learnmore=learnmore_list())
954956

957+
@ec_page.route("/stein-watkins")
958+
def render_sw_ecdb():
959+
info = to_dict(request.args)
960+
learnmore = learnmore_list_remove('Stein-Watkins dataset')
961+
t = 'Stein-Watkins elliptic curve database'
962+
bread = [("Datasets", url_for("datasets")), ("Stein-Watkins dataset", " ")]
963+
if 'Fetch' in info:
964+
errors = []
965+
if info.get("ctype") == "all":
966+
fname = "a.{:03d}"
967+
kmax = 999
968+
elif info.get("ctype") == "prime":
969+
fname = "p.{:02d}"
970+
kmax = 99
971+
else:
972+
errors.append("Invalid conductor type")
973+
if 'k' in info and not errors:
974+
k = info["k"].strip()
975+
if k.isdigit():
976+
k = int(k)
977+
if k <= kmax:
978+
fname = fname.format(k)
979+
else:
980+
errors.append(f"k must be at most {kmax}")
981+
else:
982+
errors.append(f"k must be a nonnegative integer at most {kmax}")
983+
if not errors:
984+
filepath = os.path.expanduser('~/data/stein_watkins_ecdb/' + fname)
985+
if os.path.isfile(filepath) and os.access(filepath, os.R_OK):
986+
return send_file(filepath, as_attachment=True)
987+
errors.append(f"File {fname} not found")
988+
for err in errors:
989+
flash_error(err)
990+
991+
return render_template("sw_ecdb.html", info=info, comma=comma, title=t, bread=bread, learnmore=learnmore)
992+
993+
@ec_page.route("/BHKSSW")
994+
def render_bhkssw():
995+
info = to_dict(request.args)
996+
learnmore = learnmore_list_remove('BHKSSW dataset')
997+
t = 'Balakrishnan-Ho-Kaplan-Spicer-Stein-Watkins elliptic curve database'
998+
bread = [("Datasets", url_for("datasets")), ("BHKSSW dataset", " ")]
999+
if 'filename' in info:
1000+
filepath = os.path.join(os.path.expanduser('~/data/bhkssw_ecdb/' + info['filename']))
1001+
if os.path.isfile(filepath) and os.access(filepath, os.R_OK):
1002+
return send_file(filepath, as_attachment=True)
1003+
else:
1004+
flash_error('File {} not found'.format(info['filename']))
1005+
return redirect(url_for(".render_bhkssw"))
1006+
# This format was nice, but not possible with the 30-second timeout limitation
1007+
#info['files'] = [ # number of curves, size in MB, lower bound, upper bound, filename
1008+
# (2249362, 151, "0", r"1 \cdot 10^8", "1e8db.txt"),
1009+
# (1758056, 123, r"1 \cdot 10^8", r"2 \cdot 10^8", "2e8db.txt"),
1010+
# (11300506, 798, r"2 \cdot 10^8", r"1 \cdot 10^9", "1e9db.txt"),
1011+
# (11982016, 866, r"1 \cdot 10^9", r"2 \cdot 10^9", "2e9db.txt"),
1012+
# (10976368, 800, r"2 \cdot 10^9", r"3 \cdot 10^9", "3e9db.txt"),
1013+
# (10395560, 768, r"3 \cdot 10^9", r"4 \cdot 10^9", "4e9db.txt"),
1014+
# (9932368, 744, r"4 \cdot 10^9", r"5 \cdot 10^9", "5e9db.txt"),
1015+
# (9584588, 720, r"5 \cdot 10^9", r"6 \cdot 10^9", "6e9db.txt"),
1016+
# (9385318, 707, r"6 \cdot 10^9", r"7 \cdot 10^9", "7e9db.txt"),
1017+
# (9071666, 685, r"7 \cdot 10^9", r"8 \cdot 10^9", "8e9db.txt"),
1018+
# (8975214, 679, r"8 \cdot 10^9", r"9 \cdot 10^9", "9e9db.txt"),
1019+
# (8788686, 666, r"9 \cdot 10^9", r"1.0 \cdot 10^{10}", "10e9db.txt"),
1020+
# (8642210, 664, r"1.0 \cdot 10^{10}", r"1.1 \cdot 10^{10}", "11e9db.txt"),
1021+
# (8477024, 652, r"1.1 \cdot 10^{10}", r"1.2 \cdot 10^{10}", "12e9db.txt"),
1022+
# (8383290, 645, r"1.2 \cdot 10^{10}", r"1.3 \cdot 10^{10}", "13e9db.txt"),
1023+
# (8275108, 638, r"1.3 \cdot 10^{10}", r"1.4 \cdot 10^{10}", "14e9db.txt"),
1024+
# (8143456, 628, r"1.4 \cdot 10^{10}", r"1.5 \cdot 10^{10}", "15e9db.txt"),
1025+
# (8106334, 626, r"1.5 \cdot 10^{10}", r"1.6 \cdot 10^{10}", "16e9db.txt"),
1026+
# (7959996, 615, r"1.6 \cdot 10^{10}", r"1.7 \cdot 10^{10}", "17e9db.txt"),
1027+
# (7903210, 611, r"1.7 \cdot 10^{10}", r"1.8 \cdot 10^{10}", "18e9db.txt"),
1028+
# (7849564, 607, r"1.8 \cdot 10^{10}", r"1.9 \cdot 10^{10}", "19e9db.txt"),
1029+
# (7781996, 602, r"1.9 \cdot 10^{10}", r"2.0 \cdot 10^{10}", "20e9db.txt"),
1030+
# (7822372, 605, r"2.0 \cdot 10^{10}", r"2.1 \cdot 10^{10}", "21e9db.txt"),
1031+
# (7636198, 591, r"2.1 \cdot 10^{10}", r"2.2 \cdot 10^{10}", "22e9db.txt"),
1032+
# (7562706, 586, r"2.2 \cdot 10^{10}", r"2.3 \cdot 10^{10}", "23e9db.txt"),
1033+
# (7593218, 588, r"2.3 \cdot 10^{10}", r"2.4 \cdot 10^{10}", "24e9db.txt"),
1034+
# (7505566, 582, r"2.4 \cdot 10^{10}", r"2.5 \cdot 10^{10}", "25e9db.txt"),
1035+
# (7409408, 575, r"2.5 \cdot 10^{10}", r"2.6 \cdot 10^{10}", "26e9db.txt"),
1036+
# (7312946, 567, r"2.6 \cdot 10^{10}", r"2.7 \cdot 10^{10}", "27e9db.txt"),
1037+
#]
1038+
if 'Fetch' in info:
1039+
fname = "{}.txt"
1040+
kmax = 2699
1041+
errors = []
1042+
if 'k' in info and not errors:
1043+
k = info["k"].strip()
1044+
if k.isdigit():
1045+
k = int(k)
1046+
if k <= kmax:
1047+
fname = fname.format(k)
1048+
else:
1049+
errors.append(f"k must be at most {kmax}")
1050+
else:
1051+
errors.append(f"k must be a positive integer at most {kmax}")
1052+
if not errors:
1053+
filepath = os.path.expanduser('~/data/bhkssw_split/' + fname)
1054+
if os.path.isfile(filepath) and os.access(filepath, os.R_OK):
1055+
return send_file(filepath, as_attachment=True)
1056+
errors.append(f"File {fname} not found")
1057+
for err in errors:
1058+
flash_error(err)
1059+
1060+
return render_template("bhkssw.html", info=info, comma=comma, title=t, bread=bread, learnmore=learnmore)
1061+
9551062
sorted_code_names = ['curve', 'simple_curve', 'mwgroup', 'gens', 'tors', 'intpts', 'cond', 'disc', 'jinv', 'cm', 'faltings', 'stable_faltings', 'rank', 'analytic_rank', 'reg', 'real_period', 'cp', 'ntors', 'sha', 'L1', 'bsd_formula', 'qexp', 'moddeg', 'manin', 'localdata', 'galrep']
9561063

9571064
code_names = {'curve': 'Define the curve',
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
{% extends 'homepage.html' %}
2+
3+
{% block content %}
4+
5+
<p>
6+
This dataset contains all 238,764,310 {{KNOWL('ec.q', 'elliptic curves')}} over $\Q$ with {{ KNOWL('ec.q.naive_height', 'naive height') }} up to $2.7 \cdot 10^{10}$ and is described in <a href="https://doi.org/10.1112/S1461157016000152">Balakrishnan-Ho-Kaplan-Spicer-Stein-Watkins</a>.
7+
</p>
8+
9+
<h3>File and data format</h3>
10+
11+
<p>
12+
The data is stored in text files, indexed from $k=0$ to $k=2699$. The file $k$.txt contains all of the elliptic curves whose minimal short Weierstrass form $y^2 = x^3 + A x + B$ has naive height $H$ in the range: the $k$th file contains data for $k \cdot 10^7 < H \le (k+1) \cdot 10^7$.
13+
</p>
14+
15+
<p>
16+
Each line corresponds to an elliptic curve, with columns separated by | characters and format given as follows. If a column has not been computed it is saved as the empty string.
17+
</p>
18+
19+
<table class="ntdata">
20+
<tr>
21+
<th>Column(s)</th>
22+
<th>Description</th>
23+
<th>Example</th>
24+
</tr>
25+
<tr>
26+
<td>$H$</td>
27+
<td>{{KNOWL('ec.q.naive_height', 'Naive height')}}</td>
28+
<td>$19003704300$</td>
29+
</tr>
30+
<tr>
31+
<td>$a_1$, $a_2$, $a_3$, $a_4$, $a_6$</td>
32+
<td>$a$-invariants for the {{KNOWL('ec.q.minimal_weierstrass_equation', 'reduced minimal model')}}</td>
33+
<td>$1$, $-1$, $0$, $-102$, $-389$</td>
34+
</tr>
35+
<tr>
36+
<td>$p_1$, $p_2$</td>
37+
<td>Parameters to form the elliptic curve, which is isomorphic to $y^2 = x^3 + p_1 x + p_2$</td>
38+
<td>$-1635$, $-26530$</td>
39+
</tr>
40+
<tr>
41+
<td>$N$</td>
42+
<td>{{KNOWL('ec.q.conductor', 'Conductor')}}</td>
43+
<td>$5940675$</td>
44+
</tr>
45+
<tr>
46+
<td>$\operatorname{tam}$</td>
47+
<td>{{KNOWL('ec.tamagawa_number', 'Tamagawa product')}}</td>
48+
<td>$1$</td>
49+
</tr>
50+
<tr>
51+
<td>$n_1$, $n_2$</td>
52+
<td>structure of {{KNOWL('ec.q.torsion_subgroup', 'torsion subgroup')}}, $\Z/n_1 \times \Z/n_2$ where $n_1 \in {1, 2}$ and $n_1 \mid n_2$</td>
53+
<td>$1$, $1$</td>
54+
</tr>
55+
<tr>
56+
<td>$\operatorname{sel}_2$</td>
57+
<td>$2$-rank of the {{KNOWL('ag.selmer_group', '$2$-Selmer group')}}</td>
58+
<td>$2$</td>
59+
</tr>
60+
<tr>
61+
<td>$w$</td>
62+
<td>Root number (sign of functional equation)</td>
63+
<td>$-1$</td>
64+
</tr>
65+
<tr>
66+
<td>$r_{\mathrm{an},0}$</td>
67+
<td>Running analytic_rank_upper_bound in Sage with parameter $\delta$ (see below) returns $r_{\mathrm{an},0}$, which is an upper bound for the rank</td>
68+
<td>$0$</td>
69+
</tr>
70+
<tr>
71+
<td>$\operatorname{mw}_{\mathrm{ub}}, \operatorname{mw}_{\mathrm{lb}}, \operatorname{mw}_{\mathrm{time}}$</td>
72+
<td>Upper and lower bounds returned by mwrank in Sage, as well as the the time used</td>
73+
<td>$2, 2, 0.052$</td>
74+
</tr>
75+
<tr>
76+
<td>$\delta$</td>
77+
<td>Running analytic_rank_upper_bound in Sage with parameter $\delta$ returns $r_{\mathrm{an},0}$ (see above), which is an upper bound for the rank.</td>
78+
<td>$2.0$</td>
79+
</tr>
80+
<tr>
81+
<td>$\operatorname{magma}$</td>
82+
<td>Rank computed by the Magma function MordellWeilShaInformation (almost always null)</td>
83+
<td>$2$</td>
84+
</tr>
85+
<tr>
86+
<td>$r$</td>
87+
<td>{{KNOWL('ec.rank', 'rank')}}</td>
88+
<td>$4$</td>
89+
</tr>
90+
<tr>
91+
<td>$\operatorname{CM}$</td>
92+
<td>1 if $E$ has {{KNOWL('ec.complex_multiplication', 'CM')}}, 0 otherwise</td>
93+
<td>$0$</td>
94+
</tr>
95+
</table>
96+
97+
<h3>Download</h3>
98+
99+
<form>
100+
<table>
101+
<tr>
102+
<td align="right">$k = $</td>
103+
<td align="left">
104+
<input type="text" name="k" size="7" placeholder="123">
105+
<span class="formexample">integer from 0 to 2699</span>
106+
</td>
107+
</tr>
108+
<tr>
109+
<td align="left">
110+
<button type="submit" name="Fetch" value="fetch">Fetch file</button>
111+
</td>
112+
</tr>
113+
</table>
114+
</form>
115+
116+
{# This format was nice since it gave statistics and provided direct download links, but the files are too big to download given the current 30-second timeout limitation.
117+
<table class="ntdata">
118+
<tr>
119+
<th>File</th>
120+
<th>Size (MB)</th>
121+
<th>Number of curves</th>
122+
<th>Lower height bound</th>
123+
<th>Upper height bound</th>
124+
</tr>
125+
{% for ncurves, size, lower, upper, fname in info.files %}
126+
<tr>
127+
<td><a href="{{ url_for('.render_bhkssw', filename=fname) }}">{{fname}}</a></td>
128+
<td>{{size}}</td>
129+
<td>{{comma(ncurves)}}</td>
130+
<td>${{lower}}$</td>
131+
<td>${{upper}}$</td>
132+
</tr>
133+
{% endfor %}
134+
</table>
135+
#}
136+
137+
{% endblock %}

lmfdb/elliptic_curves/templates/congruent_number_data.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ <h2>Data files</h2>
107107
<pre>000137 [[-3136/25,77112/125],[-38025/289,2151240/4913]]</pre>
108108
</td>
109109
<td>
110-
For eight rank 2 curves, the second generator is not known and given as [?,?]
110+
For three rank 2 curves, the second generator is not known and given as [?,?]
111111
</td>
112112
</tr>
113113

0 commit comments

Comments
 (0)