Quantum Information and Channels: A formalization blueprint

47 The quantum Fourier transform

This chapter writes the quantum Fourier transform on \(n\) qudits of dimension \(d\) as a unitary circuit of one- and two-qudit gates, in the form of [ 121 , Fig. 5.1 ] , and proves that its Kraus operator is the Fourier matrix. The proof is given once, for every order of the gates in which each controlled phase acts after the Fourier gate on its target and before the Fourier gate on its control. Scheduling the gates by time in \(2n-1\) layers of disjoint gates, followed by one layer of swaps, is such an order, and gives a circuit of depth at most \(2n\) with the same gates. The qubit circuit of [ 121 , Fig. 5.1 ] is the case \(d=2\), with the depth and gate counts unchanged. The chapter uses the circuits of Chapter 45 on the geometry of sites and pairs.

47.1 Qudits and gates

The system of \(n\) qudits of dimension \(d\) has the sites \(0,\dots ,n-1\) and the basis \(\{ 0,\dots ,d-1\} \) at every site; qubits are the case \(d=2\). A configuration \(x\) encodes the number \(\langle x\rangle =\sum _ix_id^{n-1-i}\), the site \(0\) most significant; this is a bijection onto \(\{ 0,\dots ,d^n-1\} \). The circuits of this chapter use the geometry of sites and pairs on the \(n\) qudits, every cell of cost \(1\).

The Fourier gate \(F_d\) of one qudit is the Fourier matrix of the residues modulo \(d\) at the primitive root \(\zeta =e^{2\pi i/d}\), indexed by \(\{ 0,\dots ,d-1\} \): \((F_d)_{yx}=\zeta ^{xy}/\sqrt d=d^{-1/2}e^{2\pi i\, xy/d}\), the factor \(d^{-1/2}\) normalizing it. The controlled phase of order \(k\) on two qudits is the diagonal matrix \((c,t)\mapsto e^{2\pi i\, ct/d^k}\). The swap of two qudits is the flip operator \(F\) on \(\mathbb {C}^d\otimes \mathbb {C}^d\). For qubits, \(F_2\) is the Hadamard gate \(H_{yx}=(-1)^{xy}/\sqrt2\); the phase gate is \(R_k=\operatorname {diag}(1,e^{2\pi i/2^k})\), and the controlled gate of a matrix \(U\) is the controlled element \(C(p,x)=px+(1-p)\) of \(p=\lvert 1\rangle \langle 1\rvert \otimes 1\) and \(x=1\otimes U\),

\begin{align} C(p,x)& =\lvert 0\rangle \langle 0\rvert \otimes 1+\lvert 1\rangle \langle 1\rvert \otimes U, \notag \end{align}

the control first.

The Fourier gate, the controlled phases and the swap are unitary, and so are the phase gates and the controlled gates of unitary matrices on qubits. For qubits, the controlled gate of \(R_k\) is the controlled phase of order \(k\).

Proof ▶

For \(d\geq 1\), \(F_d\) is unitary by Lemma 14.1.32, since \(e^{2\pi i/d}\) is a primitive \(d\)-th root of unity; for \(d=0\) there is nothing to prove. A diagonal matrix of phases is unitary. The controlled gate of a unitary matrix is block diagonal with unitary blocks, and \(F^\dagger =F\), \(F^2=1\).

47.2 Admissible orders of the gates

The Fourier matrix \(F\) on \(n\) qudits is the Fourier matrix \(F_{d^n}\) of \(\mathbb {Z}/d^n\mathbb {Z}\) in the base-\(d\) encoding, \(F_{yx}=(F_{d^n})_{\langle y\rangle \langle x\rangle }\) [ 121 , eq. (5.2) ] for \(d=2\). Its gates are given by one table on the cells: the Fourier gate \(F_d\) on a qudit; on an ordered pair \((j,i)\) with \(i{\lt}j\) the controlled phase of order \(j-i+1\), with control \(j\) and target \(i\); on an ordered pair \((a,b)\) with \(a{\lt}b\) the swap. Each is unitary, and so is its placement on the register. For qubits these are the Hadamard gate and the controlled gate of \(R_{j-i+1}\).

The Fourier matrix on \(n\) qudits is unitary, and

\begin{align} F_{yx}& =d^{-n/2}\, e^{2\pi i\langle y\rangle \langle x\rangle /d^n}. \label{eq:qft_dft_entries} \end{align}
Proof ▶

By the entries of \(F_{d^n}\) and \((d^n)^{-1/2}=(d^{-1/2})^n\). A relabelling of a unitary matrix along a bijection of its index set is unitary, and \(F_{d^n}\) is unitary by Lemma 47.1.3.

The Fourier and controlled phase cells are the qudits and the ordered pairs \((j,i)\) with \(i{\lt}j\). A sequence of such cells is admissible from a set \(A\) of transformed qudits when every Fourier gate acts on a qudit not yet transformed, which it then transforms, and every controlled phase \((j,i)\) acts when its target \(i\) is transformed and its control \(j\) is not. A concatenation is admissible exactly when the first part is admissible from \(A\) and the second from \(A\) together with the qudits transformed by the first. The swap cells are the pairs \((k,n-1-k)\) for \(k{\lt}\lfloor n/2\rfloor \).

