Physics
The qubit: Rabi, Ramsey, decoherence
A two-level system you can drive and read, and the three times that ruin it. Rabi oscillations under a resonant field, the π pulse, the Ramsey fringe, T₁ relaxation, T₂ dephasing and the T₂* an ensemble's spread adds on top - all on the Bloch sphere, with sixty-four spins fanning out and the Hahn echo snapping them back. Every curve is measured against its closed form.

What happens
One spin on a sphere, driven by a microwave field and forgetting. A resonant drive swings it from north to south and back - Rabi oscillations - and a pulse of the right length is a π pulse. Left alone, the vector relaxes toward north on T₁ and loses its phase on T₂; an ensemble of spins with slightly different frequencies fans out much faster, and that fanning is what a Ramsey experiment sees as decaying fringes. The Hahn echo flips the spins halfway and the fanned phases refocus - the static spread undone, the true T₂ left. Try Rabi, then Ramsey, then the echo, and watch which decay each undoes.
Equations used in the module
Equations
du/dt = −Δv − u/T₂, dv/dt = Δu − Ωw − v/T₂, dw/dt = Ωv − (w − 1)/T₁
Rabi: P₁ = sin²(Ωt/2), π pulse at t = π/Ω
Ramsey: P₁ = ½[1 + cos(Δτ) e^{−τ/T₂} e^{−σ²τ²/2}]
Hahn echo: the π pulse undoes the static spread, not T₂

