Quantum Sandbox logo

Quantum Sandbox

An Interactive Quantum Circuit Playground

All Lessons Sandbox
Part 2: How They Work 11 min read

Entanglement

Einstein called it "spooky action at a distance" - and he did not mean it as a compliment. Entanglement is the strangest, most powerful, and most useful feature of quantum mechanics. It is also completely real.

Beyond individual qubits

So far, you have worked with one qubit at a time. Add a second qubit, and something new becomes possible: the two qubits can become entangled - linked in a way that has no classical equivalent.

When two qubits are entangled, the state of the system cannot be described by simply listing the state of each qubit separately. Instead, the pair is described as a single joint state. Measuring one qubit instantly tells you something about the other - not because information traveled between them, but because their fates were correlated from the moment they became entangled.

Imagine you have two coins. You put them in separate boxes, seal them, and send one to Tokyo and one to New York. When the New York scientist opens their box and sees heads, they instantly know the Tokyo coin is tails. That is a classical correlation - built in at the start, no mystery. But quantum entanglement is different: the coins were genuinely in superposition (not secretly heads or tails) until one was opened, and then both resolved simultaneously.

Bell states: the building blocks of entanglement

The simplest entangled states are called Bell states. The most famous one is written as: (|00⟩ + |11⟩) / √2. This means the two-qubit system is in a superposition where both qubits are 0, or both are 1 - with equal probability. There is no classical mixture that can reproduce this correlation.

To create this Bell state, you start with two qubits both in |0⟩. Apply H to the first qubit, putting it in superposition. Then apply a CNOT gate (Controlled-NOT): this gate flips the second qubit only if the first qubit is |1⟩. Because the first qubit is in superposition (both 0 and 1), the CNOT propagates that superposition to both qubits together, creating entanglement.

After this two-step circuit, measuring either qubit gives a random 0 or 1 - that part looks classical. But measure both, and they always match. Always. No exception. Every single time. This perfect correlation, no matter how far apart the qubits are, is the signature of entanglement.

Why classical correlation is not enough

You might think: can't you explain this with classical correlations? Pre-program both qubits with the same random value before you separate them?

In 1964, physicist John Bell derived a mathematical inequality - now called Bell's inequality - that any classical hidden variable theory must satisfy. He showed that quantum mechanics predicts violations of this inequality. Experiments have since confirmed those violations beyond any reasonable doubt. The correlations of entanglement are stronger than any classical correlation can produce.

Think of it like two students who always give matching answers on a pop quiz, no matter which of several possible questions the teacher picks - even though they never agreed on answers beforehand and cannot communicate during the quiz. Classical "cheating" (a pre-shared answer sheet) can only match the teacher's questions so well. Entangled qubits match better than any pre-shared answer sheet possibly could - that excess is what Bell's inequality catches.

This means there is no hidden value pre-programmed into the qubits. The correlation genuinely arises at the moment of measurement, not before. Einstein's discomfort with "spooky action" turned out to be wrong - not because action travels instantly, but because the correlations were never classical to begin with.

Crucially, entanglement does not allow information to travel faster than light. You cannot use entanglement to send a message, because you cannot control which outcome your measurement produces.

Try it in the Sandbox
Create and explore a Bell state
  1. Open the Algorithm Preset dropdown and select Bell State.
  2. Check the probabilities: 50% |00⟩ and 50% |11⟩. No |01⟩ or |10⟩.
  3. Look at the Bloch spheres: they appear uncertain. Neither qubit has an independent state.
  4. Click Measure All: collapses to 00 or 11. Reset and repeat. They always match!
  5. Click Clear, then build it: H on qubit 1 (col 1), CNOT control=1 target=2 (col 2).

What entanglement does for computing

Entanglement is not just a curiosity - it is a resource. Quantum computers exploit entanglement to process information in ways that classical computers simply cannot replicate.

With n classical bits, you store and process n independent pieces of information. With n entangled qubits, the joint state of the system can encode correlations across all 2ⁿ possible bit strings simultaneously. Algorithms that use entanglement can explore and exploit these correlations in ways that are computationally impossible to simulate efficiently classically.

It's the difference between n people each privately flipping their own coin, versus n coins wired together so that every combination of heads and tails carries its own piece of shared information. A classical computer has to track each bit's story on its own; an entangled register carries relationships between bits as a first-class resource, which is exactly what algorithms like Grover's (Lesson 11) and Shor's (Lesson 12) exploit.

Entanglement is also the foundation of quantum teleportation (Lesson 13), quantum error correction (Lesson 9), and quantum key distribution (Lesson 14). In each case, the non-classical correlations of entanglement enable something that is either impossible or exponentially harder without it.

The CNOT gate: creating entanglement

The Controlled-NOT (CNOT) gate is a two-qubit gate. It has a control qubit and a target qubit. The rule is simple: if the control qubit is |1⟩, flip the target qubit. If the control is |0⟩, do nothing.

When applied to a qubit in superposition (as the control), the CNOT creates entanglement. This is because the operation "if |1⟩ flip" creates a correlation between the two qubits - their states become intertwined. The CNOT, combined with the Hadamard, is enough to create any two-qubit entangled state. These two gates - together with single-qubit rotation gates - form a universal quantum gate set: any quantum computation can be built from them.

Key takeaway

Entanglement links two or more qubits into a single joint quantum state that cannot be described independently. Measuring one entangled qubit instantly determines a correlated outcome for its partner - a correlation stronger than any classical mechanism can produce, confirmed experimentally by violations of Bell's inequality.

Knowledge check · Question 1 of 4

Two qubits are in the Bell state (|00⟩ + |11⟩) / √2. You measure the first qubit and get 0. What will you get when you measure the second qubit?

In the (|00⟩ + |11⟩)/√2 Bell state, the qubits are correlated to always be equal. Measuring the first qubit as 0 collapses the joint state to |00⟩, so the second must also be 0.
Knowledge check · Question 2 of 4

What two-gate sequence creates the Bell state (|00⟩ + |11⟩) / √2 starting from |00⟩?

The Hadamard first puts qubit 1 into superposition. The CNOT then propagates that superposition onto qubit 2, entangling the two qubits into the Bell state.
Knowledge check · Question 3 of 4

Why can't entanglement be explained by a classical "pre-shared answer sheet" (hidden variables agreed on in advance)?

Bell's inequality sets a limit on how correlated any classical hidden-variable theory can be. Quantum mechanics predicts - and experiments confirm - correlations that exceed this limit, ruling out pre-shared classical answers.
Knowledge check · Question 4 of 4

Why can't you use entanglement to send a message faster than light?

Measurement outcomes on entangled qubits are random - you can't choose to get a 0 or a 1. Since you can't control the outcome, you can't encode a chosen message in it, so no faster-than-light signaling is possible.