So far, we've been looking at phases that have an exact -bit binary expansion. Now, we will analyze the performance of the QPE algorithm for phases that have a value that cannot be exactly represented using bits, and see what happens when we increase the number of estimation wires. In the following exercise, we will define an estimation window. The estimation window is a tuple of the two most likely outcomes. We would expect the eigenphase (i.e., the phase angle , associated with the eigenvalue ) to be between the two values of the estimation window.

Using the QPE algorithm, estimate the two most likely outcomes of the eigenphase of the eigenvector of a unitary operator. The function qpe(unitary, estimation_wires, target_wires) is provided for you and returns a list of probabilities on the estimation wires. Since this involves testing your solution for a different number of estimation wires, please change the return value of the variable done to True when you are finished with testing.

or to submit your code

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

Learning Objectives:

  • Analyze the QPE for phases that do not have a -bit binary expansion.