|q⟩ Bad Qubits

advanced · Programming · Fault-Tolerant Gate Synthesis

Checkpoint: Synthesize a Logical Gate

This checkpoint exercises the central skill of the module: turning a target logical rotation into an exact word over the fault-tolerant Clifford+TT gate set. You will synthesize a zz-rotation whose angle is a multiple of π/4\pi/4, so the result comes out exactly — no approximation error — letting you focus on the synthesis logic itself.

What you are building

The target is the zz-rotation

Rz ⁣(3π4)=exp ⁣(i3π8Z)=diag ⁣(ei3π/8,  ei3π/8).R_z\!\left(\tfrac{3\pi}{4}\right) = \exp\!\left(-i\,\tfrac{3\pi}{8}\,Z\right) = \mathrm{diag}\!\left(e^{-i 3\pi/8},\; e^{i 3\pi/8}\right).

Recall the two facts you need, both true up to a global phase (which the unitary grader ignores):

Rz ⁣(π2)S,Rz ⁣(π4)T.R_z\!\left(\tfrac{\pi}{2}\right) \equiv S, \qquad R_z\!\left(\tfrac{\pi}{4}\right) \equiv T .

The synthesis idea

Rotations about the same axis add their angles:

Rz(α)Rz(β)=Rz(α+β).R_z(\alpha)\, R_z(\beta) = R_z(\alpha + \beta).

So decompose the target angle into a sum of π/4\pi/4-multiples and emit the corresponding SS/TT word:

3π4=π2+π4        Rz ⁣(3π4)ST.\tfrac{3\pi}{4} = \tfrac{\pi}{2} + \tfrac{\pi}{4} \;\;\Longrightarrow\;\; R_z\!\left(\tfrac{3\pi}{4}\right) \equiv S\,T .

This is exactly the procedure a real synthesizer follows for angles in the π4Z\tfrac{\pi}{4}\mathbb{Z} lattice; for generic angles it would instead call an ε\varepsilon-approximate routine (Solovay–Kitaev or Ross–Selinger), spending more TT gates for more precision. Here a single TT suffices, so the synthesized TT-count is 1.

Try it

Build the Clifford+TT word that realizes Rz(3π/4)R_z(3\pi/4). The grader compares your circuit's unitary (up to global phase) against Rz(3π/4)R_z(3\pi/4) — apply SS then TT.

Run your code to see the quantum state.

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