qspec logo qspec logo

A physics toolbox for laser spectroscopy.

Static Badge Static Badge Static Badge

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

qspec. hyper_zeeman_12  (  j ,  m ,  a_hyper=0.0 ,  gi=0.0 ,  gj=0.0 ,  b_field=0.0 ,  g_n_as_gyro=False ,  as_freq=True  )[source]

The two eigenvalues of the hyperfine structure + Zeeman effect Hamiltonian for a nuclear spin of $I=1/2$ and the magnetic quantum number $m$, calculated analytically using the Breit-Rabi equation

$$\begin{aligned} E_\pm &= -\frac{\Delta E}{2(2J + 1)} - g_J\mu_\mathrm{B}m\mathcal{B} \pm \frac{\Delta E}{2}\sqrt{1 + \frac{4mx}{2J + 1} + x^2}\\[2ex] \Delta E &= A\left(J + \frac{1}{2}\right),\quad x = \frac{(g_J\mu_\mathrm{B} - g_I\mu_\mathrm{N})\mathcal{B}}{\Delta E}. \end{aligned}$$

For $|m| = J + 1/2$, only one state exists and both returned values are equal.

Parameters:
jscalar

The electronic total angular momentum quantum number $J$.

mscalar

The magnetic quantum number $m_F$.

a_hyperarray_like

The magnetic dipole hyperfine constant $A = \mu_I \mathcal{B}_J / (IJ)$ (MHz if as_freq else eV).

giarray_like

The nuclear g-factor $g_I$ or the gyromagnetic ratio $\gamma_I$ (MHz/T) if g_n_as_gyro is True.

gjarray_like

The electronic g-factor $g_J$.

b_fieldarray_like

The B-field $\mathcal{B}$ (T).

g_n_as_gyrobool

Whether gi is the nuclear g-factor (False) or the gyromagnetic ratio $\gamma_I$ (True). The default is False.

as_freqbool

The shift can be returned in energy (False, eV) or frequency units (True, MHz). The default is True.

Returns:
(x0, x1)tuple[ndarray, ndarray]

The two solutions $E_\mp$ of the Breit-Rabi equation, where x0 and x1 correspond to $F = J \mp 1/2$, respectively (MHz if as_freq else eV).