In this post, we focus on the quantum Fourier transform (QFT), which is the most fundamental and widely used example of a quantum discrete integral transform (see this post). The corresponding unitary matrix is , where the kernel matrix is
where
is the
-th root of unit. We will construct a quantum circuit that efficiently implements the quantum Fourier transform.
Exercise Prove that the kernel matrix
is unitary. You may find the following formula useful:
where .
The discrete Fourier transform (DFT) is defined as
which is ubiquitous in fields such as digital signal processing, speech recognition, image analysis, and data compression. It can transform a problem into some other problem for which the solution is easier to found.
The most efficient classical algorithms for computing the discrete Fourier transform (DFT) on elements are based on the fast Fourier transform (FFT), which has a computational complexity of
. In quantum computation, the DFT is implemented via the quantum Fourier transform, which can be realized on a quantum computer using only
elementary gates. This exponential speedup over classical FFTs is a central feature of several landmark quantum algorithms, including Shor’s algorithm for integer factorization and the quantum phase estimation subroutine.
As explained in this post, in quantum computing we consider the mapping of basis states with
, so that the focus is on the indices of
and
. The quantum Fourier transform (QFT) is thus a unitary map on the computational basis states:
or equivalently, for a general quantum state,
The amplitude after applying the unitary
corresponds to the discrete Fourier transform of
given in Eq. (1).
We now assume that is the number of basis states, so we can work in an
-qubit space
. To understand the quantum Fourier transform (QFT) effectively, it is essential to have a solid grasp of binary number operations, since we will treat the basis label of
as a binary number.
Suppose we represent an integer in binary as
, which corresponds to
This implies that
Essentially, the QFT exploits the binary representation of in the phase factor
, which involves
We only need to consider the fractional part, as the integer part contributes a factor of to the exponential.
Now consider as a binary number, so that
Calculating the multiplication with , we have
so on and so forth, the final term is
We then drop the integer part when for all
since their contributions for exponential factor are all one. This means that for the
-th qubit
, it contributes to the exponential
as
if
, and as
if
.
Thus, the quantum Fourier transform on can be written as
Designing a quantum circuit to realize this transformation is the next step in constructing the quantum Fourier transform algorithm.
Exercise. The equation above can also be derived from the following calculation:
Take as an example to check the expression.
The product form in Eq.(4) naturally guides us in designing a quantum circuit that implements . To construct this circuit, we employ the Hadamard gate together with a series of controlled rotation gates of the form
as suggested by the derivation above.
The quantum circuit for quantum Fourier transform is as follows:

Figure 1 quantum circuit for quantum Fourier transform.
For convenience, let us denote
Using this notation, we have
The reversed order of the indices in is intentional.
The product form of the state after applying the quantum Fourier transform naturally guides the design of a quantum circuit that implements , as illustrated in Figure 1.
The circuit produces the output state
after which a sequence of SWAP gates is applied to reverse the qubit order. To construct this circuit, we employ the Hadamard gate together with a series of controlled rotation gates , where each rotation gate
takes the form
Although we will not use it here, notice that is the Pauli-
operator, which flips the phase of the
basis.
We have already encountered several equivalent expressions for the Hadamard operator that play crucial roles in different context;
here is yet another useful representation:
The action of the controlled- gate, denoted
, is as follows:
where . Thus, the controlled rotation
injects the control qubit’s binary value
into the phase of the target qubit, contributing a factor of
. With the above preparation, let us now examine the quantum circuit in Figure 1.
For the bottom quantum wire , the Hadamard operator gives (see Eq. 1)
For , the Hadamard gate contributes a phase factor
, and the controlled-
gate controlled by
contributes
, so that the final phase factor is
. The state of this quantum wire becomes
For , the Hadamard gate contributes a phase factor
, the controlled-
gate controlled by
contributes
, and the controlled-
gate controlled by
contributes
. The final phase factor is thus
, and the state of this quantum wire becomes
This pattern continues similarly for the remaining qubits. We see that the quantum circuit in Figure 1 realizes the quantum Fourier transform.
