Now that we've seen how Grover's search can be formulated using QSP, let's implement it using PennyLane.

Your task is to build a quantum function that implements a QSP sequence for two iterations of Grover's search. Use the same -rotation encoding for the parameter as introduced in section 2.

The required angles for the QSP sequence can be found using qml.poly_to_angles. Recall that for two iterations (), the expected Chebyshev polynomial of the first kind is .

Hint.

Think about what measurement you should use to get the QSP polynomial out of the circuit and be careful with factors of two in the angles for the rotations.

or to submit your code

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

Learning Objectives:

  • Define quantum signal processing sequences.
  • Implement QSP sequences for amplitude amplification.