Spin operator matrix representations in Sx basis 1. The problem statement, all variables and given/known data
I want to find the matrix representation of the $\hat{S}_x,\hat{S}_y,\hat{S}_z$ and $\hat{S}^2$ operators in the $S_x$ basis (is it more correct to say the $x$ basis, $S_x$ basis or the $\hat{S}_x$ basis?).
2. Relevant equations
$$\hat{S}^2|s,m_s\rangle=s(s+1)\hbar^2|s,m_s\rangle$$
$$\hat{S}_z|s,m_s\rangle=m_s\hbar|s,m_s\rangle$$
$$\hat{S}_x|s,m_s\rangle=\frac{1}{2}(\hat{S}_++\hat{S}_-)|s,m_s\rangle$$
$$\hat{S}_y|s,m_s\rangle=\frac{1}{2i}(\hat{S}_+-\hat{S}_-)|s,m_s\rangle$$
$$\hat{S}_{\pm}|s,m_s\rangle=\sqrt{s(s+1)-m_s(m_s \pm 1)}\hbar|s,m_s \pm 1\rangle$$
3. The attempt at a solution
Finding these in the $S_z$ basis is simple enough. All I need to do is investigate how the basis vectors $\{|\frac{1}{2},\frac{1}{2}\rangle \equiv |\alpha\rangle, |\frac{1}{2},\frac{-1}{2}\rangle\equiv |\beta\rangle\}$ transform under the action of the operator i wish to represent. Then the columns of the matrix become the image of the basis vectors under the operation. However, I'm not sure what the eigenvectors (basis vectors) of $S_x$ are. On top of that, the actions of the operators i have supplied would no longer apply in a different basis, would they? I would prefer to do it via this method rather than using a similarity transform if possible. 
Would I do it by defining the operators as follows?
$$\hat{S}^2|s,m_s\rangle=s(s+1)\hbar^2|s,m_s\rangle$$
$$\hat{S}_x|s,m_s\rangle=m_s\hbar|s,m_s\rangle$$
$$\hat{S}_+=\hat{S}_y+i\hat{S}_z$$
$$\hat{S}_-=\hat{S}_y-i\hat{S}_z$$
Which both imply that:
$$\hat{S}_y=\frac{1}{2}(\hat{S}_++\hat{S}_-)$$
$$\hat{S}_z=\frac{1}{2}(\hat{S}_+-\hat{S}_-)$$
And with the basis vectors of $S_y$, $|\alpha\rangle$ and $|\beta\rangle$ defined as before?
 A: The solution is quite simple, and based on 2 observations - 


*

*You expect the $S_x$ to be diagonal (with appropriate eigenvalues)

*The commutation relations of spin operators must be preserved (in some books the spin operators are defined by those relations) ($[S_i,S_j]=i\hbar \varepsilon_{ijk}S_k$)


