The Quantum Fourier Transform (QFT) is the quantum analogue of the Discrete Fourier Transform (DFT), transforming quantum states from the computational basis into the Fourier basis.
QFT encodes information through quantum amplitudes and phase relationships, making periodicity and phase information useful for further quantum computation.
A QFT circuit is primarily built using Hadamard gates, controlled-phase rotations, and SWAP gates, with each playing a specific role in constructing the Fourier-basis representation.
For an n-qubit system, the exact QFT can be implemented using O(n²) gates, but this should not be interpreted as simply being “faster than FFT” because the QFT output is a quantum state rather than a classical list of Fourier coefficients.
The inverse QFT reverses the transformation and is especially important for extracting encoded phase information in algorithms such as Quantum Phase Estimation and Shor’s algorithm.
QFT can be implemented and explored in Qiskit, while approximate QFT circuits can reduce smaller controlled-phase rotations to lower circuit complexity when an exact transformation is unnecessary.
The Quantum Fourier Transform (QFT) is the quantum version of the discrete Fourier transform. It changes a quantum state from the computational basis into the Fourier basis, making information about phase and periodic structure easier for certain quantum algorithms to extract.
Unlike a classical Fourier transform, the QFT operates directly on a quantum state and is implemented as a quantum circuit. It is a foundational component of Quantum Phase Estimation and Shor’s algorithm. In this guide, we’ll build the idea from the classical DFT to the QFT formula, then see a simple 3-qubit quantum Fourier transform circuit, its complexity, inverse QFT, applications, and a practical Qiskit implementation.
What is the Quantum Fourier Transform?
The Quantum Fourier Transform is a unitary transformation that maps a quantum state from the computational basis to the Fourier basis. For an n-qubit register, it operates across possible basis states.
QFT in One Simple Intuition
A classical Fourier transform breaks a signal into its frequency components. The QFT performs a related transformation, but on the amplitudes and phases of a quantum state. This makes phase and periodicity easier for certain quantum algorithms to extract. That is why QFT appears in algorithms such as Quantum Phase Estimation and Shor’s algorithm.
Importantly, the QFT does not simply perform an FFT on a quantum computer. It is a quantum transformation implemented through a sequence of quantum gates.
What Happens to a Quantum State?
For a computational-basis state |x⟩, the QFT is defined as:
|x⟩ → (1/√N) Σᵧ₌₀ᴺ⁻¹ e^(2πixy/N) |y⟩
Here:
is the input basis state.
represents the output basis states.
for qubits.
represents the phase relationship.
provides normalization.
The important idea is not to memorise the formula, but to understand that QFT changes how quantum information is represented so that phase and periodic structure become accessible to later operations.
How is the Quantum Fourier Transform Related to the Classical DFT?
The QFT is closely related to the Discrete Fourier Transform (DFT). Both use complex exponentials to transform information into a Fourier basis, but the QFT applies the transformation as a unitary operation on a quantum state.
Quick Recap of the Discrete Fourier Transform
The DFT can be written as:
It takes a classical list of values and produces Fourier coefficients. These coefficients describe the frequency components present in the input and are widely used in signal processing and numerical computation.
DFT vs QFT in One Table
Feature
DFT
QFT
Input
Classical data/vector
Quantum state
Output
Fourier coefficients
Quantum state in Fourier basis
Transformation
Matrix/vector operation
Quantum unitary
Typical purpose
Frequency analysis
Phase/periodicity in quantum algorithms
Implementation
Classical arithmetic
Quantum gates
Why the QFT Is Not Just an FFT
FFT and QFT are related but are not the same thing. The FFT is a classical algorithm for efficiently computing the DFT. The QFT is a quantum circuit that implements a Fourier transformation on a quantum state. Therefore, comparing their complexity as though they perform exactly the same computational task can be misleading.
What is the Quantum Fourier Transform Formula?
For , the quantum Fourier transform is:
QFTₙ|x⟩ = (1/√N) Σᵧ₌₀ᴺ⁻¹ e^(2πixy/N)|y⟩
This is the central quantum Fourier transform formula. You do not need to derive it line by line to understand how QFT works.
Breaking Down the QFT Formula
Each part has a specific role:
: the Fourier transformation.
|x⟩: the input computational-basis state.
: the number of possible basis states.
: the normalization factor.
: the phase factor.
|y⟩: the output basis states.
What Does the Phase Factor Actually Do?
The exponential term assigns different phases to the components of the resulting state. These relative phases are what allow later quantum operations to reveal useful periodic or phase information. The formula tells us what the QFT does mathematically. The next question is how a quantum computer actually builds that transformation from basic gates.
How Do You Build a Quantum Fourier Transform Circuit?
A standard exact quantum Fourier transform circuit can be constructed from three main ingredients: Hadamard gates, controlled-phase rotations and a final layer of SWAP gates.
The Three Building Blocks of a QFT Circuit
1. Hadamard gate
The Hadamard gate creates superposition and provides the basic building block for the QFT.
2. Controlled-phase gate
Controlled-phase gates introduce relative phase information between qubits. Their rotation angles become progressively smaller as the circuit moves through the qubits.
3. SWAP gate
SWAP gates reverse the qubit ordering produced by the standard decomposition. They can sometimes be omitted if the reversed ordering is handled elsewhere.
QFT Circuit for 2 Qubits
Conceptually, a 2-qubit QFT follows the pattern:
H → controlled phase → H → controlled phase → SWAP
The Hadamard gates create superposition, while the controlled-phase operation introduces the relative phase relationships required for the Fourier-basis transformation.
QFT Circuit for 3 Qubits
A 3-qubit QFT circuit follows the same pattern at a larger scale:
Apply H to the first qubit.
Apply controlled-phase rotations with the other qubits.
Repeat the process for the remaining qubits.
Apply the final SWAP operations.
The controlled rotations use progressively smaller angles, such as , , and , depending on the qubit pair.
This 3-qubit QFT circuit is useful because it makes the repeating structure of the quantum Fourier transform gates easier to see than the formula alone.
How Does a 3-Qubit QFT Work Step by Step?
A 3-qubit register contains 2³ = 8 computational-basis states:
|000⟩, |001⟩, …, |111⟩
Start With a Simple Input State
Consider the input:
|101⟩
The QFT transforms this single basis state into a superposition of all eight basis states, with different phase relationships between them.
The resulting state contains structured phase relationships. These relationships can then be exploited by algorithms such as quantum phase estimation. The important point is that the QFT’s value does not simply come from creating a large superposition. It comes from the way these phases interfere when the quantum circuit continues processing the state.
What is the Complexity of the Quantum Fourier Transform?
An exact QFT on qubits requires elementary gates in its standard decomposition. Since , this can also be expressed as in terms of the Hilbert-space dimension.
QFT Complexity in Terms of Qubits
The standard complexity is:
where is the number of qubits.
As the number of qubits increases, the gate count grows quadratically. A 3-qubit circuit remains small, while a 100-qubit QFT requires substantially more gates.
QFT vs Classical DFT
The distinction becomes clearer when comparing the standard complexities:
Naive DFT:
FFT:
QFT: , where
Does QFT Beat the FFT?
Not in the simple sense of “QFT is faster.” The apparent difference comes partly from the fact that an -qubit quantum system represents a space of basis states. But extracting a complete classical list of Fourier coefficients from a quantum state requires measurement, which can remove the apparent advantage. So QFT and FFT should not be treated as interchangeable algorithms with directly comparable outputs.
What is the Inverse Quantum Fourier Transform?
The inverse quantum Fourier transform reverses the QFT, taking a state from the Fourier basis back toward the computational basis. It is obtained by reversing the QFT circuit and taking the adjoint of each gate.
QFT vs Inverse QFT
QFT
Inverse QFT
Computational basis → Fourier basis
Fourier basis → computational basis
Applies the forward phase convention
Uses conjugate/reversed phases
Encodes phase information
Helps extract phase information
How Do You Reverse a QFT Circuit?
To construct an inverse QFT circuit:
Reverse the order of the gates.
Replace phase rotations with their inverses.
Handle the SWAP operations in reverse as appropriate.
Keep the Hadamard gates unchanged because H is its own inverse.
Why is the Inverse QFT Important?
The inverse QFT is particularly important in Quantum Phase Estimation and Shor’s algorithm, where phase information must eventually be converted into a form that can be measured.
Where is the Quantum Fourier Transform Used?
The main value of QFT comes from its ability to help quantum algorithms extract phase and periodicity information. Its best-known applications are Quantum Phase Estimation and Shor’s algorithm.
QFT in Quantum Phase Estimation
In Quantum Phase Estimation, an unknown phase is encoded into a quantum register. The inverse QFT then transforms that phase information into a form that can be measured.
This makes QFT quantum phase estimation one of its most important applications.
QFT in Shor’s Algorithm
Shor’s algorithm uses the QFT to help identify periodicity. That periodicity is then used as part of the process for solving the factoring problem.
The QFT is therefore a subroutine within Shor’s algorithm, not the entire algorithm.
Other Quantum Algorithms and Applications
QFT can also appear in:
Quantum arithmetic
Period-finding
Fourier-basis transformations
Certain quantum simulation and signal-processing techniques
The key takeaway is that QFT provides the phase and periodicity transformation that these algorithms can exploit.
How Do You Implement a QFT in Qiskit?
Qiskit provides a practical way to represent and inspect a quantum Fourier transform circuit. Current IBM documentation recommends QFTGate as the modern Qiskit representation.
Create a 3-Qubit QFT Circuit
A minimal Qiskit implementation is:
from qiskit import QuantumCircuit
from qiskit.circuit.library import QFTGate
qc = QuantumCircuit(3)
qc.append(QFTGate(3), [0, 1, 2])
print(qc.draw())
Here, QuantumCircuit(3) creates a three-qubit circuit, while QFTGate(3) represents the QFT over those three qubits. append() places the QFT gate on the register, and draw() displays the resulting circuit.
Decompose the QFT Into Basic Gates
The abstract QFTGate can be decomposed to reveal the underlying structure:
Hadamard gates
Controlled-phase gates
SWAP gates
This lets beginners move from the high-level QFT representation to the actual quantum Fourier transform circuit underneath it.
What Should Beginners Look for in the Circuit?
Rather than memorising every gate, look for the recurring pattern:
H → controlled phases → H → controlled phases → SWAP
Once this structure becomes familiar, reading a QFT quantum circuit becomes much easier.
Conclusion
The Quantum Fourier Transform becomes much easier to understand once its pieces are connected: it transforms quantum states into the Fourier basis, uses controlled phase relationships to build that transformation, and can be reversed when phase information needs to be extracted. With these foundations, you can start recognising why QFT is such an important building block in modern quantum algorithms.
Want to move from understanding quantum algorithms to actually building them? The Applied Quantum Computing & AI programme by IIT Delhi, delivered on Varsity by InterviewBit, combines quantum foundations with Qiskit, algorithm design, real quantum systems, and hands-on projects so you can put these concepts into practice.
Frequently Asked Questions
Can the Quantum Fourier Transform be applied to a superposition?
Yes. The QFT is a linear operation, so it can be applied to any valid quantum state, including superpositions. It transforms the amplitudes and phases of the input state into a new Fourier-basis representation, which can reveal useful periodic patterns.
What is an approximate Quantum Fourier Transform?
An approximate QFT is a simplified version that removes some of the smallest controlled-phase rotations. This reduces the number of gates and circuit depth while keeping the transformation sufficiently accurate for some applications.
When should you use an approximate QFT?
An approximate QFT can be useful when reducing circuit depth and gate count is more important than implementing the exact transformation. This is particularly relevant on current quantum hardware, where deeper circuits are more exposed to noise and errors.
What is a QFT matrix?
A QFT matrix is the unitary matrix that represents the Fourier transformation on a quantum system. Its entries contain complex phase factors, and for an n-qubit system it has dimensions .
How does QFT transform an arbitrary quantum state?
The QFT transforms every computational-basis component of a state into a corresponding Fourier-basis pattern. Because it is linear, the transformation applies to the entire superposition at once, changing the amplitudes and phase relationships between its components.
Why can’t you directly read all the Fourier coefficients from a QFT?
A QFT stores information in the amplitudes and phases of a quantum state, but measurement does not reveal all amplitudes at once. Instead, algorithms such as phase estimation are designed to extract particular information from the transformed state through carefully chosen measurements.
What is the semiclassical Quantum Fourier Transform?
The semiclassical QFT is a measurement-based approach that replaces parts of the standard QFT circuit with measurements and classically controlled operations. It can reduce the number of coherent qubits needed for certain implementations.
What is phase kickback in the QFT?
Phase kickback is a mechanism where a controlled operation transfers phase information onto another qubit. This phase information can then be processed by Hadamard gates and the QFT, making phase kickback an important concept in quantum phase estimation and related algorithms.
How does QFT accuracy affect quantum phase estimation?
The accuracy of the QFT affects how precisely a phase can be represented and extracted. Using more counting qubits provides more bits with which to encode the estimated phase, while an approximate QFT can trade some precision for a shallower circuit.
How can a QFT circuit be optimized for quantum hardware?
A QFT circuit can be optimized by removing very small controlled-phase rotations, reducing unnecessary SWAP operations, and adapting the circuit to the hardware’s connectivity. Qiskit also supports synthesis options that can omit or simplify parts of the standard circuit.