Ask Your Question

Converting Sage groups to Gap groups

asked 2021-07-27 22:31:30 +0100

Drake Thomas gravatar image

updated 2021-07-29 11:59:22 +0100

FrédéricC gravatar image

I'm trying to convert groups in Sage to groups in Gap in the SageMathCell environment (all the below code is being run on sagecell dot sagemath dot org ). I've seen indications for two ways of doing this, gap(G) and However, these don't seem equivalent. For instance, if I run the following code:

G1 = gap(SymmetricGroup(5))
test1 = gap.ConjugacyClassesSubgroups(G1)
print("success 1")

G2 = SymmetricGroup(5).gap()
test2 = gap.ConjugacyClassesSubgroups(G2)
print("success 2")

I get this output:

<class ''>
success 1
<class ''>
TypeError: Gap produced error output
Error, Variable: 'Sym' must have a value

   executing \$sage3:=Sym( [ 1 .. 5 ] );;

So it appears that only the gap(G) functionality actually works to produce something I can run Gap computations on. This would be fine, except that gap(G) does not actually seem to work for all groups! If I try to run

G3 = WeylGroup(["F", 4])
G4 =
print("constructed G4")
G5 = gap(G3)
print("constructed G5")

I get the output:

<class 'sage.combinat.root_system.weyl_group.WeylGroup_gens_with_category'>
constructed G4
TypeError                                 Traceback (most recent call last)
<ipython-input-1-6f93228822c9> in <module>
     13 G4 =
     14 print("constructed G4")
---> 15 G5 = gap(G3)
     16 print("constructed G5")
TypeError: gap() takes exactly one argument (2 given)

What's the right way to convert Sage groups to Gap groups in a way that consistently lets me perform computations on them? I'm at a bit of a loss as to what's going wrong here.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2021-07-29 10:43:05 +0100

FrédéricC gravatar image

This works :

sage: G3 = WeylGroup(["F", 4])                                                  
sage: H3 = libgap(G3)                                                           
sage: L = libgap.ConjugacyClassesSubgroups(H3)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2021-07-27 22:31:30 +0100

Seen: 151 times

Last updated: Jul 29 '21