sabfodel / physics
lab · interactive

Lab

Small experiments that run in the browser, with the equations behind them.

Exp. 001

The Bloch sphere

one qubit
gates
circuit
state

|ψ⟩ = 1|0⟩

θ = 0 · φ = 0

born rule
P(0)1.00
P(1)0.00
Exp. 001Apply gates to |0⟩. Measuring picks 0 or 1 with the Born-rule probabilities.

Any pure state of one qubit can be written, up to an unobservable global phase, with two angles:

∣ψ⟩=cos⁡θ2 ∣0⟩+eiφsin⁡θ2 ∣1⟩\lvert\psi\rangle = \cos\tfrac{\theta}{2}\,\lvert 0\rangle + e^{i\varphi}\sin\tfrac{\theta}{2}\,\lvert 1\rangle

Read (θ,φ)(\theta, \varphi) as polar and azimuthal angles and every state becomes a point on a unit sphere: ∣0⟩\lvert 0\rangle at the north pole, ∣1⟩\lvert 1\rangle at the south, and equal superpositions around the equator.

The useful fact is that every single-qubit gate is a rotation of that sphere. Up to global phase,

U=e−iα n^⋅σ⃗/2U = e^{-i\alpha\,\hat{n}\cdot\vec{\sigma}/2}

rotates the Bloch vector by angle α\alpha about the axis n^\hat n. That is all the simulator above does — it never stores amplitudes, only the arrow, and turns it with Rodrigues' formula:

GateAxisAngle
X, Y, Zx, y, zπ
H(x + z)/√2π
Szπ/2
Tzπ/4

The probability of measuring 0 is the height of the arrow: P(0)=cos⁡2θ2=1+z2P(0) = \cos^2\tfrac{\theta}{2} = \tfrac{1 + z}{2}. Try H then T repeatedly: the state walks around the equator and the probabilities never change — the information is all in the phase.

Limits: one qubit, pure states only. Entanglement has no picture here — two entangled qubits don't each have their own arrow. For that, see qsim-rs.

§

Next

planned