Source: Ideas from Computational Physics (Landau, Páez, Bordeianu), §12.8. Original wording — no textbook Qiskit listing dumps. Continues 12.7b. Labs: 12.8b.
Chapter 9’s DFT maps a length-N signal yk to coefficients Yn with powers of ZN=e−2πi/N. The quantum Fourier transform does the same job on an N=2n-dimensional Hilbert space. Pick the QFT definition and the QFT4 matrix among lookalikes.
(Qiskit / CS indexing from 0; no extra 2π factors.) Basis labels: ∣0⟩=∣00⟩, ∣1⟩=∣01⟩, ∣2⟩=∣10⟩, ∣3⟩=∣11⟩.
Take four samples of y(t)=3cos(ωt)+2cos(3ωt), apply QFT4, read frequency bins, and check that the inverse (or direct sum of components) rebuilds y. Labs lock Z4=−i and the (0,0) entry 1/2.
With n qubits, N=2n components live in an N-D Hilbert space (tensor-product basis). The circuit generalizes: layered Hadamards and controlled phase rotations Rk=P(2π/2k), then bit-reversal SWAPs — still O(n2) gates vs classical O(NlogN) on explicitly stored vectors.