learn deep. ship safe.Practice testsFollow ByteMunSubscribe
AI & Machine Learning

Bell States Explained: Quantum Entanglement for Beginners, With Python Code You Can Run

Bell states are the simplest form of quantum entanglement: four two-qubit states built with just two gates. This guide explains what they are, why they matter, and includes tested Qiskit code to create them, tell them apart and run a Bell test that beats the classical limit.

Bell states explained: two entangled qubit spheres linked together, with the four Bell state formulas Φ+, Φ−, Ψ+ and Ψ−
The four Bell states: the simplest and most important examples of quantum entanglement.

Bell states are the four simplest, maximally entangled states of two qubits. Measure one qubit and you instantly know the result for the other, however far apart they are. They're created with just two gates (a Hadamard and a CNOT), and they power quantum teleportation, superdense coding, quantum key distribution and the experiments that won the 2022 Nobel Prize in Physics.

If you're learning quantum computing, Bell states are where entanglement stops being an abstract word and becomes something you can build, run and measure. This guide explains them in plain language, shows the maths only where it helps, and includes Python code (tested with Qiskit 2.6) that prepares all four Bell states, tells them apart, and runs a Bell test that beats the classical limit.

What are Bell states?

A qubit can be in state |0⟩, |1⟩, or a superposition of both. With two qubits, there are four basic states: |00⟩, |01⟩, |10⟩ and |11⟩.

The Bell states are four special combinations of those:

|Φ+⟩ = (|00⟩ + |11⟩) / √2
|Φ−⟩ = (|00⟩ − |11⟩) / √2
|Ψ+⟩ = (|01⟩ + |10⟩) / √2
|Ψ−⟩ = (|01⟩ − |10⟩) / √2

In words:

  • Φ (phi) states: the two qubits always give the same result when measured, either both 0 or both 1.

  • Ψ (psi) states: the two qubits always give opposite results.

  • The + and − signs are a relative phase. You can't see it with a simple measurement, but it changes how the state behaves in interference and in other measurement directions.

The 1/√2 means each outcome has a 50% chance. Measure the first qubit of |Φ+⟩ and you'll get 0 or 1 at random, but the second qubit will always match it.

What does "maximally entangled" mean?

A two-qubit state is entangled when it can't be written as "qubit A is in some state, and qubit B is in some other state". The qubits only have a shared description. Erwin Schrödinger coined the term in 1935.

Bell states are maximally entangled: on its own, each qubit looks completely random (a 50/50 coin), yet the pair is perfectly correlated. All the information is in the relationship between the qubits, none in either one alone.

Does entanglement let you send messages faster than light?

No, and this is one of the most common misunderstandings. When Alice measures her qubit, she gets a random result. She can't choose it, so she can't encode a message in it. Bob also just sees random results until the two compare notes over an ordinary (light-speed or slower) channel. Physicists call this the no-communication theorem. The correlation is real, but it can't carry information on its own.

Why are they called Bell states?

They're named after physicist John Stewart Bell. In 1935, Einstein, Podolsky and Rosen (the "EPR" paper) argued that quantum mechanics might be incomplete, and that hidden variables might secretly decide measurement results in advance. For decades this looked like philosophy.

In 1964, Bell showed it could be tested. He proved that any theory based on local hidden variables must satisfy certain limits on correlations, now called Bell inequalities, while quantum mechanics predicts those limits can be broken using entangled states like these.

Experiments followed. John Clauser, Alain Aspect and Anton Zeilinger shared the 2022 Nobel Prize in Physics for experiments with entangled photons that established violations of Bell inequalities. In 2015, several groups performed "loophole-free" Bell tests that closed the main experimental gaps. Bell himself died in 1990, before the prize.

How do you create a Bell state on a quantum computer?

You need just two gates:

  1. Hadamard (H) on qubit 0: turns |0⟩ into an equal superposition of |0⟩ and |1⟩.

  2. CNOT with qubit 0 as control and qubit 1 as target: flips qubit 1 only when qubit 0 is 1.

