Presets
Playback
State preparation
Named states
Gates
Rotation angle
Drive and decoherence
Measurement and target
Layers
Model check
The science
What is modelled
A single qubit, a two-level quantum system. Every pure state |psi> = cos(theta/2)|0> + e^(i phi) sin(theta/2)|1> is one point on a sphere of radius 1; a mixed state (a statistical mixture) is a point inside. The Bloch vector is r = (Tr rho sigma_x, Tr rho sigma_y, Tr rho sigma_z) and rho = (I + r.sigma)/2.
Gates are rotations (SU(2) to SO(3))
A unitary U = exp(-i a n.sigma/2) turns the Bloch vector by the angle a about the axis n. X, Y, Z are pi turns, S is a quarter turn and T an eighth turn about z, and the Hadamard is a pi turn about (x+z)/sqrt(2). U and -U give the same rotation: SU(2) covers SO(3) twice, which is why a spin needs a 720 degree turn to return to itself as an amplitude.
Drive and decoherence
With a microwave drive plus detuning the vector obeys the Bloch equations dr/dt = w x r - (x/T2, y/T2, (z - 1)/T1) with w = (Omega_x, Omega_y, Delta). T1 is the energy relaxation time (toward |0>, a zero-temperature bath), T2 the dephasing time of the x-y components, and 1/T2 = 1/(2 T1) + 1/T_phi, so T2 cannot exceed 2 T1 (the sliders enforce it). Purity is Tr rho^2 = (1 + |r|^2)/2 and the entropy is that of the eigenvalues (1 +- |r|)/2. Fidelity with a pure target t is F = (1 + r.t)/2.
Measurement
Measuring along a basis axis a gives the first outcome with probability (1 + r.a)/2 (Born rule) and collapses the state to +-a. The 1000-shot button samples without collapsing, so you can watch the statistical noise of about sqrt(N p (1 - p)).
Simplifications and checks
One qubit, a rotating frame, a zero-temperature bath and Markovian (exponential) relaxation; real devices also show 1/f noise, leakage and crosstalk. Times are in microseconds only to give the numbers a scale. In-page checks: (1) 300 random gates computed as 2x2 complex matrices on the amplitudes and as 3x3 rotations on the Bloch vector agree; (2) the RK4 integration of the Bloch equations matches the closed form; (3) a pi pulse flips |0> to |1> and seeded Born-rule counts agree with N p within four standard deviations.