GHZ State
What You'll Learn: How to extend quantum entanglement beyond two qubits, creating the three-qubit "all-or-nothing" correlation behind the GHZ argument against local hidden-variable theories.
Level: Beginner | Time: 15 minutes | Qubits: 3 | Framework: Qiskit
Prerequisites: Bell State
The Idea
In a Bell state, two qubits always agree. A GHZ state takes this further: three qubits always agree — they're either all 0 or all 1, with nothing in between.
Why does this matter? In 1989, Greenberger, Horne, and Zeilinger showed that this state rules out local hidden-variable theories without an inequality: "Bell's theorem without inequalities." In the ideal case, measuring the three qubits in four settings (XXX, XYY, YXY and YYX) gives perfectly predictable products of outcomes that no local assignment of values can reproduce. The Z-basis histogram this circuit produces is not that test: a classical source that emits 000 or 111 at random gives the same bars. The difference only shows up in the X and Y measurements.
But there's a catch: GHZ entanglement is fragile. If you lose even one of the three qubits (it drifts away or decoheres), the remaining two are left in a completely unentangled state. This makes GHZ states both powerful for tests of quantum mechanics and challenging for real-world applications.
How It Works
The Circuit
CODE┌───┐ q_0: ┤ H ├──■────■── └───┘┌─┴─┐ │ q_1: ─────┤ X ├──┼── └───┘┌─┴─┐ q_2: ──────────┤ X ├ └───┘
Step 1: Superposition
PYTHONqc.h(0) # Put qubit 0 into superposition: (|0⟩ + |1⟩) / √2
Just like the Bell state, we start by putting qubit 0 into an equal superposition. The other two qubits remain in |0⟩.
State after Step 1: (|0⟩ + |1⟩)/√2 ⊗ |0⟩ ⊗ |0⟩ = (|000⟩ + |100⟩)/√2
Step 2: First Entanglement
PYTHONqc.cx(0, 1) # If qubit 0 is |1⟩, flip qubit 1
The first CNOT correlates qubit 1 with qubit 0 — identical to the Bell state step.
State after Step 2: (|000⟩ + |110⟩)/√2
Step 3: Second Entanglement
PYTHONqc.cx(0, 2) # If qubit 0 is |1⟩, flip qubit 2
The second CNOT brings qubit 2 into the entangled group. Now all three qubits are correlated.
State after Step 3: (|000⟩ + |111⟩)/√2 = |GHZ⟩
The Pattern
To create an N-qubit GHZ state, you always use the same recipe:
- Hadamard on qubit 0
- CNOT from qubit 0 to each of qubits 1, 2, ..., N-1
This means the circuit depth grows linearly with N. On hardware with only nearest-neighbor connectivity, you'd need swap gates — but on simulators, any qubit can control any other.
The Math
State Evolution
Starting from |000⟩:
-
Initial: |ψ₀⟩ = |000⟩
-
After H: |ψ₁⟩ = (H ⊗ I ⊗ I)|000⟩ = (|000⟩ + |100⟩)/√2
-
After CX(0,1): |ψ₂⟩ = (|000⟩ + |110⟩)/√2
-
After CX(0,2): |ψ₃⟩ = (|000⟩ + |111⟩)/√2 = |GHZ₃⟩
General N-Qubit Form
|GHZ_N⟩ = (|0⟩^⊗N + |1⟩^⊗N) / √2
For N = 2 this is exactly the Bell state |Φ+⟩.
Key Property: Monogamy of Entanglement
The GHZ state has maximum multipartite entanglement but zero bipartite entanglement. If you trace out any one qubit, the remaining qubits are in a mixed state with no entanglement:
ρ₁₂ = Tr₃(|GHZ⟩⟨GHZ|) = (|00⟩⟨00| + |11⟩⟨11|) / 2
This is a classical mixture — not a quantum superposition. The entanglement truly lives in the three-body correlation, not in any pair.
GHZ vs. W State
There are different "kinds" of three-qubit entanglement:
| Property | GHZ: (|000⟩+|111⟩)/√2 | W: (|001⟩+|010⟩+|100⟩)/√3 |
|---|---|---|
| Lose 1 qubit | All entanglement lost | Remaining 2 still entangled |
| Measurement correlations | All-or-nothing | Exactly one qubit is |1⟩ |
| Bell violation | Maximum (deterministic proof) | Partial |
| Use case | Quantum secret sharing, metrology | Robust quantum networks |
These represent fundamentally different entanglement classes — you cannot convert a GHZ state into a W state using only local operations.
Expected Output
When you measure all 3 qubits 1024 times:
| Outcome | Expected Count | Probability |
|---|---|---|
| |000⟩ | ~512 | ~50% |
| |111⟩ | ~512 | ~50% |
| All others | 0 | 0% |
All three qubits always agree — that's the signature of GHZ entanglement.
On real hardware: Decoherence breaks GHZ correlations faster than Bell state correlations. You'll see "leakage" into states like |001⟩, |010⟩, |100⟩, etc. The fraction of 000 and 111 outcomes is only an upper bound on the GHZ-state fidelity: a classical 50/50 mix of 000 and 111 scores 100% here but has fidelity 0.5 with the GHZ state. Measuring the coherence between 000 and 111 needs measurements in rotated bases.
Running the Circuit
PYTHONfrom circuit import run_circuit, verify_ghz_state # Basic execution — 3-qubit GHZ counts = run_circuit(shots=1024) print(counts) # {'000': ~512, '111': ~512} # Scale to 5 qubits counts = run_circuit(shots=1024, n_qubits=5) print(counts) # {'00000': ~512, '11111': ~512} # Verification — checks all-or-nothing correlations result = verify_ghz_state(n_qubits=3, shots=4096, tolerance=0.05) print(result["passed"]) # True for check in result["checks"]: print(f" {check['name']}: {check['detail']}")
Try It Yourself
-
Scale up: Create a 5-qubit, then 10-qubit GHZ state. Are the probabilities still 50/50? (On a simulator, yes — on real hardware, fidelity drops with N.)
-
Measure in X basis: Add
qc.h(i)before measurement on all qubits. What outcomes do you see? (Hint: it's related to GHZ's parity properties.) -
Simulate decoherence: Use Qiskit's noise model to add single-qubit depolarizing noise. How quickly does the |000⟩+|111⟩ fraction drop?
-
Build a W state: Create (|001⟩ + |010⟩ + |100⟩)/√3 instead. Compare what happens when you trace out one qubit.
What's Next
- Quantum Teleportation — Use entanglement to transfer a quantum state
- Superdense Coding — Send 2 classical bits using 1 entangled qubit
- Bell State — Review the 2-qubit foundation
Applications
| Application | How GHZ States Are Used |
|---|---|
| Quantum Secret Sharing | Split a secret among N parties such that all must cooperate to recover it |
| Quantum Metrology | Heisenberg-limited phase estimation (√N improvement over classical) |
| Quantum Error Correction | Repetition codes encode a logical qubit in GHZ-like states |
| Bell Tests | Mermin's inequality gives exponentially increasing violation with N |
| Quantum Networks | Multipartite entanglement distribution for quantum internet protocols |
References
- Greenberger, D.M., Horne, M.A., Zeilinger, A. (1989). "Going Beyond Bell's Theorem." In: Bell's Theorem, Quantum Theory and Conceptions of the Universe, pp. 69-72. arXiv: 0712.0921
- Greenberger, D.M., Horne, M.A., Shimony, A., Zeilinger, A. (1990). "Bell's theorem without inequalities." American Journal of Physics 58(12), 1131-1143.
- Mermin, N.D. (1990). "Extreme quantum entanglement in a superposition of macroscopically distinct states." Physical Review Letters 65(15), 1838.
- Nielsen, M.A. & Chuang, I.L. Quantum Computation and Quantum Information, Section 1.3.6.