Algorithm

Inverse QFT

Exact adjoint of the QFT. Readout step of phase estimation.

Qubits 3 Cost O(n²) Default 3 qubits, input |000⟩

Undo the QFT SWAPs first, then apply inverse controlled phases (negative CP angles) and H from LSB to MSB. QFT then IQFT is identity.

On |000⟩ the inverse QFT is also identity, so this default circuit looks like it “does nothing” in Z. Use it after a QFT, or as the tail of QPE/Shor.

How it works

  1. 1
    Unreverse

    SWAP [0,2] undoes the QFT bit reversal.

  2. 2
    Inverse phases + H

    For each wire i from 0: CP from earlier wires with angle −1/2^{i−j}, then H i.

Default Qubi (static)
SWAP [0,2]
H 0
CP [0,1] -0.5
H 1
CP [0,2] -0.25
CP [1,2] -0.5
H 2

Function form: IQFT(0..2)

Circuit
q0q1q2HP-0.5HP-0.25P-0.5H
Expected result

State. IQFT|000⟩ = |000⟩

P(000) = 1 for this input. After QFT, the same circuit restores the original computational state.

BasisAmplitudeProbability
|000⟩ 1
100%

Notes

  • Counting q0 is the LSB of the recovered integer, same convention as QPE.
  • Negative CP angles are π-multiples, e.g. −0.5 is −π/2.

Change parameters

The write-up above is for the default circuit. Use this control to generate other variants and load them in the simulator.