Hands-on lab · 1 step
Grover search on three qubits
Build Grover's algorithm for items and one marked item : the uniform superposition followed by two iterations of the phase oracle and the diffuser . The grader substitutes three different oracles (, , ) into the placeholder and requires the distribution with , every other outcome having probability .
Step 1: Two Grover iterations for N = 8
The register has three qubits in ; qubit is the most significant bit, so has index .
The circuit already contains the oracle placeholder twice. In the circuit editor it is the statement Of on its own line; keep it exactly twice, once per Grover iteration. The grader replaces both copies by the diagonal matrix , i.e. the identity with the single entry changed to .
Allowed gates: , , , , , , ; at most operations including both Of statements; no measurements.
Build followed by two copies of . The diffuser equals, up to the global phase , the gate sequence , because .
grover-cases (three oracles, ): the full distribution on qubits must equal and for every , within .