Clarify genus 2 minimal/simplified model snippets - #21
Conversation
Rename C/X to Cmin/Csim in the genus 2 curve code snippets and add // minimal equation and // simplified equation comments, so it is clear which model each variable refers to; display Csim after defining it. Point the simplified-model rational points snippet at Csim instead of Cmin, and fix simplify_hyperelliptic_point/comp_poly to divide the y-coordinate by sqrt(n/squarefree_part(n)) rather than n, so the displayed simplified-model points (and the snippet) actually lie on the simplified model when h = 0. Mirror the renaming in the Code-to-Magma download and add a Simplified equation step to it. Verified by running the generated Magma snippets for 169.a.169.1, 400.a.409600.1 and 336.a.172032.1 (all pass except pre-existing Magma package issues), the sage snippets in a sage REPL, page renders and the Magma download via the flask test client, and the genus2_curves test suite (42 passed). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mordell-Weil generators are stored with denominators cleared, as a relation d*y = yD(x,z). The y-coordinate of the minimal model transforms to the simplified model as y -> (2*y + h(x,z))/s, so multiplying through by d gives d*Y = (2*yD + d*h(x,z))/s: h picks up the same factor d. comp_poly added only a single copy of h, which was wrong for every curve having both h != 0 and a generator with a denominator (700 of the 4039 curves sampled). On 336.a.172032.1 the generator 3x^2 - 32z^2 = 0, 6y = -35xz^2 was displayed on the simplified model as 6y = x^3 - 69xz^2 rather than 6y = 6x^3 - 64xz^2, which is 2x(3x^2 - 32z^2) as it must be for a 2-torsion generator. comp_poly now takes the denominator as an argument, and mw_gens_table takes a function of it, leaving the minimal-model path untransformed. Adds regression tests for this and for the scale correction earlier in the branch: 400.a.409600.1 (h = 0, content 4, so points scale by 2 and not 4) and 336.a.172032.1, plus a check that the Magma download defines Cmin, Csim and J in dependency order. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Thanks for the careful review. Fixed in f546785, which keeps the The
|
|
GPT signed off. |
Magma refuses to apply Ogg's formula once v_2(disc) >= 12, so for those
curves the conductor snippet passes the local L-factor at 2 explicitly.
The snippet on the curve page did this, but the download built its
conductor line from the static entry in code.yaml, so downloads for
curves with 4096 | abs_disc died at Conductor(LSeries(Cmin)) with
Runtime error: v_2(disc)=14>=12, cannot use Ogg's formula
unless forced by LocalData:="Ogg"
Move the option into magma_cond_option() and have both callers use it,
with the code.yaml entry taking a placeholder the way 'curve' already
does. Verified in Magma that the downloads for 400.a.409600.1 and
336.a.172032.1 now run to completion and report the right conductor.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
GPT signed off again. |
|
Superseded by LMFDB#7157, opened upstream from this same branch. Closing here; review continues upstream. |
The genus 2 curve-page snippets defined a
C(minimal model) and anX(simplified model)without saying which was which. Following the suggestion in the issue, the snippets now use
CminandCsimwith// minimal equation/// simplified equationcomments, and thesimplified-model snippet displays the resulting curve. The simplified-model rational points
snippet now constructs points on
Csimrather than on the minimal model, and the download filegains a matching "Simplified equation" step. Along the way this fixes a bug in
simplify_hyperelliptic_point/comp_poly(y-coordinate divided by the content n of 4f+h²instead of sqrt(n/squarefree_part(n))): for the 3160 curves with h = 0 the displayed
simplified-model points were not actually on the curve (e.g.
(0 : -1/2 : 1)on 400.a.409600.1),and the corrected points are needed for the new snippet to run. Addresses LMFDB#5344.
Also included, since it lands on the same
condline ofcode.yaml: the Magma download failedfor every curve with 4096 | abs_disc. Magma will not apply Ogg's formula once v_2(disc) >= 12, so
the conductor snippet has to pass it the local L-factor at 2 via
ExcFactors. The curve page didthat, but the download built its conductor line from the static
condentry incode.yaml, whichhad no such option, so downloads for those curves died with
The option now comes from a single
magma_cond_option()used by both the page snippet and thedownload, with the
code.yamlentry taking a placeholder the waycurvealready does, so the twocannot drift apart again. This bug is pre-existing and independent of the renaming above.
Verified by running the generated Magma/Sage snippets for 169.a.169.1, 400.a.409600.1 and
336.a.172032.1, running the full regenerated Magma downloads for 400.a.409600.1 and 336.a.172032.1
end to end (both now complete and report the conductors and discriminants matching their labels),
rendering the affected pages and the Magma download with the test client, and the genus2_curves
test suite (46 passed).
Note that Magma prints
WARNING: ExcFactors and BadPrimes are obsolete, use LocalDatafor theaffected curves. That warning is pre-existing on the curve page, and switching to the modern
LocalDataspelling is left for a follow-up rather than changing page behavior here.🤖 Generated with Claude Code