Attach a quantum ancilla prepared with amplitude
on ; this is possible because . Mark a state as good only when both the original success qubit and this ancilla equal one. The enlarged state's good probability is , so its good amplitude is . One amplitude amplification iteration rotates the angle from to . It therefore prepares exactly, after which the flag and ancillary qubits may be discarded. This is an instance of exact amplitude amplification.
Choose an integer large enough that
Prepare an ancillary qubit in and declare only to be good. The initial good amplitude of
is . Applying amplitude amplification iterations gives good amplitude
The final state is therefore up to a global phase. Discarding the ancilla prepares exactly; this is exact amplitude amplification.