Skip to main content
All visualizations
Intermediate

Spin Precession and Rabi Flopping

Put a magnetic field on the Bloch sphere and the arrow starts to turn. Add a resonant radio wave and you have an X gate.

Spin Precession and Rabi Flopping visualization

Violet is the spin, amber is the field it precesses about, and the dashed circle is the cone it is locked onto. On the right, the simulated population sits underneath the dashed closed-form Rabi curve — two different routes to the same number.

A field makes a spin turn, not fall over

Drop a spinning top and it does not topple; it precesses, tracing a slow cone about the vertical. A spin in a magnetic field does exactly the same thing, for exactly the same reason — the field applies a torque perpendicular to the spin, so the spin moves sideways rather than toward the field.

Start on Static field, tilt the field, and watch the cone. The half-angle never changes, no matter how long you wait or how strong you make B₀. A static field can rotate a spin around forever and never flip it — which is worth sitting with, because it is the reason single-qubit control needs a second, much weaker field.

What B₀ does control is the speed: ω₀ = γB₀, the Larmor frequency, linear in the field and independent of everything else. Drag B₀ from 0.3 T to 3 T and the arrow speeds up by a factor of ten. At 1.5 T a proton turns 63.87 million times a second, which is why the animation runs on a compressed clock and says so in the readout.

Why an MRI scanner is tuned to 64 MHz

The whole of magnetic resonance imaging is in that one number. Put a body in a 1.5 T magnet, and every hydrogen nucleus in it precesses at 63.87 MHz — an FM radio frequency. Broadcast at that frequency and the protons absorb; broadcast a hundred kilohertz off and they largely ignore you.

Switch the species to ¹³C and the frequency drops by a factor of four in the same field, which is why an NMR spectrometer has a separate channel for every nucleus. Switch to the electron and it jumps by 658×, into the microwave band — which is why electron-spin qubits are driven by the same hardware that runs a Wi-Fi router, and nuclear ones by something closer to a shortwave transmitter.

Because ω₀ is strictly proportional to B, adding a deliberate spatial gradient to the magnet makes the resonant frequency a position label. That is the entire idea behind imaging: the scanner is not measuring where the signal came from, it is measuring what frequency it came back at.

The trick: hit it at exactly the right frequency

Switch to RF drive. A second, much weaker field B₁ now rotates in the plane, going round at the drive frequency. Off resonance it is useless — it pushes the spin one way, the spin precesses out from under it, and the next push cancels the last.

On resonance the pushes line up. Every turn the spin makes, the drive is exactly where it needs to be, and the tiny nudges accumulate into a full flip. Set the detuning to zero and watch the population climb all the way to 1; then detune by one Rabi frequency and watch the ceiling drop to exactly 50%, however long you drive. The formula for that ceiling is ω₁²/(ω₁² + Δ²), and it is drawn dashed over the simulated curve on the right.

Notice which way the trade goes: detuning makes the oscillation faster (the generalised Rabi frequency is √(ω₁² + Δ²)) and shallower at the same time. That combination is the reason a real pulse has to be calibrated in both amplitude and frequency, and the reason a miscalibrated gate leaks population instead of simply doing nothing.

This is the RX gate — not an analogy for it

Flip the point of view to Rotating frame. The fast precession disappears, because you are now turning with the drive, and what is left is a static field pointing along x. The spin just rotates about it, steadily, at ω₁ = γB₁.

A rotation about a fixed axis by an angle proportional to elapsed time is precisely what RX(θ) means in the circuit simulator. Drive for θ/ω₁ seconds and you have applied RX(θ). Press π pulse and the spin lands on |1⟩: that is the X gate. Press π/2 pulse and it stops on the equator, in an equal superposition — the gate the simulator calls √X.

The RF phase control is where the other axes come from. Shift the drive by 90° and the static field in the rotating frame points along y instead, so the same pulse now implements RY. And with the drive off entirely, free precession about B₀ is a rotation about z at ω₀ — an RZ gate that costs nothing but time, which is why real hardware often implements RZ by relabelling the phase of every later pulse instead of doing anything at all.

What the numbers on screen are not

Two honest caveats. First, B₁ here runs to a quarter of B₀; a real scanner uses something like a millionth, so a real 90° pulse takes hundreds of thousands of precession turns rather than four. The exaggeration is what makes the nutation visible in one screen; the physics is otherwise unmodified, and every frequency in the readouts is the true value for the fields shown.

Second, this is one perfectly isolated spin. Nothing here decays. A real spin loses its transverse phase in milliseconds (T₂) and returns to alignment in seconds (T₁), and it is that decay — not the precession — that carries the contrast in an MRI image. The decoherence visualization is where that part lives.