Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2019/iii/paper-324/3/b/i/solution

Use a clean quantum ancilla and apply the quantum circuit , then the Pauli Z gate on the ancilla, then the inverse quantum circuit :
This compute-phase-uncompute construction implements on every input with the ancilla initially , and by linearity on any superposition of those inputs. The action on ancilla- inputs need not coincide with ; the question only requires the clean-ancilla subspace.

New to topics? Read the docs here!