How to create a group action on some group with GAP Given group $G$ is generated by some elements $g_1,g_2,\cdots$ with some relations. Group $A$ is generated by some elements $a_1,a_2,\cdots$ with some relations. I want to define a group action $\rho: G \times A\rightarrow A$ and I only need to define how generators of $G$ acts on generators of $A$. How to use GAP to create such group action?
For specific example, 
$G=\mathbb{Z}_4\times \mathbb{Z}_4 = \langle g_1,g_2: g_1 g_2 g_1^{-1}g_2^{-1},g_1^4,g_2^4\rangle$, $A= \mathbb{Z}_2\times \mathbb{Z}_2= \langle a_1,a_2: a_1 a_2 a_1^{-1}a_2^{-1},a_1^2,a_2^2\rangle$
and group action is 
$\rho(g_1,a_1)=a_2$, $\rho(g_1,a_2)=a_1$, $\rho(g_2,a_1)=a_2$, $\rho(g_2,a_2)=a_1$. I've read this page and don't find some useful example .Thanks very much.
 A: For each $a_i$ you create an automorphism $A\to A$ that describes the action.
Then create the group generated by these automorphisms, and make a homomorphism $G\to$this group.
In your example:
gap> F:=FreeGroup("g","h");
gap> G:=F/ParseRelators(F,"g4=h4=ghGH=1");
<fp group on the generators [ g, h ]>
gap> F:=FreeGroup("a","b");
gap> A:=F/ParseRelators(F,"a2=b2=abAB=1");
<fp group on the generators [ a, b ]>

read off the action as you describe:
gap> hom1:=GroupHomomorphismByImages(A,A,[A.1,A.2],[A.2,A.1]);
[ a, b ] -> [ b, a ]
gap> hom2:=GroupHomomorphismByImages(A,A,[A.1,A.2],[A.2,A.1]);
[ a, b ] -> [ b, a ]
gap> augrp:=Group(hom1,hom2);
<group with 2 generators>
gap> act:=GroupHomomorphismByImages(G,augrp,[G.1,G.2],[hom1,hom2]);
[ g, h ] -> [ [ a, b ] -> [ b, a ], [ a, b ] -> [ b, a ] ]
gap> Size(Kernel(act));
8

Caveats:


*

*Finitely presented is the worst way to to describe the groups you have. It is possible that the calculation (I did in the development version) will fail or slow down badly in the released versions. Rather describe G and H as permutation group or pc groups.

*Your notation acts on the left. GAP acts (in what clearly is the natural way :-) ) on the right. Be careful that you don't twist yourself up in this.

