Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2025/ii/paper-3/10c/b/i/solution

Let . Applying the oracle with this answer qubit produces phase kickback:
Inside , the gates on both search qubits conjugate the phase oracle for . Hence
where .
The first oracle similarly acts on the search register as . Reading the remaining gates from right to left, the search-register operation after its initial Hadamards is therefore
while the answer qubit remains in .

New to topics? Read the docs here!