Visualizing Two-Qubit Quantum States and Entanglement

Introduction

This interactive guide is an exploration of the intuition behind two-qubit quantum states. The traditional way to learn about qubits is to use the Dirac formalism, which uses vectors of complex numbers to describe quantum states. This is a powerful, flexible, and mathematically beautiful way to describe qubits... but it isn't the most intuitive.

At the core, any formalism is helpful only insofar as it helps us predict the behavior of quantum systems—e.g. what results do we get when measuring a qubit? The visualizations in this guide strike directly at the core of the question: what happens when we measure a qubit in a general two-qubit state? Readers are assumed to know the basics of Dirac notation, qubits, and entanglement.

We will walk through 5 visualizations, building up to a new and intuitive way of visualizing a two-qubit state which we call the Schmidt visualization. Here's the table of contents:

Visualizing a Single-Qubit State

A qubit is a quantum system with only two measurable states. The two possible states are conventionally written as |0⟩ and |1⟩.

There are many kinds of qubits, but they can all be written in the following form:

Single-qubit state
|ψ⟩=α |0⟩ + β |1⟩
Amplitudes α and β are complex numbers. They must satisfy |α|² + |β|² = 1. This is because |α|² and |β|² are the probabilities of measuring the |0⟩ and |1⟩ states, respectively.

There is a well-known one-to-one mapping between a single-qubit state and a point on a unit sphere. This is called the Bloch sphere mapping. Since a point on the sphere can be described by two angles (θ, φ), we can write the state as:

Bloch sphere mapping
θ, φcos(θ/2)|0⟩ + e sin(θ/2)|1⟩
Every direction on the Bloch sphere corresponds to angles 0 ≤ θ ≤ π and 0 ≤ φ < 2π. Using this mapping, |0⟩ is at the north pole, |1⟩ is at the south, |+⟩ and |−⟩ are on opposite sides of the equator.

A small note: a single-qubit state has only two degrees of freedom, even though we use four real numbers to describe it in the traditional form. We lose one degree of freedom because the overall phase of the state is irrelevant, and one more because of the magnitude is constrained to be 1. This helps us understand why only two angles, θ and φ, can fully describe a single-qubit state.

Hover over any point on the sphere to see the corresponding state.

For electron spin qubits, the Bloch mapping is especially intuitive. The bloch direction can be thought of as the direction of the electron's spin, which can point in any direction in 3D space. For other kinds of qubits, the bloch direction doesn't have a well-known physical interpretation - but it's quantum, after all - we shouldn't expect it to. It still perfectly describes the structure of the qubit.

Single-qubit state
Controls
|ψ⟩ =1|0⟩ +(0 + 0i)|1⟩
There is a one-to-one mapping between the state of a qubit and a point on a sphere.
Hover over the sphere to change the state
Axes

Visualizing a Single-Qubit Measurement

One of the most fundamental operations in quantum mechanics is measurement of a qubit. For example, the act of checking if if an electron is spin up or down is a measurement.

A measurement is respresented by a 2x2 matrix Ô, whose eigenstates |φ1⟩ and |φ2⟩ are the two possible outcomes of the measurement. For example, for the "computational basis" observable Ôz, the eigenstates are |0⟩ and |1⟩, which means the two possible outcomes of the measurement are "up" and "down" on the Bloch sphere. The matrix Ô is called an observable. Performing a measurement causes the state to "collapse" or "switch" to one of these two eigenstates, with probabilities given by the Born rule:

The Born rule
P(|φ⟩)=|⟨φ|ψ⟩|²
With this probability, the qubit in state |ψ⟩ will collapse to |φ⟩ when measured with observable Ô.

A single-qubit observable also has a more intuitive spherical interpretation. It turns out that the two potential outcomes of a measurement are guaranteed to be opposite, or antipodal points on the Bloch sphere. Performing a measurement is equivalent to collapsing the state on the bloch sphere to one of these two points.

So, we can think of a single-qubit observable as a line through the center of the sphere, which intersects the sphere at two opposite points. Given a line that passes through the sphere at n = (nx, ny, nz), the corresponding observable can be constructed as:

Bloch Observable Mapping
n · σ=nₓ σₓ + ny σy + nz σz
Whereσkare the pauli matrices
Note that using -n instead of n yields the same observable, except with the addition of a phase factor of -1, which doesn't affect measurements at all.

