Lean, informalized

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

Exercise 5.3 - The classical cost of transforming 2n2^n complex numbers, directly and by the fast Fourier transform

Operation counts of the direct and the fast Fourier transform.

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

A list of N=2nN = 2^n complex numbers x0,…,xN−1x_0, \dots, x_{N-1}, as many as the amplitudes of nn qubits, is to be Fourier transformed on a classical computer. The discrete Fourier transform sends it to the list y0,…,yN−1y_0, \dots, y_{N-1} with yk=1N∑j=0N−1e2πijk/Nxj.y_k = \frac{1}{\sqrt{N}} \sum_{j=0}^{N-1} e^{2\pi i jk/N} x_j .(1) The exercise asks how the number of elementary arithmetic operations grows with nn, once when (1) is evaluated directly, one output yky_k at a time, and once when the transform is computed by the fast Fourier transform.

The Operation Counts

The operation count Tdir(n)T_{\mathrm{dir}}(n) of the direct evaluation of a transform of 2n2^n numbers is the whole number Tdir(n)=4n+2n(2n−1),T_{\mathrm{dir}}(n) = 4^n + 2^n \bigl(2^n - 1\bigr),(2)✦

The fast Fourier transform’s operation count TFFT(n)T_{\mathrm{FFT}}(n) for 2n2^n numbers satisfies the recursion TFFT(0)=0,TFFT(n+1)=2TFFT(n)+2n+1.T_{\mathrm{FFT}}(0) = 0, \qquad T_{\mathrm{FFT}}(n+1) = 2\,T_{\mathrm{FFT}}(n) + 2^{n+1}.(3)✦

The Claim

For real functions ff and gg of the whole number nn, f(n)=Θ(g(n))f(n) = \Theta(g(n)) means that there are constants c,C>0c, C > 0 and n0n_0 with cg(n)≤f(n)≤Cg(n)c\,g(n) \le f(n) \le C\,g(n) for all n≥n0n \ge n_0.

Theorem 1. As n→∞n \to \infty, the operation count of the direct evaluation satisfies Tdir(n)=Θ(22n),T_{\mathrm{dir}}(n) = \Theta\bigl(2^{2n}\bigr),(4)✦ and the operation count of the fast Fourier transform satisfies TFFT(n)=Θ(n2n).T_{\mathrm{FFT}}(n) = \Theta\bigl(n\,2^n\bigr).(5)✦

What Is Checked

The claim is stated over the two operation counts: the closed formula (2) for the direct evaluation and the recursion (3) for the fast Fourier transform.

What the library proves about these counts is their order of growth, (4) for the direct evaluation and (5) for the fast Fourier transform.