Module 3 in the Quantum Computing: A Complete Learning Path series. Bridging the transition from single-qubit geometry in Bloch Sphere Explained (Module 2) to multi-qubit communication in Superdense Coding (Module 3b) and Quantum Teleportation (Module 9).
In single-qubit quantum mechanics, every pure state can be visualized as a vector pointing to a point on the surface of the three-dimensional Bloch sphere. However, as soon as a second qubit enters the system, quantum physics reveals its most distinctive phenomenon: quantum entanglement.
When two qubits become entangled, the state of the composite system can no longer be described by the independent states of its individual components. Individual qubits lose their independent identity, single-qubit Bloch vectors collapse into the interior of the sphere as mixed states, and measurements on separated particles exhibit correlations that cannot be explained by classical probability.
In this guide, we build two-qubit entanglement from first principles: defining mathematical non-separability, synthesizing the four maximally entangled Bell states (EPR pairs), deriving the Bell basis decoder, and running verifiable code in Qiskit 2.x with Matplotlib circuit diagrams.
1. What is Entanglement? Mathematical Non-Separability
To understand what entanglement is, we must first understand what it is not. Consider two independent qubits, A and B, each in a general superposition state:
|ψ_A⟩ = α₀ |0⟩ + α₁ |1⟩, |ψ_B⟩ = β₀ |0⟩ + β₁ |1⟩
The joint state of the two qubits is given by the tensor product $|a⟩ \otimes |b⟩$:
|ψ_joint⟩ = α₀β₀ |00⟩ + α₀β₁ |01⟩ + α₁β₀ |10⟩ + α₁β₁ |11⟩
Any two-qubit state that can be factored into such a tensor product is called a product state (or separable state). Now, consider the canonical Bell state:
|Φ+⟩ = ( |00⟩ + |11⟩ ) / √2
The Non-Separability Proof:
Can we choose single-qubit coefficients $\alpha_0, \alpha_1, \beta_0, \beta_1$ such that $|\psi_{\text{joint}}\rangle = |\Phi^+\rangle$? Matching coefficients requires:
- $\alpha_0 \beta_0 = 1 / \sqrt{2}$
- $\alpha_1 \beta_1 = 1 / \sqrt{2}$
- $\alpha_0 \beta_1 = 0 \implies$ either $\alpha_0 = 0$ or $\beta_1 = 0$
- $\alpha_1 \beta_0 = 0 \implies$ either $\alpha_1 = 0$ or $\beta_0 = 0$
If $\alpha_0 = 0$, then $\alpha_0 \beta_0 = 0 \neq 1 / \sqrt{2}$, a contradiction! If $\beta_1 = 0$, then $\alpha_1 \beta_1 = 0 \neq 1 / \sqrt{2}$, another contradiction!
No single-qubit states $|\psi_A\rangle$ and $|\psi_B\rangle$ exist whose product equals $|\Phi^+\rangle$. The state is mathematically non-separable: it exists solely as an indivisible two-qubit entity.
2. The Controlled-NOT (CNOT) Gate: Generating Entanglement
Single-qubit operations (such as Hadamard $H$, Pauli $X$, or Phase $Z$) are local unitaries ($U_A \otimes U_B$). By definition, a local unitary applied to a separable state produces another separable state—it can never create entanglement from scratch.
To generate entanglement, we need an interaction between qubits. The universal two-qubit entangler is the Controlled-NOT (CNOT or $CX$) gate. It leaves the control qubit unchanged and flips the target qubit if and only if the control qubit is $|1\rangle$:
CX |00⟩ = |00⟩, CX |01⟩ = |01⟩, CX |10⟩ = |11⟩, CX |11⟩ = |10⟩
The Entanglement Recipe:
When a CNOT is fed an unentangled product state where the control qubit is in superposition:
|ψ⟩ = |+⟩ |0⟩ = [ (|0⟩ + |1⟩) / √2 ] ⊗ |0⟩ = ( |00⟩ + |10⟩ ) / √2
CX |ψ⟩ = ( CX|00⟩ + CX|10⟩ ) / √2 = ( |00⟩ + |11⟩ ) / √2 = |Φ+⟩
The CNOT couples the control's superposition to the target's bit value, fusing the two independent states into a single entangled state.
3. The 4 Maximally Entangled Bell States (EPR Pairs)
The 4 Bell states form an orthonormal basis for the entire two-qubit Hilbert space $\mathbb{C}^4$, known as the Bell basis:
1. State |Φ+⟩ = ( |00⟩ + |11⟩ ) / √2 — (Correlated, Positive Phase)
Prepared from $|00\rangle$ via $H(q_0)$ followed by $CX(q_0, q_1)$:

