Solution (source code)

= Solution

For the two field-sensitive orientations alone, choose the unsplit excited-manifold energy as reference and put $x=\mu B/(k_{\mathrm B}T)$. The restricted single-molecule <partition function> is
$$
\boxed{q_{\mathrm{mag}}=e^{x}+e^{-x}=2\cosh x,\qquad\mu=2\mu_{\mathrm B}.}
$$
If the ground-manifold zero used above is retained, this restricted contribution is instead $2e^{-\beta\Delta}\cosh x$. The extra factor is independent of $B$, so it does not change magnetization conditional on occupying the excited manifold.

There are two magnetic states total; multiplying this expression by another factor of two would double count them. For the full thermal ensemble, the nonmagnetic ground states must be added:
$$
\boxed{q_{\mathrm{full}}=2+2e^{-\beta\Delta}\cosh x.}
$$
Although the omitted ground-state term has no direct field dependence, it affects normalization inside $\ln q$. Thus the restricted expression describes molecules constrained to the excited manifold; it cannot by itself give the magnetization of all thermally equilibrated NO molecules.