Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

QCQI – Chapter 4 Detailed Summary: Quantum Circuits & Universality

Learning Objectives

  • Use the quantum circuit model: wires, gates, controlled operations, measurement.

  • Decompose arbitrary single-qubit unitaries via ZYZ Euler angles and synthesize circuits.

  • Understand universal gate sets (e.g., Clifford+T, {H,T,CNOT}\{H,T,\mathrm{CNOT}\}) and the idea of Solovay–Kitaev.

  • Recognize two-qubit universality: any entangling two-qubit gate + all 1-qubit gates is universal.

  • Implement and reason about Toffoli/controlled-UU constructions and CNOT counts at a high level.

Circuit Model & Controlled Operations

A circuit is a sequence of unitary gates acting on qubit wires, followed by measurements. Controlled gates apply a target unitary UU when the control is 1|1\rangle, with matrix ctrl-U=diag(I,U)\mathrm{ctrl}\text{-}U = \mathrm{diag}(I, U) in the control’s computational basis.

Eureka! Control promotes linear evolution into conditional evolution without leaving unitarity; it is the bridge to classical logic within quantum circuits.

Universality & Gate Libraries

A gate set G\mathcal{G} is universal if any nn-qubit unitary can be approximated to tolerance ε\varepsilon by a circuit over G\mathcal{G} with polynomial overhead in nn and log(1/ε)\log(1/\varepsilon). Key libraries:

  • Clifford+T: generated by {H,S,CNOT,T}\{H,S,\mathrm{CNOT},T\}, where T=diag(1,eiπ/4)T=\mathrm{diag}(1,e^{i\pi/4}).

  • {H,T,CNOT}\{H,T,\mathrm{CNOT}\}: also universal (since S=T2S=T^2).

  • Any entangling 2-qubit gate + all 1-qubit gates is universal.

Eureka! Adding any entangling 2-qubit gate to the set of all 1-qubit gates “crosses the universality threshold.”

Single-Qubit Decomposition (ZYZ)

Any USU(2)U\in \mathrm{SU}(2) admits

U=eiδRz(α)Ry(β)Rz(γ),Rn(θ)=eiθnσ/2.\begin{aligned} U = e^{i\delta}\, R_z(\alpha)\, R_y(\beta)\, R_z(\gamma),\qquad R_n(\theta)=e^{-i\theta\, \vec n\cdot \vec\sigma/2}. \end{aligned}

Synthesis follows directly from these rotations.

Eureka! On the Bloch sphere, UU is a rotation; ZYZ chooses a convenient coordinate chart for that rotation.

Two-Qubit Decomposition (Idea)

Any USU(4)U\in \mathrm{SU}(4) can be compiled into a sequence of one-qubit gates interleaved with a finite number of CNOTs. Canonical/KAK decompositions separate local (1-qubit) and nonlocal content.

Eureka! CNOTs are the currency of nonlocality; compilation tries to spend as few as possible.

Approximation & Solovay–Kitaev (SK) Idea

Given a finite universal set with inverses, SK constructs ε\varepsilon-approximations of single-qubit unitaries with length polylog(1/ε)(1/\varepsilon). Practical compilers often use number-theoretic exact synthesis for Clifford+T and heuristic search for small circuits.

Eureka! Polylogarithmic approximation length means high precision is cheap asymptotically.

Worked Constructions

Controlled-UU (single control). Using ZYZ for UU and two CNOTs yields a standard ctrl-U\mathrm{ctrl}\text{-}U template (Barenco-style).

Toffoli (CCX). Can be implemented using Clifford+T with modest TT-count (relative-phase versions reduce CNOT/T counts).

Pseudo-code Aids

Pseudocode — ZYZ angles from a 2×22\times2 unitary

Input: UU(2)U \in \mathrm{U}(2) Normalize phase so detU=1\det U = 1; extract α,β,γ\alpha,\beta,\gamma so that U=Rz(α)Ry(β)Rz(γ)U=R_z(\alpha)R_y(\beta)R_z(\gamma) (Use arctan2 on matrix entries; handle edge cases when β0\beta\approx 0)

Pseudocode — Controlled-UU from ZYZ + two CNOTs (concept)

Input: U=Rz(α)Ry(β)Rz(γ)U=R_z(\alpha)R_y(\beta)R_z(\gamma) Synthesize ctrl-U\mathrm{ctrl}\text{-}U using patterns: interleave CNOT\mathrm{CNOT}s with Rz,RyR_z,R_y on the target Output: Circuit with two CNOTs + single-qubit rotations (details in notebook)

Pseudocode — Coarse Clifford+T approximation of Rz(θ)R_z(\theta)

Input: angle θ\theta, grid step π/4\pi/4 Find k=round(θ/(π/4))k=\mathrm{round}(\theta/(\pi/4)) and use TkT^k (up to phase) Refine with H,SH,S context to reduce global-phase effects

Schematics

Universal Gate Library

Controlled-UU (concept)

Hands-on Notebook (Multi-Backend)

Run: L04_QCQI_Ch04_Quantum_Circuits_and_Universality

In the first cell set backend to one of: cirq, pennylane, braket, pyquil, or qiskit.

Mini-Lab Ideas

  1. Extract ZYZ angles from a random single-qubit unitary; synthesize and verify fidelity.

  2. Coarsely approximate Rz(θ)R_z(\theta) with Clifford+T; study error vs. TT-count.

  3. Implement controlled-Rz(θ)R_z(\theta) and measure entanglement generated from +0|+0\rangle.