---
title: "Spin in a Magnetic Field: Precession and Resonance"
module: Spin
moduleNumber: 8
lessonNumber: 2
order: 802
summary: >
  A spin coupled to a magnetic field is the simplest nontrivial quantum dynamics.
  A static field makes the spin expectation precess on a cone at the Larmor
  frequency while the energy levels split linearly. Adding a weak oscillating field
  and passing to the rotating frame produces Rabi oscillations and a resonance
  lineshape — the physics of NMR and ESR, and the driven qubit.
topics: [Spin]
sources:
  - book: Griffiths & Schroeter
    ref: "§4.4.2 Larmor Precession; §11.1 Two-Level Systems (Rabi)"
  - book: Sakurai & Napolitano
    ref: "§2.1 Spin Precession; §5.5 Time-Dependent Two-State Problems"
  - book: Cohen-Tannoudji, Diu & Laloë
    ref: "Ch. IV Complements — Magnetic Resonance"
draft: false
---

The [Stern–Gerlach lesson](/quantum-mechanics/spin/spin-half-pauli-matrices-and-stern-gerlach)
built the static structure of spin-½: a two-dimensional space, the Pauli
matrices, and measurement statistics. A magnetic field turns that structure into
dynamics. The Zeeman Hamiltonian is proportional to a single Pauli operator for a
static field, and to a time-dependent combination when a drive is added. Both
cases solve in closed form, and together they cover Larmor precession, magnetic
resonance, and the driven qubit.

## The magnetic moment and the Zeeman Hamiltonian

A particle with spin $\vec S$ carries a magnetic moment proportional to it,

$$
\vec\mu = \gamma\,\vec S,
\qquad
\gamma = g\,\frac{q}{2m},
$$

where $\gamma$ is the **gyromagnetic ratio** and $g$ the dimensionless $g$-factor.
For the electron $q = -e$ and $g_s \approx 2$, so $\gamma_e = -g_s e/2m_e < 0$; the
moment points opposite the spin.[^gs-larmor] The energy of the moment in a field
is $H = -\vec\mu\cdot\vec B = -\gamma\,\vec B\cdot\vec S$.

Take a uniform static field along $z$, $\vec B = B_0\hat z$. Then

$$
H = -\gamma B_0\,S_z = -\gamma B_0\,\frac{\hbar}{2}\sigma_z
 = -\frac{\hbar\omega_0}{2}\sigma_z,
\qquad
\omega_0 \equiv \gamma B_0 .
$$

The eigenstates are the $S_z$ eigenspinors $\lvert\pm\rangle$ with energies

$$
E_\pm = \mp\frac{\hbar\omega_0}{2},
\qquad
\Delta E = E_- - E_+ = \hbar\omega_0 = \hbar\gamma B_0 .
$$

The splitting is linear in the field. For an electron
$\Delta E = g_s\mu_B B_0$ with the Bohr magneton $\mu_B = e\hbar/2m_e$; the
corresponding frequency is $\gamma_e B_0/2\pi \approx 28.0\ \mathrm{GHz/T}$, in the
microwave band (electron spin resonance). A proton has
$\gamma_p/2\pi \approx 42.58\ \mathrm{MHz/T}$, in the radiofrequency band (nuclear
magnetic resonance).[^codata-gyro]

