Academy K

Implementing the QFT Circuit

HardCodingQFTcircuit implementationcontrolled rotations

Related module: Fourier transform, phase estimation and factoring

Problem statement

Implement the Quantum Fourier Transform for nn qubits using the standard circuit decomposition.

The QFT can be written as a product of Hadamards and controlled phase rotations:

QFT∣j⟩=12n∑k=02n−1e2πijk/2n∣k⟩\text{QFT}|j\rangle = \frac{1}{\sqrt{2^n}}\sum_{k=0}^{2^n-1}e^{2\pi ijk/2^n}|k\rangle

Write pseudocode for the circuit and explain the gate sequence.

Practise this problem

Verify you understand it—not just that you read the answer.

Learn the foundations

The Quantum Computing track covers this topic and more in depth.