Search
Grover With a Sealed Oracle
Difficulty: Medium ★★
Search 8 items with a phase oracle you are not allowed to open. Two Grover iterations is the sweet spot for N = 8, and your diffuser has to be built by hand.
Objective
build_grover_circuit(oracle) receives a 3-qubit phase-oracle Gate that flips the sign of one unknown basis state. Return a 3-qubit circuit with exactly two oracle calls that measures the marked state with probability above 0.94.
Constraints
- Exactly two qc.append(oracle, [0, 1, 2]) calls.
- No GroverOperator / initialize shortcuts.
- Do not inspect the oracle: every non-oracle gate must be identical for every oracle.
Entry Point
build_grover_circuitChecks
- Exports build_grover_circuit(oracle).
- Calls the oracle exactly twice.
- Amplifies each of the 8 possible targets above 94%.
- The circuit is identical apart from the oracle box.
Your Code
Outputpending
Execution results will appear here.