Introduction to the Classical Discrete Fourier transform:
The DFT transforms a sequence of N complex numbers {xn}:=x0,x1,x2,...,xN−1 into another sequence of complex numbers {Xk}:=X0,X1,X2,... which is defined by
Xk=∑n=0N−1xn.e±2πiknN
We might multiply by suitable normalization constants as necessary. Moreover, whether we take the plus or minus sign in the formula depends on the convention we choose.
Suppose, it's given that N=4 and x=⎛⎝⎜⎜⎜12−i−i−1+2i⎞⎠⎟⎟⎟.
We need to find the column vector X. The general method is already shown on the Wikipedia page. But we will develop a matrix notation for the same. X can be easily obtained by pre multiplying x by the matrix:
M=1N−−√⎛⎝⎜⎜⎜11111ww2w31w2w4w61w3w6w9⎞⎠⎟⎟⎟
where w is e−2πiN. Each element of the matrix is basically wij. 1N√ is simply a normalization constant.
Finally, X turns out to be: 12⎛⎝⎜⎜⎜2−2−2i−2i4+4i⎞⎠⎟⎟⎟.
Now, sit back for a while and notice a few important properties:
- All the columns of the matrix M are orthogonal to each other.
- All the columns of M have magnitude 1.
- If you post multiply M with a column vector having lots of zeroes (large spread) you'll end up with a column vector with only a few zeroes (narrow spread). The converse also holds true. (Check!)
It can be very simply noticed that the classical DFT has a time complexity O(N2). That is because for obtaining every row of X, N operations need to be performed. And there are N rows in X.
The Fast fourier transform:
Now, let us look at the Fast fourier transform. The fast Fourier transform uses the symmetry of the Fourier transform to reduce the computation time. Simply put, we rewrite the Fourier transform of size N as two Fourier transforms of size N/2 - the odd and the even terms. We then repeat this over and over again to exponentially reduce the time. To see how this works in detail, we turn to the matrix of the Fourier transform. While we go through this, it might be helpful to have DFT8 in front of you to take a look at. Note that the exponents have been written modulo 8, since w8=1.
Notice how row j is very similar to row j+4. Also, notice how column j
is very similar to column j+4. Motivated by this, we are going to split the
Fourier transform up into its even and odd columns.
In the first frame, we have represented the whole Fourier transform matrix
by describing the jth row and kth column: wjk. In the next frame, we separate the odd and even columns, and similarly separate the vector that is to be transformed. You should convince yourself that the first equality really is
an equality. In the third frame, we add a little symmetry by noticing that
wj+N/2=−wj (since wn/2=−1).
w2jkww2N/2jkw2jkDFT(N/2)DFTN in a new way:
Now suppose we are calculating the Fourier transform of the function f(x).
We can write the above manipulations as an equation that computes the jth
term f^(j).
Note: QFT in the image just stands for DFT in this context. Also, M refers to what we are calling N.
This turns our calculation of DFTN into two applications of DFT(N/2). We
can turn this into four applications of DFT(N/4), and so forth. As long as N=2n for some n, we can break down our calculation of DFTN into N
calculations of DFT1=1. This greatly simplifies our calculation.
In case of the Fast fourier transform the time complexity reduces to O(Nlog(N)) (try proving this yourself). This is a huge improvement over the classical DFT and pretty much the state-of-the-art algorithm used in modern day music systems like your iPod!
The Quantum Fourier transform with quantum gates:
The strength of the FFT is that we are able to use the symmetry of the
discrete Fourier transform to our advantage. The circuit application of QFT
uses the same principle, but because of the power of superposition QFT is
even faster.
The QFT is motivated by the FFT so we will follow the same steps, but
because this is a quantum algorithm the implementation of the steps will be
different. That is, we first take the Fourier transform of the odd and even
parts, then multiply the odd terms by the phase wj.
In a quantum algorithm, the first step is fairly simple. The odd and even
terms are together in superposition: the odd terms are those whose least
significant bit is 1, and the even with 0. Therefore, we can apply QFT(N/2) to both the odd and even terms together. We do this by applying we will simply apply QFT(N/2) to the n−1 most significant bits, and recombine the odd and even appropriately by applying the Hadamard to the least significant bit.
Now to carry out the phase multiplication, we need to multiply each odd
term j by the phase wj . But remember, an odd number in binary ends with a 1 while an even ends with a 0. Thus we can use the controlled phase shift, where the least significant bit is the control, to multiply only the odd terms by the phase without doing anything to the even terms. Recall that the controlled phase shift is similar to the CNOT gate in that it only applies a phase to the target if the control bit is one.
Note: In the image M refers to what we are calling N.
The phase associated with each controlled phase shift should be equal to
wj where j is associated to the k-th bit by j=2k.
Thus, apply the controlled phase shift to each of the first n−1 qubits,
with the least significant bit as the control. With the controlled phase shift
and the Hadamard transform, QFTN has been reduced to QFT(N/2).
Note: In the image, M refers to what we are calling N.
Example:
Lets construct QFT3. Following the algorithm, we will turn QFT3 into QFT2
and a few quantum gates. Then continuing on this way we turn QFT2 into
QFT1 (which is just a Hadamard gate) and another few gates. Controlled
phase gates will be represented by Rϕ. Then run through another iteration to get rid of QFT2. You should now be able to visualize the circuit for QFT on more qubits easily. Furthermore, you can see that the number of gates necessary to carry out QFTN it takes is exactly
∑i=1log(N)i=log(N)(log(N)+1)/2=O(log2N)
Sources:
https://en.wikipedia.org/wiki/Discrete_Fourier_transform
https://en.wikipedia.org/wiki/Quantum_Fourier_transform
Quantum Mechanics and Quantum Computation MOOC (UC BerkeleyX) - Lecture Notes : Chapter 5
P.S: This answer is in its preliminary version. As @DaftWillie mentions in the comments, it doesn't go much into "any insight that might give some guidance with regards to other possible algorithms". I encourage alternate answers to the original question. I personally need to do a bit of reading and resource-digging so that I can answer that aspect of the question.