Solution (source code)

= Solution

With $\mathbf B=B_0\hat{\mathbf z}$ and $S_z=(\hbar/2)\sigma_z$,
$$
H_0=\mu_BB_0\begin{pmatrix}1&0\\0&-1\end{pmatrix}.
$$
Thus
$$
\boxed{E_+=\mu_BB_0,\quad |+\rangle=\begin{pmatrix}1\\0\end{pmatrix};\qquad E_-=-\mu_BB_0,\quad |-\rangle=\begin{pmatrix}0\\1\end{pmatrix}.}
$$
For $B_0>0$, <spin> down is the lower <energy eigenstate>. The negative <electron magnetic moment> is already accounted for in the positive coefficient multiplying $\mathbf S\cdot\mathbf B$ in the given <Hamiltonian>.