Skip to content

Support libgap conversion for general and relative number fields#42435

Open
cxzhong wants to merge 1 commit into
sagemath:developfrom
cxzhong:libgap_number_field
Open

Support libgap conversion for general and relative number fields#42435
cxzhong wants to merge 1 commit into
sagemath:developfrom
cxzhong:libgap_number_field

Conversation

@cxzhong

@cxzhong cxzhong commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

📚 Description

Extend libgap(...) conversion beyond cyclotomic fields so that matrix
groups (and Coxeter groups) over number fields can use the GAP backend.

  • NumberFieldElement._libgap_ converts both absolute and relative fields
    via the GAP algebraic-extension tower. Relative elements use the relative
    power-basis coordinates (self.list()), which match GAP's generator even
    when it is not an absolute primitive element of the field.
  • NumberField_generic._libgap_ builds relative fields as towers of GAP
    algebraic extensions, and is now cached.
  • The reverse conversion is centralized in _convert_from_gap_string, which
    strips GAP's ! constant markers and interprets cyclotomic E(n) in the
    field tower rather than in the universal cyclotomic field.

This is split out from #42383 (CoxeterGroup default base ring), which depends
on this conversion support but is reviewed separately.

📝 Checklist

  • The title is concise and informative.
  • I have linked a relevant issue or PR.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

Extend libgap(...) conversion beyond cyclotomic fields so matrix groups
(and Coxeter groups) over number fields use the GAP backend.

- NumberFieldElement._libgap_ converts absolute and relative fields via
  the GAP algebraic-extension tower. Relative elements use the relative
  power-basis coordinates (self.list()), which match GAP's generator even
  when it is not an absolute primitive element of the field.
- NumberField_generic._libgap_ builds relative fields as towers of GAP
  algebraic extensions, and is now cached.
- The reverse conversion is centralized in _convert_from_gap_string,
  which strips GAP's '!' constant markers and interprets cyclotomic
  'E(n)' in the field tower rather than the universal cyclotomic field.
@github-actions

Copy link
Copy Markdown

Documentation preview for this PR (built with commit f79d402; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@cxzhong cxzhong requested a review from dimpase June 27, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant