
# Nuclear Magnetic Resonance & Imaging

> A nucleus is $10^{-15}$ m across and buried inside an atom, and yet a hospital down the road turns
> billions of them over on command, twice a second, and reads back a picture of your brain. The trick
> is entirely in this course's toolkit: precession, resonance, and a magnetic field that tells the
> truth about position.

## Learning Objectives

After this lesson you will be able to:

1. Explain why flipping a nuclear spin requires a transverse field that *rotates*, and state the **resonance** condition $\omega = \gamma B_0$.
2. Construct the **rotating frame**, derive the effective field $\mathbf{B}_{\text{eff}}$, and solve for Rabi flopping on and off resonance.
3. Compute pulse durations: show that the flip angle is $\gamma B_1 t$, and design $\pi/2$ and $\pi$ pulses from realistic hardware numbers.
4. Explain the **chemical shift**, read an ethanol spectrum, and state the field homogeneity a chemical-shift measurement demands.
5. Describe the **spin echo** and distinguish $T_1$, $T_2$, and $T_2^{*}$.
6. Show how a linear **field gradient** converts frequency into position, explain what an MRI machine actually measures, and describe how blood flow is imaged.

---

## Intuition

> **A note on where you are.** Freericks' §2.4 is independent of §2.3 — nothing here uses entanglement,
> Bell inequalities, or the analyzer loop. What it *does* use is the very first thing this course
> established: a magnetic moment tied to an angular momentum precesses about a magnetic field at the
> Larmor rate. If you skipped straight to this lesson, R.1.1 is the only prerequisite, and this is the
> lesson where that precession stops being an obstacle to be averaged away and becomes the instrument.

Everything in R.1 treated precession as a nuisance we had to understand in order to trust the
Stern-Gerlach apparatus. Here it becomes the whole point. We want to reach into a sample, take hold of
the spin of a hydrogen nucleus, and turn it over — without touching it, because it is a proton, and
without heating the sample, because in the medical case the sample is a person.

The only handle we have is a magnetic field, and the only thing a field does to a spin is make it
precess. So the plan writes itself: a spin sitting along $\hat z$ will tip over if we make it precess
about a horizontal axis. Apply a horizontal field and wait a half-turn.

That plan fails immediately, and the reason it fails is the interesting part. There is already a large
vertical field $B_0$ present — we need it, for reasons that will become clear — and the spin is already
whipping around it at the Larmor rate, typically tens of megahertz. From the spin's point of view a
*static* horizontal field is not horizontal at all: it sweeps past at $63$ million times a second,
pushing the spin one way and then the other, so the net effect over any appreciable time is nothing.
The spin just wobbles.

The fix is the whole subject. Make the horizontal field *rotate*, at exactly the frequency at which
the spin is already precessing. Then, in a frame turning along with the spin, the transverse field
stands still, and the spin can precess about it steadily and tip over. That matching condition is
**resonance**, and it is why the technique is called nuclear magnetic *resonance* [Fre, §2.4].

Get resonance right and everything else follows: the frequency you must supply tells you about the
local field, which tells you about chemistry (the chemical shift) and, if you deliberately make the
field vary across the sample, about *position*. That last step is magnetic resonance imaging, and it
is one line of algebra away.

---

## Theory

### Precession, for a nucleus

From R.1.1: a magnetic moment tied to angular momentum by $\boldsymbol\mu = \gamma\mathbf{S}$ obeys
$d\mathbf{S}/dt = \gamma\,\mathbf{S}\times\mathbf{B}$, which preserves $|\mathbf{S}|$ and the component
along $\mathbf{B}$, leaving precession about the field at the **Larmor frequency** $\omega_0 = \gamma B_0$.
Nothing changes for a nucleus except the numerical value of $\gamma$, which is smaller than the
electron's by roughly the mass ratio. For the proton — a spin-$\tfrac12$ nucleus, and the one that
matters, since the human body is mostly water and fat —

$$
\frac{\gamma_p}{2\pi} = 42.58\ \text{MHz/T} .
$$

So a $1.5$ T clinical magnet puts protons at $63.9$ MHz and a $3$ T magnet at $127.7$ MHz: the FM band
and just above it. This is why the transverse field is supplied by *radio waves*. A circularly
polarized radio wave is precisely a magnetic field vector rotating in a plane, and tuning the
transmitter tunes the rotation rate.

One number is worth having before we go on, because it explains the entire engineering of the field.
The two spin states differ in energy by $\hbar\omega_0$, and at body temperature the thermal population
difference is

$$
\frac{\hbar\omega_0}{2k_BT}
= \frac{(1.055\times10^{-34})(2\pi\times 63.9\times10^6)}{2(1.381\times10^{-23})(310)}
\approx 5\times10^{-6} ,
$$

five parts per million. Only that tiny excess contributes any signal at all; the rest cancels. NMR
works only because a cubic centimetre of water holds about $7\times10^{22}$ protons, so five parts per
million is still $3\times10^{17}$ spins. It also explains why the magnet is enormous and expensive:
signal scales with $B_0$ through the polarization *and* through the induced voltage, so roughly as
$B_0^2$, and there is no cheap substitute.

### The rotating frame

Now the central calculation. Apply a static field along $\hat z$ and a transverse field of magnitude
$B_1$ rotating in the $x$–$y$ plane at angular frequency $\omega$, in the same sense as the precession:

$$
\mathbf{B}(t) = B_0\hat z + B_1\bigl(\cos\omega t\,\hat x - \sin\omega t\,\hat y\bigr) .
$$

This is a time-dependent problem and looks unpleasant. Move to a frame rotating about $\hat z$ at the
same rate $\omega$, so that the transverse field is stationary in it. A vector's rate of change in the
two frames differs by the frame's rotation, and applying that to $\mathbf{S}$ turns the equation of
motion into a static one:

$$
\left(\frac{d\mathbf{S}}{dt}\right)_{\text{rot}} = \gamma\,\mathbf{S}\times\mathbf{B}_{\text{eff}},
\qquad
\mathbf{B}_{\text{eff}} = \left(B_0 - \frac{\omega}{\gamma}\right)\hat z + B_1\hat x' ,
$$

with $\hat x'$ the (now stationary) direction of the transverse field. The rotation has *subtracted*
$\omega/\gamma$ from the vertical field — the frame's own turning does part of the precession for us,
and only the remainder is left to act.

The physics is now visible by inspection. Define the **detuning** $\Delta = \omega_0 - \omega$ and the
**Rabi frequency** $\omega_1 = \gamma B_1$. Then $\gamma\mathbf{B}_{\text{eff}} = \Delta\hat z + \omega_1\hat x'$,
and in the rotating frame the spin simply precesses about that fixed axis at rate

$$
\Omega = \sqrt{\Delta^2 + \omega_1^2} .
$$

*On resonance*, $\omega = \omega_0$ so $\Delta = 0$: the vertical part cancels exactly, the effective
field is purely transverse, and the spin precesses about $\hat x'$ at $\omega_1$. Starting from
$\lvert{+z}\rangle$ it tips smoothly down through the $x'$–$z$ plane,

$$
\langle S_z\rangle(t) = \frac{\hbar}{2}\cos\left(\omega_1 t\right) ,
\qquad
P(-z, t) = \sin^2\!\left(\frac{\omega_1 t}{2}\right) ,
$$

reaching $-\hbar/2$ at $\omega_1 t = \pi$ and returning at $2\pi$. This periodic turning over and back
is **Rabi flopping**. Note that even in the rotating frame nothing has been "pushed"; the spin is doing
the only thing it can do, precessing, about an axis we manufactured.

*Off resonance*, the effective field is tilted out of the plane by an angle $\beta$ with
$\sin\beta = \omega_1/\Omega$, so the spin precesses on a cone that no longer reaches the south pole:

$$
P(-z, t) = \frac{\omega_1^2}{\omega_1^2 + \Delta^2}\,\sin^2\!\left(\frac{\Omega t}{2}\right) .
$$

The prefactor is a Lorentzian in the detuning with half-width $\Delta = \omega_1$. That single formula
carries the whole story: the flip is complete only exactly on resonance, and off resonance the spin
merely nods — Freericks' "dips down and up a little bit." It also tells us the **linewidth**: a stronger
drive flips faster but responds over a wider range of frequencies, so sharp spectroscopy needs weak,
long pulses and fast control needs strong, short ones. That trade-off runs through every qubit control
problem in Term 4.

### When to stop

The flip angle after a resonant pulse of duration $t$ is

$$
\alpha = \omega_1 t = \gamma B_1 t .
$$

A $\pi/2$ *pulse* ($\alpha = 90°$) tips a spin from the axis into the transverse plane, where it
precesses and induces a voltage in a pickup coil — this is how the signal is created. A $\pi$ *pulse*
($\alpha = 180°$) inverts it completely.

Freericks makes a question of this [Fre, §2.4.4], and it is worth answering sharply because the wrong
answer is very tempting. **The duration depends on $B_1$, not on $B_0$.** The big field sets the
*frequency* you must transmit at; the little field sets *how long* you must transmit for. They are
independent knobs, and conflating them is the commonest confusion in the subject.

Numbers, for a typical $B_1 = 10\ \mu$T:

$$
\frac{\omega_1}{2\pi} = 42.58\times10^{6}\times10^{-5} = 426\ \text{Hz},
\qquad
t_{\pi} = \frac{\pi}{\gamma B_1} = \frac{1}{2\times426} = 1.17\ \text{ms},
$$

with $t_{\pi/2} = 587\ \mu$s. So the carrier oscillates at $64$ MHz while the envelope lasts about a
millisecond — some $75{,}000$ carrier cycles inside one pulse. The two timescales are utterly separated,
which is exactly what makes the rotating-frame picture so accurate.

### The chemical shift

If every proton in the sample felt exactly $B_0$, NMR would be a one-line experiment. They do not. The
electrons around a nucleus circulate in the applied field and generate a small opposing field of their
own, so the nucleus feels

$$
B_{\text{local}} = B_0\,(1 - \sigma) ,
\qquad
\omega_0 = \gamma B_0 (1 - \sigma) ,
$$

where the shielding constant $\sigma$ is set by the chemical environment. The resulting shift in
resonance frequency is the **chemical shift**, quoted in parts per million of the carrier so that it is
the same number on any spectrometer. It is typically $0$–$10$ ppm for protons: at a $400$ MHz
instrument, $1$ ppm is $400$ Hz.

The classic demonstration is ethanol, $\mathrm{C_2H_5OH}$, whose six hydrogens fall into three
chemically distinct groups — the three on the methyl carbon, the two on the carbon next to the oxygen,
and the one bonded to the oxygen itself. A low-resolution spectrum shows three peaks with areas in the
ratio $3:2:1$, which counts the hydrogens in each group directly. That alone is a structural
fingerprint.

At higher resolution each peak splits further, because each group of protons feels the small magnetic
fields of its *neighbours'* nuclear spins. The methyl peak becomes a triplet (three sublines) and the
neighbouring pair becomes a quartet (four). The pattern follows the "$n+1$ rule": a group with $n$
equivalent neighbouring spin-$\tfrac12$ nuclei splits into $n+1$ lines, because $n$ spin-$\tfrac12$
neighbours have $n+1$ distinguishable total projections. The methyl group has two neighbours, so
$2 + 1 = 3$; the pair has three neighbours, so $3 + 1 = 4$. The hydroxyl proton exchanges rapidly
between molecules and typically shows as a single, solvent-dependent line whose position wanders.

This is why chemists care. The peak positions identify the functional groups, the areas count the
nuclei, and the splitting patterns reveal which groups are bonded to which — a molecular structure read
straight off a frequency axis.

It also sets a punishing hardware requirement, which is the substance of two of Freericks' problems
[Fre, §§2.4.3, 2.4.5]. Resolving $0.1$ ppm demands that $B_0$ be uniform across the sample to one part
in $10^7$, or about a microtesla in a $9.4$ T magnet. If the field is *less* uniform than the shift you
are trying to see, every peak broadens into a smear and the chemical shift is simply lost — the sample
is reporting the magnet's imperfections rather than its own chemistry. Hence shim coils, spinning
sample tubes, and a great deal of money.

### The spin echo

Field inhomogeneity is not only a spectroscopy problem; it also destroys the signal in the time domain,
and Hahn's 1950 fix for it is one of the prettiest tricks in physics.

Start with the spins along $\hat z$ and apply a $\pi/2$ pulse to lay them into the transverse plane,
where they precess together and induce a signal. They do not stay together. Each sits in a slightly
different local field, so each precesses at a slightly different rate, and the fan of spin vectors
*dephases* — splays out around the circle — until they point in all directions and the net signal is
gone. The characteristic time for this is called $T_2^{*}$, and most of it is the magnet's fault.

Now wait a time $\tau$ and apply a $\pi$ pulse about the same transverse axis. This reflects the whole
fan: the spins that had run ahead are now behind by exactly as much as they had gained. But each spin
is still in *its own* local field, so each keeps its own rate — the fast ones are still fast. After a
second interval $\tau$, every spin has made up exactly the deficit it was given, and the whole fan
converges: the signal reappears as a **spin echo** at time $2\tau$.

```mermaid
flowchart LR
    A["spins along z"] -->|"pi/2 pulse"| B["all in the<br/>transverse plane"]
    B -->|"evolve tau"| C["dephased fan<br/>fast ahead of slow"]
    C -->|"pi pulse"| D["fan reflected<br/>fast now behind"]
    D -->|"evolve tau"| E["refocused<br/>ECHO at 2 tau"]
```

The beauty of it is that we never needed to know what the local fields were. Any *static* spread of
precession rates is undone, whatever its cause. What is not undone is anything that changes between the
two intervals — a spin that diffuses into a different field, or that exchanges energy with its
surroundings. So the echo amplitude decays as $\tau$ is lengthened, and the time constant of that decay
is the genuine, irreducible transverse relaxation time $T_2$:

$$
\frac{1}{T_2^{*}} = \frac{1}{T_2} + \gamma\,\frac{\Delta B_0}{2} ,
$$

the second term being the recoverable part. Separately, the spins also drift back toward $\hat z$,
because that is the low-energy direction and energy leaks into the surroundings; the time constant for
the *longitudinal* magnetization to recover is $T_1$. The two are physically different — $T_1$ requires
energy exchange, $T_2$ only phase scrambling — so $T_2 \le 2T_1$ always. In a mobile liquid the
molecular tumbling averages the local fields so effectively that the two nearly coincide; in solids and
in tissue $T_2$ is far shorter. Brain white matter at $1.5$ T has $T_1 \approx 700$ ms and
$T_2 \approx 80$ ms, while cerebrospinal fluid has $T_1 \approx 4$ s and $T_2 \approx 2$ s. **Those
differences are the contrast in an MRI image** — the machine is not photographing anatomy, it is
photographing relaxation times.

### From spectroscopy to imaging

Everything so far demanded a uniform field. Imaging is what you get by deliberately ruining that, in a
controlled way [Fre, §2.4.6].

Superimpose on $B_0$ a **field gradient** $G$, a small field that grows linearly with position:

$$
B(z) = B_0 + G z
\quad\Longrightarrow\quad
\omega(z) = \gamma\left(B_0 + G z\right) .
$$

Precession frequency is now a linear function of position. Since the received signal's amplitude at
each frequency counts the spins precessing at that frequency, **the measured spectrum is the projection
of the proton density along $z$.** Frequency has become a ruler. Rotate the gradient direction, take
another projection, repeat, and reconstruct the density from its projections exactly as a CT scanner
does — which is what Lauterbur did in 1973, and what Mansfield turned into a fast, practical
slice-by-slice method.

A real scanner uses three gradients and gets the job done in one pass per line:

- **Slice selection.** Apply $G_z$ during a shaped RF pulse of bandwidth $\Delta f$. Only spins in the slab where $\omega(z)$ falls inside the pulse's band are excited, a slab of thickness $\Delta z = 2\pi\Delta f/(\gamma G_z)$. Everything outside is untouched.
- **Frequency encoding.** Apply $G_x$ while the signal is read out, so position along $x$ maps to frequency and one Fourier transform of the recorded signal gives a whole line.
- **Phase encoding.** Apply $G_y$ briefly *before* readout so that spins acquire a position-dependent phase, and step its strength from one repetition to the next. The set of readouts then samples a two-dimensional grid, and a 2D inverse FFT gives the image.

Formally the machine measures the Fourier transform of the spin density, $S(\mathbf{k}) = \int \rho(\mathbf{r})\,e^{-i\mathbf{k}\cdot\mathbf{r}}\,d^3r$
with $\mathbf{k} = \gamma\int\mathbf{G}\,dt$, and the gradients steer a trajectory through that
$\mathbf{k}$-space. Resolution follows from arithmetic: with $G = 10$ mT/m the frequency changes by
$\gamma G/2\pi = 426$ Hz per millimetre, so resolving $1$ mm requires resolving $426$ Hz, which requires
reading out for at least $1/426 \approx 2.3$ ms. Stronger gradients buy resolution or speed; they also
demand fearsome amplifiers and are the source of the famous banging noise, as the coils flex against
$B_0$.

*Why linear?* Any *monotonic* field profile assigns a unique frequency to each position, so an image
could in principle be recovered. Linearity is what makes the recovery a plain Fourier transform: the
$\mathbf{k}$-space samples are then uniformly spaced and the reconstruction is an FFT rather than a
warped, non-uniform inversion that costs resolution and signal-to-noise. A *non-monotonic* profile is
fatal — two different positions share a frequency and no algorithm can separate them, which is exactly
what a badly shimmed magnet does to the edges of its bore.

### Blood flow, and fMRI

Freericks asks whether motion spoils the imaging [Fre, §2.4.7]. It changes it, and the changes are more
useful than the damage.

The complication is real: a proton that moves between excitation and readout is encoded at one position
and detected at another, producing blurring and, with pulsatile flow, ghost images repeated across the
picture. Cardiac gating and flow-compensating gradient shapes exist precisely to suppress this.

But the same sensitivity is a measurement. In **time-of-flight** angiography, repeated rapid pulses
saturate the stationary spins in a slice — they never fully recover between pulses — while blood
flowing into the slice arrives fully relaxed and gives a much larger signal. Vessels light up against a
dark background with no contrast agent at all. In **phase-contrast** imaging, a bipolar gradient pulse
(equal and opposite lobes) returns static spins to zero net phase while a spin moving along the
gradient accumulates a phase proportional to its velocity, so the phase map *is* a velocity map,
signed and quantitative.

Functional MRI adds one more layer. Haemoglobin carrying oxygen is diamagnetic; without it,
deoxyhaemoglobin is paramagnetic and distorts the local field around each vessel, shortening $T_2^{*}$
and darkening the image. When a region of the brain becomes active, blood flow to it increases by more
than the extra oxygen consumed, so the *fraction* of deoxyhaemoglobin falls, $T_2^{*}$ lengthens, and
the signal rises — by a few percent at $3$ T. This is the **BOLD** contrast (blood-oxygen-level
dependent), and it is worth being clear about what it is: an indirect, haemodynamic proxy for neural
activity, lagging it by four to six seconds, not a picture of thought. Other nuclei give other windows;
phosphorus-31 spectroscopy, for instance, tracks ATP and phosphocreatine and so reports on metabolism
directly.

### Why this belongs in a quantum computing curriculum

NMR is not a detour. It is the oldest and most refined technology for controlling individual quantum
two-level systems, and essentially every technique used to drive a superconducting or trapped-ion qubit
was invented by NMR spectroscopists first: resonant $\pi$ and $\pi/2$ pulses, composite pulses robust
against amplitude errors, spin echo and its multi-pulse descendants (now called dynamical decoupling),
Ramsey interferometry, and the $T_1/T_2$ vocabulary in which every qubit datasheet is written.

It was also, briefly, the leading quantum computing platform. In 2001 Vandersypen and collaborators ran
Shor's algorithm on a seven-spin molecule and factored 15, using exactly the pulse sequences described
above. Liquid-state NMR quantum computing then hit a wall, and the reason is the five-parts-per-million
number from the start of this lesson: the usable signal from a thermal ensemble falls off exponentially
with the number of qubits, so the approach does not scale past about a dozen. The control physics
survived the platform and is now everywhere — see
[1.6.2 Two-Level Dynamics & Rabi Oscillations](../../term-1-quantum-mechanics/c06-dynamics/02-two-level-rabi.md)
for the same Hamiltonian done as quantum dynamics, and Term 4's hardware course for its descendants.

---

## Hands-on (Python)

```python
import numpy as np

gamma_2pi = 42.58e6          # proton gyromagnetic ratio / 2pi, Hz/T

# --- 1. Larmor frequencies and pulse durations ---------------------------
print(" B0 (T)   f0 (MHz)")
for B0 in (0.5, 1.5, 3.0, 9.4):
    print(f"  {B0:4.1f}    {gamma_2pi * B0 / 1e6:8.2f}")

print("\n B1 (uT)   f1 (Hz)   t_pi/2 (us)   t_pi (us)")
for B1 in (1e-6, 1e-5, 1e-4):
    f1 = gamma_2pi * B1                       # Rabi frequency in Hz
    print(f"  {B1*1e6:5.0f}    {f1:8.1f}   {1/(4*f1)*1e6:9.1f}   {1/(2*f1)*1e6:8.1f}")
# The frequency comes from B0; the DURATION comes from B1 alone.

# --- 2. Rabi flopping, on and off resonance ------------------------------
def p_flip(t, w1, delta):
    Om = np.hypot(w1, delta)
    return (w1**2 / Om**2) * np.sin(Om * t / 2) ** 2

w1 = 2 * np.pi * 426.0                        # rad/s, for B1 = 10 uT
t_pi = np.pi / w1
print(f"\n detuning/w1   P(flip) at t = t_pi   max possible flip")
for r in (0.0, 0.5, 1.0, 2.0, 5.0):
    d = r * w1
    grid = np.linspace(0, 20 * t_pi, 20001)
    print(f"   {r:5.1f}         {p_flip(t_pi, w1, d):.4f}              "
          f"{p_flip(grid, w1, d).max():.4f}")
# On resonance the flip is complete; at a detuning of one Rabi frequency the
# best achievable flip is already only 1/2 -- a Lorentzian of half-width w1.

# --- 3. Spin echo: refocusing a static spread of rates -------------------
rng = np.random.default_rng(0)
N, tau = 20000, 5e-3
dw = 2 * np.pi * rng.normal(0, 40.0, N)       # +/- 40 Hz static inhomogeneity

def coherence(phases):
    return abs(np.mean(np.exp(1j * phases)))

free = dw * 2 * tau                            # no pi pulse: dephase for 2 tau
echo = dw * tau - dw * tau                     # pi pulse at tau flips the sign
print(f"\nsignal after 2 tau, free induction : {coherence(free):.4f}")
print(f"signal after 2 tau, with pi pulse  : {coherence(echo):.4f}")
# ~0.03 vs exactly 1: the static spread is undone without ever measuring it.

# --- 4. Gradient encoding: the spectrum IS the projection ----------------
G = 10e-3                                      # T/m
z = np.linspace(-0.10, 0.10, 400)              # 20 cm field of view
rho = (np.abs(z) < 0.06) * 1.0                 # a slab ...
rho += (np.abs(z - 0.02) < 0.01) * 1.5         # ... with a bright inclusion
f = gamma_2pi * G * z                          # frequency assigned to position
print(f"\nfrequency ruler        : {gamma_2pi * G / 1e3:.1f} kHz per metre"
      f"  =  {gamma_2pi * G / 1e3 * 1e-3:.3f} kHz per mm")
print(f"readout time for 1 mm  : {1 / (gamma_2pi * G * 1e-3) * 1e3:.2f} ms")
print(f"bandwidth over 20 cm   : {(f.max() - f.min()) / 1e3:.1f} kHz")
# Reading the spectrum back out recovers rho(z) exactly, because the map
# z -> f is linear and therefore invertible with a plain Fourier transform.
```

---

## Exercises

**E1 (easy).** A scanner runs at $B_0 = 3$ T. **(a)** What radio frequency flips protons? **(b)** The
same scanner is used for sodium-23, with $\gamma/2\pi = 11.26$ MHz/T. What frequency does that need?
**(c)** If the transmitter is left tuned to the proton frequency, what happens to the sodium nuclei?

<details><summary>Solution</summary>

**(a)** $f_0 = 42.58 \times 3 = 127.7$ MHz.

**(b)** $f_0 = 11.26 \times 3 = 33.8$ MHz — a completely different band. Different nuclei are addressed
by different frequencies in the *same* magnet, which is what makes multinuclear spectroscopy possible
without changing hardware.

**(c)** Essentially nothing. The detuning is $\Delta/2\pi \approx 94$ MHz while a typical Rabi frequency
is a few hundred hertz, so the maximum achievable flip is
$\omega_1^2/(\omega_1^2 + \Delta^2) \sim (426/9.4\times10^7)^2 \approx 2\times10^{-11}$. The sodium spins
wobble by an unmeasurable amount and stay put. Resonance is extraordinarily selective.
</details>

**E2 (easy).** A pulse of $B_1 = 20\ \mu$T is applied on resonance. How long must it last to be a $\pi/2$
pulse? A $\pi$ pulse? If the amplifier delivers only half the intended $B_1$ but the timing is unchanged,
what flip angle results, and what fraction of the intended signal does a "$\pi/2$" pulse produce?

<details><summary>Solution</summary>

$\omega_1/2\pi = 42.58\times10^6\times 2\times10^{-5} = 852$ Hz. A $\pi/2$ pulse needs
$\omega_1 t = \pi/2$, i.e. $t = 1/(4\times852) = 293\ \mu$s; a $\pi$ pulse needs $587\ \mu$s.

At half amplitude the flip angle halves: the "$\pi/2$" pulse delivers $45°$. The transverse
magnetization it creates is $\sin\alpha$ of the full value, so $\sin 45° = 0.707$ — about 71% of the
intended signal, a 29% loss from a 50% amplitude error. Small errors cost far less than that, because
$\sin\alpha$ is stationary at $\alpha = 90°$: a $5\%$ amplitude error loses only
$1 - \sin(85.5°) = 0.3\%$ of the signal. A $\pi$ pulse enjoys no such protection — its error is first
order — which is why composite pulses were invented to protect inversions rather than excitations.
</details>

**E3 (medium).** A spectrometer operates at $500$ MHz for protons. **(a)** What is $B_0$? **(b)** Two
peaks are separated by $2.1$ ppm; how many hertz apart are they? **(c)** To resolve peaks $0.05$ ppm
apart, how uniform must $B_0$ be across the sample, in tesla? **(d)** What happens to the ethanol
spectrum if the field is ten times less uniform than that?

<details><summary>Solution</summary>

**(a)** $B_0 = 500/42.58 = 11.74$ T.

**(b)** $2.1\ \text{ppm}\times 500\ \text{MHz} = 2.1\times10^{-6}\times5\times10^{8} = 1050$ Hz.

**(c)** Resolving $0.05$ ppm means the *unwanted* spread must be well below $5\times10^{-8}$ of $B_0$:
$\Delta B \lesssim 5\times10^{-8}\times 11.74 = 5.9\times10^{-7}$ T, roughly half a microtesla — about
one hundredth of the Earth's field, across the whole sample volume. This is what shim coils and sample
spinning are for.

**(d)** Each line broadens to about $0.5$ ppm, which is comparable to the spacing of the fine structure.
The triplet and quartet merge into single humps, so the $J$-coupling information — and with it the
bonding topology — is lost. The three main group peaks, separated by more than 1 ppm, survive as broad
bumps, so you would still count $3:2:1$ and identify the functional groups, but you could no longer say
which group is attached to which. Resolution buys structure, not just prettiness.
</details>

**E4 (medium).** Explain the spin echo carefully. **(a)** Why does a $\pi$ pulse refocus a *static*
spread of precession rates? **(b)** Why does it fail to refocus diffusion through an inhomogeneous
field? **(c)** A sample has $T_2 = 90$ ms and, in the scanner's field, $T_2^{*} = 12$ ms. What echo
amplitude survives at $2\tau = 60$ ms, and what would a free-induction signal give at the same time?

<details><summary>Solution</summary>

**(a)** After the first interval, a spin whose offset is $\delta\omega$ has acquired phase
$\delta\omega\,\tau$. The $\pi$ pulse reflects every phase about the pulse axis, sending
$\phi \to -\phi$. During the second interval each spin accumulates $+\delta\omega\,\tau$ again, because
it is still sitting in the same local field, so its total phase is
$-\delta\omega\tau + \delta\omega\tau = 0$ — independently of $\delta\omega$. Every spin returns to the
same phase at once and the signal reappears. Crucially, we never had to know any $\delta\omega$: the
refocusing is automatic.

**(b)** The cancellation relies on each spin experiencing the *same* offset in both intervals. A spin
that diffuses to a different location samples a different field after the pulse, so its two accumulated
phases no longer cancel and it contributes a residual random phase. This is why echo attenuation in a
gradient is used to *measure* diffusion coefficients — the failure of the trick is itself an instrument.

**(c)** The echo decays with the true $T_2$: $e^{-60/90} = e^{-0.667} = 0.513$, so about 51% survives.
A free-induction signal decays with $T_2^{*}$: $e^{-60/12} = e^{-5} = 0.0067$, under 1%. Refocusing
recovers a factor of about 76 in signal here — which is why virtually every clinical sequence is built
on echoes rather than raw free induction.
</details>

**E5 (hard).** Freericks ends the chapter by asking you to explain an MRI machine to a non-specialist
[Fre, §2.4.8]. Do it properly, as a technical brief a competent non-physicist could follow, covering:
**(a)** what the large static field does to a nuclear spin; **(b)** how fast the rotating field must turn
and why; **(c)** what happens when it does; **(d)** why the static field is deliberately made to vary
across the patient, and what would happen if it did not; **(e)** what the machine actually measures when
it makes an image. Include at least three quantitative statements.

<details><summary>Solution</summary>

**(a) The static field.** Every hydrogen nucleus in the body is a tiny magnet carrying angular momentum,
so in a magnetic field it does not line up — it *precesses*, sweeping around the field direction like a
tilted spinning top, at a rate strictly proportional to the field: $42.58$ MHz per tesla. In a $1.5$ T
scanner that is $63.9$ MHz. The field also very slightly biases which way the spins point: about five
nuclei in a million more along the field than against it. That minute imbalance is the entire signal, and
it works only because a cubic centimetre of tissue contains around $7\times10^{22}$ hydrogen nuclei.

**(b) How fast the radio wave must rotate.** To tip a spin over you must make it precess about a
*horizontal* axis, so you apply a horizontal magnetic field — but the spin is already whirling around
the vertical field 64 million times a second, and a horizontal field that stands still averages to
nothing from the spin's point of view. The horizontal field must therefore rotate at exactly the
precession rate, $63.9$ MHz, so that the spin always sees it in the same direction. That matching is
resonance, and a circularly polarized radio wave at the right frequency supplies it.

**(c) What happens.** In a frame rotating with the wave, the vertical field cancels out and the spin
sees only the small horizontal field — about $10\ \mu$T, a ten-thousandth of the main field. It precesses
about *that*, tipping steadily over. Turn the wave off after a quarter turn and the spins lie in the
horizontal plane, where they precess together and induce a measurable voltage in a coil; that is the
signal. The timing follows from the small field alone: at $10\ \mu$T, a half-turn takes about $1.2$ ms.
The big field says what frequency; the little field says how long.

**(d) Why the field is made non-uniform.** With a perfectly uniform field, every hydrogen nucleus in the
body precesses at the same frequency, so the signal is a single tone and tells you only *how much*
hydrogen is present — a single number for the whole patient, with no way to tell head from foot. Adding
a field that increases steadily along the body makes the precession frequency increase steadily too, so
that each slice precesses at its own frequency. Frequency has become a ruler: separating the received
signal into its frequency components separates the body into its slices. With a typical gradient the
frequency changes by about $426$ Hz per millimetre. The gradient must be *linear* so the map from
position to frequency can be inverted by a straightforward Fourier transform; a field that rose and then
fell would give two different places the same frequency, and no amount of computing could tell them
apart.

**(e) What is actually measured.** Not anatomy, and not "hydrogen" alone. The machine records how much
signal comes back from each frequency — hence each location — *and how fast that signal fades*. The
fading times, $T_1$ and $T_2$, differ strongly between tissues: brain white matter has $T_2 \approx 80$
ms while cerebrospinal fluid has $T_2 \approx 2$ s, a factor of 25. By choosing the pulse timings the
operator decides which of those differences dominates the picture, which is why the same patient in the
same machine yields images that look nothing alike. An MRI image is a map of hydrogen density weighted
by relaxation times — and because relaxation is exquisitely sensitive to the molecular environment,
that turns out to be a superb map of soft tissue.
</details>

---

## Checkpoint

