Apologies for the very novice question. I am trying to find conjugacy classes and representatives (in matrix form) of a finite group of matrices $G$, isomorphic to $$ (\mathbb{Z}/n\mathbb{Z})^3 \rtimes S_3. $$ The isomorphism is as follows: the $i$-th copy of $\mathbb{Z}/n\mathbb{Z}$ is generated by the diagonal matrix with entries $\omega = e^\frac{2\pi \sqrt{-1}}{n}$ in the $(i,i)$ entry, and 1 elsewhere, and $S_3$ acts by conjugation, permuting the copies of $\mathbb{Z}/n\mathbb{Z}$.
I set this problem up in Magma using SemidirectProduct (an example follows with $n=3$).
The command Classes(G); seems to be what I want, however, it returns representatives expressed in cycle notation since SemidirectProduct presents $G$ as a permutation group. Is there a way to preserve the matrix form of the elements of the group when invoking SemidirectProduct (getting elements of the semidirect product as pairs of matrices)? Or an alternative way to construct the group $G$?
//Three copies of Cyclic group
F<w> := CyclotomicField(3);
H := MatrixGroup< 3, F | [w,0,0, 0,1,0, 0,0,1], [1,0,0, 0,w,0, 0,0,1], [1,0,0, 0,1,0, 0,0,w] >;
//Permutation group
K := MatrixGroup<3, F | [0,1,0, 1,0,0, 0,0,1], [0,0,1, 1,0,0, 0,1,0]>;
k1 := elt <K | 0,1,0, 1,0,0, 0,0,1>;
k2 := elt <K | 0,0,1, 1,0,0, 0,1,0>;
//Conjugacy action
A := AutomorphismGroup(H);
p1 := elt<A|hom<H->H | g :-> g^k1>>;
p2 := elt<A|hom<H->H | g :-> g^k2>>;
f := hom<K->A| k1 -> p1, k2-> p2>;
G := SemidirectProduct(H,K,f);
The
SemidirectProductintrinsic actually produces several maps as output that you can use for this. For example we can defineThen we have that
This give a nice way to take a matrix pair $(h,k) : h \in H, k \in K$ as an element of $G$ by
(I know you are asking about the other direction).
If you would like to turn a permutation in $G$ to a pair of matrices $(h,k)$, we can write a function
This will take $g$ as a permutation, and you want to write it as a corresponding ordered pair of matrices $h \in H$, $k \in K$;
k := m3(g).gprime := g*m2(k^-1);h := (m1^-1)(gprime).(Note: you will either need to define this function at an appropriate place in your code where
m1,m2,m3have been previously defined, or else define the function as takingm1,m2,m3as arguments.)As an alternate way to do this, you can define a map with specified inverse to convert back and forth between permutations and matrix pairs.