| c₁(t) | — |
| c₂(t) | — |
| |c₁|², |c₂|² | — |
| Δφ = φ₂−φ₁ | — |
| ⟨σx⟩, ⟨σy⟩, ⟨σz⟩ | — |
| P(+), P(−) | — |
two_state_time_evolution | v1.1 | Sep 29, 2026
Phase, angular frequency and relative phase for a quantum system with two non-degenerate energy eigenstates.
This version assumes a time-independent Hamiltonian: H, its eigenstates and its eigenvalues stay fixed while the state evolves.
The math is identical for any two-state system. The SYSTEM toggle (top left, below SET TO FULL SCREEN) changes the labels. This INFO text uses the spin labels; in QUBIT mode the simulation shows the following instead:
| Spin ½ | Qubit |
| |+⟩z, |−⟩z | |0⟩, |1⟩ (computational basis, |0⟩ at the north pole) |
| |+⟩x, |−⟩x | |+⟩, |−⟩ |
| |+⟩y, |−⟩y | |+i⟩, |−i⟩ |
| |+⟩n, |−⟩n | |θ,φ⟩ = cos(θ/2)|0⟩ + eiφsin(θ/2)|1⟩, and its orthogonal partner |θ,φ⟩⊥ |
| c₁, c₂, E₁, E₂, ω₂₁, T₂₁ | c₀, c₁, E₀, E₁, ω₁₀, T₁₀ |
| eV and fs; E from −3 to 5 eV | μeV and ns; E from −25 to 25 μeV |
The qubit defaults are E₀ = −10.35 μeV and E₁ = +10.35 μeV, i.e. H = −(ℏωq/2)σz with a 5 GHz splitting (20.7 μeV, period 0.2 ns), typical of a superconducting qubit. Each system remembers its own energies when you switch.
Assumption: the Hamiltonian is time independent. That is what makes the energy eigenstates stationary states and gives each coefficient the simple phase factor e−iEnt/ℏ. Changing E₁, E₂ or the eigenstates is not a time-dependent H: it defines a new H and restarts the clock at t = 0.
By default the energy eigenstates are |E₁⟩ = |+⟩z with energy E₁ and |E₂⟩ = |−⟩z with energy E₂ (a spin in a magnetic field along z). The small |±⟩z ✎ button in the ENERGIES panel changes them to |±⟩x, |±⟩y, or |±⟩n for any direction n̂ = (θ, φ). Writing |1⟩ = |E₁⟩ and |2⟩ = |E₂⟩, the Schrödinger equation gives
Each coefficient keeps its magnitude and only its phase changes. Writing cn(t) = |cn| eiφn(t),
So each coefficient is a phasor: an arrow of fixed length |cn| turning in the complex plane at angular frequency ωn. Because of the minus sign, a positive energy turns the arrow clockwise. A negative energy turns it counter-clockwise.
An overall phase has no physical meaning, so it is chosen to make c₁(0) real and non-negative. The initial state is then set by just two numbers, both belonging to c₂:
In terms of the spin direction (θ from the z axis, φ around from the x axis) this is c₁ = cos(θ/2), c₂ = sin(θ/2) eiφ. The six buttons are the usual special cases:
| |+⟩z = |1⟩ | |−⟩z = |2⟩ |
| |+⟩x = (|1⟩ + |2⟩)/√2 | |−⟩x = (|1⟩ − |2⟩)/√2 |
| |+⟩y = (|1⟩ + i|2⟩)/√2 | |−⟩y = (|1⟩ − i|2⟩)/√2 |
The convention fixes the phase only at t = 0. As time runs, c₁(t) turns away from the real axis like any other coefficient.
If the energy eigenstates are not |±⟩z, the initial state is still entered in the z basis with this convention, and the coefficients that evolve are cn(0) = ⟨En|ψ(0)⟩. These are shown in the equation above the views and are generally complex. |±⟩n are written with the same convention: |+⟩n = cos(θ/2)|+⟩z + sin(θ/2)eiφ|−⟩z and |−⟩n = sin(θ/2)|+⟩z − cos(θ/2)eiφ|−⟩z.
|cn(t)|² = |cn(0)|² for all t. The arrows never change length, so the probability of measuring E₁ or E₂ is constant: choose the energy eigenbasis as the measurement basis and both curves in the Measurement probabilities view stay flat.
Multiplying the whole state by one overall phase eiα changes nothing measurable. Factor out c₁'s phase:
Only the relative phase Δφ is physical, and it evolves at the difference frequency. The Relative phase view shows this in a frame that rotates with c₁: c₁ stands still and c₂ turns at ω₂₁. Try BOTH E + 1: both arrows speed up, but Δφ and every measurable quantity are unchanged. Adding a constant to the Hamiltonian is unobservable.
Choose a measurement basis |±⟩ (|±⟩z, |±⟩x, |±⟩y or |±⟩n). The probabilities of the two outcomes are
If the measurement basis is the energy eigenbasis, both are constant. For any other basis they contain an interference term that depends on Δφ, so they oscillate at ω₂₁ (the Bohr frequency), not at ω₁ or ω₂. For example, with energy eigenstates |±⟩z and measurement basis |±⟩x:
If |ψ(0)⟩ is itself an energy eigenstate, no probability changes at all: a stationary state has no time dependence in any observable.
With the convention above, cos(θ/2) = |c₁|, sin(θ/2) = |c₂|, and the azimuth is φ = Δφ. The Bloch vector is (⟨σx⟩, ⟨σy⟩, ⟨σz⟩) = (2|c₁||c₂| cos Δφ, 2|c₁||c₂| sin Δφ, |c₁|² − |c₂|²), with |+⟩z at the north pole. Time evolution is a precession about the energy axis (drawn in orange and blue, labeled E₁ and E₂; the z axis by default) at ω₂₁: the latitude (the probabilities |cn|²) is fixed and only the longitude (the relative phase) changes. The green and yellow dots mark |+⟩ and |−⟩ of the measurement basis. If the state vector makes an angle γ with the green dot, then P(+) = cos²(γ/2) and P(−) = sin²(γ/2).
The UNITS toggle (in DISPLAY OPTIONS) chooses physical units (the default) or ℏ = 1. Physical units depend on the system: eV and fs for a spin and μeV and ns for a qubit. Conveniently, ℏ = 0.6582 in both (0.6582 eV·fs = 0.6582 μeV·ns), so a period is T = h/E = 4.136 fs ÷ E(eV), or 4.136 ns ÷ E(μeV). With the spin defaults E₁ = 1 eV and E₂ = 2.5 eV: T₁ = 4.14 fs, T₂ = 1.65 fs and T₂₁ = 2.76 fs (a 1.5 eV gap is a near-infrared photon, the scale of atomic transitions). ℏ = 1 is dimensionless: energies in a unit ε, angular frequencies in ε/ℏ and time in ℏ/ε, so ω equals E numerically. Switching units keeps the energy numbers and resets t to 0.
This section describes the mode chosen with MAGNETIC FIELD at the top of DEFINE HAMILTONIAN.
A spin in a field B₀ along n̂ has H = −μ·B₀ with μ = γS (proton) or μ = −γS (electron, neutron), so E = ±ℏω₀/2 with the Larmor frequency ω₀ = γB₀. For the electron and neutron |+⟩n is the upper level; for the proton it is the lower one, so its phasors and its precession turn the other way. The energies are symmetric about zero, so ω₂₁ = ∓ω₀.
The OSCILLATING DRIVE adds a field B₁cos(ωt) perpendicular to B₀. With B₀ along z (following L. Engelhardt, Am. J. Phys. 83, 1051 (2015)),
(S in units of ℏ for an electron or neutron; the proton's H has the opposite sign. Ω is called ω₁ in the paper; here ω₁ already means E₁/ℏ.) The energy eigenstates of H₀ are no longer stationary: |c₁| and |c₂| change, so the arrows change length and the Bloch vector leaves its circle. There is no closed-form solution, so the simulation integrates the Schrödinger equation numerically (exactly unitary steps; because H(t) repeats every drive period, one period is enough to reach any time).
Resonance. When ω = ω₀ the spin flips completely: starting in |+⟩z, P(−z) reaches 1 at the flip time τ = 2π/Ω. Off resonance the flip is incomplete, with pflip ≈ (Ω/2)²/[(Ω/2)² + (ω − ω₀)²], a peak of full width Ω (Rabi's formula). The + τ button jumps by the time of the largest flip, π/√((Ω/2)² + (ω − ω₀)²).
Why it flips. The spin precesses about the total field B(t) (the red arrow on the Bloch sphere). The drive tips B(t) back and forth; on resonance the tip reverses each time the spin is at the bottom of its precession, so the spin spirals from the north pole to the south pole. The small wiggles in P(t), 2ω₀/Ω of them per flip, come from the spin being pulled down twice per drive cycle.
Illustrative or realistic. ILLUSTRATIVE uses strong drives (Ω/ω₀ around 0.1, as in the paper) so the spiral and the wiggles can be seen. REALISTIC uses laboratory strengths (B₁ from 1 μT to 1 mT): Ω/ω₀ is about 10−² or much less, so a flip takes hundreds to millions of Larmor turns. Then the views are strobed: the arrows are shown once every two drive periods, like a strobe light synchronized to the drive, and the fast precession is drawn as a blur (its speed on screen is only for show). The probability plot shows the band that the fast precession sweeps. The detuning is set in units of Ω, and playback speed scales to the flip time.
This mode uses μeV and ns, with fields in tesla (the SET BY toggle shows angular frequencies ω₀ = γB₀ and Ω = γB₁ in rad/ns instead). Conveniently ℏ = 0.6582 μeV·ns, so a period is T = h/E = 4.136 ns ÷ E(μeV). Gyromagnetic ratios: electron 176.1 rad/ns/T (28.02 GHz/T), proton 0.2675 rad/ns/T (42.58 MHz/T), neutron 0.1832 rad/ns/T (29.16 MHz/T). The electron default, B₀ = 0.35 T, is an X-band ESR field (ω₀/2π = 9.8 GHz); the proton default, 3 T, is an MRI field (128 MHz). Note that f = ω/2π: a “GHz” that is really rad/ns is off by 2π.
Larry Engelhardt, Francis Marion University
Built with Claude Opus 5.5, 2026. Layout, styling and presentation tools adapted from the
Electric Charge Simulator v7.02 by Mehmet Fatih Tasar, Georgia State University.
This work is licensed under a CC BY-NC-SA 4.0 International License.