In Codercise I.3.2, you were introduced to the most general single-qubit unitary, which is implemented in PennyLane as qml.Rot. This Rot gate actually applies a sequence of three operations:

def decomposed_rot(phi, theta, omega): qml.RZ(phi, wires=0) qml.RY(theta, wires=0) qml.RZ(omega, wires=0)

Even though Rot is the most general single-qubit operation, under the hood it's just RZ and RY gates! This means that, together, RZ and RY form a universal gate set for single-qubit operations (as do RZ and RX, or RY and RX)

Can you find a set of angles phi, theta, omega such that the sequence of gates

qml.RZ(phi, wires=0) qml.RX(theta, wires=0) qml.RZ(omega, wires=0)

acts the same as a Hadamard gate (up to a global phase)?

Hint.

For convenience, here are the matrix forms for and

Start by determining which angle of the will give you the correct magnitude of the elements, then use the to adjust the signs to give up to a global phase.

or to submit your code

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

Learning Objectives:

  • Define what it means for a gate set to be universal for quantum computing.
  • State two universal gate sets for single-qubit quantum computation.