/ quantum course Back to lab
PATHWAY PROGRESS0/27 passed

05 / Algorithms · LESSON 12 / 27 · 20 MIN

Amplitude amplification and Grover's search.

Follow the oracle's marking step and the inversion about the mean.

Mark without measuring

With four candidates, H on both qubits yields amplitudes [1/2,1/2,1/2,1/2]. A phase oracle for 11 flips the sign of that amplitude only, giving [1/2,1/2,1/2,−1/2]. The probability bars have not moved yet.

Inversion about the mean

The diffuser D=2|s⟩⟨s|−I sends every amplitude a to 2ā−a, where ā is the arithmetic mean of all amplitudes. After 11 is marked the mean is 1/4, so the unmarked amplitudes become 0 and the marked one becomes 1.

Avoid overshooting

For one marked item among N, about (π/4)√N queries are needed. Extra iterations rotate the state past the target and away again. Building the oracle and fault-tolerant overheads are costs separate from this ideal query count.

LIVE EXPERIMENT / 1 OF 4

q0|0⟩q1|0⟩HHHHXXXXHH

Initialize the register

Every qubit starts in zero.

BasisAmplitudeProbability
|00⟩1.000100.0%

TEST YOURSELF

Lesson quiz

Get all 2 questions right to pass. Retry as often as you like.

0/2 answered

1. With 4 items and one marked, how likely is success after one ideal iteration?
2. What does the phase oracle change right away?

Sign in with email or a wallet to check your answers and keep your lesson progress in sync.

Your account

Sign in to pick up your progress on any device.

or

Wallet sign-in uses a free signature (EIP-4361) on whatever EVM network your wallet is on. No gas, no transaction.