Skip to main content
Sandbox Physics

Q047 · Mark / reflect / stop

Grover Amplitude Amplification

Choose a small search space, mark its target entries and move the round selector. Follow the phase oracle and reflection as probability flows toward the targets and back out again. Sample the readout and find a stopping point from the recorded success rates.

Interactive modelGrover Amplitude Amplification
Ideal marked probability before readout—\text{—}
Circuit oracle calls per trial—\text{—}
Evidence and query budget

SIMULATED MEASUREMENT RECORD

Find the stopping point

Acquire a record to begin.

Colored bars and points come from records; thin gray marks are the model with the configured errors. Whiskers are pointwise 95% Wilson intervals for output or success fractions. They are not phase confidence intervals, simultaneous bands or guarantees after optional stopping.

Recorded success, 95% Wilson range

—\text{—}

Best observed round among sampled settings

—\text{—}

All circuit / verification queries

—\text{—}

The best observed round is a descriptive choice from this finite scan, not a certified optimum. Every output is checked against the known teaching oracle; that adds one verification query. No real-data oracle construction or hardware advantage is demonstrated.

Recomputed from the exported trials
RoundsTrialsSuccessesCircuit / verification queries
Latest 12 trials; CSV retains all trials
TrialSettingReported bitsIntegerCircuit queries

Physics tutorial

Amplification has a stopping point

BackgroundThe input starts with equal amplitudes across a small declared search space. An oracle changes the phase of marked entries; a second unitary reflects amplitudes about the uniform direction.

Why it mattersProbability is redistributed rather than created. Once the state passes a favorable orientation, repeating the same operations can reduce success.

Start with the essentials

Focus question
Which tested round has the greatest recorded success, and what queries did the scan consume?
One-sentence intuition
The oracle alone leaves probabilities unchanged. Interference in the reflection changes their magnitudes. The pair rotates the ideal state repeatedly, so stopping matters.

Core mathematical model

Uniform preparation

∣s⟩=1N∑x=0N−1∣x⟩,N=2n|s\rangle=\frac{1}{\sqrt N}\sum_{x=0}^{N-1}|x\rangle,\quad N=2^n

Targets are a cyclic consecutive set starting at the selected index. Their values are already known to the simulator.

Phase oracle

OϵO∣x⟩={ei(π+ϵO)∣x⟩x∈M∣x⟩x∉MO_{\epsilon_O}|x\rangle=\begin{cases}e^{i(\pi+\epsilon_O)}|x\rangle&x\in\mathcal M\\|x\rangle&x\notin\mathcal M\end{cases}

The phase offset is entered in degrees and converted to radians. A coherent error is not a probabilistic bit flip.

Reflection with phase error

DϵD=−I+(1−ei(π+ϵD))∣s⟩⟨s∣D_{\epsilon_D}=-I+\bigl(1-e^{i(\pi+\epsilon_D)}\bigr)|s\rangle\langle s|

The leading global minus sign makes the zero-error operator the usual inversion about the mean. The imperfect operator remains unitary.

The complete circuit

∣ψk⟩=(DϵDOϵO)k∣s⟩|\psi_k\rangle=(D_{\epsilon_D}O_{\epsilon_O})^k|s\rangle

All complex components are updated explicitly. The operation slider can show the state immediately after an oracle or reflection.

Independent ideal reference

PM(k)=sin⁡2((2k+1)α),sin⁡2α=M/NP_{\mathcal M}(k)=\sin^2((2k+1)\alpha),\quad\sin^2\alpha=M/N

This rotation formula applies to ideal phases before readout errors. It is an independent benchmark, not the rule used to generate the state vector.

Recorded success and circuit cost

P^M(k)=Nsuccess,k/Nshots,k,CO=kNshots,k\widehat P_{\mathcal M}(k)=N_{\mathrm{success},k}/N_{\mathrm{shots},k},\quad C_O=kN_{\mathrm{shots},k}

Each reported output is additionally checked once against the target set. The separate verification counter includes that extra query.

Common difficulties

An oracle is a resource

Typical misconceptionThe simulator discovers a secret in a real database.

Better mental modelThe target set is supplied to the teaching oracle. Constructing a real oracle can be costly and is outside this model.

Amplitude versus probability

Typical misconceptionA negative arrow represents a negative chance.

Better mental modelArrow direction is complex phase and length is amplitude magnitude. Probability is the squared magnitude and remains nonnegative.

No stopwatch proof

Typical misconceptionFast browser animation proves quantum advantage.

Better mental modelThis is a small classical simulation. The query ledger describes a declared model, not measured quantum hardware or a complete classical comparison.

Run the experiment

  1. 01

    Watch phase before probability

    Choose Before amplification, set one round and inspect its oracle step.

    What to observe: The marked amplitude changes sign but its probability does not yet increase.
  2. 02

    Find and pass the peak

    Compare Stop near the peak with Go too far.

    What to observe: The same target set can become much less likely after extra rounds.
  3. 03

    Use records to choose a round

    Acquire the full round scan.

    What to observe: Success fractions fluctuate. The highest observed setting is a descriptive result from the finite record, not a guaranteed optimum.
  4. 04

    Introduce a mismatch

    Try an imperfect oracle and readout flips separately.

    What to observe: Coherent phase errors change the evolved amplitudes. Readout flips distort the reported bit strings after evolution.