7 Grover’s search algorithm
This chapter covers
- Using Grover’s algorithm to solve simple search problems
- Implementing simple classical functions on a quantum computer
- Implementing and testing end-to-end quantum algorithms
- Using Q# and Qiskit to implement Grover’s algorithm
As we saw in chapter 6, solving a classical problem on a quantum computer takes several steps (see figure 7.1). It starts with converting the classical problem to its “quantum” formulation that allows us to come up with a quantum algorithm for it. Then, this algorithm has to be implemented as a quantum program. Finally, we need to compare the performance of the quantum solution to that of the best classical solution for the same problem to decide whether using the quantum algorithm for this problem is a good idea.
Figure 7.1 Solving a classical problem on a quantum computer involves converting the problem to its “quantum” formulation, implementing the quantum algorithm as code, and evaluating the performance of the quantum solution to compare it to that of the classical algorithms for solving the same problem.
