Write . Since the marked word is , the required oracle is a single Toffoli gate with and as its two controls and the answer qubit as its target:
The target flips exactly when both controls are one, which is exactly when .
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 .
After the initial Hadamards the search register is
The marked-state phase oracle changes only the last sign:
Now . Since the overlap of the last displayed state with is , its image is . Thus the complete output is
The minus sign is a physically irrelevant global phase.
Measurement of the two search qubits in the computational basis returns with probability one. The answer qubit is unentangled from them and remains in .
Only one Grover iteration is required. For one marked item among four, the initial marked amplitude corresponds to an angle with , so ; one iteration changes this to , giving unit success amplitude. Further iterations are neither needed nor beneficial.

Articles by others on the same topic (0)

There are currently no matching articles.