The qubit state is a Bloch vector r = (x, y, z), |r| ≤ 1, drawn here as a rotatable flattened (orthographic) projection of the Bloch sphere rather than a full 3D scene. Two things fight over it every frame:
Decoherence (open-system drift):
dz/dt = Γ·(1 − z) (T1 relaxation → |0⟩)
dx/dt = −1.5Γ·x (T2 dephasing)
dy/dt = −1.5Γ·y
Lyapunov feedback control:
u = K·(r × r_target)
dr/dt += 2·(u × r)
u is the microwave drive field the controller applies. It is chosen by steepest-descent on the Lyapunov function V = 1 − r·r_target: differentiating the rotation dr/dt = 2u×r shows d(r·r_target)/dt = 2u·(r×r_target), which is maximised by u = K(r×r_target) — the classic Lyapunov-based control law used to drive a quantum system toward a target state (Mirrahimi et al.) without ever solving the full Schrödinger equation for the drive pulse in advance. (Verified numerically: integrating this exact law from |+⟩ toward |0⟩ with no decoherence converges to fidelity 0.999999999... — the law is self-consistent.)
- Target θ/φ or preset buttons — choose where on the Bloch sphere the controller should hold the qubit.
- Feedback gain K — how hard the controller pushes back each time decoherence knocks the state off target; too low and it drifts, too high and it overshoots/oscillates.
- Decoherence rate Γ — how fast the environment relaxes and dephases the qubit; this is the disturbance the controller is fighting.
- Controller ON/OFF — switch off to watch the raw, uncorrected decay toward the north pole.
- Drag the disk — rotate the viewing angle of the flattened Bloch projection (azimuth/elevation), exactly like orbiting a camera around the sphere.
Real-world relevance: real superconducting-qubit and trapped-ion processors use exactly this idea — continuous or pulsed feedback derived from a Lyapunov/optimal-control law — to actively stabilise a qubit's state against T1/T2 noise between gate operations.