$\newcommand{\ket}[1]{\vert #1\rangle}\newcommand{\matrixelement}[3] {\langle#1\vert#2\vert#3\rangle}$Question :: Construct the spin matrices for a spin half particle in the basis in which $S_z$ is diagonal.
Recall Basics :: Choose an Orthogonal Basis
Where do we get orthonormal basis? Usually the simultaneous eigenvectors of
a set of commuting operators are taken as an orthonormal basis. Then each
operators in the set will be represented by a diagonal matrix. The diagonal
entries will be just the eigenvalues.
Recall Basics :: Matrix Representation of Operators
In an orthonormal basis $\{\ket{k}, k=1,2,..,n\}$ the matrix for
an operator $\hat{T}$ in Dirac notation is given by
\begin{equation}
{\underline {\sf T} }= \begin{pmatrix}
\matrixelement{1}{\hat{T}}{1} &
\matrixelement{1}{\hat{T}}{2} & \ldots & \matrixelement{1}{\hat{T}}{n} \\
\matrixelement{2}{\hat{T}}{1} & \matrixelement{2}{\hat{T}}{2}& \ldots &
\matrixelement{2}{\hat{T}}{n}\\
\ldots & \ldots &\ldots & \ldots \\
\matrixelement{n}{\hat{T}}{1}&
\matrixelement{n}{\hat{T}}{2}& \ldots & \matrixelement{n}{\hat{T}}{n}
\end{pmatrix}
\end{equation}
Recall Basics :: From Angular Momentum Algebra
Next we will need to recall
\begin{eqnarray}
S_+&=&S_x+i S_y; \qquad S_-=S_x-iS_y\\
S_z\ket{m} &=& m \hbar \ket{m},\qquad m=s,s-1,s-2,\ldots,-s\\
S_\pm\ket{m} &=& \sqrt{s(s+1)-m(m\pm1)}\hbar \ket{m\pm1}
\end{eqnarray}
Steps for Solution
Choose a basis
For a spin $\frac{1}{2}$ particle, the eigenvalues of $S_z$ are $\frac{\hbar}{2}, -\frac{\hbar}{2}$. We choose eigenvectors of \(S_z\) as basis. There are two eignevectors [ \ket{\tfrac{1}{2}},\text{ and } \ket{-\tfrac{1}{2}}.\]
First write the matrix for \(S_z\)
In the basis chosen $S_z$ is diagonal. Hence it is straightforward to write the matrix for $S_z$ \begin{equation} S_z=\frac{\hbar}{2} \begin{pmatrix} 1& 0 \\0 & -1 \end{pmatrix} \end{equation}
Next construct matrices for \(S_+, S_-\)
The matrix will be given by \begin{equation} S_+= \left( \begin{array}{rr} \matrixelement{\tfrac{1}{2}}{S_+}{\tfrac{1}{2}}& \matrixelement{-\tfrac{1}{2}}{S_+}{\tfrac{1}{2}}\\[3mm] \matrixelement{\tfrac{1}{2}}{S_+}{-\tfrac{1}{2}}& \matrixelement{\tfrac{1}{2}}{S_+}{\tfrac{1}{2}} \end{array} \right)
\end{equation} Start with action of \(S_=\) on ket vector with highest \(m\) value. In our case, for this problem we compute action of \(S_+\) on
\(\ket{\tfrac{1}{2}}\) and get \begin{eqnarray} S_+\ket{\tfrac{1}{2}}= 0 & \Rightarrow & \matrixelement{\tfrac{1}{2}}{S_+}{\tfrac{1}{2}}=0,\qquad
\matrixelement{-\tfrac{1}{2}}{S_+}{\tfrac{1}{2}}=0 \end{eqnarray} {\it This will give the first row of the matrix.}\\ For the next row, use ket vector for the
next value of \(m\).\\ For this problem compute \(S_+\ket{-\tfrac{1}{2}}\) \begin{eqnarray} S_+\ket{-\tfrac{1}{2}}= \ket{\tfrac{1}{2}} & \Rightarrow &
\matrixelement{\tfrac{1}{2}}{S_+}{-\tfrac{1}{2}}=1,\qquad \matrixelement{-\tfrac{1}{2}}{S_+}{-\tfrac{1}{2}}=0 \end{eqnarray} Therefore,
the matrix for $S_+$ becomes \begin{equation} S_+ =\frac{\hbar}{2}\begin{pmatrix}0& 1\\0&0 \end{pmatrix} \end{equation} The matrix
for $S_-$ is hermitian adjoint of $S_+$ and hence we get \begin{equation} S_- = \frac{\hbar}{2}\begin{pmatrix}0& 0\\1&0 \end{pmatrix} \end{equation}
Next use $S_\pm$ to get $S_x, S_y$
The matrices for, $S_x,S_y$, are therefore given by \begin{eqnarray}
S_x&=\frac{1}{2}\Big(S_+ + S_-\Big)
=&\frac{\hbar}{2}\begin{pmatrix}0&1\\1&0\end{pmatrix} \\ S_y&= \frac{1}{2i}(S_+ - S_-)=&\frac{\hbar}{2}\begin{pmatrix}0&-i\\i&0\end{pmatrix} \end{eqnarray} To
summarize, we get the result that the spin $\frac{1}{2}$ matrices are given by \begin{equation} S_x= \frac{\hbar}{2} \sigma_1; \quad S_y= \frac{\hbar}{2}
\sigma_2; \quad S_z= \frac{\hbar}{2} \sigma_3. \end{equation} where \(\sigma_1, \sigma_2, \sigma_3\) are Pauli matrices \begin{equation}
\sigma_1=\begin{pmatrix}0&1\\1&0\end{pmatrix} \qquad \begin{pmatrix}0&-i\\i&0\end{pmatrix}\qquad \begin{pmatrix}1&0\\0&-1\end{pmatrix} \label{E1} \end{equation}
Use link below ro download full soultion of spin half problem