Bloch Sphere Simulator: Visualize a Qubit State
Explore a single-qubit quantum superposition: drag the state vector, apply gates, simulate measurements, or enter amplitudes and Bloch angles directly.
Interactive single-qubit simulator
State mode: drag/tap the sphere to move the vector. Camera mode: drag to orbit. Mouse wheel or +/− zooms. On the keyboard, arrows move the state; hold Shift to orbit the camera.
θ controls amplitude balance; φ controls relative phase. Values update live.
Advanced mode accepts a physical Bloch vector or a Hermitian 2×2 density matrix. Interior points represent mixed states.
ρ = [[a, c+di], [c−di, b]]
|ψ⟩ = |0⟩Advertisement
X basis
Y basis
Apply quantum gates
Each gate animates a rotation path. X and Y generally change amplitude balance; Z, S and T are Z-axis phase rotations.
I = [[1, 0], [0, 1]]
|0⟩- No gates applied
Simulate measurements
Sampling uses Born-rule probabilities. Relative phase becomes visible in X- and Y-basis outcomes.
Choose a basis and number of shots.
Copy and export
Worked qubit state examples
Guided exercise: phase changes interference
- Load |+⟩: Z is 50/50 and X is 100/0.
- Keep θ = 90° and change φ to 90°: Z remains 50/50 while Y becomes 100/0.
- Change φ to 180°: Z still remains 50/50 while X becomes 0/100.
Bloch sphere concepts
What the sphere represents
A surface point represents one pure qubit after global phase is removed. The arrow coordinates equal the Pauli expectation values.
Angles and amplitudes
θ sets the balance between |0⟩ and |1⟩. φ is their relative phase, which rotates the arrow around Z.
Phase and interference
Changing φ leaves Z probabilities unchanged but changes X and Y probabilities. Those bases reveal interference between amplitudes.
How gates rotate states
Unitary gates rotate the Bloch vector. Only rotations around Z are purely relative-phase changes; X and Y rotations usually also change amplitude magnitudes.
What it cannot represent
One sphere cannot encode correlations or entanglement between multiple qubits. Interior vectors represent mixed one-qubit states, not imperfectly normalized pure states.
Bloch sphere formulas
θ is the polar angle and φ the relative azimuthal phase.
α and β are complex amplitudes; their squared magnitudes are probabilities, not amplitudes.
α* is the complex conjugate. For a pure state, x²+y²+z²=1.
For pure states this is equivalent to θ=2 arccos(|α|), φ=arg(β)−arg(α).
The expectation values are ⟨X⟩=x, ⟨Y⟩=y and ⟨Z⟩=z.
I is identity, r=(x,y,z), and σ=(X,Y,Z). Physical states require |r|≤1.
Numerical example
For α=1/√2 and β=i/√2, the norm is 1. Then x=0, y=1, z=0, so θ=90° and φ=90°. Born’s rule gives Z: 50/50, X: 50/50 and Y: 100/0. This is |+i⟩.
Bloch sphere and superposition FAQ
What is a quantum superposition?
A normalized combination α|0⟩+β|1⟩. The complex amplitudes determine measurement probabilities and relative phase.
How do I convert α and β to Bloch coordinates?
Normalize first, then use x=2Re(α*β), y=2Im(α*β), z=|α|²−|β|².
Why does φ not change Z-basis probabilities?
φ changes phase, not |α| or |β|. Since Z probabilities are |α|² and |β|², they depend only on θ.
What do points inside the sphere mean?
They are mixed states. Their Bloch-vector length is less than one; the center is the maximally mixed state. Normalized nonzero state vectors are pure and stay on the surface.
Can a Bloch sphere represent two entangled qubits?
No. It completely represents one qubit. A reduced state of one member can appear as a mixed point, but the sphere omits the two-qubit correlations.
What is global phase?
A common factor eiγ multiplying all amplitudes. It has no observable effect and is not represented geometrically.
Why are amplitudes complex?
The complex phase produces interference. It can change X- or Y-basis measurements even when Z-basis probabilities are unchanged.
Method, review and limitations
Starlight Robotics
Direct complex arithmetic, Pauli-basis Born probabilities and browser pseudorandom sampling.
All calculations run client-side. The default simulator represents one ideal qubit and removes global phase. The canvas is an educational mathematical model, not experimental quantum hardware. Sampling varies randomly; it does not model device noise unless you enter a mixed state.
References: IBM Quantum Learning: single systems; Qiskit Statevector documentation; Nielsen and Chuang, Quantum Computation and Quantum Information, Cambridge University Press.
