HomeQuantum ComputingQuantum Fourier Transform — |j⟩ → QFT|j⟩

🌀 Quantum Fourier Transform — |j⟩ → QFT|j⟩

Interactive 3-qubit Quantum Fourier Transform: pick input state |j⟩, toggle forward/inverse QFT, and watch the 8 output amplitudes' phases and a live QFT circuit diagram.

Quantum Computing2DAdvanced60 FPS
quantum-fourier-transform ↗ Open standalone

About the Quantum Fourier Transform

The Quantum Fourier Transform is the quantum computing counterpart of the classical discrete Fourier transform. Instead of decomposing a signal into frequencies, it maps a computational basis state |j⟩ of a qubit register onto an equal-magnitude superposition of every basis state |k⟩, with each term carrying its own phase e^(2πijk/N). This simulation fixes a 3-qubit register (N = 8 states) so you can pick any input j, run the transform forward or in reverse, and watch exactly how the output phases are distributed.

The QFT rarely appears on its own — its real importance is as a building block. It is the key subroutine inside Shor's algorithm for factoring large integers, and inside quantum phase estimation, which underlies many other quantum algorithms. Because factoring is the mathematical backbone of RSA encryption, an efficient, fault-tolerant QFT is one of the reasons quantum computers are taken seriously as a future threat to modern cryptography.

Frequently Asked Questions

What is the Quantum Fourier Transform used for?

It is the core subroutine of Shor's factoring algorithm and of quantum phase estimation, which itself powers algorithms for chemistry simulation, eigenvalue problems and more. It rarely runs as a standalone tool — it's almost always a piece inside a larger quantum algorithm.

Why do all the output bars have the same height?

Because the QFT maps any basis state to an equal superposition: every output amplitude has exactly the same magnitude, 1/√8 ≈ 0.354, for this 3-qubit register. Only the phase differs between output states, which is why the bars are coloured differently but never sized differently.

What's the difference between forward and inverse QFT?

The forward QFT uses phase e^(2πijk/N); the inverse QFT⁻¹ uses the complex conjugate, e^(−2πijk/N). The magnitudes stay identical either way — only the direction every phase rotates flips, which is exactly what "undoing" a transform requires.

Is this a full quantum simulation or a classical calculation?

This page computes the exact QFT amplitudes analytically using the formula above — it is mathematically exact, not an approximation. What it does not do is simulate quantum measurement collapse or noisy hardware; it shows you the clean, ideal amplitudes a perfect quantum computer would produce.

Why is n fixed at 3 qubits here?

Three qubits (N = 8 basis states) is large enough to see genuinely different phases across the outputs, yet small enough to draw every bar, phase and gate clearly on screen. The same formula scales to any N = 2^n; larger registers just mean finer phase steps and more qubits in the circuit diagram.

How does the circuit diagram relate to the formula?

The circuit is the standard decomposition of the QFT into Hadamard gates (which create superposition) and controlled-phase rotations R₂, R₃ (which apply the j·k-dependent phase bit by bit), finishing with swaps that restore the natural qubit ordering. Multiplying out that sequence of gates reproduces the QFT formula exactly.

Why can't you just "read off" the QFT result?

Measuring a quantum register collapses it to one basis state with a probability equal to the squared magnitude of its amplitude — and since every |k⟩ here has the same magnitude, a direct measurement gives no information about the phases at all. That's why the QFT is used inside interference-based algorithms rather than as a way to extract a Fourier spectrum directly.

Does changing j ever change the magnitude pattern, not just the phases?

No. For any input state |j⟩, all 8 output amplitudes keep exactly the same magnitude, 1/√8. Changing j only reshuffles which output state gets which phase — effectively stepping the phase pattern by 2πj/8 between neighbouring k values — it never makes one output more or less probable than another.

⚙ Under the hood

Interactive 3-qubit Quantum Fourier Transform: pick input state |j⟩, toggle forward/inverse QFT, and watch the 8 output amplitudes' phases and a live QFT circuit diagram.

Quantum ComputingFourier TransformCircuit DiagramCanvas 2DComplex Amplitudes

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)