If you read anything on quantum computing you are extremely likely to see the Bloch sphere, so it’s probably important to explain what it is and how it works.
Image from wikipedia: Wikipedia: Qubit
The Bloch sphere is a way of visually representing a qubit.
The north pole is the state, and the south pole is the state. The Z axis is vertical and runs from the to the state. A qubit’s state is represented by a point on the sphere.
If you read the last post, you might remember that there was a Pauli-Z gate which changed the phase of a qubit without changing it’s probability, as well as a more generalized version of the phase changing gate which also just rotated around the Z axis. Looking at the bloch sphere, you can see why that is true! Rotating a point around the Z axis moves it around the sphere horizontally, but it doesn’t make it any closer or farther to either the north or south pole. Since the distance to the poles is preserved, the probability of being one or the other stays the same, even though the phase changes.
The not gate, aka the Pauli-X gate, rotated a point around the X axis 180 degrees. Looking at the sphere, you could see how that would change a to a , or otherwise flip the probabilities & amplitudes of the states.
The Pauli-Y gate is a little more complex though (pun intended!) as it mapped to and to by rotating 180 degrees around the Y axis. You may wonder how and can both refer to the south pole, but the situation there is that every point EXCEPT the poles have a unique representation. So, they really do both refer to the south pole.
To find where a qubit sits on the sphere, the first step is to figure out the spherical coordinates theta () and phi () values, which you can then convert to a 3d point.
Start with whatever qubit you have in this form, where you know what the values for alpha () and beta () are:
You can also write a qubit as:
Or like this, with less euler, and more trig:
You can then set your known alpha and beta values to the trig (or euler) based equations:
and then solve for theta and phi (I wave my hands a bit here).
Once you have the theta and phi values figured out, you can convert that to a unit distance 3d point representing a point on the sphere by using the below, which describes the X,Y,Z components of the point:
Hopefully this explanation makes enough sense that if you encounter the bloch sphere, or things talking about rotations on the bloch sphere, you won’t be too lost 😛
Ok… time to move on to multiple qubit quantum circuits so we can do more interesting things and perhaps analyze the most well known quantum algorithms!