Create a circuit which runs some specified number of times, and manually set the step number my_steps. The results in the two-dimensional geometry will be displayed for combo = [0, 0, 0, 0, 0]. The oracle and diffusion matrices are defined below, and available by calling oracle_matrix(combo) and diffusion_matrix(). From the plots, confirm that applying the Grover operator rotates the state vector, and determine the optimal number of Grover steps for .

You should observe that, for , four steps are optimal. After that, more Grover steps rotate us away from the solution.

or to submit your code

To interact with codercises, please switch to a larger screen size.

Learning Objectives:

  • Describe and manipulate the geometry of Grover search.