# Orbits on group actions acting on sets

Hello!

I am wondering how to solve the following problem efficiently.

I have a Permuation Group $G$ acting on $A = {1,\ldots,n}$ and I wish to compute the orbits of $G$ but not the ones of $G$ acting on $A$ but rather for $G$ acting on some $S \subseteq A \times A$ in the natural way. That is if $g \in G$ and $ x = {a,b} \in S$ then $x^g = {a^g,b^g} \in S$

Other software for permuation groups (magma, gap) allows to do this by specifing an additional option "on sets/on tuples" to compute the specifed orbits.

I am wondering how could I do the same in sage, given a permuation group $G$ and an $S$ as described above.

Thanks!

Are you saying that you want the orbits of $G$ on $A\times A$ ? Such orbits are usually called orbitals. GAP can do this for you, e.g. using its package called GRAPE.

But can it be directly done in sage?

I've written the answer below :)