# How do I create a group action table with GAP?

Background:

Let $G$ be a group of size $k\cdot p^n$.

Let $S$ be the set of all subsets of size $p^n$ of $G$.

Define the map $f\colon G \times S \rightarrow S$ by $(g, s) \mapsto gs$ if $s \in S$.

I would like to create the group action table of $f$ with GAP. So in the case of $S_3$ I would get a table with twenty rows ( elements of $S$ ) and six columns ( elements of $S_3$ ) containing $gs$.

Question: How do I create a ( this ) group action table with GAP?

You'll find it easier to work with GAP if you switch to right actions.

G := SymmetricGroup( 3 );;
S := Combinations( AsSet( G ), 3 );;

myLeftAction := function( act, pnt ) # useless for Orbits, Stabilizer, etc.
return AsSet( List( pnt, x -> act*x ) );
end;

myRightAction := function( pnt, act )
return AsSet( List( pnt, x -> x*act ) );
end;;

table := List( S, s -> List( G, g -> myRightAction( s, g ) ) );;

PrintArray( table ); # If you have around 200 columns of screen
Browse( table ); # takes less screen space, but requires the Browse package

# Here is a way to display them in 72 columns using one-line notation
Display(
JoinStringsWithSeparator( List( table, row ->
JoinStringsWithSeparator( List( row, ent ->
JoinStringsWithSeparator( List( ent, perm ->
JoinStringsWithSeparator( ListPerm( perm, NrMovedPoints(G) ),
"" )), "|")), " ")), "\n" ));

• @Steve: thanks. a recent OS upgrade introduced auto-correct. Jan 28, 2012 at 18:13
• Super. Thank you very much for this clear answer. Jan 28, 2012 at 20:07
• How did you learn GAP that well? - See: math.stackexchange.com/questions/104195/… Jan 31, 2012 at 13:31