Bloch sphere puzzles: shortest gate sequences and strategy

The shortest solutions to the lab’s challenges, found by exhaustive search, plus a way of thinking that finds them by hand.

7 min read · reviewed December 2026

The challenge

Starting from |0⟩, reach a target point using the gates H, S, S†, T, T†, X, Y and Z. The shortest sequences below were found by a breadth-first search over all sequences, so no shorter one exists with these gates.

Shortest sequences from |0⟩ using H, S, S†, T, T†, X, Y, Z (found by breadth-first search). One shortest solution is shown; others of the same length may exist.
TargetShortestGatesT gates
Flip to |1⟩X10
Reach |+⟩H10
Reach |−⟩H → Y20
Reach |+i⟩H → S20
Reach |−i⟩H → S†20
Half-way between +x and +yH → T21
Tilt |0⟩ by 45° towards −yH → T → H31
A longer oneH → T → H → T42

How to think about it

  • Height first: H moves a pole to the equator, X moves a pole to the other pole.
  • Longitude second: once on the equator, Z, S, S†, T and T† only spin the vector around the z axis, by 180, 90, −90, 45 and −45 degrees.
  • Tilting off the equator needs another H, because only gates with an axis other than z change the height.
  • A sandwich H·T·H is a rotation by 45 degrees about x. It tilts a pole by 45 degrees.

Counting cost

In fault-tolerant machines the T gate is the expensive one. A sequence with the fewest T gates is usually preferred over one with the fewest total gates. In the table the first five challenges use no T gate at all, because their targets are among the six named points that Clifford gates reach.

What about any target?

Sequences of H and T can get arbitrarily close to any point on the sphere, but the sequence length grows as the accuracy improves. The Solovay–Kitaev theorem says the length grows only polynomially in the logarithm of the inverse accuracy, so approximating a rotation to high precision is feasible. Practical compilers use more specialised methods to reduce the T count further.

Check the cited reference before using specific numbers for gate counts at a given accuracy. They depend on the algorithm.

Make your own

Use the Set state tab to put the vector somewhere, note the coordinates, then see if you can reach the same point from |0⟩ with a short sequence. Points on the six axes and on the equator at multiples of 45 degrees are easy. Points such as 60 degrees north need Ry and are not reachable exactly with a short H, T sequence.

Try it

Questions

Why does the search stop at 8 gates?

The lab’s search is limited for speed. All the listed challenges are solved well within that limit.

Is the shortest solution unique?

Often not. Different sequences can reach the same point, for example H then Z and H then Y both reach |−⟩ from |0⟩. The lab shows one shortest solution.

Read next

Sources and further reading

  • F. Bloch, “Nuclear induction” (1946)
  • M. Nielsen and I. Chuang, Quantum Computation and Quantum Information, section 1.2 and chapter 4
  • C. Dawson and M. Nielsen, “The Solovay–Kitaev algorithm” (2005)
  • Dictionary: Bloch sphere

Check the original sources for exact citations.