Single-qubit gate rotation example – the Bloch Clock
We can apply specific rotations around each axis using the rx(q,θ), ry(q,θ), or rz(q,φ) gates. Here, q is the qubit number, and θ and φ are the rotation angles in radians. Thus, any value from 0 to 2π or 0 to -2π will fully rotate the vector around that axis back to the starting point. Any multiples will cause multiple rotations.
To try out two new gates RY and RZ, represented by the following functions, ry()
and rz()
, we will encode the time of the day in the Bloch sphere. Looking back at Figure 6.1, we will use the rotation around the Y-axis or the θ angle to represent the hour of the day and the φ angle to represent the minutes.
Representing the hour of the day using θ
Thus, through the day, the qubit vector will spiral down from the |0⟩ state, representing midnight, to the equator, which will be at noon, and then continue to spiral down to the...