1. Why must the transverse field rotate rather than stand still, and what is the resonance condition?
2. Write $\mathbf{B}_{\text{eff}}$ in the rotating frame and describe the motion on and off resonance. What sets the width of the resonance?
3. A pulse must flip a spin from $+z$ to $-z$. What sets its frequency, and what sets its duration?
4. What does a $\pi$ pulse refocus in a spin-echo sequence, and what does it fail to refocus? Distinguish $T_1$, $T_2$, and $T_2^{*}$.
5. How does a linear field gradient turn frequency into position? What would go wrong with a non-monotonic field?

<details><summary>Answers</summary>

1. The spin is already precessing about the large static field at $\omega_0 = \gamma B_0$, so a static transverse field sweeps past it at that rate and its effect averages to nothing. A field rotating at $\omega_0$ stands still in the spin's own rotating frame and can act coherently. The resonance condition is $\omega = \gamma B_0$.
2. $\mathbf{B}_{\text{eff}} = (B_0 - \omega/\gamma)\hat z + B_1\hat x'$, so $\gamma\mathbf{B}_{\text{eff}} = \Delta\hat z + \omega_1\hat x'$. On resonance the vertical part cancels and the spin precesses about $\hat x'$ at $\omega_1 = \gamma B_1$, flipping completely. Off resonance it precesses about a tilted axis at $\Omega = \sqrt{\Delta^2+\omega_1^2}$ and only reaches $\omega_1^2/(\omega_1^2+\Delta^2)$ of a flip — a Lorentzian of half-width $\Delta = \omega_1$, so the drive strength sets the linewidth.
3. The frequency is set by the *static* field, $\omega = \gamma B_0$; the duration by the *rotating* field, $t_\pi = \pi/(\gamma B_1)$. They are independent: at $B_0 = 1.5$ T and $B_1 = 10\ \mu$T the carrier is $63.9$ MHz and the pulse lasts $1.17$ ms.
4. It refocuses any *static* spread of precession rates — magnet inhomogeneity, susceptibility variation — because each spin's phase error is reversed and then re-accumulated identically. It fails on anything that changes between the two intervals: diffusion into a different field, or energy exchange with the surroundings. $T_1$ is the recovery of magnetization along the field (needs energy exchange); $T_2$ is the irreducible loss of transverse phase coherence; $T_2^{*}$ is the faster apparent decay including the recoverable inhomogeneous part, $1/T_2^{*} = 1/T_2 + \gamma\Delta B_0/2$.
5. With $B(z) = B_0 + Gz$ the precession frequency $\omega(z) = \gamma(B_0 + Gz)$ is a linear function of position, so the amplitude at each frequency counts the spins at the corresponding place and the spectrum *is* the projection of the spin density. Linearity makes the inversion a plain Fourier transform. A non-monotonic field maps two different positions to the same frequency, so their signals are irreversibly superimposed and no reconstruction can separate them.

</details>

---

## Further Reading

- **[Fre]** J. K. Freericks, *Quantum Mechanics Done Right*, §2.4 — the NMR/MRI story this lesson follows, with its Nobel-Prize timeline and the "explain the MRI machine" essay problem.
- **[Sak]** Sakurai & Napolitano, §§2.1 and 5.5 — spin precession, the rotating frame, and magnetic resonance as time-dependent perturbation theory.
- **[Gri]** Griffiths & Schroeter, §4.4.3 and Problem 4.50 — Larmor precession and the driven two-level system in wave-mechanics language.
- **[NC]** Nielsen & Chuang, §7.7 — NMR quantum computation: pulse sequences, refocusing, pseudo-pure states, and why the ensemble approach stops scaling.
- **[ER]** Eisberg & Resnick, Ch. 12 — nuclear moments and magnetic resonance in the historical/experimental route.
- E. L. Hahn, "Spin Echoes", *Phys. Rev.* **80**, 580 (1950); L. M. K. Vandersypen et al., *Nature* **414**, 883 (2001) — the echo, and Shor's algorithm on a seven-spin molecule.
- [Classical Stern-Gerlach Experiment](../c01-freericks-intro-quantum-world/01-classical-stern-gerlach.md) — where $\boldsymbol\mu = \gamma\mathbf{S}$ and the Larmor frequency come from.
- [1.6.2 Two-Level Dynamics & Rabi Oscillations](../../term-1-quantum-mechanics/c06-dynamics/02-two-level-rabi.md) — the same driven two-level problem as quantum dynamics, with the rotating-wave approximation done properly.
- [1.2.2 The Bloch Sphere](../../term-1-quantum-mechanics/c02-qubits-bloch/02-bloch-sphere.md) — the geometry in which every pulse in this lesson is a rotation.

---

← Prev: [Einstein, Podolsky, Rosen & Bell](03-epr-and-bell.md) · Up: [Resources](../README.md) · Next: [1.6.2 Two-Level Dynamics & Rabi Oscillations](../../term-1-quantum-mechanics/c06-dynamics/02-two-level-rabi.md) →
