Ask Your Question
1

Action of Permutations on Points, maybe with GAP?

asked 2022-04-02 02:31:40 +0200

thethinker gravatar image

updated 2022-04-02 02:57:07 +0200

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
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2022-04-02 05:34:35 +0200

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) )
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

Stats

Asked: 2022-04-02 02:31:40 +0200

Seen: 27 times

Last updated: Apr 02