0

Does anyone know of a quick way to enumerate the permutation matrices for the symmetry group of the cube $O_h = S_4 \times C_2$? $O_h$ has $48$ elements; if we label the vertices of the cube $1,2,…,8$ then the permutation $$p= \left(\begin{array}{cccccccc} 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8\\ 1 & 4 & 7 & 6 & 3 & 2 & 5 & 8\end{array} \right) $$ belongs to $O_h$ and the corresponding permutation matrix is $$M_p= \left(\begin{array}{cccccccc} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0\\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1\end{array} \right). $$ I'd like to be able to enumerate the set $\{M_p : p \in O_h\}$ quickly without having to draw out each matrix by hand. It would also be nice to be able to do it for the $n$-dimensional cube. Any help appreciated.

RedOrange
  • 331

2 Answers2

1

Here is the code you can paste directly in GAP.

#change dim to any other value you want
dim:=8;;

#The identitymatrix (whose columns are going to be changed)
I:=IdentityMat(dim);;

#The def. of a function that assigns a matrix to a permutation g
mat:=function(g)
M:=List(I, i->Permuted(i,g));
return M;
end;;

#This is an example of how the function is used 
g:=(1,7)(2,5)(3,4)(6,8);
(1,7)(2,5)(3,4)(6,8)
M:=mat(g);;
Display(M);
[ [  0,  0,  0,  0,  0,  0,  1,  0 ],
  [  0,  0,  0,  0,  1,  0,  0,  0 ],
  [  0,  0,  0,  1,  0,  0,  0,  0 ],
  [  0,  0,  1,  0,  0,  0,  0,  0 ],
  [  0,  1,  0,  0,  0,  0,  0,  0 ],
  [  0,  0,  0,  0,  0,  0,  0,  1 ],
  [  1,  0,  0,  0,  0,  0,  0,  0 ],
  [  0,  0,  0,  0,  0,  1,  0,  0 ] ]
  • You may also have a look at existing GAP function for that - see ?PermutationMat. It has two more arguments - 2nd is the dimension and third (optional) to specify the field. – Olexandr Konovalov Oct 09 '14 at 19:23
  • If you will view the implementation of PermutationMat with PageSource (see here) then you will see that it creates a zero matrix and then sets one entry in each row to the identity of the field - this is much cheaper then shuffle the columns around. – Olexandr Konovalov Oct 09 '14 at 20:56
0

Have you noticed that for $p$ you considered , $M_p$ is formed by the rule that $i$th row in the matrix has $0$ everywhere except at $p(i)$ place. so write down all $48$ permutations, and that will give you all permutation matrices by this easy rule.

Cannot write all $48$ matrices,that you will have to do, but can give you one more example, say take $\sigma$= $(12)(34)$, your matrix

$M_{\sigma}= \left(\begin{array}{cccccccc} 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\ 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0\\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1\end{array} \right).$