Interference

Phase Kickback Dial

Difficulty: Easy ★

A controlled-phase gate acting on an eigenstate leaves the target alone and writes the eigenphase onto the control. Use that to dial an arbitrary phase onto qubit 0 without ever applying a phase gate to it directly.

Objective

build_phase_kickback_circuit(phi) returns a two-qubit circuit ending with qubit 0 in (|0> + e^(i phi)|1>)/sqrt(2) and qubit 1 (the target) in |1>.

Constraints

  • Allowed gates: h, x, cp.
  • Use at least one cp gate.

Entry Point

build_phase_kickback_circuit

Checks

  • Exports build_phase_kickback_circuit(phi).
  • The kicked-back phase matches for four values of phi.

Your Code

Outputpending

Execution results will appear here.