Ask Your Question
1

Action of Permutations on Points, maybe with GAP?

asked 3 years ago

thethinker gravatar image

updated 3 years ago

I cannot seem to figure out how to make Sage act on a point with a permutation. For example, if I act on the integer 17 with the permutation (5,17), the result is 17. This works fine in vanilla GAP:

gap> 17^(17,5);
5
gap> OnPoints(17,(17,5));
5

But I can't seem to determine the Sage command - does Sage only have the ability to multiply permutations with p1.action(p2), or can it do what I'm getting at here?

I tried accessing the GAP interface directly with gap.console(), but the resulted in the kernel hanging. Actually, even SageMathCell can't seem to figure out what gap.console() is supposed to do.

Anyone have any thoughts?

EDIT: Learning more about how Sage calls GAP is not helping....

sage: libgap.eval(G:=FreeGroup(3))
<free group on the generators [ x0, x1, x2 ]>
sage: libgap.eval(OnPoints(3,(1,2,3)))
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-3-0f49a104e96c> in <module>
----> 1 libgap.eval(OnPoints(Integer(3),(Integer(1),Integer(2),Integer(3))))

NameError: name 'OnPoints' is not defined
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
4

answered 3 years ago

Max Alekseyev gravatar image

Permutation p is viewed as a function, and so its action on a point is just the result of this function:

p = Permutation('(5,17)')
print( p(5) )
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: 3 years ago

Seen: 263 times

Last updated: Apr 02 '22