This is an exact statevector simulator, not an animation: the register's state is a length-2n vector of complex amplitudes ψ, one per basis string |qn-1…q1q0⟩. A single-qubit gate is a 2×2 unitary matrix applied to every amplitude pair that differs only in the target bit; CNOT swaps the amplitude pair on the target bit whenever the control bit is 1. The bars show the Born-rule probabilities |ψi|² read directly off that vector — nothing is faked or pre-rendered.
H = 1/√2 [[1, 1], [1,-1]]
X = [[0, 1], [1, 0]]
Y = [[0,-i], [i, 0]]
Z = [[1, 0], [0,-1]]
S = [[1, 0], [0, i]]
T = [[1, 0], [0, e^{iπ/4}]]
- Superposition — apply H to q0 from the |0…0⟩ ground state to split probability 50/50 between two basis states.
- Entanglement — H on q0 then CNOT(control=q0, target=q1) builds a Bell pair; the entropy of the reduced state of q0 jumps from 0 to 1 bit, the signature of true quantum correlation (the "Bell pair" button does this in one click).
- Entropy (q0) — the von Neumann entropy of qubit 0's reduced density matrix (partial trace over the rest of the register), computed from its eigenvalues. 0 bits = qubit 0 is unentangled from the rest; 1 bit = maximally entangled.
- Measure — samples a basis outcome from the real probabilities and collapses the state vector to it, exactly as a physical measurement would.