Hover over the sphere on the right to choose a line through the sphere, and see the corresponding observable.

Single-Qubit Observable
Controls
Ôz=
100-1

There is a one-to-one mapping between a one-qubit observable and a line through the center of the sphere. The two points of intersection with the sphere are the two possible measurement outcomes.

Hover over the sphere to choose a measurement observable
Axes

Visualizing the Probabilities of All Single-Qubit Measurement Outcomes

We can introduce a spherical visualization of the probabilities of measuring a qubit to a given state. The brightness at each point on the sphere is proportional to the probability of measuring the qubit to that state. This is the "measurement distribution" of the qubit - and it's unique to each qubit state.

|0⟩ state
|ψ⟩ = |0⟩
Measurement
probability
100%
0%
Axes
|𝑖⟩ state
|ψ⟩ = 1√2(|0⟩ + i|1⟩)
Measurement
probability
100%
0%
Axes
  • The |0⟩ state: Measuring along the vertical axis always returns the north pole (100%) and never the south pole (0%). Away from that axis the probability decays smoothly as cos²(θ/2), so the equator glows at 50% while the south pole is dark.
  • The |i⟩ = (|0⟩ + i|1⟩)/√2 state: A measurement along the +y axis returns |i⟩ with certainty, while the opposite |−i⟩ outcome never appears. The north and south poles stay at 50%, matching the intuition that measuring |i⟩ in the computational basis produces 0 or 1 with equal chance.

Since the measurement distribution is unique to each qubit state, this is an intuitive visualization of a qubit state. It's an alternative to the Bloch sphere - but it's not specific to just single-qubit states, as we'll see in the next section.

Two-Qubit States

A two-qubit statevector can be written like this:

General two-qubit state
|ψ⟩=a|00⟩ + b|01⟩ + c|10⟩ + d|11⟩
|a|² + |b|² + |c|² + |d|²=1

Note: a two-qubit state has 6 degrees of freedom. There are 8 real coefficients, but one degree of freedom is lost because of the normalization constraint, and one more because the overall phase is irrelevant.

Again, this formalism is only helpful insofar as it helps us predict what happens when we measure a two-qubit state. If we want a more direct intution, we need to understand the following two pieces of information:

Two complementary pieces of information

The behavior of a two-qubit state is determined by:

  • Single-qubit marginals: the probability of every measurement outcome on qubit A alone (and similarly for qubit B). This is captured by the qubit's reduced density matrix.
  • Conditional states: given that qubit A is measured and produces some outcome |a⟩, to which one-qubit state does B collapse? Symmetrically, if B is measured first, to where does A collapse?

Since quantum measurements happen sequentially, and since we already understand the behavior of a one-qubit state, these two pieces of information fully specify the joint behavior.

Our objective is to arrive at a visualization which conveys both pieces in tandem.

Visualizing the Marginal Probabilities of a Two-Qubit State

Let's use the same probability visualization from before, but now for two qubits.

To aid in understanding, we'll introduce a helpful concept: the Schmidt decomposition. It's well known that any two-qubit state can be factored into a form which looks like the following:

Schmidt form
|ψ⟩=√λ |a₁⟩|b₁⟩ + e √(1−λ) |a₂⟩|b₂⟩
λ is between 0 and 1;
φ is between 0 and 2π;
|a₁⟩ and |a₂⟩ are opposite points on the Bloch sphere;
|b₁⟩ and |b₂⟩ are opposite points on the Bloch sphere.

Note that it has 6 free parameters. Since |a₁⟩ and |b₁⟩ are single-qubit states, we need two parameters for each. We don't need any more for |a₂⟩ and |b₂⟩ because they can be derived from |a₁⟩ and |b₁⟩ (up to a phase), since they are simply the opposite points on the Bloch sphere. λ and φ give us the remaining 2 parameters.

While the schmidt form might look complicated, it does expose λ, an important parameter for how the marginal probabilities of the first qubit looks. Try changing λ in the following visualization to see how the probabilities change. We've fixed |a₁⟩, |b₁⟩, |a₂⟩, and |b₂⟩ to be |0⟩, |0⟩, |1⟩, and |1⟩, which are the computational basis states. The φ parameter does not affect measurement probabilities at all, so we've omitted it for now.

