Academy K

Implementing a Grover Oracle

InterviewCodingGrover's algorithmoraclecircuit design

Related module: Search and amplitude amplification

Problem statement

Design an oracle circuit for Grover's algorithm that marks the state ∣101⟩|101\rangle (i.e., applies a phase of −1-1 to ∣101⟩|101\rangle and +1+1 to all other states) for a 3-qubit system.

Write the circuit using only X, H, and multi-controlled Z (CCZ) gates.

Hints

Practise this problem

Verify you understand it—not just that you read the answer.

Learn the foundations

The Quantum Computing track covers this topic and more in depth.