Case Study 2: Proving Entanglement
"I measured
00and11and nothing else, therefore I made a Bell state" is not an argument. It is a description of one measurement setting.
Executive Summary
A student reports that they have prepared an entangled state on a quantum computer. Their evidence:
a histogram showing 49% 00, 51% 11, and nothing else. It looks conclusive.
It proves nothing. This case study builds a circuit with zero entanglement that produces the same histogram, shows exactly what additional measurement separates them, and then walks up the ladder of rigor from "a second basis" to a proper entanglement witness — a single number with a threshold that no unentangled state can cross.
Along the way it takes a position that matters professionally: the standard of evidence for an entanglement claim is higher than most people apply, and knowing the difference is what makes you useful when reviewing someone else's result.
Skills applied: Bell states (§4.3, §4.5); the reduced-state test (§4.4); the two-basis experiment (§4.4 pitfall); basis changes via H (Chapter 3 §3.8).
Reproducibility. All simulator results below use seed_simulator=1234 at 4,096 shots.
The Claim
Circuit: h(0); cx(0, 1); measure both
Result: {'00': 2074, '11': 2022}
Perfect correlation. No 01, no 10. The student concludes: entangled.
The circuit is entangled — we verified that in §4.4 with the reduced-state test. But the histogram is not what establishes it, and the difference between "true" and "established by this evidence" is the entire subject of this case study.
The Counterexample
Here is a circuit that produces the same histogram and contains no entanglement whatsoever:
from qiskit import QuantumCircuit
impostor = QuantumCircuit(2, 2)
impostor.h(0)
impostor.measure(0, 0) # <-- collapses the superposition HERE
with impostor.if_test((impostor.clbits[0], 1)):
impostor.x(1) # classically copy the result
impostor.measure(1, 1)
Read what happens. Qubit 0 goes into superposition and is measured, which destroys the superposition and yields a definite classical bit — a fair coin flip. Then a classical controller reads that bit and flips qubit 1 to match. At no point do the two qubits share a quantum state.
This is precisely the "two red balls in two boxes" correlation from §4.3: real, perfect, and entirely classical.
Z basis, Bell : {'00': 2074, '11': 2022}
Z basis, impostor : {'00': 2031, '11': 2065}
Indistinguishable. Any statistical test you apply to these two histograms will fail to separate them, because they are samples from the same distribution.
⚠️ Common Pitfall — More shots will not help.
The instinct on seeing two indistinguishable histograms is to take more data. It cannot work. The two circuits produce the same distribution in this measurement setting, so more samples measure that same distribution more precisely.
This is Chapter 2's distinction in a new guise: sampling noise shrinks with shots, and a systematic limitation of your measurement does not. You do not need more data; you need different data.
Level 1: A Second Basis
Insert a Hadamard on each qubit immediately before measuring. From Chapter 3 §3.8, $HZH = X$, so this measures both qubits in the $X$ basis instead of the computational basis.
def in_x_basis(qc):
qc.h(0)
qc.h(1)
return qc
X basis, Bell : {'00': 2074, '11': 2022}
X basis, impostor : {'00': 1039, '01': 1037, '10': 992, '11': 1028}
Complete separation. The Bell state stays perfectly correlated. The impostor collapses to uniform noise across all four outcomes.
The reason is exactly §4.3's claim, now demonstrated rather than asserted: quantum correlation survives a change of basis; classical correlation does not. The impostor's correlation lives in a particular basis — the one in which the measurement happened — and rotating away from it destroys the correlation. The Bell state's correlation is basis-independent.
That is a genuinely strong result from a two-line change, and for most practical purposes it is enough. But notice what it is not: it is a demonstration that two specific circuits differ. It is not a proof that any circuit passing the test is entangled.
Level 2: A Witness
The rigorous version is an entanglement witness: a quantity you measure, with a threshold that no separable state can exceed. Exceed it, and entanglement is proven — not suggested.
For the Bell state $|\Phi^+\rangle$ the standard witness uses two correlators:
$$W = \langle Z \otimes Z\rangle + \langle X \otimes X\rangle$$
For $|\Phi^+\rangle$, both terms equal $+1$, so $W = 2$. Any separable state has $W \leq 1$.
import numpy as np
from qiskit import QuantumCircuit, transpile
from qiskit_aer import AerSimulator
SIM = AerSimulator()
def correlator(prep, basis):
"""<basis (x) basis> from counts: +1 for equal bits, -1 for unequal."""
qc = prep()
if basis == "X":
qc.h(0)
qc.h(1)
qc.measure([0, 1], [0, 1])
counts = SIM.run(transpile(qc, SIM), shots=4096,
seed_simulator=1234).result().get_counts()
total = sum(counts.values())
same = counts.get("00", 0) + counts.get("11", 0)
diff = counts.get("01", 0) + counts.get("10", 0)
return (same - diff) / total
def bell():
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
return qc
zz, xx = correlator(bell, "Z"), correlator(bell, "X")
print(f" <ZZ> = {zz:+.4f} <XX> = {xx:+.4f} W = {zz + xx:.4f}")
<ZZ> = +1.0000 <XX> = +1.0000 W = 2.0000
$W = 2 > 1$. Entanglement is proven, not inferred — and the proof rests on a threshold that holds for every separable state, not on a comparison against one particular impostor.
Run the same measurement on the impostor and you get $\langle ZZ\rangle \approx 1$, $\langle XX\rangle \approx 0$, so $W \approx 1$: exactly at the classical bound, as it must be.
📐 Math Aside — Where the bound comes from.
A separable state is a mixture of products: $\rho = \sum_i p_i\, \rho_i^A \otimes \rho_i^B$.
For any single product term, $\langle Z\otimes Z\rangle = \langle Z\rangle_A \langle Z\rangle_B$ and likewise for $X$ — the expectation factorizes, because there is no correlation to violate it. Each single-qubit expectation is bounded by the Bloch-sphere constraint $\langle X\rangle^2 + \langle Y\rangle^2 + \langle Z\rangle^2 \leq 1$.
Maximizing $\langle Z\rangle_A\langle Z\rangle_B + \langle X\rangle_A\langle X\rangle_B$ subject to that constraint on both qubits gives a maximum of exactly 1 — achieved, for instance, by both qubits pointing along $(1,0,1)/\sqrt2$. Mixing product states cannot beat the best single one, since the expression is linear in $\rho$.
So $W \leq 1$ for every separable state, and $W = 2$ for $|\Phi^+\rangle$. The gap between 1 and 2 is where entanglement lives, and any measured value above 1 is inside it.
This is a cousin of the CHSH inequality, which uses four correlators at cleverly chosen angles and gives the more famous bound $2$ versus Tsirelson's $2\sqrt2$. The two-term version above is easier to run and sufficient here. This book does not run CHSH anywhere — Chapter 30 §30.7 covers cross-entropy benchmarking, a different measure entirely, and Chapter 38's BB84 is a prepare-and-measure protocol whose security rests on no-cloning rather than on a Bell violation. (Ekert's E91, in Chapter 38's reading list, is the entanglement-based alternative where security does follow from a Bell violation, and it is the protocol for which a CHSH test would be the eavesdropper detector.) Running the full four-correlator CHSH test on hardware is a worthwhile exercise and this book does not do it for you.
Level 3: On Real Hardware, Where It Gets Hard
Everything so far was noiseless. On hardware the witness value drops, and the interesting question becomes: does it drop below the threshold?
from qiskit_ibm_runtime.fake_provider import FakeSherbrooke
Running the same two correlators through a device-derived noise model at optimization level 3:
hardware <ZZ> = +0.9653 <XX> = +0.9653 W = 1.9307
Comfortably above the separable bound of 1 — entanglement demonstrated on hardware, with a real proof rather than a suggestive histogram. And the impostor, for comparison, sits at $W = 0.9966$: exactly at the classical bound, as it must.
A useful sanity check on the bound itself, which takes one loop:
# Sample random PRODUCT states and see how large W can get.
rng = np.random.default_rng(7)
best = 0.0
for _ in range(20_000):
def random_bloch():
theta = np.arccos(1 - 2 * rng.random())
phi = 2 * np.pi * rng.random()
return np.array([np.sin(theta) * np.cos(phi),
np.sin(theta) * np.sin(phi),
np.cos(theta)])
a, b = random_bloch(), random_bloch()
best = max(best, a[2] * b[2] + a[0] * b[0]) # <ZZ> + <XX>
print(f"max W over 20,000 random product states: {best:.4f}")
max W over 20,000 random product states: 0.9980
Twenty thousand tries and nothing crosses 1. The bound is not a convention; it is a fact about product states, and the 📐 Math Aside below proves it.
But now extrapolate against Chapter 4 §4.9's decay. Each correlator degrades roughly with the circuit's error rate, so as circuits grow, $W$ falls toward 1. At some size the witness stops being able to prove anything, not because the entanglement vanished but because the noise swamped the evidence. That crossing point is a much more meaningful measure of a device's capability than its qubit count, and it is essentially what Chapter 30's benchmarks formalize.
🔬 Honest Assessment — The standard of evidence in practice.
Three tiers, and it is worth knowing which one a given claim sits in:
Evidence What it establishes Common? Computational-basis counts only Nothing about entanglement Very Two complementary bases Strongly suggestive; separates the obvious impostors Sometimes A witness above its threshold, with error bars Proof, up to statistics Rare outside dedicated papers The first row is the one to watch for. It appears in blog posts, in student work, in vendor material, and occasionally in peer-reviewed papers where the entanglement claim was incidental to the main result and nobody pushed on it.
The fix is cheap. One extra basis is two gates. A witness is two circuits and a subtraction. There is no good reason to make the weak claim, and being the person who asks "in which bases?" is a small, reliable way to be useful.
And note the honest limit of the strong version: a witness above threshold proves entanglement existed in the state you measured. It does not tell you how much, it does not identify which state, and it can be fooled by a sufficiently adversarial preparation. Full characterization needs tomography, which costs exponentially many measurement settings — which is why witnesses exist.
Analysis
The structure of this case study is the structure of a great many arguments in quantum computing, and it is worth naming.
A measurement is a question, and a histogram is an answer to one question. The student's histogram answered "what do these qubits do in the computational basis?" — accurately. It simply was not the question whose answer distinguishes entanglement from classical correlation.
Constructing an explicit counterexample is the strongest move available. Arguing abstractly that counts are insufficient is much less persuasive than handing someone a twelve-line circuit with zero entanglement that reproduces their exact data. Build the impostor.
Thresholds beat comparisons. "Different from this impostor" is weaker than "above a bound no separable state can reach." When you can find a witness with a proven threshold, use it — the claim becomes robust against impostors you did not think of.
Noise erodes evidence, not just accuracy. The witness value falling toward its threshold as circuits grow is a distinct failure from "the answer got noisier." It is the proof degrading, and recognizing that distinction is what Chapter 30 is for.
Lessons
- Computational-basis counts never establish entanglement. A classically conditioned circuit reproduces them exactly.
- More shots cannot fix a wrong measurement setting. You need different data, not more data.
- Two complementary bases separate the obvious impostors, and cost two gates.
- A witness with a proven threshold is the real standard. $W = \langle ZZ\rangle + \langle XX\rangle > 1$ proves entanglement; $W = 2$ is the maximum.
- Quantum correlation survives a change of basis; classical correlation does not. That is the operational content of the difference.
- Build the counterexample. It is more persuasive than the argument.
- On hardware the witness degrades toward its threshold, and the size at which it crosses is a more meaningful capability metric than qubit count.
- A witness proves existence, not amount or identity. Full characterization needs tomography, at exponential cost.
Questions
-
Build the impostor circuit and reproduce all four histograms. Then modify it so it produces
{'01', '10'}instead — a classical impostor for $|\Psi^+\rangle$. Does the same $X$-basis test separate it? What about the witness? (Careful: $|\Psi^+\rangle$ has $\langle ZZ\rangle = -1$.) -
Compute $W$ for all four Bell states. Which exceed the bound of 1? For those that do not, find a modified witness that works, and explain what determines the right choice of correlators.
-
Prove the bound $W \leq 1$ numerically: sample 10,000 random product states, compute $W$ for each, and report the maximum. Does it approach 1? Which product state achieves it?
-
The impostor uses mid-circuit measurement and classical feedforward. Construct a second impostor that uses neither — only unitary gates and a final measurement — that still reproduces the Z-basis histogram with no entanglement. (Hint: what does a mixture look like if you never look at one of the qubits?)
-
Run the witness on
FakeSherbrookefor 2-qubit Bell states on the best and worst usable qubit pairs. Report both $W$ values. Does the worst pair still prove entanglement? -
Extend the witness experiment to a 3-qubit GHZ state. What is the analogous witness, and what is its separable bound? Run it on hardware and find the qubit count at which the evidence gives out.
-
Hardest. The two-basis experiment separates the Bell state from this impostor. Construct an unentangled state that passes the two-basis test — that is, one with $\langle ZZ\rangle$ and $\langle XX\rangle$ both substantially positive — and then show that the witness still correctly rejects it. What does this exercise establish about the difference between an ad hoc comparison and a proven bound?