Tags Math

When learning the basics of quantum computing, the Bloch sphere comes early on as a visualization technique of quantum states. It shows the state of a single qubit as a point on this sphere:

Bloch sphere showing kets 0 and 1 in the usual places

This post explains how the Bloch sphere works and also why it works.

Mapping 4 dimensions onto a sphere

We have a qubit in an arbitrary state:

\[\ket{\psi}=a\ket{0}+b\ket{1}\]

How can we visualize this state?

Had a and b been real numbers, it would have been easy since there would only be two dimensions (degrees of freedom). However, in reality a,b\in\mathbb{Z}, making our visualization task much more challenging because there are now 4 dimensions (two for each complex number). The Bloch sphere is a clever mapping from this 4D reality into something we can visualize.

We start by representing each of the complex coefficients using their polar representation, where the magnitudes and angles are real numbers:

\[\begin{align*} a&=r_a e^{i\phi_a}\\ b&=r_b e^{i\phi_b} \end{align*}\]

Therefore:

\[\ket{\psi}=r_a e^{i\phi_a}\ket{0} + r_b e^{i\phi_b}\ket{1}\]

Since a global phase doesn't affect the observable properties of a qubit (see the appendix for more on this), we can multiply this state by the global state e^{-i\phi_a} to get [1]:

\[\begin{align*} \ket{\psi}&=e^{-i\phi_a}\left (r_a e^{i\phi_a}\ket{0} + r_b e^{i\phi_b}\ket{1} \right ) \\ &=r_a\ket{0}+r_b e^{i(\phi_b-\phi_a)}\ket{1} \end{align*}\]

There's only a single angle in this equation: \phi_b-\phi_a; this is the relative phase between the two components of the state. Let's call it just \phi, and then:

\[\ket{\psi}=r_a\ket{0}+r_b e^{i\phi}\ket{1}\]

We're down from 4 real parameters to 3. But there's still a constraint on our state equation that we didn't use; all quantum states must be normalized - the amplitudes must satisfy:

\[|a|^2+|b|^2=1\]

In our case:

\[|r_a|^2+|r_b e^{i\phi}|^2=1\]

To proceed from here, we'll rewrite the second magnitude using the cartesian representation of complex numbers (instead of parameters r_a and \phi, we'll use x and y) and do some algebra:

\[\begin{align*} |r_a|^2+|x+iy|^2&=1 \\ {r_a}^2+(x+iy)(x-iy)&=1 \\ {r_a}^2+x^2+y^2&=1 \\ \end{align*}\]

If we rename r_a to z, this equation should look familiar:

\[x^2+y^2+z^2=1\]

This is the equation of a unit sphere! We can now use spherical coordinates to express:

\[\begin{align*} x&=sin(\theta) cos(\phi) \\ y&=sin(\theta) sin(\phi) \\ z&=cos(\theta) \\ \end{align*}\]

Where \theta is the angle from the positive z axis ("polar angle") and \phi is the angle from the positive x axis ("azimuthal angle"):

Unit sphere with spherical coordinates

If you recall, we expressed a in our quantum state as z and b as x+iy. Substituting back into the state equation:

\[\begin{align*} \ket{\psi}&=z\ket{0}+(x+iy)\ket{1}\\ &=cos(\theta)\ket{0}+(sin(\theta)cos(\phi) + i sin(\theta)sin(\phi))\ket{1}\\ &=cos(\theta)\ket{0}+sin(\theta)(cos(\phi) + i sin(\phi))\ket{1}\\ &=cos(\theta)\ket{0}+sin(\theta)e^{i \phi}\ket{1}\\ \end{align*}\]

We're now down to just 2 real parameters: the angles \theta and \phi. These two angles uniquely map a quantum state onto a unit sphere.

Now comes the trickiest part in understanding the Bloch sphere, IMHO. Notice that something is wrong with the mapping we've just found. In spherical coordinates, $$0\leq\theta\leq \pi$$. However, if we set \theta=\pi in the state equation we've just derived, we get:

\[\ket{\psi}=-\ket{0}\]

Which is not what we see on the Bloch sphere; indeed, since the states \ket{0} and \ket{1} are orthogonal by definition, we should not be seeing \ket{1} as the polar opposite of \ket{0} on the Bloch sphere, and yet we do. What's going on?

The simple (but partial) explanation is that we'd need only half a sphere to represent states, but it wouldn't have the nice visual properties of the full Bloch sphere. There are deeper mathematical reasons for this - see discussions #1 and #2 for more details.

The usual mathematical trick is to stretch the state space over an entire sphere by using \frac{\theta}{2} instead of \theta. Therefore, our state would be:

\[\ket{\psi}=cos\left (\frac{\theta}{2} \right )\ket{0}+sin\left (\frac{\theta}{2} \right )e^{i \phi}\ket{1}\]

Now if we set \theta=\pi, we get:

\[\ket{\psi}=0\cdot\ket{0}+e^{i\phi}\ket{1}\equiv\ket{1}\]

Once again, the equivalence to \ket{1} is because now that the phase \phi applies only to \ket{1}, it makes no difference. Indeed, if we have a point on the z axis, it doesn't really matter what its azimuthal angle is.

Using the Bloch sphere to visualize quantum states

Now that we understand the math behind the mapping, let's use it to visualize some quantum state superpositions on the Bloch sphere.

We'll start with the important state \ket{+}:

