GHZ state: three-qubit entanglement

Chain CNOTs after a Hadamard to entangle three qubits so they all agree.

Beginner · 3 qubits · 3 gates · 2 two-qubit · depth 3 · reviewed November 2026

Open in the Circuit Builder

What is happening

The GHZ state (|000⟩ + |111⟩)/√2 extends the Bell idea to three qubits. Measuring any one qubit fixes the other two. GHZ states are used to test quantum hardware, because they are fragile: noise on any qubit shows up as outcomes other than 000 and 111.

Step by step

  1. 1. H on q0

    Creates superposition on the first qubit.

  2. 2. CNOT q0 to q1

    Entangles the first two qubits into a Bell pair.

  3. 3. CNOT q1 to q2

    Extends the correlation to the third qubit, giving (|000⟩ + |111⟩)/√2.

Expected result

Probabilities: 50% for |000⟩ and 50% for |111⟩.

Qubit 0 is the leftmost bit. In Qiskit, bitstrings are printed in the reverse order.

Qiskit code

from qiskit import QuantumCircuit
from math import pi

qc = QuantumCircuit(3, 3)
qc.h(0)
qc.barrier()
qc.cx(0, 1)
qc.barrier()
qc.cx(1, 2)
qc.barrier()
qc.measure(0, 0)
qc.measure(1, 1)
qc.measure(2, 2)

# Qiskit prints bit strings with qubit 0 on the RIGHT; this site writes qubit 0 on the LEFT.

Try this

  • Increase the noise to 3% and measure how much probability leaks to other outcomes.
  • Extend to five qubits with more CNOTs.
  • Change the second CNOT to start from q0 and compare the result.

Gates used

Related reading

Questions

Why are GHZ states used as hardware benchmarks?

Because creating them needs many two-qubit gates in sequence, so the fraction of correct outcomes drops quickly as noise increases.