- Published on
Understanding Quantum Superposition: Beyond Classical Probability
- Authors
- Name
- Jonas Vetterle
- @jvetterle
One thing that can be really confusing is the notion of a qubit being in a superposition of states. After all, how can something be in two states at the same time? It's not like a coin can be both heads and tails at the same time, right?
The closest we can get to that is by spinning the coin, and while it's spinning, it's neither heads nor tails. And as soon as it lands, it's either heads or tails. But that's different from the coin being in both states at the same time - it's just the coin spinning back and forth between heads and tails and us not knowing which state it's in until we look at it.
In this article we'll see mathematically why it's the case the superposition is different from mere uncertainty about which state a qubit is in. But before we get there, we'll have to talk about measurement and different bases.
Basis States
A qubit is always in a state of superposition, even if we know it's in a certain state, say, . We just have to be a bit more specific about what kind of superposition we're talking about. In this case, if we measure a qubit and find it's in state we can say that in terms of the computational basis it's not in superposition, but it is in a superposition in other measurement bases. To see why that is the case, take a look at the Bloch sphere below.
The Computational Basis
What is most often referred to as a superposition, is a superposition between the states and , which are the basis states in the computational basis. So for example taking a qubit in the state and applying the Hadamard gate to it, rotates the state vector around the y-axis by , which brings it into the state . That is, the state of the qubit is now in equal superposition between the states and .
Other Measurement Bases
But the and states are not the only basis states. There are infinitely many basis states, and we can always express the state of a qubit in terms of a superposition of these basis states. There are three requirements for a set of basis states to be considered a basis. The first is that they are orthogonal. They appear spatially parallel on the Bloch sphere (e.g. the "up" and "down" states and , but they are geometrically orthogonal to each other. Two other features of basis states are that they are complete in the sense that they span the entire space of possible states and that they are normalised (i.e. the inner product of a basis states with itself is 1, to ensure we get valid probabilities). To see that for example the basis states and are complete and normalised, consider that you can reach any point on the Bloch Sphere by choosing appropriate and angles.
So what are the different bases we typically encounter in quantum computing?
- First of all there is computational basis, or z-basis with basis states
- Then there is the Hadamard basis, or x-basis. One way to get to these states from , as we have seen, is to rotate around the y-axis:
- And finally there is the y-basis, which you get to from, say, , by rotating around the x-axis:
Rewriting States in Different Bases
Of course we can also rewrite the computational basis vectors in terms of other basis states like the Hadamard basis states:
which is a way of saying that the computational basis states are a superposition of the Hadamard basis states as claimed above.
As you can see, any point on the Bloch Sphere can be expressed in any of these, or other, bases. And that's why a qubit is always in a state of superposition in some basis, even if we know it's in a certain state in the computational basis, say, .
Three Conditions for Basis States
States vectors in the computational basis are just kets with a 1 in the position of the state and 0s elsewhere: and . The three conditions for basis vectors mentioned above can then be expressed as follows:
- orthogonality:
- normality:
- completeness:
Computing Probability Amplitudes
With the definition of an arbitratry quantum state in place, we can see that the inner product of it with a basis state gives us a measure for how similar it is to that basis state. That is, , and .
If we make the assumption that the normalization condition also holds for any arbitrary state, in other words, that any linear combination of basis states leads to a pure state - a state on the surface of the Bloch sphere, we obtain .
Substituting the expressions for and from above, we get
which basically yields the Born Rule. This expression tells us that projecting an arbitrary state vector onto a basis state not only gives us a measure of how similar the state is to the basis state. It also gives us something called the probability amplitudes and , which, when squared, give us the probabilities of observing either state or when measuring the state in the computational basis.
Measurement in different Bases
So far we've seen what basis states are mathematically and in terms of the Bloch Sphere. Let's now see how to set up an experiment to measure a qubit in a certain basis.
Stern-Gerlach Experiments
There are 2 parts to explaining measurement in quantum mechanics: running experiments and see what actually happens and the mathematical formalism that describes what happens. For the first part, it's instructive to learn about the Stern-Gerlach experiments. One could write an entire article about these experiments, but we'll focus on only a few aspects here.
Expected Results with Quantum Objects
The gist of the experiment is that we shoot a beam of silver atoms (2) through a magnetic field (3), and then we measure the deflection of the atoms on a screen (5). What we're really measuring here is the spin of the atom. Depending on the spin of the atom, it gets deflected either up or down when it goes through the magnetic field. Before measurement it can point in any direction, but after measurement (after we observe it on the screen) always either points up or down. The up and down states are the basis states of the computational basis/ z-axis.
Different Results with Classical Objects
This result is different than if we were to run it with a classical object, like a magnet, which can point in any direction just like the spin of an atom. If we were to shoot a magnet with a random orientation through the magnetic field, it would get deflected in proportion to its orientation. And if we were to repeat this experiment many times, we would see a continuous distribution of deflections on the screen (4). The silver atom however, being a quantum object, always gets deflected either up or down, and never in between.
Verifying that Measurement Alters the State
Before measurement, the state of the atom, it's spin, is in a random superposition of the up and down states. But after measurement, the state of the atom is either up or down. So it is in a definite state, not in a superposition anymore, in the computational basis. This result is what is meant when one says that the act of measuring a qubit alters its state. One can verify that the atom is really not in a superposition anymore by letting it pass through another Stern-Gerlach apparatus after it got deflected up: If the second apparatus is oriented in the same direction as the first one (i.e. we measure in the computational basis again), and we take an atom that got deflected up by the first apparatus, it will get deflected up again by the second apparatus.
But it's not just that the apparatus filtered out the atoms that were in the down state. There is another variant of this experiment which adds a second apparatus that is rotated by 90 degrees, effectively measuring the spin of the atom in the x-basis now. Behind that second apparatus is a third one which again measures the spin in the z-basis.
The interesting result here is that when we measure the spin of the atom (which we measured to be the in the up state according to the first apparatus) in the x-bases, it seems to "reset" the state of the atom along the z-axis. We know this, because when we measure the spin of the atom in the z-basis for the second time (after having measured in the x-basis), we no longer have a 100% chance of finding the atom in the up state. Instead we again find that the atom is in an equal superposition of the up and down states.
One finding of the SG experiments is that we can never know both the spin of an atom in the x-basis and the z-basis (or any other basis) at the same time. This is also referred to as the different bases being incompatible with each other.
What happens mathematically during measurement
Having seen what happens in the Stern-Gerlach experiments, let's now see what happens mathematically when we measure a qubit. By convention, we measure a qubit in the computational basis, at which point we observe the qubit to be in either the or state. That is, we can't actually measure the state of a qubit (in terms of it and rotations) with a single measurement. While a qubit is a probabilistic object, the act of measuring it will always yield a definite result. In that sense, measuring the qubit collapses the state of a qubit into one of the basis states.
Recall that we can express an arbitrary qubit state as , and that the amplitutes and can be obtained by taking the inner product of the state with the basis states: and . This allows us to rewrite the state of the qubit in terms of the outer products of the basis states:
where is just the identity matrix. Crucially though we can think of and as the operators that get applied to the state of the qubit when they leave the top and bottom holes of the Stern-Gerlach apparatus, respectively. So when we measure the state of the qubit, we're actually applying the operators and to the state of the qubit.
For example, when we measure the state, we apply the operator to which collapses the state of the qubit into the state:
In other words, after measurement, we state of the qubit is no longer , but , which is another way of saying that the act of measurement alters the state of a qubit.
How is this different from classical probability?
With all of the basics in place, we can now get to the question from the beginning: how is superposition different from mere uncertainty about which state a qubit is in?
Measuring a Qubit in a Superposition
Let's start with a quantum state
This state is in a superposition of the and states, meaning it's not the case that the state is either or with equal probability. Instead, there is a 0% chance that the state is in the or the state, and a 100% chance that the state is in the superposition of the two states, .
To see why, consider measuring the state not in the computational basis but another, incompatible, basis like the Hadamard basis. We can express the state in terms of the Hadamard basis states because as we've seen above:
So by substituting we find that the state actually corresponds to the state in the Hadamard basis: .
We can then run 2 experiments with our state, one in the computational basis and one in the Hadamard basis.
- In the computational basis, we measure the state to be either or with equal probability.
- And in the Hadamard basis, we always find the state to be .
Measuring a Qubit in a Classical Probabilistic Mixture
Now consider the alternative scenario where is not in a superposition, but in a classical probabilistic mixture of the and states. This means that the state of the qubit is either or with equal probability, instead of both at the same time. If we state is , then the state of the qubit in the Hadamard basis would be either or with equal probability. And likewise, if the state is , then the state of the qubit in the Hadamard basis would also be either or with equal probability.
In other words, if we run the same 2 experiments as above:
- In the computational basis, we measure the state to be either or with equal probability, as before.
- But in the Hadamard basis, we measure the state to be either or with equal probability.
Superposition can lead to Interference Effects
So that is the key difference between superposition and classical probability. In superposition, quantum amplitudes are not independent of each other. They can interfere and effectively cancel each other out. This can be verified experimentally by preparing the same state multiple times and measuring it 2 incompatible bases, as described above.
Conclusion
That's a wrap for this article. We've covered a lot of ground, touching upon measurement bases, the Stern-Gerlach experiments and measurement in quantum mechanics. Finally we saw how superposition is different from mere uncertainty about which state a qubit is in.
Where to go from here? Read up on entanglement or head straight to the tutorial on how to run quantum circuits on real quantum computers. If you're interested in an example for how superposition can lead to computational advantages, check out Deutsch's Algorithm.