# GAP semidirect product algorithm

Can anybody guide me towards, or possibly even explain here, the algorithm that GAP uses to compute the semidirectproduct of two permutation groups which outputs another permutation group?

EXAMPLE:

gap> C3:=CyclicGroup(IsPermGroup,3);
Group([ (1,2,3) ])
gap> C7:=CyclicGroup(IsPermGroup,7);
Group([ (1,2,3,4,5,6,7) ])
gap> A:=AutomorphismGroup(C7);
< group with 1 generators >
gap> elts := Elements(A);
[ IdentityMapping( Group([ (1,2,3,4,5,6,7) ]) ),
[ (1,2,3,4,5,6,7) ] -> [ (1,3,5,7,2,4,6) ],
[ (1,2,3,4,5,6,7) ] -> [ (1,4,7,3,6,2,5) ],
[ (1,2,3,4,5,6,7) ] -> [ (1,5,2,6,3,7,4) ],
[ (1,2,3,4,5,6,7) ] -> [ (1,6,4,2,7,5,3) ],
[ (1,2,3,4,5,6,7) ] -> [ (1,7,6,5,4,3,2) ] ]
gap> sigma := elts[2];
[ (1,2,3,4,5,6,7) ] -> [ (1,3,5,7,2,4,6) ]
gap> sigma^3;
[ (1,2,3,4,5,6,7) ] -> [ (1,2,3,4,5,6,7) ]
gap> map := GroupHomomorphismByImages(C3, A, GeneratorsOfGroup(C3), [sigma]);
[ (1,2,3) ] -> [ [ (1,2,3,4,5,6,7) ] -> [ (1,3,5,7,2,4,6) ] ]
gap> SDP := SemidirectProduct(C3, map, C7);
Group([ (2,3,5)(4,7,6), (1,2,3,4,5,6,7) ])

-
The code is on line 919 of lib/gprdperm.gi I'll look over it to see if it is easy to explain. – Jack Schmidt Aug 3 '12 at 20:11
Oh my, yes it is very simple. A little scary. It rewrites the normal subgroup in its regular action (so $K$ acting on $|K|$ points), and then of course the complement subgroup acts on the normal subgroup giving the semidirect product of $H/C_H(K)$ with $K$. If $C_H(K) \neq 1$, then do the subdirect product smooshy thing with $H$'s original rep. – Jack Schmidt Aug 3 '12 at 20:15
In particular, please don't try this with $S_{20}$ as the normal subgroup. :-) – Jack Schmidt Aug 3 '12 at 20:15