Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
sagemathgh-36889: more libgap in permutation groups ; get rid of _libgap_init_
    
Moving forward from gap pexpect interface to libgap interface :

- using more libgap in the permutation groups code

- get rid of the barely used `_libgap_init_` method in favor of the
unique `_gap_init_` method.

### 📝 Checklist

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have created tests covering the changes.
    
URL: sagemath#36889
Reported by: Frédéric Chapoton
Reviewer(s): Dima Pasechnik, Frédéric Chapoton
  • Loading branch information
Release Manager committed Jan 1, 2024
2 parents 73468b7 + b20ef4f commit 03d75b1
Show file tree
Hide file tree
Showing 12 changed files with 112 additions and 99 deletions.
8 changes: 6 additions & 2 deletions src/sage/algebras/fusion_rings/fusion_double.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,16 @@ def __init__(self, G, prefix="s"):
self._names = {}
self._elt = {}
self._chi = {}
self._unit_index = None # index of the unit element
count = ZZ.zero()
for g in G.conjugacy_classes_representatives():
for chi in G.centralizer(g).irreducible_characters():
# NOTE: the trivial char is not necessarily the first one
self._names[count] = "%s%s" % (prefix, count)
self._elt[count] = g
self._chi[count] = chi
if self._unit_index is None and all(v == 1 for v in chi):
self._unit_index = count
count += ZZ.one()
self._cyclotomic_order = G.exponent()
self._basecoer = None
Expand Down Expand Up @@ -650,9 +654,9 @@ def one_basis(self):
EXAMPLES::
sage: FusionDouble(CyclicPermutationGroup(2), prefix="h").one()
h0
h1
"""
return ZZ.zero()
return self._unit_index

@cached_method
def dual(self, i):
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/matrices/latin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2496,7 +2496,7 @@ def check_bitrade_generators(a, b, c):
sage: a, b, c, G = p3_group_bitrade_generators(3)
sage: check_bitrade_generators(a, b, c)
True
sage: check_bitrade_generators(a, b, gap('()'))
sage: check_bitrade_generators(a, b, libgap(gap('()')))
False
"""
A = PermutationGroup([a])
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/permutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def _gap_(self, gap):
sage: gap(Permutation((1,2,3))) # needs sage.libs.gap
(1,2,3)
sage: type(_) # needs sage.libs.gap
<class 'sage.interfaces.gap.GapElement'>
<class 'sage.libs.gap.element.GapElement_Permutation'>
"""
return self.to_permutation_group_element()._gap_(gap)

Expand Down
Loading

0 comments on commit 03d75b1

Please sign in to comment.