Theorem 47.2.4 Every admissible order computes the Fourier transform
✓

Every admissible order of the Fourier and controlled phase gates computes the quantum Fourier transform, with the qudits in reverse order until the swaps restore it. Precisely, let a sequence of the Fourier and controlled phase cells contain each of them once and be admissible from the empty set. The product of the placed gates along it, the first on the right, has the entry \(F_{\bar yx}\) at \((y,x)\), where \(\bar y_i=y_{n-1-i}\). Followed by the swaps, the product is \(F\), the Fourier matrix of \(\mathbb {Z}/d^n\mathbb {Z}\) in the base-\(d\) encoding.

Proof ▶

Follow the column \(e_x\) of a basis vector. After a prefix of the sequence the column is the product state in which every transformed qudit \(k\) carries \(d^{-1/2}\sum _ce^{2\pi i\, c\, \theta _k}\lvert c\rangle \) and every other qudit its input digit \(x_k\). The Fourier gate on a qudit \(a\) still in its basis state gives it the phase \(\theta _a=x_a/d\), by Lemma 45.7.2. The controlled phase \((j,i)\) is diagonal; since its control \(j\) is still in the basis state \(x_j\) and its target \(i\) is transformed, it adds \(x_jd^{-(j-i+1)}\) to \(\theta _i\). Hence after the whole sequence

\begin{align} \theta _k& =\frac{x_k}d+\sum _{j{\gt}k}\frac{x_j}{d^{j-k+1}}, \notag \end{align}

independently of the order, and the entry at \(y\) is \(d^{-n/2}\prod _ke^{2\pi i\, y_k\theta _k}\). The sum \(\sum _ky_k\theta _k\) differs from \(\langle \bar y\rangle \langle x\rangle /d^n\) by an integer: the terms \(x_jy_kd^{j-k-1}\) with \(j{\lt}k\) omitted from it are integers. The swap of \(k\) and \(n-1-k\) exchanges the two coordinates, so the swaps reverse the order of the qudits.

47.3 The circuit of Nielsen and Chuang

The textbook circuit without swaps applies, for each qudit \(i=0,\dots ,n-1\) in turn, the Fourier gate to \(i\) and then, for \(j=i+1,\dots ,n-1\), the controlled phase of order \(j-i+1\) with control \(j\) and target \(i\), one gate per layer. This order is admissible and contains each Fourier and controlled phase cell once, \(n(n+1)/2\) cells in all. The Fourier circuit is the textbook circuit followed by the swaps, one per layer.

Along its single branch the textbook circuit without the swaps has the Kraus operator with entry \(F_{\bar yx}\) at \((y,x)\), and the Kraus operator of the Fourier circuit is \(F\). For qubits this is the circuit of [ 121 , Fig. 5.1 ] .

Proof ▶

By Lemma 45.6.1 and Lemma 45.1.10 the Kraus operator is the product of the placed gates, and Theorem 47.2.4 applies.

The Fourier circuit is unbranched and locally unitary. Without the swaps it uses \(n(n+1)/2\) gates, and with them \(n(n+1)/2+\lfloor n/2\rfloor \), which also bounds its depth. None of these numbers depends on \(d\).

Proof ▶

Every layer holds one unitary gate of cost \(1\) and has one outcome, so by Lemma 45.6.1 the gate count is the number of layers, and the depth is at most the gate count.

47.4 The Fourier transform in linear depth

Place the Fourier gate on the qudit \(i\) at time \(2i\) and the controlled phase of order \(j-i+1\) with control \(j\) and target \(i{\lt}j\) at time \(i+j\). Two distinct cells used at the same time \(t\) are disjoint: if they shared a qudit, the time and the order \(i{\lt}j\) would determine the other qudit of each. Every cell has a time below \(2n-1\). The scheduled circuit is the sequence of the layers of the gates at the times \(0,\dots ,2n-2\), followed by the layer of all swaps. The order of the times is admissible: \(2i{\lt}i+j{\lt}2j\) for \(i{\lt}j\).

The Kraus operator of the scheduled circuit is the Fourier matrix \(F\). It is unbranched and locally unitary, uses as many gates as the Fourier circuit of Definition 47.3.1, and has depth at most \(2n\).

Proof ▶

By Theorem 45.6.5 the Kraus operator of a layer is the product of the placements of its gates, in any order; ordering each layer as its time class, the product of the layers is the product along the concatenation of the time classes, followed by the swaps, and Theorem 47.2.4 applies. The time classes partition the Fourier and controlled phase cells, so the gate count is the number of these cells plus \(\lfloor n/2\rfloor \), as for the Fourier circuit. Each of the \(2n\) layers has depth at most \(1\), and the depth of a sequence is at most the sum of the depths of its layers; for \(n=0\) the only layer is empty.