Fourier

Phase Estimation

Difficulty: Medium ★★

Read the eigenphase of U = P(2 pi theta) into a counting register. When theta has an exact t-bit expansion the answer should be certain, and otherwise it should round to the nearest value.

Objective

estimate_phase(theta, num_counting) returns a (t + 1)-qubit circuit with counting qubits 0..t-1 (qubit 0 = least significant bit) and target qubit t. Prepare the target in the eigenstate |1> yourself. The counting register must end in round(theta * 2^t).

Constraints

  • No PhaseEstimation library circuit.

Entry Point

estimate_phase

Checks

  • Exports estimate_phase(theta, num_counting).
  • Reads exact phases with probability above 0.999.
  • theta = 0.3 with 4 bits peaks at 5.

Your Code

Outputpending

Execution results will appear here.