Skip to content

Simulator starter · reviewed 2026-10-25

GHZ State (3 qubits)

Extend a Bell pair to a third qubit and watch all three measured bits agree, shot after shot.

  • Qiskit
  • OpenQASM 3

Recorded simulator example · open starter templates to create your own run. Open starter templates →

A modular teaching board with two glass paths, removable gates and two output tiles.
A small circuit. The whole experiment.
Qubits
3
Operations
6
Shots
4,096
  1. Prepare

    Create superposition on q0 and extend the correlation to q1 and q2 with two CNOT gates.

    visual circuit + operation list
  2. Generate

    Keep Qiskit and OpenQASM 3 representations inspectable.

    generated source
  3. Simulate

    Execute 4,096 seeded shots on local Aer.

    complete counts + trace
  4. Review

    Explain the three-way correlation and the proof boundary.

    evidence manifest

Workflow question

What this sample is testing.

Prepare the three-qubit GHZ state (|000> + |111>)/sqrt(2) with one Hadamard and two controlled-X gates, measure every qubit, and preserve the source and complete counts so another person can check that only the all-zeros and all-ones outcomes appear.

Route rationale

Local Qiskit Aer simulator, no provider token required

Complete 4,096-shot 000/111 distribution in a reviewer-safe result packet

Method

Start all three qubits in |0>. Apply a Hadamard gate to q0, then a controlled-X from q0 to q1 and a second controlled-X from q1 to q2. Each controlled-X extends the correlation to the next qubit, so all three share one outcome. Measure the three qubits into three classical bits.

Run the generated Qiskit circuit on the local Qiskit Aer simulator for 4,096 shots with simulator and transpiler seed 2048. Store the circuit, source, complete counts, route note, and export manifest together.

How to read the result

The stored simulator snapshot contains only 000 and 111, with 2,024 and 2,072 observations. Those are the two perfectly correlated outcomes expected from an ideal GHZ circuit; no mixed bitstring such as 010 appears.

The counts equal the Bell-state sample because both circuits give a 50/50 split between two outcomes and both runs use seed 2048, so the seeded sampler draws the same split. That is a property of seeded sampling, not of the circuit. A different seed would change the split around the same 50 percent.

Measured distribution

Complete seeded count table

4,096 shots

1112,07250.59%
0002,02449.41%

Complete ideal-simulator distribution. Engine Qiskit Aer 0.17.0; simulator and transpiler seed 2048. This static public fixture is not a live provider run.

Proof boundary

  1. Computational-basis counts alone show correlation between the three bits but do not by themselves establish three-party entanglement. A stronger test would add measurements in other bases or a witness such as the Mermin inequality.
  2. This is an ideal local simulation. On hardware, gate noise, readout error, and the chain of controlled-X gates would put weight on mixed bitstrings.
  3. This is a seeded local simulation, not a live provider job or hardware benchmark.

Generated representations

Inspect the source behind the counts.

The public code is a review fixture. Provider credentials, workspace members, billing context, and private notes stay excluded.

Qiskit circuit

Python
from qiskit import QuantumCircuit

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

OpenQASM circuit

OpenQASM 3
OPENQASM 3;
include "stdgates.inc";
bit[3] c;
qubit[3] q;
h q[0];
cx q[0], q[1];
cx q[1], q[2];
c[0] = measure q[0];
c[1] = measure q[1];
c[2] = measure q[2];

Evidence manifest

JSON
{
  "workflowId": "QF-SAMPLE-GHZ-3",
  "runner": "qiskit-aer",
  "artifacts": [
    "generated-qiskit.py",
    "generated-openqasm.qasm",
    "counts.json",
    "counts.csv",
    "trace.json"
  ],
  "privateFieldsExcluded": [
    "providerCredentialId",
    "userEmail",
    "billingState",
    "adminNotes"
  ]
}

What the reviewer receives

  • generated-qiskit.py
  • generated-openqasm.qasm
  • counts.json
  • counts.csv
  • trace.json

Explicitly excluded

  • providerCredentialId
  • userEmail
  • billingState
  • adminNotes

Questions this record answers

Workflow FAQ

What result should a GHZ circuit produce?

In an ideal computational-basis simulation, only 000 and 111 should appear, with approximately half of the shots in each state.

Why are the counts the same as the Bell-state sample?

Both circuits split the shots between two outcomes with equal probability, and both runs use simulator seed 2048, so the seeded sampler draws the same split (2,024 and 2,072). A different seed would change the split but not the two outcomes.

Do GHZ counts prove three-qubit entanglement?

Not alone. They show perfect correlation in one basis. Measurements in other bases or an inequality test are needed for a stronger entanglement claim.