[GAP Forum] Orbit of group action on matrices

Burkhard Höfling burkhard at hoefling.name
Sat Sep 25 09:59:58 BST 2010


On 25/09/2010, at 8:36 , Benjamin Sambale wrote:

> Dear Forum,
> 
> I've defined an action of a permutation group on a set of square matrices in the following way:
> 
> act:=function(x,g)
>   local i;
>   for i in [1..Length(x[1])] do x[i]:=Permuted(x[i],g); od;
>   return Permuted(x,g);
> end;
> 
> This works as expected, for example:
> 
> gap> act([[1,2],[3,4]],(1,2));
> [ [ 4, 3 ], [ 2, 1 ] ]
> 
> However, using the Orbit command gives
> 
> gap> Orbit(Group((1,2)),[[1,2],[3,4]],act);
> Lists Assignment: <list> must be a mutable list
> 
> What is wrong here?

Your action tries to change the argument x (by assigning permuted rows). But this is probably not what you had intended anyway. Try the following.

act:=function(x,g)
  local i, y;
  y := [];
  for i in [1..Length(x[1])] do y[i]:=Permuted(x[i],g); od;
  return Permuted(y,g);
end;

Cheers,

Burkhard.




More information about the Forum mailing list