3

Is there a command in GAP to obtain all transformations on $n$ symbols (so there should be $n^n$ of them). I can not find such a command in https://www.gap-system.org/Manuals/doc/ref/chap53.html#X7B51CE257B814B09 but I would think that there is such a command since one can even find all finite groups of a given (low) order using GAP. The output should be a list containing all transformation from [1..n] to [1..n]. So for example for n=2, the list looks like this:

[Transformation([1,2]),Transformation([1,1]),Transformation([2,2]),Transformation([2,1])];

Mare
  • 2,332
  • 1
    Not sure if this is the most efficient way, but OnTuples( tup, g); can be used, where tup := [1..n]; and g loops over all elements in SymmetricGroup(n). – Felix Huber Oct 31 '19 at 10:58
  • It also depends on the format of "all transformation" that you like, Please specify. – Felix Huber Oct 31 '19 at 11:01
  • @FelixHuber I added an example for n=2. Im not sure whether I understand your comment correctly. Can you turn your comment in an answer even if it is not the most efficient way? – Mare Oct 31 '19 at 12:11
  • My bad. Please ignore my comment, I misunderstood your question. – Felix Huber Oct 31 '19 at 13:33

1 Answers1

2

Not "my" solution, from another GAP user:

gap> List(FullTransformationSemigroup(3));

does the job, returning

[ Transformation( [ 1, 1, 1 ] ), Transformation( [ 1, 1, 2 ] ), Transformation( [ 1, 1 ] ), Transformation( [ 1, 2, 1 ] ), ...

  • 1
    Iterator and Enumerator work for FullTransformationSemigroup, so instead of forming a list, you can also write constructions like for s in FullTransformationSemigroup(n) do ...; od; - see more in the GAP manual: https://www.gap-system.org/Manuals/doc/ref/chap30.html#X7EF8910F82B45EC7 for enumerators and https://www.gap-system.org/Manuals/doc/ref/chap30.html#X85A3F00985453F95 for iterators. – Olexandr Konovalov Nov 01 '19 at 13:17