$$
% caption: The two spin energies split linearly with field strength; the gap
% hbar*omega_0 = hbar*gamma*B_0 sets the Larmor and resonance frequency. The
% moment opposite the spin makes spin-up the lower state for a negative gamma.
\begin{tikzpicture}[>=stealth, font=\small, scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (0,0) -- (5.4,0) node[right, font=\footnotesize] {$B_0$};
\draw[->, black] (0,-2.0) -- (0,2.2) node[above, font=\footnotesize] {energy};
\node[font=\footnotesize, anchor=east] at (0,0) {$0$};
% two diverging lines
\draw[very thick, acc] (0,0) -- (4.8,-1.7);
\draw[very thick, dashed, black] (0,0) -- (4.8,1.7);
\node[text=acc, font=\footnotesize, anchor=west] at (4.85,-1.7) {spin up};
\node[text=black, font=\footnotesize, anchor=west] at (4.85,1.7) {spin down};
% gap indicator
\draw[<->, black] (3.2,-1.13) -- (3.2,1.13);
\node[font=\footnotesize, anchor=west, fill=white, inner sep=1pt] at (3.35,0.55) {energy gap};
\end{tikzpicture}
$$

## Larmor precession

The dynamics of a general spin state follow from the time-evolution operator
$U(t) = e^{-iHt/\hbar}$. Since $H = -\tfrac{\hbar\omega_0}{2}\sigma_z$ is diagonal,

$$
U(t) = \exp\!\Big(\frac{i\omega_0 t}{2}\sigma_z\Big)
 = \begin{pmatrix} e^{i\omega_0 t/2} & 0 \\ 0 & e^{-i\omega_0 t/2} \end{pmatrix}.
$$

Start with a spin tilted by a polar angle $\alpha$ from $z$,
$\chi(0) = \big(\cos\tfrac{\alpha}{2},\ \sin\tfrac{\alpha}{2}\big)^{\mathsf T}$.
Evolving,

$$
\chi(t) = \begin{pmatrix} \cos\tfrac{\alpha}{2}\,e^{i\omega_0 t/2} \\[2pt]
 \sin\tfrac{\alpha}{2}\,e^{-i\omega_0 t/2} \end{pmatrix}.
$$

The expectation values follow from the Pauli matrices. With
$a = \cos\tfrac{\alpha}{2}\,e^{i\omega_0 t/2}$ and
$b = \sin\tfrac{\alpha}{2}\,e^{-i\omega_0 t/2}$,

$$
\langle S_x\rangle = \frac{\hbar}{2}\,2\,\mathrm{Re}(a^\ast b) = \frac{\hbar}{2}\sin\alpha\cos\omega_0 t,
$$
$$
\langle S_y\rangle = \frac{\hbar}{2}\,2\,\mathrm{Im}(a^\ast b) = -\frac{\hbar}{2}\sin\alpha\sin\omega_0 t,
$$
$$
\langle S_z\rangle = \frac{\hbar}{2}\big(|a|^2 - |b|^2\big) = \frac{\hbar}{2}\cos\alpha .
$$

The polar angle stays fixed at $\alpha$ and the vector sweeps around $z$ at
angular frequency $\omega_0$. This is **Larmor precession**: the spin expectation
value traces a cone, exactly like a classical magnetic moment in a field. The
azimuthal sense is set by the sign of $\gamma$.

The same result comes from the Heisenberg picture without solving for the state.
[Ehrenfest's theorem](/quantum-mechanics/formalism/time-evolution-schrodinger-and-heisenberg-pictures)
gives the operator equation of motion, which for $\langle\vec S\rangle$ reads

$$
\frac{\d\langle\vec S\rangle}{\d t}
 = \frac{1}{i\hbar}\big\langle[\vec S, H]\big\rangle
 = \gamma\,\langle\vec S\rangle\times\vec B .
$$

> **Proof.** With $H = -\gamma\vec B\cdot\vec S$ and
> $[S_i, S_j] = i\hbar\varepsilon_{ijk}S_k$,
> $$
> [S_i, H] = -\gamma B_j[S_i,S_j] = -\gamma B_j\,i\hbar\varepsilon_{ijk}S_k
> = i\hbar\gamma\,(\vec S\times\vec B)_i .
> $$
> Dividing by $i\hbar$ and taking the expectation value gives
> $\d\langle S_i\rangle/\d t = \gamma(\langle\vec S\rangle\times\vec B)_i$. This is
> the classical torque equation for a magnetic moment, so the quantum expectation
> obeys the classical precession law exactly, with no approximation.

The precession frequency $\omega_0 = \gamma B_0$ is independent of the tilt angle
and of $\hbar$ — a purely classical-looking rate, even though the underlying
observable is quantized to $\pm\hbar/2$.

$$
% caption: The spin expectation value precesses on a cone of fixed opening angle
% about the field direction z at the Larmor frequency omega_0; the z-component is
% constant while the transverse part rotates.
\begin{tikzpicture}[>=stealth, font=\small, scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
% field axis
\draw[->, thick, black] (0,-1.6) -- (0,2.6) node[above, font=\footnotesize] {$z$};
% cone
\draw[black] (0,1.7) ellipse (1.6 and 0.45);
\draw[black] (0,0) -- (1.6,1.7);
\draw[black] (0,0) -- (-1.6,1.7);
% spin vector
\draw[->, very thick, acc] (0,0) -- (1.15,1.99);
\node[circle, fill=acc, inner sep=1.5pt] at (1.15,1.99) {};
\node[text=acc, font=\footnotesize, anchor=south west] at (1.2,2.02) {spin};
% rotation arrow around cone rim
\draw[->, thick] (1.35,1.55) arc (-20:200:1.55 and 0.42);
\node[font=\footnotesize, text=black] at (0,1.7) {precession};
% opening angle
\draw[black, thick] (0,0.9) arc (90:60:0.9);
\node[font=\footnotesize, text=black, anchor=west] at (0.28,0.72) {tilt};
\end{tikzpicture}
$$

## Driving the spin: the rotating frame

Add a weak oscillating field transverse to $B_0$,

$$
\vec B(t) = B_0\hat z + B_1\cos(\omega t)\,\hat x,
\qquad
H(t) = -\gamma\big[B_0 S_z + B_1\cos(\omega t)\,S_x\big].
$$

The static part precesses the spin at $\omega_0$; the transverse part can flip it
when $\omega$ is tuned near $\omega_0$. To see the resonance cleanly, pass to a
frame rotating about $z$ at the drive frequency $\omega$, using the unitary
$R(t) = e^{i\omega t S_z/\hbar}$. The linear oscillation
$\cos(\omega t)\,\hat x$ splits into two counter-rotating circular fields; in the
rotating frame one becomes static and the other spins at $2\omega$. Dropping the
fast $2\omega$ term (the **rotating-wave approximation**, valid for
$B_1 \ll B_0$) leaves a time-independent effective Hamiltonian

$$
H_{\mathrm{eff}} = -\frac{\hbar}{2}\big[(\omega_0-\omega)\sigma_z + \omega_1\sigma_x\big],
\qquad
\omega_1 \equiv \gamma B_1 .
$$

This is a static spin problem again, but about an **effective field** with a
$z$-component set by the detuning $\omega_0-\omega$ and an $x$-component set by the
drive strength $\omega_1$. Its magnitude is the **generalized Rabi frequency**

$$
\Omega = \sqrt{(\omega-\omega_0)^2 + \omega_1^2}.
$$

$$
% caption: In the rotating frame the drive and the detuning combine into a static
% effective field; its z-leg is the detuning omega_0 minus omega, its transverse
% leg is the Rabi drive omega_1, and its length is the generalized Rabi frequency.
\begin{tikzpicture}[>=stealth, font=\small, scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
% axes of rotating frame
\draw[->, black] (0,0) -- (0,3.0) node[above, font=\footnotesize] {rotating $z$};
\draw[->, black] (0,0) -- (3.4,0) node[right, font=\footnotesize] {rotating $x$};
% detuning leg (vertical) and drive leg (horizontal)
\draw[very thick, black] (0,0) -- (0,2.2);
\draw[dashed, black] (0,2.2) -- (2.4,2.2);
\draw[very thick, black] (0,0) -- (2.4,0);
% resultant
\draw[->, very thick, acc] (0,0) -- (2.4,2.2);
\node[anchor=south east, font=\footnotesize, text=acc] at (2.4,2.2) {resultant};
\node[text=black, font=\footnotesize, anchor=east] at (-0.1,1.1) {detuning};
\node[text=black, font=\footnotesize, anchor=north] at (1.2,0) {drive};
\node[font=\footnotesize, anchor=west, text=acc] at (1.25,1.3) {Rabi rate};
\end{tikzpicture}
$$

## Rabi oscillations

Prepare the spin in $\lvert +\rangle$ and ask for the probability it is found in
$\lvert -\rangle$ after time $t$. In the rotating frame the spin precesses about
the effective field at rate $\Omega$; converting back gives the **Rabi formula**

$$
P_{+\to-}(t) = \frac{\omega_1^2}{\Omega^2}\,\sin^2\!\Big(\frac{\Omega t}{2}\Big)
 = \frac{\omega_1^2}{(\omega-\omega_0)^2 + \omega_1^2}\,\sin^2\!\Big(\frac{\Omega t}{2}\Big).
$$

> **Worked example.** Verify the two limits. **On resonance** $\omega = \omega_0$,
> so $\Omega = \omega_1$ and $P_{+\to-} = \sin^2(\omega_1 t/2)$: the population
> flops completely, $0\to1\to0$, with period $2\pi/\omega_1$. A pulse of duration
> $t = \pi/\omega_1$ (a $\pi$-pulse) inverts the spin with certainty; a pulse of
> half that (a $\pi/2$-pulse) creates an equal superposition. **Far off
> resonance** $|\omega-\omega_0|\gg\omega_1$, the prefactor
> $\omega_1^2/\Omega^2\to 0$: the spin barely responds, and the small oscillation
> it does make is fast, at rate $\Omega\approx|\omega-\omega_0|$. Resonance is
> sharp in both amplitude and rate.

The prefactor $\omega_1^2/\Omega^2$ is the maximum reachable flip probability at a
given detuning. It equals $1$ only at exact resonance and falls off as the drive
is mistuned. The full flopping on resonance is the coherent inversion used to
manipulate qubits and to invert nuclear-spin populations in NMR.

$$
% caption: Rabi flopping of the excited-state population versus time: on resonance
% the population inverts completely and periodically; off resonance the amplitude
% is capped below one and the oscillation is faster.
\begin{tikzpicture}[>=stealth, font=\small, scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (0,0) -- (7.0,0) node[right, font=\footnotesize] {time};
\draw[->, black] (0,0) -- (0,3.0) node[above, font=\footnotesize] {transition prob.};
\node[font=\footnotesize, anchor=east] at (0,2.6) {$1$};
\node[font=\footnotesize, anchor=east] at (0,1.3) {$\tfrac{1}{2}$};
\draw[dashed, black] (0,2.6) -- (7.0,2.6);
% on resonance: sin^2(pi*x/2.6) reaching 1; period tuned to fill
\draw[very thick, acc] plot[domain=0:6.8, samples=120]
  ({\x}, {2.6*(sin(deg(3.1416*\x/2.6)))^2});
% off resonance: smaller amplitude 0.45, faster
\draw[very thick, dashed, black] plot[domain=0:6.8, samples=140]
  ({\x}, {2.6*0.42*(sin(deg(3.1416*\x/1.55)))^2});
\node[text=acc, font=\footnotesize, anchor=south west] at (0.35,2.62) {on resonance};
\node[text=black, font=\footnotesize, anchor=south west] at (4.4,1.15) {detuned};
\end{tikzpicture}
$$

## The resonance lineshape

Fix the pulse so that on resonance it is a $\pi$-pulse, or simply read the maximum
of the Rabi oscillation, and scan the drive frequency. The peak flip probability

$$
P_{\max}(\omega) = \frac{\omega_1^2}{(\omega-\omega_0)^2 + \omega_1^2}
$$

is a **Lorentzian** centered at $\omega = \omega_0$ with full width at half maximum
$2\omega_1$. The response peaks sharply when the drive matches the level splitting.
Locating the center measures $\omega_0 = \gamma B_0$, hence the field $B_0$ (as in
magnetometry and MRI) or the moment $\gamma$ (as in precision measurements of
$g$-factors). The width is set by the drive strength here; in practice it is
broadened further by relaxation, and the observed linewidth reports on the
spin's coupling to its environment.

$$
% caption: The peak transition probability versus drive frequency is a Lorentzian
% centered at the Larmor frequency omega_0 with full width 2*omega_1; scanning the
% drive locates the resonance and hence the field or the gyromagnetic ratio.
\begin{tikzpicture}[>=stealth, font=\small, scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->, black] (0,0) -- (7.0,0) node[right, font=\footnotesize] {drive frequency};
\draw[->, black] (0,0) -- (0,3.0) node[above, font=\footnotesize] {peak transition};
\node[font=\footnotesize, anchor=east] at (0,2.6) {$1$};
\node[font=\footnotesize, anchor=east] at (0,1.3) {$\tfrac{1}{2}$};
% Lorentzian centered at x=3.5, width param w=0.8
\draw[very thick, acc] plot[domain=0:7.0, samples=160]
  ({\x}, {2.6*0.64/((\x-3.5)^2 + 0.64)});
\draw[dashed, black] (3.5,0) -- (3.5,2.6);
\node[font=\footnotesize, anchor=north] at (3.5,0) {resonance};
% half-width markers
\draw[dashed, black] (0,1.3) -- (7.0,1.3);
\draw[<->, black] (2.7,1.3) -- (4.3,1.3);
\node[font=\footnotesize, anchor=south] at (3.5,1.32) {full width};
\end{tikzpicture}
$$

## The Bloch equations and relaxation

Precession plus relaxation gives the phenomenological description of a real spin
ensemble. Writing $\vec M = N\langle\vec\mu\rangle$ for the magnetization of $N$
spins, the precession law $\d\vec M/\d t = \gamma\,\vec M\times\vec B$ acquires two
damping terms,

$$
\frac{\d M_z}{\d t} = \gamma(\vec M\times\vec B)_z - \frac{M_z - M_0}{T_1},
\qquad
\frac{\d M_{\perp}}{\d t} = \gamma(\vec M\times\vec B)_\perp - \frac{M_\perp}{T_2},
$$

the **Bloch equations**. $T_1$ is the longitudinal (energy) relaxation time toward
the equilibrium magnetization $M_0$, and $T_2$ is the transverse (phase) coherence
time. Their measurement is the basis of magnetic-resonance contrast: different
tissues have different $T_1$ and $T_2$, and the imaging sequence turns those into
image intensity.[^ct-nmr] The isolated two-level dynamics — precession, Rabi
flopping, and the Lorentzian resonance — is the coherent core beneath that
applied machinery, and the same mathematics governs the driven qubit taken up in
the [next lesson](/quantum-mechanics/spin/two-level-systems-and-the-bloch-sphere).

[^gs-larmor]: Griffiths & Schroeter, _Introduction to Quantum Mechanics_, 3rd ed.
(Cambridge, 2018), §4.4.2. The sign of $\gamma$ fixes the sense of precession and
which spin state lies lower; for the electron $\gamma < 0$, so $\lvert +\rangle$
(spin up) is the ground state in a field along $+z$.

[^codata-gyro]: Values from CODATA/NIST: the electron and proton gyromagnetic
ratios and the Bohr magneton are tabulated at
[physics.nist.gov/cuu/Constants](https://physics.nist.gov/cuu/Constants/). The
proton value $\gamma_p/2\pi \approx 42.577\ \mathrm{MHz/T}$ underlies clinical MRI
at $B_0 \sim 1.5$–$3\ \mathrm{T}$.

[^ct-nmr]: Cohen-Tannoudji, Diu & Laloë, _Quantum Mechanics_, Vol. I (Wiley,
1977), Ch. IV and its magnetic-resonance complements. The Bloch equations are
phenomenological: $T_1$ and $T_2$ encode the coupling to the lattice and to
neighboring spins, not the coherent single-spin dynamics.