The solution is to make a permutation of the known operators, i.e $S_x \rightarrow S_z$, $S_z \rightarrow S_y$, $S_y \rightarrow S_x$.
$$S_x = {\hbar \over 2}\begin{pmatrix} 1 & 0 \\ 0 & -1\end{pmatrix}$$
$$S_z = {\hbar \over 2}\begin{pmatrix} 0 & -i \\ i & 0\end{pmatrix}$$
$$S_y = {\hbar \over 2}\begin{pmatrix} 0 & 1 \\ 1 & 0\end{pmatrix}$$
The $S^2$ operator, being rotationaly invariant (proportional to unit matrix), remains unchanged
$$S^2 = {3 \hbar^2 \over 4}\begin{pmatrix} 1 & 0 \\ 0 & 1\end{pmatrix}$$
Another way to solve this is to look at this as purely algebraic problem - find the unitary matrix which diagonalizes $S_x$ and apply it to all the remaining matrices (changing representation basis of the matrix).
A: It is fairly late but one interesting way to think about this problem is to think about the Stern-Gerlach Experiment.
Suppose you have two Stern-Gerlach setups, say, one setup in the X direction, the next in the Z direction, and 
you send in a stream of unpolarized spins through the first one.
You will see that 50% of them are in the $|S_x;+\rangle$ and 50% of are in the $|S_x;-\rangle$. If you now block one of the beams and let the other pass through the next, you will see that the outgoing beam has 50% $|+\rangle$ and 50% $|-\rangle$. (Here I do not write $S_z$ as I have written everything in the $S_z$ basis.)
You can thus conclude that $|S_x;+\rangle$ has an equal mix of $|+\rangle$ and $|-\rangle$ ($S_x$ has an equal probability of being thrown into the $|+ \rangle$ or $|-\rangle$ states) or in more rigorous terms $$ |S_x;+\rangle = \frac{1}{\sqrt{2}} \left[ |+\rangle + e^{\iota \delta}|-\rangle \right]$$. The overall phase (with $\delta$ real) is immaterial here and thus can be absorbed into any one of the kets. 
$|S_x;-\rangle$ can then be written from orthogonality considertations.
$$ |S_x;-\rangle = \frac{1}{\sqrt{2}} \left[ |+\rangle - e^{\iota \delta}|-\rangle \right]$$.
Now for an operator $\hat{A}$ with eigenkets $|a'\rangle$ and corresponding eigenvalues a', the representation of A is given by 
$$A = \sum_{a'} a' |a'\rangle \langle a'|$$.
Then it follows for $S_x$
$$S_x = \frac{\hbar}{2} \left[\left( |S_x;+\rangle \langle S_x;+|\right) - \left( |S_x;-\rangle \langle S_x;-|\right)\right]$$
$$=\frac{\hbar}{2} \left[ e^{- \iota \delta} \left( |+\rangle \langle -|\right) + e^{\iota \delta} \left(|-\rangle \langle-|\right)\right]$$
Similarly for $S_y$,
$$S_y = \frac{\hbar}{2} \left[\left( |S_y;+\rangle \langle S_y;+|\right) - \left( |S_y;-\rangle \langle S_y;-|\right)\right]$$
$$=\frac{\hbar}{2} \left[ e^{- \iota \omega} \left( |+\rangle \langle -|\right) + e^{\iota \omega} \left(|-\rangle \langle-|\right)\right]$$
The real constants $\delta$ and $\omega$ can be evaulated with a similar experiment consisting of a Stern-Gerlach experiment aligned along X axis followed by one along Y axis. As before, we will see that the second SG apparatus gives out equal counts of $|S_y;\pm\rangle$. Or in ket notation, we have,
$$| \langle S_y; \pm|S_x;+\rangle| = | \langle S_y; \pm|S_x;-\rangle| = \frac{1}{\sqrt{2}}$$
Which results in $\frac{1}{2} \left[1 +\pm e^{\iota (\delta - \omega)}\right] = \frac{1}{\sqrt{2}}$, or $\delta$ - $\omega$ = $\frac{\pi}{2}$. Conventionally you can chose either one of them to be 0 and the other $\frac{\pi}{2}$. Chosing $\omega = \frac{\pi}{2}$, we have,
$$S_x =\frac{\hbar}{2} \left[ \left( |+\rangle \langle -|\right) +  \left(|-\rangle \langle-|\right)\right]$$
and,
$$S_y =\frac{\hbar}{2} \left[ \left( -\iota |+\rangle \langle -|\right) + \left(\iota |-\rangle \langle-|\right)\right]$$ in the $S_z$ basis. 
To change your basis from $S_z$ to say $S_x$, you can do the same thing (replace $S_z$ by $S_x$). But as Alexander mentions, you should be careful with the ordering (x $\rightarrow$ y $\rightarrow$ z) of $S_x$, $S_y$ and $S_z$ because of their non commutativity. 

Ref: Modern Quantum Mechanics: J.J. Sakurai
