Skip to content

Use libgap for permutation-group socles - #43008

Merged
vbraun merged 1 commit into
sagemath:developfrom
dimpase:fix/libgap-socle-crisp
Oct 22, 2026
Merged

vbraun merged 1 commit into
sagemath:developfrom
dimpase:fix/libgap-socle-crisp

Conversation

@dimpase

@dimpase dimpase commented Oct 17, 2026

Copy link
Copy Markdown
Member

PermutationGroup_generic.socle() still computes through the pexpect GAP interface. Use the existing libgap group instead, preserving the ambient group and its domain. This is another step toward #26902.

A direct replacement exposes CRISP issue 16: with CRISP 1.4.11 loaded, taking the socle twice for SymmetricGroup(4) fails with a missing EANormalSeriesByPcgs method. The old interface masks this by reconstructing the group. Compute and cache IsElementaryAbelian() before calling Socle(), allowing GAP's elementary-abelian method to handle the resulting Klein four-group. The code comment links the upstream issue.

The existing repeated-socle example covers that failure when CRISP is loaded. Additional doctests forbid the old _gap_() conversion and check nonstandard domains, the ambient group, normality, repeated socles, and the trivial group. The displayed generator order changes to the order returned by libgap.

Validation on macOS with GAP 4.16.1 and CRISP 1.4.11:

  • All 1,044 doctests in permgroup.py pass with --serial --long --optional=sage,gap_package_hap.
  • Separate probes check socle orders, normality, ambient groups, domains, and two repeated socles for 17 groups, with CRISP loaded and pexpect GAP startup disabled. All pass with this change. Omitting the property call reproduces the upstream error for S4, A4, and S4 on a nonstandard domain; the original implementation fails the no-pexpect check.
  • Ruff passes with both repository CI configurations; git diff --check passes.

Local tests load the edited Python module over the installed Sage native libraries; CI will validate the full source build.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

None.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

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

@dimpase
dimpase force-pushed the fix/libgap-socle-crisp branch from 6c69bd6 to 88dfcba Compare October 18, 2026 15:57
vbraun pushed a commit to vbraun/sage that referenced this pull request Oct 18, 2026
Release Manager
sagemathgh-43008: Use libgap for permutation-group socles
    
`PermutationGroup_generic.socle()` still computes through the pexpect
GAP interface. Use the existing libgap group instead, preserving the
ambient group and its domain. This is another step toward sagemath#26902.

A direct replacement exposes [CRISP issue
16](bh11/crisp#16): with CRISP 1.4.11 loaded,
taking the socle twice for `SymmetricGroup(4)` fails with a missing
`EANormalSeriesByPcgs` method. The old interface masks this by
reconstructing the group. Compute and cache `IsElementaryAbelian()`
before calling `Socle()`, allowing GAP's elementary-abelian method to
handle the resulting Klein four-group. The code comment links the
upstream issue.

The existing repeated-socle example covers that failure when CRISP is
loaded. Additional doctests forbid the old `_gap_()` conversion and
check nonstandard domains, the ambient group, normality, repeated
socles, and the trivial group. The displayed generator order changes to
the order returned by libgap.

Validation on macOS with GAP 4.16.1 and CRISP 1.4.11:

- All 1,044 doctests in `permgroup.py` pass with `--serial --long
--optional=sage,gap_package_hap`.
- Separate probes check socle orders, normality, ambient groups,
domains, and two repeated socles for 17 groups, with CRISP loaded and
pexpect GAP startup disabled. All pass with this change. Omitting the
property call reproduces the upstream error for S4, A4, and S4 on a
nonstandard domain; the original implementation fails the no-pexpect
check.
- Ruff passes with both repository CI configurations; `git diff --check`
passes.

Local tests load the edited Python module over the installed Sage native
libraries; CI will validate the full source build.

### 📝 Checklist

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

None.
    
URL: sagemath#43008
Reported by: Dima Pasechnik
Reviewer(s):

@fchapoton fchapoton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks reasonable

@vbraun
vbraun merged commit 2e7e4b7 into sagemath:develop Oct 22, 2026
23 of 26 checks passed
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.

3 participants