Let be the orthogonal projection onto the good linear subspace , and let be a prepared unit vector with . For , define
The amplitude amplification theorem states that, if the reflection operators about the initial state and the good subspace can be implemented, the iteration
satisfies
To prove it, the two reflections preserve the linear span of . In this ordered orthonormal basis, direct multiplication gives
Multiplying this rotation matrix by replaces by , proving the formula by mathematical induction.
For known , choose to be a nearest nonnegative integer to . Then , so measurement finds the good subspace with probability at least , using iterations. For , measurement of the initial state already has constant success probability. If success is certain; if these reflections cannot create any good component. If , the initial-state reflection is , implemented using quantum state preparation and its inverse quantum circuit.
Figure 1. . Each iteration adds the angle in the good-bad plane. The probability rises near one and then falls again, so the stopping time matters.
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.
Use the inverse quantum circuit rule. Every gate in is self-inverse, so reverse their order. From left to right, the circuit for is:
1. a controlled-NOT with the lower qubit controlling the upper;
2. on the upper qubit and on the lower qubit;
3. a controlled-NOT with the upper qubit controlling the lower;
4. on the upper qubit.
This is the requested circuit description, with the two wires and control directions unchanged under each individual gate's adjoint.