Circuit 1: Preparation of |Φ+⟩ from ground state |00⟩.
2. State |Φ−⟩ = ( |00⟩ − |11⟩ ) / √2 — (Correlated, Negative Phase)
Prepared by applying an $X$ gate (or $Z$ gate) to $q_0$ before the Hadamard, creating $|-\rangle \otimes |0\rangle$ before the CNOT:

Circuit 2: Preparation of |Φ−⟩ with relative minus phase.
3. State |Ψ+⟩ = ( |01⟩ + |10⟩ ) / √2 — (Anti-Correlated, Positive Phase)
Prepared by flipping the target qubit $q_1$ with an $X$ gate, so the CNOT flips $|01\rangle \leftrightarrow |10\rangle$:

Circuit 3: Preparation of |Ψ+⟩ with bit-flip anti-correlation.
4. State |Ψ−⟩ = ( |01⟩ − |10⟩ ) / √2 — (The Singlet State)
Prepared with $X$ gates on both qubits before the entangling layer. $|\Psi^-\rangle$ is the unique anti-symmetric singlet state with total spin $S = 0$, making it invariant under arbitrary simultaneous bilateral rotations:

Circuit 4: Preparation of the rotationally invariant Singlet State |Ψ−⟩.
Bell Basis Properties Matrix
| Bell State | Input State | Statevector Expression | Correlation Type | Allowed Outcomes |
|---|---|---|---|---|
| |Φ+⟩ | |00⟩ | ( |00⟩ + |11⟩ ) / √2 | Correlated (Even Parity) |
00 (50%), 11 (50%) |
| |Φ−⟩ | |10⟩ | ( |00⟩ − |11⟩ ) / √2 | Correlated (Even Parity) |
00 (50%), 11 (50%) |
| |Ψ+⟩ | |01⟩ | ( |01⟩ + |10⟩ ) / √2 | Anti-Correlated (Odd Parity) |
01 (50%), 10 (50%) |
| |Ψ−⟩ | |11⟩ | ( |01⟩ − |10⟩ ) / √2 | Anti-Correlated (Singlet) |
01 (50%), 10 (50%) |
4. Why the Bloch Sphere Fails for Entangled Qubits
In Module 2 (Bloch Sphere Explained), we saw that any standalone qubit pure state points to the surface of the three-dimensional Bloch sphere with radius |r| = 1. What happens to the Bloch vector of qubit A when it is entangled in |Φ+⟩?
Single Qubit (Pure State) : |r| = 1 (Points to sphere surface)
Entangled Qubit (Isolated) : |r| = 0 (Collapses to dead center)
Because an entangled state cannot be factored into independent parts, qubit A does not have a pure state of its own. If you measure qubit A in isolation along any axis ($X$, $Y$, or $Z$), you observe pure 50/50 random noise:
- Expectation along $X$: $\langle X \rangle = 0$
- Expectation along $Y$: $\langle Y \rangle = 0$
- Expectation along $Z$: $\langle Z \rangle = 0$
With all three coordinates vanishing ($r_x = 0, r_y = 0, r_z = 0$), qubit A collapses into a maximally mixed state at the exact center of the sphere (|r| = 0). The Bloch sphere is fundamentally a single-qubit geometry tool—it cannot visualize entanglement because none of the information belongs to qubit A or qubit B alone. All the information resides exclusively in the joint correlations between them.
5. Reversing Entanglement: The Bell Basis Analyzer
If we measure $|\Phi^+\rangle$ and $|\Phi^-\rangle$ directly in the computational basis, both produce 00 (50%) and 11 (50%). How can an experimenter distinguish all four Bell states deterministically?
Because quantum circuits are unitary and reversible, we apply the inverse of the Bell preparation circuit: a CNOT gate followed by a Hadamard on the control qubit ($CX \to H$):

