LMFDB / lmfdb

L-Functions and Modular Forms Database
Other
246 stars 199 forks source link

Make elliptic curve search results downloads more useful #4810

Open AndrewVSutherland opened 2 years ago

AndrewVSutherland commented 2 years ago

It would be nice if the search result downloads for elliptic curves included a corresponding list of labels and a make_data function that would create the elliptic curves, as is done for the genus 2 curve search result downloads.

roed314 commented 2 years ago

See also #4933 for some suggestions on changing how downloads of search results work.

JohnCremona commented 2 years ago

I just tried out the Sage version of this and have two suggestions:

  1. there is a comment in the file 'To create a list of curves, type "curves = make_data()"'. I suggest that instead we have print( 'To create a list of curves, type "curves = make_data()"') so that the user sees the instruction when they read the file into sage.
  2. As well as creating the curves from their a-invariants you can set the curve's _lmfdb_label attribute, by adding lines like for lab, E in zip(labels, curves): E._lmfdb_label = lab Then, for any curve E in the list created, the user can see its label easily, and can even run E.lmfdb_page() to see its LMFDB home page.

I suspect that people using this will ask for more of the data stored for the curve in the LMFDB to be included in the file (rank, generators, etc), which could be done in a follow-up. Again, these extra properties can be stored in the Sage elliptic curve object.

I will try the Magma and gp version next.

JohnCremona commented 2 years ago

Magma and gp version work fine -- but again I suggest having the hint about make_data display when the file is read. In the case of gp I would suggest "curves = make_data();" with a semicolon, as otherwise the user sees the list (which ir not pretty).

I'll be happy to review a version with these minor changes.

edgarcosta commented 2 years ago

I would not print anything, instead, I would move the To create higher up, e.g.:


# Elliptic curves downloaded from the LMFDB on 23 January 2022.
# Query "{'conductor': 11}" returned 3 curves.
#
# To create a list of curves, type "curves = make_data()"
#
#
# Below are two lists, one called labels, and one called data (in matching order).
# Each entry in the data list has the form:
#    [[a1, a2, a3, a4, a6] Weierstrass coefficients]
# defining the elliptic curve y^2 + a1xy + a3y = x^3 + a2x^2 + a4x + a6.