Entanglement: Spooky Action at a Distance

You have two boxes. One holds a glove, the other holds its partner. You leave one box in Istanbul and fly the other to Tokyo. In Tokyo you open the box and see a left glove — and instantly you know the one in Istanbul is the right glove. Nothing surprising there; the gloves were decided from the start.
Quantum entanglement looks similar at first glance. But there is a deep difference: with entangled qubits, the outcome is not decided until it is measured. And yet the two qubits agree perfectly every time, however far apart they are. Einstein didn't like this and called it "spooky action at a distance".
In this post we'll build that spooky link on your own computer.
Two gates, one miracle
We need just two gates: the H gate from the first post and a new friend, CNOT. CNOT flips the "target" qubit if the "control" qubit is 1, and leaves it alone otherwise.
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(2)
qc.h(0) # qubit 0: superposition
qc.cx(0, 1) # tie qubit 1 to qubit 0
print(Statevector(qc))The result is the famous Bell state:
|Φ+⟩ = (|00⟩ + |11⟩) / √2
The system is half "both 0" and half "both 1". |01⟩ and |10⟩ never appear.
Measurement: always in agreement
Measure the circuit 2000 times and a typical result looks like this:
{'00': 981, '11': 1019}Never 01, never 10. In every shot the qubits say the same thing. But which thing they say is completely random.
The real weirdness: alone, nothing
Here is the most interesting part: if you look at only one of the qubits, you see a perfectly random coin toss. When we compute the state of a single qubit with Qiskit (by taking a partial trace), we get this matrix:
[[0.5 0. ]
[0. 0.5]]That means "no information at all". The information isn't stored in the individual qubits — it lives in the relationship between them. The number that measures this is the entanglement entropy, and for a Bell state it is exactly 1 bit, the maximum possible for two qubits.
So how is it different from gloves?
You might wonder: "Maybe the qubits know from the start what they'll be, just like the gloves?" Einstein thought so too. In 1964 John Bell found a way to test this "hidden variable" idea experimentally. Decades of experiments showed that nature does not side with Einstein's intuition — work that earned Aspect, Clauser and Zeilinger the 2022 Nobel Prize in Physics.
You can see a hint of this in your own code: even when you measure the qubits in a different basis (the X basis), the correlation survives. Gloves have no such "change of basis".
x = QuantumCircuit(2)
x.h(0); x.cx(0, 1) # Bell state
x.h([0, 1]) # measure in the X basis
x.measure_all() # still only 00 and 11Faster-than-light messages? No.
The first question everyone asks: "Can we use this to communicate faster than light?" No. The person in Tokyo gets a random value they can't control; to compare notes with Istanbul they still need a classical channel (a phone, the internet). Entanglement doesn't carry information by itself, but it opens new ways to move information — like quantum teleportation, which we'll see in the third post.
The four Bell states
Add a few X gates to the starting qubits and you get four different Bell states:
Φ+ → only 00 and 11
Φ− → only 00 and 11 (with a different phase)
Ψ+ → only 01 and 10
Ψ− → only 01 and 10 (with a different phase)
In the Ψ states the qubits always give opposite results. The two spheres in the cover animation show the Φ+ case: the moment they are measured, they "fall" to the same pole together.
Summary
H + CNOT entangles two qubits.
Entangled qubits are random individually and perfectly correlated together.
The information lives in the relationship, not in the qubits.
Entanglement doesn't allow faster-than-light messaging, but it is the main fuel of quantum computing.
All the code for this post is on GitHub — download it, run it and play with the parameters.
Next up: Quantum Teleportation — we'll use entanglement to move a qubit's state from one place to another.



Comments