Skip to content

Commit b3d1c67

Browse files
author
Release Manager
committed
gh-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: #36889 Reported by: Frédéric Chapoton Reviewer(s): Dima Pasechnik, Frédéric Chapoton
2 parents 87a91d9 + b20ef4f commit b3d1c67

File tree

12 files changed

+112
-99
lines changed

12 files changed

+112
-99
lines changed

src/sage/algebras/fusion_rings/fusion_double.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,16 @@ def __init__(self, G, prefix="s"):
175175
self._names = {}
176176
self._elt = {}
177177
self._chi = {}
178+
self._unit_index = None # index of the unit element
178179
count = ZZ.zero()
179180
for g in G.conjugacy_classes_representatives():
180181
for chi in G.centralizer(g).irreducible_characters():
182+
# NOTE: the trivial char is not necessarily the first one
181183
self._names[count] = "%s%s" % (prefix, count)
182184
self._elt[count] = g
183185
self._chi[count] = chi
186+
if self._unit_index is None and all(v == 1 for v in chi):
187+
self._unit_index = count
184188
count += ZZ.one()
185189
self._cyclotomic_order = G.exponent()
186190
self._basecoer = None
@@ -650,9 +654,9 @@ def one_basis(self):
650654
EXAMPLES::
651655
652656
sage: FusionDouble(CyclicPermutationGroup(2), prefix="h").one()
653-
h0
657+
h1
654658
"""
655-
return ZZ.zero()
659+
return self._unit_index
656660

657661
@cached_method
658662
def dual(self, i):

src/sage/combinat/matrices/latin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2496,7 +2496,7 @@ def check_bitrade_generators(a, b, c):
24962496
sage: a, b, c, G = p3_group_bitrade_generators(3)
24972497
sage: check_bitrade_generators(a, b, c)
24982498
True
2499-
sage: check_bitrade_generators(a, b, gap('()'))
2499+
sage: check_bitrade_generators(a, b, libgap(gap('()')))
25002500
False
25012501
"""
25022502
A = PermutationGroup([a])

src/sage/combinat/permutation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ def _gap_(self, gap):
707707
sage: gap(Permutation((1,2,3))) # needs sage.libs.gap
708708
(1,2,3)
709709
sage: type(_) # needs sage.libs.gap
710-
<class 'sage.interfaces.gap.GapElement'>
710+
<class 'sage.libs.gap.element.GapElement_Permutation'>
711711
"""
712712
return self.to_permutation_group_element()._gap_(gap)
713713

0 commit comments

Comments
 (0)