Skip to content

Fix number-field code-snippet errors: Magma Galois assignment & Q-collapse, PARI high-degree Galois (LMFDB#6759)#32

Open
roed-math wants to merge 1 commit into
mainfrom
ai/t41-nf-snippet-errors
Open

Fix number-field code-snippet errors: Magma Galois assignment & Q-collapse, PARI high-degree Galois (LMFDB#6759)#32
roed-math wants to merge 1 commit into
mainfrom
ai/t41-nf-snippet-errors

Conversation

@roed-math

Copy link
Copy Markdown
Owner

Some auto-generated code snippets on number-field pages error when run. Building on the already-merged
Oscar automorphism_group fix (LMFDB#6867), this addresses errors that the snippet CI harness cannot catch
because it only exercises degree <= 2 fields and skips Magma. Running every snippet across a spread of
fields (Q, imaginary/real quadratic, monogenic & non-monogenic cubics, a quartic, and a degree-12 field)
surfaced three genuine bugs, all fixed in lmfdb/number_fields/code.yaml: (1) the Magma Galois-group
snippet used = instead of :=, erroring on every field; (2) Magma's NumberField collapses a degree-1
polynomial to the rationals, so the Q page (1.1.1.1) broke on unit rank, regulator, subfields and the
class-number formula — fixed by DoLinearExtension := true; (3) PARI's polgalois hard-errors above
degree 11, now guarded to return an explanatory message. The two committed gp snippet-test logs are updated
for the new PARI Galois line (its output is unchanged). One issue is intentionally left as a documented
limitation: the PARI analytic-class-number-formula snippet overflows the default PARI stack on high-degree
fields (a resource limit, not a code error). Verified by executing the fixed snippets in Sage, sage --gp,
and Magma across the field spread. Addresses LMFDB#6759.

🤖 Generated with Claude Code

Running the number field snippets across a spread of fields (Q, quadratic,
cubic, quartic, degree 12) surfaced three genuine errors that the snippet CI
harness cannot catch, since it only tests degree <= 2 fields and skips Magma:

- The Magma galois_group snippet used `=` (equality) instead of `:=`
  (assignment), erroring on every field.
- Magma's NumberField collapses a degree-1 polynomial to the rationals, so
  the Q field page (1.1.1.1) broke on unit rank, regulator, subfields and the
  class number formula; fixed with `DoLinearExtension := true` in the field
  and class-number-formula snippets.
- PARI's polgalois hard-errors above degree 11; now guarded with an if() that
  returns an explanatory message (degree <= 11 is unchanged).

Updates the two committed gp snippet-test logs for the new PARI Galois command
line (its output is unchanged). Verified by executing the fixed snippets in
sage, sage --gp and Magma across the field spread.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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