“qubit” + “clock” = qlock
qlock is a whimsical application of quantum computing concepts to everyday life. In quantum computers across the world, a qubit holds a state that will collapse to either 0 or 1 when measured. Here, it simply tells us the time.
Reading the time
Any state of one qubit can be written with two angles, and drawn as a point on the Bloch sphere:
\[ \ket{\psi} = \cos\tfrac{\theta}{2}\,\ket{0} + e^{i\phi}\sin\tfrac{\theta}{2}\,\ket{1} \]
The hour sets \(\theta\), how far the arrow has tipped away from \(\ket{0}\): midnight points straight at \(\ket{0}\), noon lies on the equator, and the day ends just short of \(\ket{1}\). The minute sets \(\phi\), how far the arrow has turned around the sphere, once every hour.
Reading the date
Two angles are all a single qubit has, and both are already telling the time, so the date gets a qubit of its own, drawn as the pink arrow on the same sphere. The month sets its \(\theta\) and the day sets its \(\phi\), so 1 January is \(\ket{0}\) and the year ends near \(\ket{1}\). Together the two qubits make one state, \(\ket{t} \otimes \ket{d}\).
Building the state with gates
Every qubit in a quantum computer starts in \(\ket{0}\). Below the clock are three ways to reach the current state from there: two rotations, a single general \(U\) gate, or a sequence of the discrete gates real hardware runs, which gets very close but usually not exactly there.