\[\ket{+}=\frac{1}{\sqrt{2}}\left (\ket{0}+\ket{1} \right )\]

To find the angles for the spherical representation:

\[\ket{\psi}=cos\left (\frac{\theta}{2} \right )\ket{0}+sin\left (\frac{\theta}{2} \right )e^{i \phi}\ket{1}\]

We notice that \phi=0 because the coefficient of \ket{1} is real. Also:

\[\frac{\theta}{2}=cos^{-1}\left (\frac{1}{\sqrt{2}}\right ) \Longrightarrow \theta=\frac{\pi}{2}\]

Recalling the meaning of \theta and \phi in spherical coordinates, this means that \ket{+} is on the positive x axis. Here is this state on the Bloch sphere, along with other important states \ket{-}, \ket{i} and \ket{-i}, which are similarly simple to compute:

Bloch sphere showing kets 0, 1, +, -, i, -i

The measurement probabilities of \ket{+} in the standard basis are \frac{1}{2} for 0 and \frac{1}{2} for 1 [2]. The Bloch sphere makes it geometrically intuitive, because \ket{+} lies on the "equator", half-way between \ket{0} and \ket{1}. Note that all the states depicted above have these measurement probabilities - the only difference between them is the relative phase, which is expressed with the \phi angle on the sphere.

As the final example, let's map the following state onto the Bloch sphere:

\[\ket{\psi}=\frac{3+i\sqrt{3}}{4}\ket{0}-\frac{1}{2}\ket{1}\]

Rearranging a bit:

\[\ket{\psi}=\frac{\sqrt{3}}{2}\left (\frac{\sqrt{3}}{2}+i\frac{1}{2}\right )\ket{0}-\frac{1}{2}\ket{1}\]

Since sin(\pi/6)=\frac{1}{2} and cos(\pi/6)=\frac{\sqrt{3}}{2}, we can rewrite it as:

\[\ket{\psi}=\frac{\sqrt{3}}{2}e^{i\pi/6}\ket{0}-\frac{1}{2}\ket{1}\]

To get into the spherical coordinate representation, we have to move the relative phase to the \ket{1}. To do that, we'll factor out e^{i\pi/6} and then ignore the global phase. We'll then use the fact that e^{-i\pi/6}=e^{i5\pi/6}:

\[\begin{align*} \ket{\psi}&=\frac{\sqrt{3}}{2}e^{i\pi/6}\ket{0}-\frac{1}{2}\ket{1}\\ &=e^{i\pi/6}\left(\frac{\sqrt{3}}{2}\ket{0}-e^{-i\pi/6}\frac{1}{2}\ket{1}\right )\\ &\equiv\frac{\sqrt{3}}{2}\ket{0}+e^{i5\pi/6}\frac{1}{2}\ket{1} \end{align*}\]

Now we're ready to extract the angles:

\[\begin{align*} \frac{\theta}{2}&=cos^{-1}\left (\frac{\sqrt{3}}{2}\right ) \Longrightarrow \theta = \frac{\pi}{3}\\ \phi&=\frac{5\pi}{6} \end{align*}\]

Here's how this looks on the sphere:

Bloch sphere showing psi

Visually, we get the intuitive sense that the probability of measuring 0 is higher than the probability of measuring 0, for example. Also, if we measure using another base like \ket{+} and \ket{-}, it's apparent that the probability of measuring \ket{-} will be higher, and so on.

Appendix: Equivalence of global phases

Let's take a qubit in this superposition:

\[\psi=\frac{\sqrt{3}}{2}\ket{0}+\frac{1}{2}\ket{1}\]

The probabilities of measurements in the standard base are:

\[\begin{align*} 0\longrightarrow\left|\frac{\sqrt{3}}{2}\right|^2&=\frac{3}{4}\\ 1\longrightarrow\left|\frac{1}{2}\right|^2&=\frac{1}{4} \end{align*}\]

Now let's apply a global phase \phi to our qubit:

\[\hat{\psi}=e^{i\phi}\left(\frac{\sqrt{3}}{2}\ket{0}+\frac{1}{2}\ket{1}\right)\]

And calculate the measurement probabilities again:

\[\begin{align*} 0\longrightarrow\left|e^{i\phi}\frac{\sqrt{3}}{2}\right|^2=\frac{\sqrt{3}}{2}e^{i\phi}\cdot\frac{\sqrt{3}}{2}e^{-i\phi}&=\frac{3}{4}\\ 1\longrightarrow\left|\frac{1}{2}\right|^2=\frac{1}{2}e^{i\phi}\cdot\frac{1}{2}e^{-i\phi}&=\frac{1}{4} \end{align*}\]

The global phase didn't change our measurement probabilities in any way; since measurement is the only way to observe the quantum state, we say that the global phase is irrelevant and can be ignored.

As an exercise, it's easy to show that this applies for any quantum state a\ket{0}+b\ket{1}. It also applies for any computational basis, not just the standard basis \ket{0} and \ket{1}.


[1]Strictly speaking, we shouldn't be using the equals sign here because this new state isn't equal to the old one; it's equivalent to it, so we can use the \equiv sign. I'll just keep using = for simplicity, though.
[2]For a generalized quantum superposition \ket{\psi}=a\ket{0}+b\ket{1}, the probability of measuring 0 is |a|^2, and the probability of measuring 1 is |b|^2. Recall that in the general case a and b are complex, so we have to calculate the norm-squared.