Two-qubit marginals
Controls
|ψ⟩ =0.50 |0⟩ |0⟩+√(1-0.50) |1⟩ |1⟩
Each point's brightness is proportional to the probability of measuring the qubit to that point. Increasing λ biases the probability toward |a₁⟩ and|b₁⟩.
Preparing visualization…

Note that when λ = 0.5, the state is perfectly entangled; it is the Bell state |Φ⁺⟩ = (|00⟩ + |11⟩)/√2. When λ is 0 or 1, the state is a pure product state.

From this visualization, we understood the outcome probabilities of measuring a single qubit in a two-qubit state. In the next visualization, we'll understand where the second qubit collapses after the first qubit is measured.

Visualizing the Conditional Collapse Map of a Two-Qubit State

Now, to understand the conditional behavior of the other qubit, we'll add some color to help locate where the other qubit collapses.

To formalize this, let's define the "conditional collapse map".

Conditional collapse map
Define ψB | A=ϕA=(⟨ϕA| ⊗ I)|ψ⟩/√p(ϕA)(project first qubit onto ϕA)
Where p(ϕA)=⟨ψ| (|ϕA⟩⟨ϕA| ⊗ I) |ψ⟩
In english: ψ is the current joint state of qubits A and B. ψB | A=ϕA is the state of qubit B after A collapses to ϕA.

Now, using the Schmidt decomposition of ψ, let's see how the collapsed state of B relates to ϕA.

Qubit B's collapse
let ψ be a the joint state of qubits A and B, expressed in Shmidt form:
|ψ⟩=√λ |a₁⟩|b₁⟩ + e √(1−λ) |a₂⟩|b₂⟩
let ϕA be a single-qubit state, expressed in A's shmidt basis:
A= α|a₁⟩ + eAβ|a₂⟩
Let's find out where B collapses if A is measured to ϕA :
ψB | A=ϕA (⟨ϕA| ⊗ I) |ψ⟩ (conditional collapse map)
                = α√λ|b₁⟩ + ei(φ-φA)β√(1−λ)|b₂⟩
This means that qubit B collapses to a state that is related to ϕA except:
  • |a₁⟩ and |a₂⟩ are replaced with weighted bases √λ|b₁⟩ and √(1−λ)|b₂⟩ (then renormalized). If λ is greater than .5, this weighting pulls the collapse towards |b₁⟩.
  • The relative phase φA is replaced with φ-φA. Now, φA is negative, which explains why the hues on the second sphere look mirrored and offset.
When λ = 0.5 the conditional collapse mapping is perfectly reciprocal: if ψB | A=ϕA = ϕB, then ψA | B=ϕB = ϕA. In other words, if λ = 0.5, measuring either qubit results in the exact same collapsed state. As soon as λ drifts toward 0 or 1, the mapping loses reciprocity.

The visualization below makes this more visual. Each point on the sphere is colored such that if ψB | A=ϕA = ϕB, then ϕA and ϕB will have the same hue. To verify this, hover over a point on either sphere to choose a ϕA, and a line will appear leading to the point ψB | A=ϕA on the other sphere. You'll see it always lands on the same hue.

Again, the brightness of the points on the sphere is proportional to the probability of measuring the qubit to that point.

The colors concretize the role of the φ and λ parameters in the decomposition. As you explore, try to verify the following:

  • The φ parameter determines the longitude where the other qubit collapses. Try increasing φ to see how the hue rotation around the axis of the Schmidt vectors changes.
  • The λ parameter affects the latitude where the other qubit collapses. When looking from the side, hover over a chosen ϕA, and see where ϕB lands. Then, change λ to see how ϕB changes. When λ = 0.5, ϕB will be at the same latitude as ϕA, but as λ increases, the ϕB is pulled towards the dominant Schmidt vector of the other qubit. Thus, we see that λ is a "gravity" parameter that pulls collapses towards the dominant Schmidt vector.

Remember, we're again fixing the Schmidt bases to the computational basis. However, other states with other schmidt bases will have the same behavior - just rotate the schmidt bases to be up-and-down (using come canonical rotation), and it will look the same. Therefore, this visualization is fully general.

