Skip to content

Add elliptic curve construction for downloaded ECNF search results#6821

Merged
roed314 merged 10 commits intoLMFDB:mainfrom
rvisser7:main
Feb 6, 2026
Merged

Add elliptic curve construction for downloaded ECNF search results#6821
roed314 merged 10 commits intoLMFDB:mainfrom
rvisser7:main

Conversation

@rvisser7
Copy link
Contributor

@rvisser7 rvisser7 commented Jan 16, 2026

This PR solves issue #6806 (and also the related issue #4810). When downloading ECNF search results for Sage, Magma, or Pari/GP, each elliptic curve is now explicitly constructed as an EllipticCurve object in the respective language. This is implemented similarly to elliptic curves over Q, using an ECNFDownloader class.

In order to construct each elliptic curve, I've added a hidden "field_coeffs" search column which is only shown in the downloaded files, which gives the coefficients of the defining polynomial of the base field $K$. This column is then used in the function create_record(row) to construct each elliptic curve over its respective base field.

As always, any comments or feedback is very welcome! 🙂

An example when searching for elliptic curves over base field 2.0.111.1 with conductor norm 1:
https://beta.lmfdb.org/EllipticCurve/?field=2.0.111.1&conductor_norm=1
http://localhost:37777/EllipticCurve/?field=2.0.111.1&conductor_norm=1

Sage download:
http://localhost:37777/EllipticCurve/?download=1&query=%7B%27field_label%27%3A+%272.0.111.1%27%2C+%27conductor_norm%27%3A+1%7D&field=2.0.111.1&conductor_norm=1&Submit=sage

Magma download:
http://localhost:37777/EllipticCurve/?download=1&query=%7B%27field_label%27%3A+%272.0.111.1%27%2C+%27conductor_norm%27%3A+1%7D&field=2.0.111.1&conductor_norm=1&Submit=magma

Pari/GP download:
http://localhost:37777/EllipticCurve/?download=1&query=%7B%27field_label%27%3A+%272.0.111.1%27%2C+%27conductor_norm%27%3A+1%7D&field=2.0.111.1&conductor_norm=1&Submit=gp

@JohnCremona
Copy link
Member

Thanks for doing this, Robin! I'll take a look and will put it on the agenda for the upcoming (soon) effort on dealing ECQ/ECNF issues.

@jenpaulhus
Copy link
Contributor

Looks great! One brief suggestions:

Looks like the knowl for Weierstrass coefficients prints twice at the bottom. This comes from two different search columns needing the same knowl. Wondering if there is a way to make it so that the downloader utils only print distinct knowls once even if two columns share a knowl?

@rvisser7
Copy link
Contributor Author

Thank you both! I had a look at the documentation for search columns, and it seems that one can provide a string as download_desc, which overrides the default knowl in the downloaded file. I've added this to the Weierstrass equation column, which resolves the issue of printing two copies of the same knowl :)

@JohnCremona
Copy link
Member

I have tried this out on some random curves, testing all of magma, gp, sage and text, csv. For the first three I tested that the commands worked. I did not test Oscar since I don't use that, and someone else should.

  • The CSV option seemed to produce an empty file. Presumably that is not right?

  • magma, gp, sage, oscar: the instructions says something like
    To create a list of fields, type "fields:= make_data();"
    so the word 'fields' needs to be changed to 'curves' twice. I think this is done by adding short_name = curves after setting table and title.

  • In the gp case, there is no semicolon after make_data() but I think there should be, as gp echos the output by default and to avoid this one has to put a semicolon. It is puzzling that this happens, since in downloader.py I see that within GPLanguage we have line_end = ';'.

  • The explanatory text includes

{# Note: I left out the knowl for degree here, since it is technically defining the degree of a number field, rather than a general field extension (which is suggested by this definition)... degree #}

which I think it would be better to remove. It comes from the knowl 'nf' having a comment in it which is copied here. Can we fix whatever part of downloader.py gets the knowl text to delete any commented out text?

@JohnCremona
Copy link
Member

I made some comments on the original Issue #4810 which are still relevant.

@rvisser7
Copy link
Contributor Author

rvisser7 commented Feb 6, 2026

Many thanks @JohnCremona for reviewing this! I've implemented your point 2 above. Given that points 1, 3, 4 all deal with issues particular to the Downloader utils class, I've opened a separate PR #6860 for this. Perhaps that PR could be reviewed and merged first, and then this one can be merged (though the order doesn't strictly matter).

I haven't implemented anything in the downloads yet for Oscar, as I don't really use Oscar, so I'm not too familiar with the language (and there also doesn't seem to be any Oscar code snippets implemented for ECNF).

@JohnCremona
Copy link
Member

Thanks @rvisser7 . I am happy for this to be merged now, and I'll go and look at #6860 .

I do not seem to still have permision to merge (which is fine by me) so please will someone else.

@roed314 roed314 merged commit f246c76 into LMFDB:main Feb 6, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants