Quantum Circuit implementing Grover's Search Algorithm

Quantum Circuit

Grover’s algorithm is general in the sense that it can be applied to speed up many (not all) classical algorithms that use search heuristics. In this project, Grover’s algorithm was implemented for any number of qubits, n.

The complete set of computational basis states is generated and stored for a chosen number of qubits. The program then amplifies the amplitude of a chosen basis state.

As an example, for a two qubits system, there are four possible basis states to amplify: (0, 0), (0, 1), (1, 0) and (1, 1). The quantum search algorithm consists of repeated application of a set of gates.

The underlying principle of the algorithm can be broken up into four steps:

  1. Apply the oracle O
  2. Apply the Hadamard transform H⊗n
  3. Perform a conditional phase shift, with every computational basis state except |0 >
  4. receiving a phase shift of -1.
  5. Apply the Hadamard transform H⊗n

Click here for more explanation on Grover's algorithm.