NMR and MRI physics · Introductory

Boltzmann spin polarization

Written by SignalsLab

Early edition: these lessons are being reviewed.

Content

Summary

In a magnetic field, nuclear spins such as hydrogen protons split into a lower-energy and a higher-energy state. The Boltzmann distribution says the lower state is only very slightly more populated, and this tiny excess, the polarization, is the source of the NMR and MRI signal.

Intuition

Imagine a huge crowd of tiny compass needles shaken constantly by thermal motion. The magnetic field tries to line them up, while heat keeps scrambling them. For protons at body temperature in a clinical scanner, thermal energy is vastly larger than the magnetic energy gap, so the spins are almost evenly split. Only a few per million tip the balance toward the low-energy state. That small surplus adds up to a net magnetization. Because there are so many protons in tissue, even this tiny fraction gives a measurable signal. Stronger fields or lower temperatures widen the energy gap and increase polarization.

Key equations

ΔE=γℏB0
(1)

Energy gap between the two proton spin states in field B0, with gyromagnetic ratio γ.

NβNα=e−ΔE/kBT
(2)

Boltzmann ratio of upper-state to lower-state populations.

P=Nα−NβNα+Nβ=tanh⁡(γℏB02kBT)
(3)

Spin polarization for spin-1/2 nuclei.

P≈γℏB02kBT
(4)

High-temperature approximation, valid when the energy gap is much smaller than kT.

Derivation

  1. Start with two levels separated by energy ΔE = γħB0.
  2. The Boltzmann law gives Nβ/Nα = exp(-ΔE/kT).
  3. Define polarization P = (Nα - Nβ)/(Nα + Nβ).
  4. Divide numerator and denominator by Nα and let x = ΔE/kT: P = (1 - e^{-x})/(1 + e^{-x}).
  5. Multiply top and bottom by e^{x/2}: P = (e^{x/2} - e^{-x/2})/(e^{x/2} + e^{-x/2}) = tanh(x/2).
  6. For x much less than 1, tanh(x/2) ≈ x/2, so P ≈ γħB0/(2kT).

Worked example

Problem

Estimate the proton polarization at 3 T and 310 K. Use γ = 2.675×10^8 rad s^-1 T^-1, ħ = 1.055×10^-34 J s, k = 1.381×10^-23 J/K.

  1. Compute ΔE = γħB0 = 2.675e8 × 1.055e-34 × 3 = 8.47e-26 J.
  2. Compute kT = 1.381e-23 × 310 = 4.28e-21 J.
  3. x = ΔE/kT = 8.47e-26 / 4.28e-21 = 1.98e-5.
  4. P ≈ x/2 = 9.9e-6.

Answer About 1×10^-5, i.e. roughly 10 extra spins in the low-energy state per million protons.

Common mistakes

  • Thinking nearly all spins align with the field; in fact the excess is only parts per million.
  • Forgetting the factor of 2 in P ≈ x/2 (population ratio difference versus polarization).
  • Using Celsius instead of kelvin for temperature.
  • Confusing the energy gap with the Larmor frequency; they are related by ΔE = hν but are not the same quantity.
  • Assuming the spins in the upper state are absent; both states are populated.

Animation

Animation coming soon

The animated version of this lesson is being prepared for the web. In the Signals AI app, lessons are drawn step by step.

Code

scene.py(70 lines)
import sys
import numpy as np
from manim import *
from blocks import *

# Physical constants (SI)
HBAR = 1.054571817e-34
KB = 1.380649e-23
GAMMA = 2.675221874e8  # 1H gyromagnetic ratio, rad/s/T
T_BODY = 310.0


def polarization(B, T=T_BODY, gamma=GAMMA):
    """Spin-1/2 polarization P = tanh(gamma*hbar*B / (2 kB T))."""
    return np.tanh(gamma * HBAR * B / (2 * KB * T))


def populations(B, T=T_BODY):
    """Return (lower, upper) populations from Boltzmann factors."""
    x = GAMMA * HBAR * B / (KB * T)
    up = np.exp(-x / 2)
    dn = np.exp(x / 2)
    z = up + dn
    return dn / z, up / z


class Main(Scene):
    def construct(self):
        # Title
        TitleCard(self, "Boltzmann polarization", "Spin-1/2 in a magnetic field")

        # Computed curve: P in ppm vs B in tesla
        Bs = np.linspace(0, 10, 200)
        ppm = lambda B: polarization(B) * 1e6
        plot = CurvePlot(ppm, x_range=(0, 10, 2), y_range=(0, 40, 10),
                         x_label="B0 (T)", y_label="P (ppm)",
                         color=C_ACCENT, x_length=7.0, y_length=4.2)
        plot.shift(LEFT * 2.3 + DOWN * 0.2)
        self.play(Create(plot.axes), Write(plot.labels))
        self.play(Create(plot.curve), run_time=2)

        # Formula
        eq = MathTex(r"P=\tanh\!\left(\frac{\gamma\hbar B_0}{2k_BT}\right)", font_size=32)
        eq.to_edge(RIGHT, buff=0.5).shift(UP * 1.8)
        self.play(Write(eq))

        # Mark 1.5 T and 3 T
        out = VGroup()
        for B, col in [(1.5, C_MAIN), (3.0, C_GOOD)]:
            d = plot.dot_at(B, color=col)
            lab = Text(f"{B} T: {ppm(B):.1f} ppm", font_size=24, color=col)
            out.add(VGroup(d, lab))
        out[0][1].next_to(eq, DOWN, buff=0.6).align_to(eq, LEFT)
        out[1][1].next_to(out[0][1], DOWN, buff=0.3).align_to(eq, LEFT)
        for g in out:
            self.play(FadeIn(g[0], scale=2), Write(g[1]))

        StepCaption(self, "Only a few spins per million line up: stronger B0 gives more signal.")
        self.wait(1.5)


if __name__ == "__main__" and "--selftest" in sys.argv:
    assert abs(polarization(0.0)) < 1e-15
    p15 = polarization(1.5) * 1e6
    assert 4.5 < p15 < 6.0, p15
    assert abs(polarization(3.0) / polarization(1.5) - 2) < 1e-3
    lo, up = populations(3.0)
    assert abs(lo + up - 1) < 1e-12 and lo > up
    assert abs((lo - up) - polarization(3.0)) < 1e-12
    print("ok")

The Manim scene code that draws this lesson's animation in the Signals AI app (Python, Manim Community).

ccBYNC© 2026 SignalsLab. Lesson text shared as is under CC BY-NC 4.0.