Ask Your Question

Accessing GAP's in function through the C Interface

asked 2017-02-05 10:24:58 -0500

jaebond gravatar image

updated 2017-06-27 11:57:17 -0500

Is there a way to access GAP's in function through Sage's C Interface to GAP?

gap> Identity(G) in G;


I was wondering how to call this from Sage:

sage: G = libgap.SymmetricGroup(5)
sage: g = libgap.eval('(1,2,3)(4,5)')

How do I test if g is in G?

edit retag flag offensive close merge delete


What is G?

vdelecroix gravatar imagevdelecroix ( 2017-03-09 18:19:26 -0500 )edit

\in is membership test. Another form of calling it would be \in( Identity(G), G );. It does not matter in this example what is G, but if you need something for the test, try e.g.\in((1,2),SymmetricGroup(3));.

alexander konovalov gravatar imagealexander konovalov ( 2017-04-03 14:47:18 -0500 )edit

Edited to clarify that I wanted to call this from Sage.

jaebond gravatar imagejaebond ( 2017-06-27 11:57:59 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-07-13 16:17:10 -0500

This might be what you want

sage: G = libgap.SymmetricGroup(5)
sage: g = libgap.eval('(1,2,3)(4,5)')
sage: getattr(g, '\\in')(G)
sage: g = libgap.eval('(1,2,3)(4,5,6)')
sage: getattr(g, '\\in')(G)
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: 2017-02-05 10:24:58 -0500

Seen: 133 times

Last updated: Jul 13