Skip to content

Add curves as a search column for abelian varieties over finite fields - #13

Open
roed-math wants to merge 2 commits into
mainfrom
ai/t14-avfq-curves-col
Open

Add curves as a search column for abelian varieties over finite fields#13
roed-math wants to merge 2 commits into
mainfrom
ai/t14-avfq-curves-col

Conversation

@roed-math

Copy link
Copy Markdown
Owner

Adds a default-off "Curves" column to the Variety/Abelian/Fq search results, so the curve equations already shown on isogeny class homepages can be displayed and, in particular, downloaded from search results in all supported formats. The column displays the first equation (TeXified, with a count of the remaining ones) to keep rows compact, while downloads contain the full list of equations; a download description explains that a denotes a generator of a non-prime base field. Rows whose curves have not been computed (NULL in av_fq_isog, so absent from psycodict records) now get a None default in AbvarFq_isoclass, displaying as blank cells and downloading as null. The TeXification logic is shared with the homepage display, and a test covering the dropdown, compact display, downloads, and NULL rows is added. Note: since the search projection is fixed, curves arrays are now fetched for all abvar searches; the worst realistic browse page (g=2, q=167) fetches about 2.3MB from the DB.
Addresses LMFDB#6975.

🤖 Generated with Claude Code

roed314 and others added 2 commits July 19, 2026 01:27
Register a default-off Curves column on the abelian varieties over Fq
search page, displaying the first curve equation (TeXified, with the
count of remaining ones) and including the full list of equations in
search downloads.  The curves attribute of AbvarFq_isoclass now defaults
to None so that rows whose curves have not been computed (stored as NULL
and omitted from psycodict records) display an empty cell and download as
null; the TeXification of stored equations is factored out of
curve_display for reuse.  Verified with a new test in test_av.py (full
lmfdb/abvar/fq/test_av.py suite passes) plus manual checks of search
pages, all download languages, and homepage regressions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The curves column is default-off but was added to the fixed db_cols
projection, so every abvar/Fq search (and every download) fetched and
deserialized the full curve arrays that the user never sees - up to
~2.2MB on the worst realistic browse page (g=2, q=167).

Drop "curves" from the static db_cols and fetch it only when the column
is actually shown: the search sets __projection__ to include curves when
curves_requested(info) is true, and AbvarFq_download overrides a new
Downloader.get_projection hook (a behavior-preserving extraction of the
existing projection logic) to add curves only when it is in the download.

Verified with the flask test client: default searches/downloads no longer
project curves (worst page drops from 33 to 32 columns, saving 2.2MB),
while showcol=curves still displays and downloads the equations; all 20
abvar tests plus number-field and ECNF download tests pass; pyflakes clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@roed-math

Copy link
Copy Markdown
Owner Author

Addressed the external review's P2 finding (heavy column in unconditional projection): commit 10d3366 removes curves from the static projection; the search now adds it via the existing __projection__ idiom only when the column is displayed, and downloads fetch it only when included, via a new behavior-preserving Downloader.get_projection hook that only the abvar downloader overrides (its default replicates the prior inline logic, so other sections are unchanged).

Measured on the review's worst realistic browse page (g=2, q=167): 2.20 MB of curve text on every default search → 0; enabling the column still renders correctly and downloads still include the equations. 20 abvar tests plus number-field/ECNF download tests pass.

Merge note: this touches lmfdb/utils/downloader.py, which PRs #3/#5/#30 also modify in other regions — same-file-different-hunk, expect trivial merges.

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.

2 participants