I was trying to diagonalize the matrix:
$\left(\begin{array}{ccc} 0 & 0 & i\\ 0 & i & 0\\ i & 0 & 0 \end{array}\right)$
I got two eigenvalues, $\lambda_{1}=i$ and $\lambda_{2}=-i$, and found the eigenspaces:
$V_{\lambda_{1}=i}=\mathrm{span}\left\{ \left(\begin{array}{c} 1\\ 0\\ 1 \end{array}\right)\right\} $
$V_{\lambda_{2}=-i}=\mathrm{span}\left\{ \left(\begin{array}{c} 1\\ 0\\ -1 \end{array}\right),\left(\begin{array}{c} 0\\ 1\\ 0 \end{array}\right)\right\} $
Then I composed a unitary matrix after orthonormalising the eigenvectors: $U=\left(\begin{array}{ccc} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} & 0\\ 0 & 0 & 1\\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} & 0 \end{array}\right)\Rightarrow U^{*}=\left(\begin{array}{ccc} \frac{1}{\sqrt{2}} & 0 & \frac{1}{\sqrt{2}}\\ \frac{1}{\sqrt{2}} & 0 & -\frac{1}{\sqrt{2}}\\ 0 & 1 & 0 \end{array}\right) $
$U^{*}AU$ does produce a diagonal matrix.
The thing is, I thought the main diagonal should have eigenvalues according to the dimensions $\dim V_{\lambda_{1}=i}=1$ and $\dim V_{\lambda_{2}=-i}=2$:
$\left(\begin{array}{ccc} i & 0 & 0\\ 0 & -i & 0\\ 0 & 0 & -i \end{array}\right)$
But that's not the right diagonal matrix. Can anyone explain where my error is here?
Thanks.
$\left(\begin{array}{c} 0\\ 1\\ 0 \end{array}\right)$ is an eigenvector for the eigenvalue $i$, not $-i$.