[GAP Forum] Converting a permutation to a list

alexk at mcs.st-and.ac.uk alexk at mcs.st-and.ac.uk
Mon Aug 18 16:32:49 BST 2014


Dear Pierre,

> Greetings,
>
> i'm looking for a function , say F, such that
>
>   F((1,2,3)(5,6)) = [[1,2,3],[5,6]].


Try this:

gap> CyclesOfTransformation(AsTransformation((1,2,3)(5,6)));
[ [ 1, 2, 3 ], [ 4 ], [ 5, 6 ] ]gap>
CyclesOfTransformation(AsTransformation((1,2,3)(5,6)));
[ [ 1, 2, 3 ], [ 4 ], [ 5, 6 ] ]

(This is available since GAP 4.7 so please make it sure you are using a
fresh release)

To convert such notation back see e.g. Jack Schmidt's reply here:

http://math.stackexchange.com/questions/815071/list-vs-permutation-representation/815167#815167


Hope this helps
Alexander


>
> My goal is to use the output list as index to fetch string from a
> separate list (eg: ["a","b","c","d","e"]). I need to express
> permutation  on the latter (eg: ("a","b","c")("d","e")) ) , do some
> computation using gap permutation group, and  convert back the output of
> gap to permutation of these strings.
>
> I've seen PermList and ListPerm but it's not a cyclic notation. There's
> possibly better way to make a permutation acting on an ordred set of
> string  but my point is the input/output with gap.
>
> --
> Pierre-Alain BOURDIL
> pabourdi at laas.fr <mailto:pabourdi at laas.fr>
> pierre-alain.bourdil at fr.thalesgroup.com
> <mailto:pierre-alain.bourdil at fr.thalesgroup.com>
> _______________________________________________
> Forum mailing list
> Forum at mail.gap-system.org
> http://mail.gap-system.org/mailman/listinfo/forum
>




More information about the Forum mailing list