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)?
For convenience, here are the matrix forms for
Start by determining which angle of the
To interact with codercises, please switch to a larger screen size.
Learning Objectives: