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:
Click here for more explanation on Grover's algorithm.