Ask Your Question

Accessing GAP's in function through the C Interface

asked 2017-02-05 17:24:58 +0200

jaebond gravatar image

updated 2017-06-27 18:57:17 +0200

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-10 01:19:26 +0200 )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 21:47:18 +0200 )edit

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

jaebond gravatar imagejaebond ( 2017-06-27 18:57:59 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-07-13 23:17:10 +0200

vdelecroix gravatar image

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 17:24:58 +0200

Seen: 315 times

Last updated: Jul 13 '17