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 to solve it. Then, this algorithm has to be implemented as a quantum program that handles the problem we’re solving. Finally, the performance of the quantum solution needs to be compared to that of the best classical solution for the same problem to ascertain that using the quantum algorithm for this problem is a worthwhile endeavor.

Figure 7.1 Solving a classical problem on a quantum computer involves converting the problem to its “quantum” formulation, writing the program that implements the quantum algorithm for solving it, and evaluating the performance of the quantum solution to compare it to that of the classical algorithms for solving the same problem.
figure

7.1 Quantum oracles

7.1.1 Math

7.1.2 Phase oracles

7.1.3 Marking oracles

7.1.4 Converting one type of oracles into another

7.1.5 Qiskit

7.1.6 Q#

7.2 Grover’s search algorithm

7.2.1 Definitions

7.2.2 Math

7.2.3 Qiskit

7.2.4 Q#

7.3 Going beyond

7.4 Summary