Bloch Sphere Lab

See a qubit as a point on a sphere. Apply gates and watch them rotate the state, set any state by its two angles, measure along the X, Y and Z axes, solve gate puzzles with the fewest moves, and test whether the order of two gates matters. Drag to turn the sphere. Everything runs in your browser.

Reviewed December 2026. New to this? Start with the Gates tab and click H, then T.

|0⟩|1⟩|+⟩|−⟩|+i⟩|−i⟩

Drag the sphere to rotate it. The dotted line drops from the tip to the equator to show depth.

x, y, z

0.000, 0.000, 1.000

θ, φ

0°, 0°

P(0), P(1)

100.0%, 0.0%

|ψ⟩ = 1.000|0⟩ + (0.000 + 0.000i)|1⟩

Every gate is a rotation of the vector. Click a gate and watch it turn. The trail shows the path.

Sequence: (nothing yet)

Tip: H then Z then H gives the same result as X. Try it, then try it from a different starting state.

A five-minute path

  1. Gates tab: click H. The vector swings from the north pole to the equator. Read P(0) and P(1): 50 percent each.
  2. Click T, then T again, then T again. Each moves the vector 45° around the equator. Four of them make a half-turn, which is a Z gate.
  3. Click H once more and read the new height. The gate turned a phase difference into a probability difference.
  4. Measure tab: choose the X basis and see how the odds changed. Measure once and watch the vector jump to an axis.
  5. Challenges tab: reach |+i⟩ in two gates, then try the longer puzzles.
  6. Does order matter? tab: compare H then T with T then H.

What the lab does and does not do

  • It shows one qubit in a pure state, with perfect gates. Every gate is applied as an exact rotation.
  • It ignores global phase, which cannot be observed. The amplitude line fixes it so the |0⟩ amplitude is real and not negative.
  • It does not show noise. Real qubits drift inside the ball. See the guide on mixed states.
  • For circuits with several qubits, use the Circuit Builder.

Reference tables

Computed by the same code as the lab.

The six named states. Coordinates are (x, y, z).
StateIn the basis |0⟩, |1⟩x, y, zθ, φP(0)
|0⟩|0⟩0.00, 0.00, 1.000°, 0°100%
|1⟩|1⟩0.00, 0.00, -1.00180°, 0°0%
|+⟩(|0⟩ + |1⟩)/√21.00, 0.00, 0.0090°, 0°50%
|−⟩(|0⟩ − |1⟩)/√2-1.00, 0.00, 0.0090°, 180°50%
|+i⟩(|0⟩ + i|1⟩)/√20.00, 1.00, 0.0090°, 90°50%
|−i⟩(|0⟩ − i|1⟩)/√20.00, -1.00, 0.0090°, 270°50%
Each gate as a rotation of the Bloch vector. “Image of |0⟩” is where the north pole goes.
GateAxisAngleImage of |0⟩
X1.00, 0.00, 0.00π (180°)0.00, 0.00, -1.00
Y0.00, 1.00, 0.00π (180°)0.00, 0.00, -1.00
Z0.00, 0.00, 1.00π (180°)0.00, 0.00, 1.00
H0.71, 0.00, 0.71π (180°)1.00, 0.00, 0.00
S0.00, 0.00, 1.00π/2 (90°)0.00, 0.00, 1.00
S†0.00, 0.00, 1.00−π/2 (-90°)0.00, 0.00, 1.00
T0.00, 0.00, 1.00π/4 (45°)0.00, 0.00, 1.00
T†0.00, 0.00, 1.00−π/4 (-45°)0.00, 0.00, 1.00
√X1.00, 0.00, 0.00π/2 (90°)0.00, -1.00, 0.00

Eight guides

Predict, then check

Where does H send |0⟩, and what are the odds of reading 0 afterwards?

To |+⟩ on the equator at (1, 0, 0). P(0) = 50%.

Does H then Z then H give the same result as X? Check with a random state.

Yes: H, Z, H gives (0.300, -0.500, -0.812), and X gives (0.300, -0.500, -0.812).

T acts on |+⟩. How far does the vector move, and what are the odds of 0 in the X basis?

It rotates 45° about z to (0.707, 0.707, -0.000). The X-basis odds of + are 85.4%, because the x component fell to cos 45°.

How many gates do you need to reach |−i⟩ from |0⟩ with H, S, S†, T, T†, X, Y, Z?

2 gates, for example H then S†.

A qubit sits at θ = 60° with any φ. What are the odds of reading 1?

P(1) = sin²(30°) = 25%. The longitude φ does not change the standard-basis odds.

Related on QuantumAtlas

Frequently asked questions

What is the Bloch sphere?

A way to draw every pure state of one qubit as a point on the surface of a sphere. The north pole is |0⟩, the south pole is |1⟩, and the equator holds the equal superpositions.

How do gates act on the Bloch sphere?

Every single-qubit gate is a rotation about some axis. X, Y and Z are half-turns about their axes, S and T are quarter and eighth turns about z, and H is a half-turn about the axis between x and z.

What does the height of the point mean?

It sets the odds of reading 0 or 1: P(0) = (1 + z)/2. Longitude, the angle around the equator, is the relative phase, and it does not change those odds.

Why are there θ/2 in the formulas?

Opposite poles are 180 degrees apart on the sphere, but |0⟩ and |1⟩ are only 90 degrees apart as state vectors. Sphere angles are double state-vector angles.

Can I show two qubits on a Bloch sphere?

Not fully. Two spheres can only show product states. Entangled qubits need more numbers than two spheres hold.

What do points inside the sphere mean?

Mixed states: a qubit with noise, or one that is entangled with something else. This lab shows pure states only.

Is the simulation exact?

Yes. Each gate is applied as an exact rotation, and the code was checked against the matrix calculation for every gate. The random sampling in the Measure tab uses a seeded generator.

Why does the measured count differ from the exact odds?

Because each measurement is random. With N copies the counts wobble by about √(p(1−p)/N), as real hardware does.

What are the challenges?

Puzzles where you reach a target state with the fewest gates. The par values come from an exhaustive search.

Where can I build whole circuits?

In the Circuit Builder, whose Qubits tab shows a Bloch vector for each qubit.

Sources and further reading

  • F. Bloch, “Nuclear induction” (1946). The sphere is named after Felix Bloch, who used the picture for spin in magnetic fields.
  • M. Nielsen and I. Chuang, Quantum Computation and Quantum Information, section 1.2 and chapter 4. The standard textbook treatment of the Bloch sphere and single-qubit gates.
  • C. Dawson and M. Nielsen, “The Solovay–Kitaev algorithm” (2005). A readable account of how short gate sequences approximate any rotation.
  • Dictionary: Bloch sphere. A short definition on this site.