|q⟩ Bad Qubits

advanced · Programming · Fault-Tolerant Gate Synthesis

Adding the T Gate

The Gottesman–Knill theorem told us that Clifford gates alone yield no speedup; we must add a gate from outside the Clifford group. The standard choice is the TT gate, and adding it to {H,S,CNOT}\{H, S, \mathrm{CNOT}\} produces a finite set that is universal: it can approximate any unitary to arbitrary precision.

The T gate

TT is the diagonal single-qubit gate

T=(100eiπ/4)=diag ⁣(1,eiπ/4).T = \begin{pmatrix} 1 & 0 \\ 0 & e^{i\pi/4} \end{pmatrix} = \mathrm{diag}\!\left(1,\, e^{i\pi/4}\right) .

It applies a π/4\pi/4 phase to the 1|1\rangle amplitude (sometimes written π/8\pi/8 because of an overall-phase convention, hence the nickname "π/8\pi/8 gate"). Its relatives in the same diagonal family are

Z=diag(1,eiπ),S=diag(1,eiπ/2),T=diag(1,eiπ/4).Z = \mathrm{diag}(1, e^{i\pi}), \qquad S = \mathrm{diag}(1, e^{i\pi/2}), \qquad T = \mathrm{diag}(1, e^{i\pi/4}).

So TT is the square root of SS and the fourth root of ZZ:

T2=S,T4=Z,T8=I.T^2 = S, \qquad T^4 = Z, \qquad T^8 = I .

The exercise verifies the first of these directly.

Why T is not Clifford

Conjugate XX by TT:

TXT=X+Y2,T X T^\dagger = \frac{X + Y}{\sqrt{2}} ,

which is a 4545^\circ rotation of XX in the XXYY plane — not a Pauli. Because TT does not normalize the Pauli group, it escapes the stabilizer formalism, and the Gottesman–Knill simulation no longer applies. This is exactly the property we needed.

Universality of Clifford + T

The set {H,S,CNOT,T}\{H, S, \mathrm{CNOT}, T\} is universal for quantum computation: any nn-qubit unitary can be approximated to any precision ε\varepsilon by a finite circuit drawn from this set. Two ingredients make this work:

  1. HH and TT generate a single-qubit rotation about an axis whose angle is an irrational multiple of π\pi. Repeatedly composing such a rotation densely fills a great circle of the Bloch sphere; combining two such non-commuting rotations densely fills all of SU(2)SU(2).
  2. Adding CNOT lifts single-qubit density to density on all of SU(2n)SU(2^n).

Density alone shows approximability; the Solovay–Kitaev theorem (a later lesson) makes it efficient, guaranteeing a short word in the generators for any target precision.

The price of T

Because the Clifford gates are typically transversal (cheap), but the TT gate is not transversal for the standard codes, TT is the expensive ingredient. It is supplied fault-tolerantly through magic-state distillation and injection (next lessons), a process that dominates the qubit and time budget of realistic fault-tolerant algorithms. Keep this asymmetry in mind: in Clifford+TT circuits, counting TT gates is counting cost.

Try it

Show that two TT gates compose into the Clifford phase gate SS. Build TTT \cdot T on one qubit; the grader checks that the resulting unitary equals S=diag(1,i)S = \mathrm{diag}(1, i).

Run your code to see the quantum state.

Sign in on the full site to ask questions and join the discussion.