Circuit 5: The Bell Basis Decoder (CX followed by H) rotates the 4 entangled states back to the computational basis.
This transformation maps the 4 entangled Bell states back into the 4 classical basis bitstrings with 100% deterministic certainty:
- $|\Phi^+\rangle \to$
00(100%) - $|\Phi^-\rangle \to$
01(100%) - $|\Psi^+\rangle \to$
10(100%) - $|\Psi^-\rangle \to$
11(100%)
This decoder is the foundational building block for Superdense Coding (Module 3b) (transmitting 2 classical bits using only 1 physical qubit) and the receiver measurement in Quantum Teleportation (Module 9).
6. Complete Qiskit 2.x Implementation
import numpy as np
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector, DensityMatrix, partial_trace
def build_bell_state(state_name: str) -> QuantumCircuit:
qc = QuantumCircuit(2, 2)
if state_name == "Phi+":
qc.h(0)
qc.cx(0, 1)
elif state_name == "Phi-":
qc.x(0)
qc.h(0)
qc.cx(0, 1)
elif state_name == "Psi+":
qc.x(1)
qc.h(0)
qc.cx(0, 1)
elif state_name == "Psi-":
qc.x(0)
qc.x(1)
qc.h(0)
qc.cx(0, 1)
return qc
def bell_basis_decoder() -> QuantumCircuit:
dec = QuantumCircuit(2, 2)
dec.cx(0, 1)
dec.h(0)
dec.measure([0, 1], [0, 1])
return dec
bell_states = ["Phi+", "Phi-", "Psi+", "Psi-"]
print("=== 4 Bell States Generation & Verification ===\n")
for name in bell_states:
prep = build_bell_state(name)
sv = Statevector(prep)
# Run through the Bell Basis Decoder
full_circuit = prep.compose(bell_basis_decoder())
full_sv = Statevector(full_circuit.remove_final_measurements(inplace=False))
probs = {k: round(float(v), 2) for k, v in full_sv.probabilities_dict().items() if v > 1e-4}
print(f"State |{name}>:")
print(f" Statevector: {np.round(sv.data, 3)}")
print(f" Bell Basis Decoder Outcome: {probs}\n")
# Verify Bloch radius collapse for Qubit A
phi_plus_sv = Statevector(build_bell_state("Phi+"))
rho_total = DensityMatrix(phi_plus_sv)
rho_A = partial_trace(rho_total, [1])
purity = np.real(np.trace(rho_A.data @ rho_A.data))
print(f"Reduced Density Matrix of Qubit A:\n{np.round(rho_A.data, 3)}")
print(f"Purity Tr(rho_A^2): {purity:.2f} (0.50 = Maximally Mixed, Bloch radius r = 0)")
Execution Output:
=== 4 Bell States Generation & Verification ===
State |Phi+>:
Statevector: [0.707+0.j 0. +0.j 0. +0.j 0.707+0.j]
Bell Basis Decoder Outcome: {'00': 1.0}
State |Phi->:
Statevector: [ 0.707+0.j 0. +0.j 0. +0.j -0.707+0.j]
Bell Basis Decoder Outcome: {'01': 1.0}
State |Psi+>:
Statevector: [0. +0.j 0.707+0.j 0.707+0.j 0. +0.j]
Bell Basis Decoder Outcome: {'10': 1.0}
State |Psi->:
Statevector: [ 0. +0.j -0.707+0.j 0.707+0.j 0. +0.j]
Bell Basis Decoder Outcome: {'11': 1.0}
Reduced Density Matrix of Qubit A:
[[0.5+0.j 0. +0.j]
[0. +0.j 0.5+0.j]]
Purity Tr(rho_A^2): 0.50 (0.50 = Maximally Mixed, Bloch radius r = 0)
Key Insights & Takeaways
- Entanglement is Non-Factorability: An entangled state cannot be written as $|a\rangle \otimes |b\rangle$. The whole possesses definite physical properties that do not exist in the parts.
- Local Randomness vs. Global Certainty: Measuring one qubit of a Bell pair yields pure 50/50 randomness ($r = 0$). Yet, the two-qubit joint correlation is 100% deterministic.
- The Quantum Information Backbone: Without the Bell basis, neither Superdense Coding nor Quantum Teleportation could exist.
Top comments (0)