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.
Asked
Active
Viewed 439 times
0
-
what is the meaning of enumerate? You want all the matrices written precisely, or just how many matrices. There will be 48 matrices – Bhaskar Vashishth Oct 08 '14 at 16:16
-
@BhaskarVashishth I want all the matrices written precisely – RedOrange Oct 08 '14 at 16:22
-
Do you want the result written in GAP? http://www.gap-system.org/ – Marc Bogaerts Oct 09 '14 at 14:16
-
@Nimda Yes, but what commands should I use? – RedOrange Oct 09 '14 at 14:26
-
@IsaacZebulunBurke Give me some time so that I'll figure that out. I presume you can generate the permutations of the symmetry group? so I'll produce an algorithm that calculates the matrix for any given permutation (of any group in fact) – Marc Bogaerts Oct 09 '14 at 14:37
-
@Nimda Thanks! I'm not even sure how to generate the permutations of the symmetry group but I could probably figure it out. – RedOrange Oct 09 '14 at 15:31
2 Answers
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 ] ]
Marc Bogaerts
- 6,305
-
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
PermutationMatwithPageSource(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).$
Bhaskar Vashishth
- 11,677
-
Thanks, I know that though! What I want is a program to do this automatically. – RedOrange Oct 09 '14 at 12:50