Starlight Tools

Quantum computing · Visualization · Private, in-browser

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.

Current state
|ψ⟩ = |0⟩

Advertisement

Z basis

|0⟩100%
|1⟩0%
⟨Z⟩ = 1.000

X basis

|+⟩50%
|−⟩50%
⟨X⟩ = 0.000

Y basis

|+i⟩50%
|−i⟩50%
⟨Y⟩ = 0.000
Bloch vector
(0, 0, 1)
Angles
0°, 0°
Purity / eigenvalues
1.000 / (1, 0)

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.

degrees
Last operation
I = [[1, 0], [0, 1]]
Result: |0⟩
  1. No gates applied

Simulate measurements

Sampling uses Born-rule probabilities. Relative phase becomes visible in X- and Y-basis outcomes.

|0⟩
0
|1⟩
0

Choose a basis and number of shots.

Copy and export

Worked qubit state examples

Guided exercise: phase changes interference

  1. Load |+⟩: Z is 50/50 and X is 100/0.
  2. Keep θ = 90° and change φ to 90°: Z remains 50/50 while Y becomes 100/0.
  3. 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

Canonical pure state
|ψ⟩ = cos(θ/2)|0⟩ + e sin(θ/2)|1⟩

θ is the polar angle and φ the relative azimuthal phase.

Normalization
|α|² + |β|² = 1

α and β are complex amplitudes; their squared magnitudes are probabilities, not amplitudes.

Bloch coordinates
x = 2 Re(α*β), y = 2 Im(α*β), z = |α|² − |β|²

α* is the complex conjugate. For a pure state, x²+y²+z²=1.

Inverse conversion
θ = arccos(z), φ = atan2(y,x)

For pure states this is equivalent to θ=2 arccos(|α|), φ=arg(β)−arg(α).

Born rule in Pauli bases
P=(1±x)/2, P=(1±y)/2, P=(1±z)/2

The expectation values are ⟨X⟩=x, ⟨Y⟩=y and ⟨Z⟩=z.

Density matrix
ρ = (I + r·σ)/2 = ½[[1+z, x−iy], [x+iy, 1−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 e 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

Content owner
Starlight Robotics
Last reviewed
Method
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.

Explore more tools