Ask Your Question
0

Accessing GAP's in function through the C Interface

asked 8 years ago

jaebond gravatar image

updated 7 years ago

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

gap> Identity(G) in G;
true

EDIT:

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?

Preview: (hide)

Comments

What is G?

vdelecroix gravatar imagevdelecroix ( 8 years ago )
1

\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 ( 7 years ago )

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

jaebond gravatar imagejaebond ( 7 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 7 years ago

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)
true
sage: g = libgap.eval('(1,2,3)(4,5,6)')
sage: getattr(g, '\\in')(G)
false
Preview: (hide)
link

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

Stats

Asked: 8 years ago

Seen: 404 times

Last updated: Jul 13 '17