# [GAP Forum] Some GAP question

Alexander Konovalov alexander.konovalov at gmail.com
Tue Dec 16 16:35:26 GMT 2008

Dear Levie,

Maybe the simplest solution to do it interactively for one triple is
here:

gap> elts:=[(1,3),(2,4),(1,2)];
[ (1,3), (2,4), (1,2) ]
gap> conj:=[(),(2,3),(2,4),(3,4),(2,3,4), (2,4,3)];
[ (), (2,3), (2,4), (3,4), (2,3,4), (2,4,3) ]
gap> List( conj, x -> x^-1*elts*x );
[ [ (1,3), (2,4), (1,2) ], [ (1,2), (3,4), (1,3) ], [ (1,3), (2,4),
(1,4) ],
[ (1,4), (2,3), (1,2) ], [ (1,4), (2,3), (1,3) ], [ (1,2), (3,4),
(1,4) ] ]

You may write a function to do this:

gap> myfun:=function(elts,conj)
> return List( conj, x -> x^-1*elts*x );
> end;
function( elts, conj ) ... end

and then call this function as it is shown here:

gap> myfun(elts,conj);
[ [ (1,3), (2,4), (1,2) ], [ (1,2), (3,4), (1,3) ], [ (1,3), (2,4),
(1,4) ],
[ (1,4), (2,3), (1,2) ], [ (1,4), (2,3), (1,3) ], [ (1,2), (3,4),
(1,4) ] ]

Now you may apply it for various values of arguments. Using list
operations
and GAP programming language constructions (see, e.g. 'for' loops) you
may
automate computations for various combinations of arguments.

Hope this gives some hints in which direction to proceed.
For the further ideas, you may find useful these chapters
from the Tutorial:

http://www.gap-system.org/Manuals/doc/htm/tut/CHAP003.htm
http://www.gap-system.org/Manuals/doc/htm/tut/CHAP004.htm

and the Reference manual chapter "The Programming Language":

http://www.gap-system.org/Manuals/doc/htm/ref/CHAP004.htm

Best wishes,
Alexander

On 11 Dec 2008, at 14:45, Levie Bicua wrote:

> Dear GAP forum members,
> I’m new to this GAP thing and I think this question is trivial to
> most of you.
> Suppose I have a set of 3 elements coming from s4 (e.g. [(1,3),(2,4),
> (1,2)]) and I want to generate other sets using GAP by the method
> below:
> gap> ()^-1*[(1,3),(2,4),(1,2)]*();
> [ (1,3), (2,4), (1,2) ]
> gap> (2,3)^-1*[(1,3),(2,4),(1,2)]*(2,3);
> [ (1,2), (3,4), (1,3) ]
> gap> (2,4)^-1*[(1,3),(2,4),(1,2)]*(2,4);
> [ (1,3), (2,4), (1,4) ]
> gap> (3,4)^-1*[(1,3),(2,4),(1,2)]*(3,4);
> [ (1,4), (2,3), (1,2) ]
> gap> (2,3,4)^-1*[(1,3),(2,4),(1,2)]*(2,3,4);
> [ (1,4), (2,3), (1,3) ]
> gap> (2,4,3)^-1*[(1,3),(2,4),(1,2)]*(2,4,3);
> [ (1,2), (3,4), (1,4) ]
> The method gave 6 different sets of 3 elements. If I will use
> another set of 3 elements and repeat the process with again using (),
> (2,3),(2,4),(3,4),(2,3,4), (2,4,3) as conjugating elements, I will
> obtain again 6 different sets. But using this process every time I
> want to obtain a list of different sets as above would be eating
> much of my time. Is there a more efficient command/method than what