Finding orbits of an action on a set of basis vector with GAP

76 Views Asked by At

I work with the computer algebra system GAP in this question. Let $K$ be a field (for example the rational numbers). I have a set $W$ consisting of sets of vectors basis of $K^n$ that only have entries 0 and 1 (but not all of them). Here a concrete example for $n=3$: $W$ is given as

[ [ [ 0, 1, 0 ], [ 1, 1, 1 ], [ 0, 0, 1 ] ], [ [ 0, 1, 0 ], [ 1, 1, 1 ], [ 0, 1, 1 ] ], [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ], [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 1, 1 ] ], 
  [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 1, 1, 1 ] ], [ [ 1, 0, 0 ], [ 0, 1, 1 ], [ 0, 0, 1 ] ], [ [ 1, 0, 0 ], [ 1, 1, 0 ], [ 0, 0, 1 ] ], [ [ 1, 0, 0 ], [ 1, 1, 0 ], [ 0, 1, 1 ] ], 
  [ [ 1, 0, 0 ], [ 1, 1, 0 ], [ 1, 1, 1 ] ], [ [ 1, 0, 0 ], [ 1, 1, 1 ], [ 0, 0, 1 ] ], [ [ 1, 1, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ], [ [ 1, 1, 0 ], [ 0, 1, 0 ], [ 0, 1, 1 ] ], 
  [ [ 1, 1, 0 ], [ 0, 1, 0 ], [ 1, 1, 1 ] ], [ [ 1, 1, 0 ], [ 0, 1, 1 ], [ 0, 0, 1 ] ], [ [ 1, 1, 0 ], [ 1, 1, 1 ], [ 0, 1, 1 ] ], [ [ 1, 1, 1 ], [ 0, 1, 1 ], [ 0, 0, 1 ] ] ]

Here the list $W$ has 16 entries and the different vectors that can appear in a list of $W$ are [1,0,0],[0,1,0],[0,0,1],[1,1,0],[0,1,1],[1,1,1].

Now I have an operator $M$ that cyclically shifts each entry of such a 0,1-vector to the right. So here $M$ sends:

-[1,0,0] to [0,1,0]

-[0,1,0] to [0,0,1]

-[0,0,1] to [1,0,0]

-[1,1,0] to [0,1,1]

-[0,1,1] to [1,1,0]

-[1,1,1] to [1,1,1]

Then $M$ also acts on $W$ by sending a basis element $[w_1,w_2,w_3]$ to $[Mw_1,Mw_2,Mw_3]$.

Thus for example a basis looks like [ [ 0, 1, 0 ], [ 1, 1, 1 ], [ 0, 0, 1 ] ]. But here it is important that the order of the elements in the basis does no matter, so [ [ 0, 1, 0 ], [ 1, 1, 1 ], [ 0, 0, 1 ] ] should be identified with [ [ 1, 1, 1 ], [ 0, 0, 1 ],[ 0, 1, 0 ] ] for example.

Question: Is there an easy way to define this action in GAP so that it also generalises to higher $n$? How do I find the orbits of the action of $M$ on the set $W$ using GAP?

In this example there are 5 orbits. For example the orbit of [ [ 0, 1, 0 ], [ 1, 1, 1 ], [ 0, 0, 1 ] ] is given by the 2 other elements of $W$ [[0,1,0],[0,1,1],[1,1,1]] and [[0,0,1],[1,1,0],[1,1,1]].

Thanks for any help!

1

There are 1 best solutions below

9
On BEST ANSWER

Since the action is (clarified in comments) by moving the block of 1's, the acting group is probably easiest a free group on one generator, and we need to implement our own function for the action of the operator $M$:

MAction:=function(vec,elm)
local pow;
  if IsOne(elm) then
    pow:=0;
  else
    pow:=LetterRepAssocWord(elm);
    pow:=SignInt(pow[1])*Length(pow);  
  fi;
  if pow<0 then
    # For inverse, simply revert vector and shift
    return Reversed(MAction(Reversed(vec),-pow));
  elif pow>0 then
    while pow>0 do
      # shift by 1.
      if vec[Length(vec)]=0 then
        # simple shift by one entry
        elm:=Length(vec);
      else
        # block shift, use that there is only one 1 block
        elm:=Position(vec,1); # where is the 1?
       
      fi;
      vec:=Concatenation(vec{[elm..Length(vec)]},
          vec{[1..elm-1]});

      pow:=pow-1;
    od;
  fi;
  return vec;
end;

Based on this we also implement an action on sets:

MActionSets:=function(set,elm)
  return Set(List(set,x->MAction(x,elm)));
end;

In your example (transforming the elements off $W$ into sets [= sorted lists] first) we now get:

gap> G:=FreeGroup(1);;
gap> W2:=List(W,Set);;
gap> orb:=Orbits(G,W2,MActionSets);;
gap> List(orb,Length);
[ 3, 1, 6, 3, 6, 1 ]
gap> orb[3];
[ [ [ 0, 0, 1 ], [ 0, 1, 0 ], [ 1, 1, 0 ] ],
  [ [ 0, 0, 1 ], [ 0, 1, 1 ], [ 1, 0, 0 ] ],
  [ [ 0, 1, 0 ], [ 1, 0, 0 ], [ 1, 1, 0 ] ],
  [ [ 0, 0, 1 ], [ 0, 1, 0 ], [ 0, 1, 1 ] ],
  [ [ 0, 0, 1 ], [ 1, 0, 0 ], [ 1, 1, 0 ] ],
  [ [ 0, 1, 0 ], [ 0, 1, 1 ], [ 1, 0, 0 ] ] ]
gap> orb[2];
[ [ [ 0, 0, 1 ], [ 0, 1, 0 ], [ 1, 0, 0 ] ] ]