Quantum Circuit Lab / framework fundamentals
Lesson 08 · framework fundamentals

Hello World in Qiskit: Build a Bell State

Build the canonical Bell state in Qiskit, inspect the circuit, and understand what the counts mean when you measure it.

Intermediate12–15 min readsoftware engineering · quantum computing

Build the circuit

The circuit API is small enough to keep the quantum operations visible.

from qiskit import QuantumCircuit

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

H puts qubit 0 into a superposition. CNOT uses it as the control and qubit 1 as the target. Measurement copies the final basis result into classical memory.

Run with shots

from qiskit_aer import AerSimulator

backend = AerSimulator()
result = backend.run(qc, shots=1024).result()
print(result.get_counts())
# Typical: {'00': 506, '11': 518}

In the ideal case, 00 and 11 appear while 01 and 10 do not. The exact counts vary because shots sample a distribution. Learn Qiskit’s bit-order convention before interpreting larger registers.

Experiment discipline: save the circuit, backend, shots, and software versions with every result.

Next see how PennyLane treats a circuit as a differentiable node, or compare this with the browser lab.