The Quantum Fourier Transform
Let’s dive into a subroutine of Shor's Algorithm that involves the Fourier Transform. In particular, we will implement its analog in the quantum realm.
We'll cover the following...
If you took a college class in signal processing and communication, chances are you would already be at home with Fourier Transforms. If this is the first time you hear the words, don’t worry about it. Simply put, the Fourier Transform is a mathematical technique that takes functions from the spatial/temporal domain to the frequency domain. The Fourier Transform of a function is a complex-valued function of frequency whose magnitude represents the amount of that frequency present in the original function and whose argument is the phase offset of the basic sinusoid in that frequency. This technique has many uses, particularly in signal processing and noise cancellation. Those are not important to us for this course. What we are more interested in is the mathematical and geometric properties of the Fourier Transform in the quantum realm.
Mathematics behind the Fourier Transform
Mathematically, the Fourier Transform maps a vector to the vector . Since quantum states are vectors in complex space, we can say that the Quantum Fourier Transform (QFT) acts on wavefunctions and quantum states and generates a state when acted upon ; such that . What is this transformation? This transformation can be considered as taking a qubit from the computational basis and to the Fourier Basis and . These states would be familiar to you, we have already seen them while studying the Hadamard Gate .
In fact, the Hadamard Gate is a 1-qubit Quantum Fourier Transform. It takes to and to . The Hadamard Gate is a specific case of the general formula for the Quantum Fourier Transform, which adds a phase to the vector as follows:
For clarity, let’s derive the formula for using this. For a single qubit, we take , since , where is the number of qubits in our system. Apply the formula to the state to produce a state on the Fourier basis. Let’s call it ...