In this set of codercises we implement the (quantum phase estimation) QPE subroutine to find the eigenvalue of a unitary matrix with eigenvector in the following way:

  1. We will implement a helper function that computes .
  2. We will write a subroutine to apply these controlled on a set of estimation wires.
  3. We will implement the circuit end-to-end to obtain the phase and eigenvalue.

Let's get started with step 1. Given a unitary matrix , compute the value of a higher power, . You can use the matrix_power function from NumPy's linear algebra library.

or to submit your code

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

Learning Objectives:

  • Define the controlled-U oracle.
  • Derive the QPE circuit end-to-end.