Algorithms · Quantum Fourier transform
QFT resource screen
A resource-focused QFT construction with a readable compile comparison.
Strong empiricalUpdated
Open on the mapView frozen graph
A small worked example, computed in your browser. It is not a result from this record's papers.
QFT then its inverse, on |0101⟩
4 qubits, starting at |0101⟩, applying the QFT then immediately undoing it.
Step 1 of 4 · X
Probability of each outcome after this step
- 0100100%
Prepares qubit 2 as |1⟩.
The whole state moves from 0000 to 0100 — one certain outcome before, one certain outcome after, no superposition either side.
Prepares qubit 0 as |1⟩, so the register reads |0101⟩.
The whole state moves from 0100 to 0101 — one certain outcome before, one certain outcome after, no superposition either side.
Applies the Quantum Fourier Transform, spreading the single input state into an equal-magnitude superposition over all 16 outputs, each carrying a different phase.
Probability spreads from 1 outcome to 16. All 16 are equally likely.
Applies the exact inverse QFT, which collapses the superposition straight back to the original input.
Probability gathers from 16 outcomes onto 1. 0101 goes from 6.3% to 100.0%.
Readout The register reads 0101 again, exactly: the QFT and its inverse cancel, the way any unitary and its adjoint do.
Open in Studio- Steps5
- Wires4
- Qubits4
- Depth18 gates
- Rotation layers4
- Papers2
The QFT record emphasizes the metadata researchers need before reuse: wire count, phase-rotation structure, and what the export check actually covers.
TakesNothingWhat joins here
No input port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.
Nothing in the Atlas meets this end.
ReturnsNothingWhat joins here
No output port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.
Nothing in the Atlas meets this end.
This record publishes no gate sequence and no register, so there is nothing here to read an interface off. Absent rather than empty. See all 152 →
The QFT maps computational basis states to a Fourier basis: for an -qubit register. The standard circuit applies a Hadamard on the top qubit, then controlled phase rotations from every later qubit into it, repeats for each qubit in turn, and optionally reverses qubit order with a final SWAP layer depending on bit-order convention — the layer this record's metadata keeps explicit. The circuit uses Hadamards and controlled-phase gates, giving total gates versus the classical FFT's arithmetic operations on a full amplitude vector — an exponential gate-count saving, but only over quantum amplitudes that must then be sampled, not a free classical output vector. This record's check is a parser/compile-compatibility comparison across the export path, not a numerical circuit-correctness proof.
TakesNothingWhat joins here
No input port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.
Nothing in the Atlas meets this end.
ReturnsNothingWhat joins here
No output port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.
Nothing in the Atlas meets this end.
This record publishes no gate sequence and no register, so there is nothing here to read an interface off. Absent rather than empty. See all 152 →
- Qubits
- 4
- Depth
- 18 gates
- Rotation layers
- 4
- Gate family
- H + controlled phase
- Bit order
- Swap layer explicit
- Export
- QASM parse checked
Hon q[0]CPon q[0], q[1]CPon q[0], q[2]CPon q[0], q[3]SWAP?on q[0], q[3]
Quantum vs classical
Classical baseline
Compare Quantum Fourier transform with the strongest classical method for the same instance, input budget, and output metric.
Quantum claim
This reference exposes a quantum circuit pattern; it does not imply an application-level speedup without a matched benchmark.
How to compare
Report input loading, circuit depth, repetitions, classical preprocessing, post-processing, and wall-clock time together.
Nobody has reviewed this record for gaps yet.
import cirq
import sympy
qubits = cirq.LineQubit.range(4)
theta = sympy.pi / 2
circuit = cirq.Circuit()
for index, qubit in enumerate(qubits):
circuit.append(cirq.H(qubit))
for offset, control in enumerate(qubits[index + 1:], start=2):
circuit.append(cirq.CZPowGate(exponent=theta / (2 ** offset))(control, qubit))
FINAL_CIRCUIT = circuitWhere this sits
This record is named by the layer graph at:
- Compile a circuit to a specific device Slot
Takes An abstract circuit (arbitrary-angle rotations, arbitrary two-qubit gates, all-to-all qubit indices); a device model giving the native gate set, coupling graph and calibration data; an approximation budget . Returns A native-gate instruction sequence obeying the connectivity constraint, plus the overhead it added (SWAP count, T-count, depth) and the accumulated synthesis error.
Related entries
- QAOA MaxCut on a 5-node ring
Algorithms
- Hadamard gate
Gates
References
- An approximate Fourier transform useful in quantum factoring
D. Coppersmith · 2002
Analyzes an approximate QFT construction and the gate-count/precision trade-off this record describes.
- Quantum Computation and Quantum Information: 10th Anniversary Edition
Michael A. Nielsen and Isaac L. Chuang · 2010
Standard graduate textbook covering the single- and two-qubit gate definitions, matrix identities, and circuit primitives this record states.