<s>[INST] Unitary transformation I have a matrix in following form
$$A=\begin{bmatrix}
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&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{bmatrix}$$
I need some help to reduce the matrix in following form using unitary transformation
$$C=\begin{bmatrix}
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&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{bmatrix}$$
I have used the unitary matrix transformation$UAU^*$ method but the result always come in following form
$$UAU^*=\begin{bmatrix}
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&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{bmatrix}$$
 [/INST] Let $e_1 = (1,0,\dots,0)^T, e_2 = (0,1,0,\dots,0)^T$, and so on.  One $U$ that works here is the $U$ whose columns are
$$
U = [e_1\quad e_3 \quad e_5 \quad e_7 \quad 
e_2 \quad e_4 \quad e_6 \quad e_8]
$$
Notice that this $U$ is a permutation matrix.
</s>