# Spin 1/2 - Base change for $S_z$ matrix

If the operator $\frac{1}{\sqrt{2}}$(I+i$\sigma_{x}$) represents the rotation operator for an anlge of $-\frac{1}{2}\pi$, applying it to the $S_{z}$ matrix in the z basekets ($\left|+\right>, \left|-\right>$) should throw the $S_{z}$ matrix in the y basekets ($\left|+\right>$+$i\left|-\right>$ , $\left|+\right>$-$i\left|-\right>$).

$\frac{1}{\sqrt{2}}$(I-i$\sigma_{x}$)$\frac{\hbar}{2}\sigma_{z}$$\frac{1}{\sqrt{2}}(I+i\sigma_{x}) = \begin{bmatrix} 0 & i\frac{\hbar}{2} \\ -i\frac{\hbar}{2} & 0 \end{bmatrix} But if I try apoaching it by a transformation operator U=\sum_{k}\left|b^{(k)}\right>$$\left\langle a^{(k)}\right|$, where de $a^{(k)}$ represent the z basekets and $b^{(k)}$ the y basekets, U=$\frac{1}{\sqrt{2}}$$(\left|+\right>+i\left|-\right>)$$\left\langle +\right|$ + $\frac{1}{\sqrt{2}}$$(\left|+\right>-i\left|-\right>)$$\left\langle -\right|$ = $\frac{1}{\sqrt{2}}$($\left|+\right>$$\left\langle +\right| + i\left|-\right>$$\left\langle +\right|$ + $\left|+\right>$$\left\langle -\right| - i\left|-\right>$$\left\langle -\right|$), the U matrix in the z eigenket basis is \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ i\frac{1}{\sqrt{2}} & -i\frac{1}{\sqrt{2}} \end{bmatrix} , but $U^\dagger\sigma_{z}U=$ \begin{bmatrix} 0 & \frac{\hbar}{2} \\ \frac{\hbar}{2} & 0 \end{bmatrix} which is clearly different. What am I doing wrong?

In order to get the same matrix back for $\sigma_{z}$, the first operator $U_0 = \frac{1}{\sqrt{2}}(I+\sigma_x)$ that you use should be the inverse of the second operator $U=∑_k|b(k)⟩ ⟨a(k)∣$, since you want to change back into the original basis. So first you should check whether $U_0 = U^\dagger$ to make sure you get the same matrix back. If this isn't true, you're not guaranteed to get the original matrix back.
Also a side note, the first matrix you got $\hbar/2 \begin{bmatrix}0& i \\ -i &0\end{bmatrix}$ is actually $\sigma_y$, and the matrix you got at the end $\hbar/2 \begin{bmatrix}0& 1 \\ 1 &0\end{bmatrix}$ is actually $\sigma_x$, which are the spin matrices in the y and x directions. So your unitary transformations did give you spin matrices, just not the one you started out with!