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.
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
- Gates tab: click H. The vector swings from the north pole to the equator. Read P(0) and P(1): 50 percent each.
- 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.
- Click H once more and read the new height. The gate turned a phase difference into a probability difference.
- Measure tab: choose the X basis and see how the odds changed. Measure once and watch the vector jump to an axis.
- Challenges tab: reach |+i⟩ in two gates, then try the longer puzzles.
- 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.
| State | In the basis |0⟩, |1⟩ | x, y, z | θ, φ | P(0) |
|---|---|---|---|---|
| |0⟩ | |0⟩ | 0.00, 0.00, 1.00 | 0°, 0° | 100% |
| |1⟩ | |1⟩ | 0.00, 0.00, -1.00 | 180°, 0° | 0% |
| |+⟩ | (|0⟩ + |1⟩)/√2 | 1.00, 0.00, 0.00 | 90°, 0° | 50% |
| |−⟩ | (|0⟩ − |1⟩)/√2 | -1.00, 0.00, 0.00 | 90°, 180° | 50% |
| |+i⟩ | (|0⟩ + i|1⟩)/√2 | 0.00, 1.00, 0.00 | 90°, 90° | 50% |
| |−i⟩ | (|0⟩ − i|1⟩)/√2 | 0.00, -1.00, 0.00 | 90°, 270° | 50% |
| Gate | Axis | Angle | Image of |0⟩ |
|---|---|---|---|
| X | 1.00, 0.00, 0.00 | π (180°) | 0.00, 0.00, -1.00 |
| Y | 0.00, 1.00, 0.00 | π (180°) | 0.00, 0.00, -1.00 |
| Z | 0.00, 0.00, 1.00 | π (180°) | 0.00, 0.00, 1.00 |
| H | 0.71, 0.00, 0.71 | π (180°) | 1.00, 0.00, 0.00 |
| S | 0.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 |
| T | 0.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 |
| √X | 1.00, 0.00, 0.00 | π/2 (90°) | 0.00, -1.00, 0.00 |
Eight guides
What is the Bloch sphere? A map of every single-qubit state
8 min read
One qubit state is one point on a sphere. Here is why that works, and what the two angles mean.
Reading a Bloch sphere: probability, phase and the three axes
7 min read
Height tells you the measurement odds in the standard basis. Longitude tells you the phase. How to read both at a glance.
Single-qubit gates as rotations of the sphere
8 min read
X, Y, Z, H, S and T are all fixed rotations. Seeing the axis and angle explains what each gate does.
Rx, Ry and Rz: rotating by any angle, and preparing any state
7 min read
The continuous rotation gates, their half-angle matrices, and a two-gate recipe for preparing any point on the sphere.
Measurement on the Bloch sphere: bases, odds and collapse
8 min read
Measuring along an axis asks one yes/no question. The answer is random with odds from the geometry, and the vector then jumps to the axis.
Why the order of gates matters: non-commuting rotations
6 min read
Rotations about different axes do not commute. A table of examples, the one tricky exception, and what it means for circuits.
What the Bloch sphere cannot show: mixed states and entanglement
7 min read
Noisy qubits live inside the ball. A qubit entangled with another sits at the centre. And two qubits cannot be drawn as two spheres.
Bloch sphere puzzles: shortest gate sequences and strategy
7 min read
The shortest solutions to the lab’s challenges, found by exhaustive search, plus a way of thinking that finds them by hand.
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.