Starting from |00⟩, the result is |Φ+⟩ = (|00⟩ + |11⟩)/√2. To get the other three, add an X gate before the circuit:

  • X on qubit 0 (input |01⟩ in Qiskit's labelling) gives |Φ−⟩. The X flips the sign after the Hadamard.

  • X on qubit 1 gives |Ψ+⟩.

  • X on both gives |Ψ−⟩ (up to an overall phase, which has no physical effect).

Bell states circuit diagram: optional X gates, a Hadamard on qubit 0 and a CNOT create Φ+, Φ−, Ψ+ and Ψ−, plus how a Bell measurement tells them apart
One Hadamard and one CNOT create a Bell state. Reversing them tells all four apart.

How do you build Bell states in Python with Qiskit?

Install the libraries first:

pip install qiskit qiskit-aer

Save this as bell_states.py. It prepares each Bell state and measures it 1,000 times on a local simulator:

from qiskit import QuantumCircuit
from qiskit_aer import AerSimulator

sim = AerSimulator()

def bell_state(name):
    qc = QuantumCircuit(2, 2)
    if name in ("Psi+", "Psi-"):
        qc.x(1)            # start from a different input state
    if name in ("Phi-", "Psi-"):
        qc.x(0)            # puts a minus sign after the Hadamard
    qc.h(0)                # superposition on qubit 0
    qc.cx(0, 1)            # entangle: qubit 0 controls qubit 1
    return qc

if __name__ == "__main__":
    for name in ["Phi+", "Phi-", "Psi+", "Psi-"]:
        qc = bell_state(name)
        qc.measure([0, 1], [0, 1])
        counts = sim.run(qc, shots=1000).result().get_counts()
        print(name, counts)

A typical run:

Phi+ {'00': 530, '11': 470}
Phi- {'00': 485, '11': 515}
Psi+ {'10': 500, '01': 500}
Psi- {'01': 483, '10': 517}

Notice two things. The Φ states only ever give 00 or 11, and the Ψ states only 01 or 10. That's the entanglement. And Φ+ and Φ− look identical, as do Ψ+ and Ψ−: a plain measurement can't see the phase. Qiskit prints bit strings with qubit 0 on the right, so 10 means qubit 1 is 1 and qubit 0 is 0.

How can you tell the four Bell states apart?

Use a Bell measurement: run the creation circuit backwards (CNOT, then Hadamard), then measure. That maps each Bell state back to a unique ordinary state. Save this as bell_measurement.py in the same folder:

from qiskit_aer import AerSimulator
from bell_states import bell_state

sim = AerSimulator()
for name in ["Phi+", "Phi-", "Psi+", "Psi-"]:
    qc = bell_state(name)
    qc.cx(0, 1)            # undo the entangling step
    qc.h(0)                # undo the Hadamard
    qc.measure([0, 1], [0, 1])
    counts = sim.run(qc, shots=1000).result().get_counts()
    print(name, counts)

Output:

Phi+ {'00': 1000}
Phi- {'01': 1000}
Psi+ {'10': 1000}
Psi- {'11': 1000}

Every state now gives one result 100% of the time, so the hidden phase is revealed. This works because of interference: the Hadamard makes the amplitudes add up or cancel depending on the + or − sign. Bell measurements are the key step in quantum teleportation and superdense coding.

A practical note: on photon-based hardware using only linear optics, a perfect Bell measurement isn't possible. Standard schemes can identify only two of the four states, so they succeed at most 50% of the time. Gate-based quantum computers like the one simulated here don't have that limit.

Can you run a Bell test yourself?

Yes. The most common version is the CHSH inequality (named after Clauser, Horne, Shimony and Holt, 1969). Alice and Bob each measure their qubit in one of two directions, and you combine the correlations into a number S:

  • Any local hidden-variable theory gives S ≤ 2.

  • Quantum mechanics allows up to 2√2 ≈ 2.828 (the Tsirelson bound).

Save this as chsh.py:

import numpy as np
from qiskit import QuantumCircuit
from qiskit_aer import AerSimulator

sim = AerSimulator()
SHOTS = 20000

def correlation(theta_a, theta_b):
    qc = QuantumCircuit(2, 2)
    qc.h(0)
    qc.cx(0, 1)            # |Phi+>
    qc.ry(-theta_a, 0)     # rotate Alice's measurement direction
    qc.ry(-theta_b, 1)     # rotate Bob's measurement direction
    qc.measure([0, 1], [0, 1])
    counts = sim.run(qc, shots=SHOTS).result().get_counts()
    same = counts.get("00", 0) + counts.get("11", 0)
    diff = counts.get("01", 0) + counts.get("10", 0)
    return (same - diff) / SHOTS

a, a2 = 0, np.pi / 2
b, b2 = np.pi / 4, -np.pi / 4
S = correlation(a, b) + correlation(a, b2) + correlation(a2, b) - correlation(a2, b2)
print(f"S = {S:.3f}  (classical limit 2, quantum max {2*np.sqrt(2):.3f})")

Our run printed S = 2.826, well above the classical limit of 2 and almost exactly the quantum maximum. On a simulator this is expected. On real hardware, noise lowers S, but well-calibrated devices still exceed 2.

A caveat: a simulator calculates quantum predictions, so this demonstrates the maths, not new physics. The real proof comes from carefully designed experiments with separated particles, like those recognised by the 2022 Nobel Prize.

What happens on real quantum hardware?

On real devices, Bell states aren't perfect. In Open Source For You's tutorial, a Bell circuit run 1,000 times on IBM's 156-qubit ibm_kingston processor gave 987 correct results (00 or 11) and 13 errors (01 or 10), about 98.7% agreement.

The errors come from:

  • Decoherence: qubits lose energy (T1) and phase (T2) over time.

  • Gate errors: two-qubit gates like CNOT are typically much noisier than single-qubit gates.

  • Readout errors: occasionally a 0 is read as a 1, or vice versa.

  • Crosstalk: operations on one qubit disturb its neighbours.

That's why Bell-state fidelity, how close the real state is to the ideal one, is a standard benchmark for quantum hardware. It tells you directly how good a device's two-qubit operations are.

What are Bell states used for?

  • Quantum teleportation (proposed by Bennett and colleagues in 1993): using a shared Bell pair, a Bell measurement and two classical bits, Alice can transfer an unknown qubit state to Bob. The original is destroyed in the process, and no information travels faster than light.

  • Superdense coding (Bennett and Wiesner, 1992): with a pre-shared Bell pair, Alice can send two classical bits by transmitting just one qubit. She applies one of four operations (I, X, Z or XZ) that turns the pair into one of the four Bell states, and Bob identifies it with a Bell measurement.

  • Quantum key distribution: in the E91 protocol (Ekert, 1991), entangled pairs create shared secret keys, and a Bell test reveals whether anyone eavesdropped.

  • Entanglement swapping and quantum repeaters: Bell measurements can entangle particles that never met, a building block for long-distance quantum networks.

  • Benchmarking: Bell-state fidelity is a quick health check for quantum processors.

  • Building bigger states: GHZ states and the entangled resources used in quantum error correction start from the same H + CNOT idea.

Entanglement has also been distributed over long distances. In 2017, China's Micius satellite distributed entangled photon pairs to ground stations about 1,200 km apart.

Common misconceptions about Bell states

  • "Entanglement sends signals instantly." No. Results are random, and you need a classical channel to make use of the correlation.

  • "The qubits had their answers all along." That's the local hidden-variable idea, and Bell tests rule it out.

  • "Teleportation moves matter." It transfers a quantum state, not a physical object, and it needs classical communication.

  • "Φ+ and Φ− are the same." They give the same results in a standard measurement, but they're different states, as the Bell measurement shows.

Where should you go next?

Once you're comfortable with Bell states, good next steps are:

  • building a quantum teleportation circuit in Qiskit (three qubits, one Bell measurement);

  • extending the circuit to a three-qubit GHZ state;

  • running your Bell circuit on real hardware through IBM Quantum's free tier and comparing the error rate with the simulator.

For the bigger picture of where quantum computing is headed, see our guide to quantum computing and its real use cases. If you're a student building your tech vocabulary, our list of AI terms every student should know is a good companion.

The bottom line

Bell states are the "hello world" of quantum entanglement: four two-qubit states, made with two gates, that behave in ways no classical system can. They show why quantum computers aren't just faster classical computers, and they sit at the heart of teleportation, quantum cryptography and quantum networks. The best way to understand them is to run the code above and watch the correlations, and the Bell inequality violation, appear for yourself.

Sources: Open Source For You: Quantum Computing, Ringing the Bell States · QuEra: Bell State glossary · Nobel Prize in Physics 2022 · IBM Quantum / Qiskit documentation · Bell, J. S., "On the Einstein Podolsky Rosen Paradox" (1964) · Clauser, Horne, Shimony & Holt (1969) · Bennett et al., quantum teleportation (1993) · Bennett & Wiesner, superdense coding (1992) · Ekert, E91 (1991)

Frequently asked questions

What are Bell states in simple terms?

Four special two-qubit states where the qubits are perfectly correlated. Measuring one tells you the other’s result, even though each looks random on its own.

How do you create a Bell state?

Apply a Hadamard gate to the first qubit, then a CNOT with the first qubit as control. Starting from 00, this gives Φ+.

Can entanglement send information faster than light?

No. Each measurement result is random, so you need an ordinary classical channel to make use of the correlation.

How do you tell the four Bell states apart?

Perform a Bell measurement: apply CNOT then Hadamard, then measure. Each Bell state maps to a unique outcome: 00, 01, 10 or 11.

What is the CHSH inequality?

A Bell test where classical theories give at most 2. Quantum mechanics allows up to about 2.83, and real experiments confirm the quantum result.

What are Bell states used for?

Quantum teleportation, superdense coding, entanglement-based quantum key distribution, quantum networks and benchmarking quantum hardware.

Concepts in this article

Python
A general-purpose language widely used for scripting, web back ends and machine learning.
Quantum computing
Computing with qubits, which use superposition and entanglement for certain problems.

How we research, write and check articles

Written by

· Senior Software Engineer

Deepak Kumar is a Senior Software Engineer based in New Delhi. He builds Generative AI into production: RAG on MongoDB Atlas Vector Search, semantic search over an editorial archive, and the multi-agent pipelines behind ByteMuni itself. He started ByteMuni to publish clear, source-checked guides for working developers.