Bell state |Φ⁺⟩
Two qubits, maximally entangled. The 'hello world' of quantum — every SDK should compile a 4-line version.
Tests the basics: Hadamard, CNOT, measurement, and the standard import path.
Qiskit
python
from qiskit import QuantumCircuit
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1], [0, 1]) Cirq
python
import cirq
q0, q1 = cirq.LineQubit.range(2)
circuit = cirq.Circuit([
cirq.H(q0),
cirq.CNOT(q0, q1),
cirq.measure(q0, q1, key="m"),
]) PennyLane
python
import pennylane as qml
dev = qml.device("default.qubit", wires=2, shots=1024)
@qml.qnode(dev)
def bell():
qml.Hadamard(wires=0)
qml.CNOT(wires=[0, 1])
return qml.sample() Amazon Braket SDK
python
from braket.circuits import Circuit
bell = Circuit().h(0).cnot(0, 1)
# Measurement is implicit — sample by running on a device:
# device.run(bell, shots=1024) OpenQASM 3
openqasm
OPENQASM 3.0;
include "stdgates.inc";
qubit[2] q;
bit[2] c;
h q[0];
cx q[0], q[1];
c = measure q;