Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Use libgap for PermutationGroup_generic._regular_subgroup_gap
Browse files Browse the repository at this point in the history
Pretty sure this works as intended though the test is a little
unclear since it shows multiple subgroups being returned instead
of just the first.
  • Loading branch information
embray committed Aug 14, 2019
1 parent 4aacf0f commit 4fe1132
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/sage/groups/perm_gps/permgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3465,14 +3465,13 @@ def _regular_subgroup_gap(self):
[ (1,4)(2,3), (1,3)(2,4) ] ))
"""
gap = self._gap_().parent()
C = gap.new("""
First(ConjugacyClassesSubgroups(%s),
x -> IsRegular(Representative(x), [1..%d]))
""" % (self._gap_().name(), self.degree()))
filt = libgap.eval('x -> IsRegular(Representative(x), [1..{}])'.format(
self.degree()))
C = libgap.First(self._libgap_().ConjugacyClassesSubgroups(), filt)
# prevent caching GAP fails
if gap.eval('%s = fail' % C.name()) == 'true':
if str(C) == 'fail':
return None

return C

@cached_method
Expand Down

0 comments on commit 4fe1132

Please sign in to comment.