Phase lanes
Controls
|ψ⟩ =0.5 |0⟩ |0⟩+eiφ0.5 |1⟩ |1⟩
Changing φ adds a twist to the measurement forward map.
Changing λ compresses the collapse map towards the dominant Schmidt vector.
Preparing visualization…

The visualization isn't perfect. While there is a way to tell exactly the longitude of collapse on B given A (by finding the matching hue), there's no perfect way to pinpoint the latitude just by looking at the colors. However, since the colors are brighter near the dominant Schmidt vector, most viewers get an intuitive sense that the collapse map is concentrated in the primary schmidt direction. We think it does a good job of conveying the "concentration" of the collapse map near the primary schmidt vector.

Implementation in practice

In practice, using the above visualization difficult, because it is very sensitive to the schmidt bases. In most states, this is not a problem, because the Schmidt bases are unique. However, when the state is maximally entangled, the Schmidt bases are not unique, and we must choose them arbitrarily. The visualization will look different depending on the choice of bases. During a smooth evolution of the state, no matter what we might try, we will experience some discontinuities when we move out of a fully entangled state, because at the moment the state moves out of maximal entanglement, the newly-unique Schmidt bases will be likely be different from the ones we had chosen arbitrarily.

To avoid dicontinuities, we use a simpler algorithm which conveys most of the same intuition, but is always smooth. We color each point on the sphere a unique color, and when a point on sphere A is selected, the point on sphere B that it corresponds to is colored the same color. An example is shown below, for the Bell state |Φ⁺⟩ = (|00⟩ + |11⟩)/√2.

Bell pair
1√2(|00⟩ + |11⟩)
A maximally mixed state.
Preparing visualization…

This visualization has a simple interpretation in a fully-entangled state: every point on sphere A has a unique color, and so does every point on B. When we measure to a point on sphere A, B will collapse to the point of the same color!

In operation, two more modifications are made:

  • We add a probability threshold, such that only the points in the top 15th-percentile probability are given any brightness on the sphere. This makes it so that, when the state is unentangled, only the points with an 85% probability or higher are shown. This produces a small bright spot around the primary schmidt vector (which is the same as the Bloch vector in this case).
  • We make the saturation of the whole sphere a function of the purity of the two-qubit state. When the state is fully entangled, the sphere is fully saturated. When the state is unentangled, all the colors on the sphere are desaturated, or white.

These two modifications make it so an unentangled state produces a small white spot around the primary schmidt vector (which is the same as the Bloch vector in this case). Thus, when unentangled, each sphere is simply a representation of the Bloch vector of it's state.

Here's a video of this visualization on real spherical displays, playing famous quantum information experiments.

A century of landmark discoveries that shaped quantum information science.

Conclusion

In conclusion, the structure of 2-qubit quantum entanglement is not unmanageably complicated. The visualizations introduced in this paper convey deep intuition on two-qubit phenomena, including:

  • Superdense coding
  • Any two-qubit QKD schemes
  • Two-qubit Grover's
  • CHSH game
  • Bit commitment
  • Deusch's algorithm (Bitflip-oracle)
  • ...and more.

For three qubits and above, it's not as easy! One of the huge benefits of two-qubit entanglements is that a single measurement results in a perfect "product state" of one-qubit states. That's what these visualizations exploit. When there three qubits in the system, this is no longer the case: in general, measuring one qubit results in a product of a one-qubit states and a two-qubit state. Therefore, they won't work with the style of visualizations we used here.

However, it's still possible to acheive a good intuitive visualization, even for three qubits in above. On Qubi, we call them the "multistate" visualizations. Stay tuned for a second article on how these visualizations can convey the intuition behind larger quantum algorithms like Grover's algorithm and Shor's algorithm.

Dear reader,

If you're reading this, you've probably already spent some time trying to understand quantum computing. And you've likely already realized how hard it is to to connect the math to real, concrete behavior.

We believe that the ability to tinker with something makes learning not only more fun, but also more effective. So, we built Qubi, a real object that mimics a qubit.

Being able to play around with two-qubit gates, like moving between half-CX and full-CX, has been massively helpful to me in truly understanding qubits. The intuition it provides is unmatched.

If you want to support our mission to bring quantum to everyone, and also understand entanglement viscerally for yourself, please support us on Kickstarter. It would mean the world to us.

— Sohum Thakkar, fellow quantum enthusiast.