Fourier

Fourier Phase Ramp

Difficulty: Easy ★

The QFT of a basis state looks like a fully entangled mess of phases, but it is actually a product state. Prove it by preparing one without a single two-qubit gate.

Objective

prepare_fourier_state(num_qubits, k) returns a circuit preparing (1/sqrt(N)) * sum_j e^(2 pi i j k / N) |j> with N = 2^num_qubits and 0 <= k < N.

Constraints

  • Single-qubit gates only (h, p, rz, s, t, x, u, ...). No entangling gates.

Entry Point

prepare_fourier_state

Checks

  • Exports prepare_fourier_state(num_qubits, k).
  • Matches QFT|k> for registers of 1 to 5 qubits.

Your Code

Outputpending

Execution results will appear here.