Lean, informalized

Nielsen & Chuang · Chapter 5, The quantum Fourier transform and its applications · p. 221

Exercise 5.6 - The gate error of a Fourier transform circuit whose controlled phases are all off by the same small amount

Phase errors add up over the Fourier circuit’s gates.

Hover over a blue or green term in the text, or a node in the graph, to find it in the other. Select it to read its declaration both in Lean and in words.

The Exercise

The quantum Fourier transform UU on nn qubits has a circuit of Hadamard gates and controlled phase gates Rk=diag(1,e2πi/2k)R_k = \mathrm{diag}(1, e^{2\pi i/2^k}), with kk up to nn, so the phases it calls for shrink to 2π/2n2\pi/2^n. Suppose each controlled RkR_k is carried out with its phase off by Δ=1/p(n)\Delta = 1/p(n), and let VV be the circuit that results. The exercise is to show that the gate error E(U,V)E(U,V) between the two unitaries scales as Θ(n2/p(n))\Theta(n^2/p(n)).

The library builds VV gate by gate and bounds E(U,V)E(U,V) from above and from below.

A Quantum System

A quantum system SS is given by its state space, a finite dimensional complex Hilbert space, and every such space HH is the state space of a system. The qudit with dd levels is the system whose state space is ℂd\mathbb{C}^d with its standard inner product and computational basis |0⟩,…,|d−1⟩|0\rangle, \dots, |d-1\rangle.✦ The qudit with d=2nd = 2^n levels is a register of nn qubits, its basis states labelled by strings x=(x0,…,xn−1)x = (x_0, \dots, x_{n-1}) of nn bits, xjx_j being the bit on wire jj.

A unitary WW of a system SS is an operator on the state space of SS with W†W=WW†=1W^\dagger W = W W^\dagger = 1.✦ The gate of a unitary d×dd \times d matrix MM is the unitary of the qudit with dd levels that acts on state vectors as MM does in the computational basis.✦

The gate error between two unitaries UU and VV of SS is the operator norm of their difference, E(U,V)=∥U−V∥=max∥|ψ⟩∥=1∥(U−V)|ψ⟩∥.E(U,V) = \|U - V\| = \max_{\| |\psi\rangle \| = 1} \|(U - V)|\psi\rangle\|.(1)✦

The Fourier Transform

The Fourier matrix FF in dimension dd is the complex d×dd \times d matrix, rows and columns labelled 0,…,d−10, \dots, d-1, built on the primitive ddth root of unity ω\omega: Fkj=ωjkd,ω=e2πi/d.F_{kj} = \frac{\omega^{jk}}{\sqrt{d}}, \qquad \omega = e^{2\pi i/d}.(2) For d≠0d \neq 0 the quantum Fourier transform on the qudit with dd levels is the unitary whose matrix in the computational basis is FF.✦ On the register of nn qubits, where d=2nd = 2^n, it is the transform UU of the exercise.

The Circuit

Each gate of the circuit acts on one wire of the register. The single qubit gate of a complex 2×22 \times 2 matrix gg on wire jj applies gg to bit jj and leaves the other bits alone.✦ More generally, when a 2×22 \times 2 block f(y)f(y) is assigned to each pattern yy of the other bits, the gate on wire jj block by block applies f(y)f(y) to that wire whenever the other bits read yy, and leaves them unchanged.✦ For a complex 2×22 \times 2 matrix Ũ\tilde U and a set KK of control wires, the multiply controlled gate CK(Ũ)C^K(\tilde U) on target wire jj is the case f(y)=Ũf(y) = \tilde U when every wire of KK carries a 11 in yy, and f(y)=1f(y) = 1 otherwise.✦

A permutation σ\sigma of the bit strings defines a permutation gate, the matrix sending |x⟩|x\rangle to |σ(x)⟩|\sigma(x)\rangle.✦ The bit reversal σ(x)j=xn−1−j\sigma(x)_j = x_{n-1-j} reverses the order of the wires, and its gate is written PP.✦

Two single qubit matrices enter: the Hadamard gate, and for each kk the phase gate Rk′R_k', which shifts the phase 2π/2k2\pi/2^k of RkR_k by Δ\Delta: H=12(111−1),Rk′=(100e2πi/2k+iΔ).H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}, \qquad R_k' = \begin{pmatrix} 1 & 0 \\ 0 & e^{2\pi i/2^k + i\Delta} \end{pmatrix}.(3)

Let HtH_t be the Hadamard gate on wire tt, and Ct,c=C{c}(Rc−t+1′)C_{t,c} = C^{\{c\}}(R_{c-t+1}') the controlled phase gate with control wire cc and target wire tt. The circuit with phase error Δ\Delta reverses the wires and then runs the block BtB_t of each wire tt in turn, a Hadamard followed by the controlled gates from the later wires c=t+1,…,n−1c = t+1, \dots, n-1; with the rightmost factor acting first, its matrix is V=Bn−1⋯B1B0P,Bt=Ct,n−1⋯Ct,t+1Ht.V = B_{n-1} \cdots B_1 B_0 \, P, \qquad B_t = C_{t,n-1} \cdots C_{t,t+1} \, H_t .(4) The approximate Fourier transform VV with phase error Δ\Delta on the register of nn qubits is the gate of the matrix (4) on that register.

The number of controlled gates is N(n)=n(n−1)2.N(n) = \frac{n(n-1)}{2}.(5)✦

The Claim

Theorem 1. Let nn be a number of qubits and pp a real function of nn with p(n)≥0p(n) \ge 0 and N(n)/p(n)≤πN(n)/p(n) \le \pi. Let UU be the quantum Fourier transform on the register of nn qubits and VV the approximate Fourier transform with phase error Δ=1/p(n)\Delta = 1/p(n). Then N(n)πp(n)≤E(U,V)≤N(n)p(n).\frac{N(n)}{\pi \, p(n)} \le E(U,V) \le \frac{N(n)}{p(n)}.(6)✦ For every real function pp on the numbers of qubits, as n→∞n \to \infty, N(n)p(n)=Θ(n2p(n)).\frac{N(n)}{p(n)} = \Theta\!\left(\frac{n^2}{p(n)}\right).(7)✦

What Is Checked

The claim is stated over the register of nn qubits, the quantum Fourier transform UU with the matrix (2), the approximate transform VV given by the circuit (4) at Δ=1/p(n)\Delta = 1/p(n), their gate error (1), and the count (5) of controlled gates.

About these constructions the library proves that the matrix (4) of the circuit is unitary for every number of qubits and every phase error Δ\Delta.✦