(1). I am trying to define a new binary operation on a given group in GAP. But I could not find any help. If anyone can help me with some reference or code, it would be great.
(2). I have constructed the table with a new operation on a group using the code:
gap> g:=SymmetricGroup(3);
Sym( [ 1 .. 3 ] )
gap> f:=function(g, x, y);
> if x in Set(g) and y in Set(g) then
> return y^-1 * x * y^2;
> fi;
> end;
function( g, x, y ) ... end
gap> M:=List(g, x-> List(g, y-> f(g, x, y)));;
But the problem I am facing is that M is a table but it does not show as the multiplication table. I need the multiplication table so that I can construct a loop from it. Thanks in advance.
First, I will reproduce your initial setup:
Note that you can check membership in a group using
x in gmore efficiently. Also, perhaps you want some action of the condition does not hold (an error message?). Anyway, in your setting you call it with the right arguments.What you need to do to create a table is to use positions of group elements in the fixed list of its elements, rather than elements themselves:
If you want to construct a loop, try the LOOPS package. I have tried that with the
Tabove, following examples here, but the table does not define a loop: