In this set of codercises, we will implement the phase kickback technique, introduced in the theory section on the right. We will the use it to calculate the eigenvalues of a unitary operator.

The phase kickback circuit is shown below:

We will implement this circuit to see if we can detect a phase of .

You are given a unitary that is promised to be either the gate or the gate. Write a quantum program using phase kickback that will result in the state with a probability of on the first qubit if is applied and with a probability of on the first qubit if is applied.

Hint.

Use qml.ControlledQubitUnitary or qml.ctrl to apply unitaries with control bits.

or to submit your code

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

Learning Objectives:

  • State the motivation behind the quantum phase estimation (QPE) subroutine.
  • List some applications of QPE.
  • Describe and implement the phase kickback technique.
  • Estimate a phase using phase kickback.