chapter ten

10 Grover’s Search Algorithm

 

This chapter covers:

  • the positioning of Grover’s search algorithm relative to existing data storage systems
  • an explanation of cases and problems where Grover’s search may be applicable.
  • classical examples showing cases where Grover’s search could be applicable too
  • how to use Grover’s search from classical Java code
  • an intuitive explanation on the internal working of Grover’s search algorithm

In this chapter, we will answer two important questions that developers have:

  1. When is it a good idea to use Grover’s search algorithm?
  2. How does the algorithm work?

Grover’s search algorithm is one of the most popular and well-known quantum algorithms. Despite its name, this algorithm is not really a replacement for search algorithms that are used today in classical software projects. In this chapter, we will explain what kind of problems could benefit of Grover’s search algorithm. After reading this chapter, you will be able to determine if a particular application you are dealing with can leverage Grover’s search algorithm. If so, you can immediately use the classical API in Strange that allows to use Grover’s algorithm.

10.1  Do we need yet another search architecture?

There are many excellent libraries, protocols, techniques available for searching structured and unstructured data systems. Grover’s search algorithm doesn’t compete with those technologies.

10.1.1  Traditional search architecture

10.1.2  What is Grover’s search algorithm?

10.2  Classical search problems

10.2.1  General preparations

10.2.2  Searching the list

10.2.3  Searching using a function

10.3  Quantum search: Using Grover’s search algorithm

10.4  The algorithm behind Grover’s search

10.4.1  Running the sample code

10.4.2  Probabilities and amplitudes

10.4.3  Superposition

10.4.4  Quantum Oracle

10.4.5  Grover Diffusion Operator: Increasing the probability

10.5  Conclusion