This project is a small, hands-on exploration of Grover's algorithm using Qiskit. Each notebook targets a different number of qubits and shows the same core steps: create a uniform superposition, apply an oracle that marks one state with a phase flip, and apply the diffusion operator to amplify the marked state's amplitude.
Grover's algorithm searches an unstructured space of
- Oracle: flip the phase of the marked state.
- Diffusion: reflect amplitudes about the mean to amplify the marked state.
- 2_QUBITS.ipynb: Minimal Grover example marking |11> with a CZ oracle.
- 3_QUBITS.ipynb: Grover example marking |111> using an H-CCX-H pattern for a phase oracle.
- 4_QUBITS.ipynb: Two separate 4-qubit examples marking |0010> and |0100> using multi-controlled gates.
- Start with a uniform superposition using H gates on all qubits.
- Build an oracle by mapping the marked state to an all-ones pattern, apply a multi-controlled phase flip, then uncompute the mapping.
- Apply the diffusion operator (H, X, multi-controlled phase, X, H).
- Measure and visualize results with a histogram to confirm the marked state dominates.
Open any notebook and run cells top to bottom. The first cells install Qiskit and plotting helpers (only needed once per environment).
These notebooks favor clarity and step-by-step construction over optimization. The goal is to practice building Grover circuits by hand and understand how the oracle and diffusion blocks work together.