Quantum Computing 101
Entanglement
Entangled qubits share one joint state that cannot be split into a state for each qubit.
In this lesson you will learn to
- Distinguish product states from entangled states.
- Build a Bell pair with H and CX and follow its state gate by gate.
- Predict the correlations in Bell-pair measurements.
- Read multi-qubit states in Qiskit's qubit order.
Product States and Entangled States
Two qubits have four basis states, |00⟩, |01⟩, |10⟩ and |11⟩, so a two-qubit state has four amplitudes.
Sometimes those four amplitudes come from two separate qubits. The state |+⟩ ⊗ |0⟩ = (|00⟩ + |10⟩)/√2 is a product state: each qubit has its own state, and measuring one tells you nothing about the other.
Other states cannot be split up like this. They are entangled: only the pair as a whole has a state.
Worked example: the Bell state cannot be factored
Try to write (|00⟩ + |11⟩)/√2 as a product of two one-qubit states and watch it fail.
Building a Bell Pair
The Bell state |Φ+⟩ = (|00⟩ + |11⟩)/√2 takes just two gates: H on the first qubit, then a CX with the first qubit as the control.
Worked example: build |Φ+⟩ gate by gate
Follow the state after each of the two gates (qubit 0 written first).
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(2)
qc.h(0)
print(Statevector.from_instruction(qc).probabilities_dict(decimals=3))
# {'00': 0.5, '01': 0.5} <- qubit 0 is the rightmost bit
qc.cx(0, 1)
print(Statevector.from_instruction(qc).probabilities_dict(decimals=3))
# {'00': 0.5, '11': 0.5}Correlations
Measure one half of a Bell pair and look only at that side: it is a perfect coin flip, 0 or 1 with equal odds.
Compare both sides and a pattern appears: the results always agree. Two separate random bits would disagree half the time; the Bell pair never does.
Worked example: compare the possible results
›Check yourself: Two qubits are in (|01⟩ + |10⟩)/√2. What do their measurement results have in common?
They always disagree: one reads 0 and the other reads 1. Each side alone is still 50/50. This is another Bell state, |Ψ+⟩.
More Qubits, More Entanglement
The same recipe scales up. Putting one qubit in superposition and chaining CX gates from it creates the GHZ state (|000⟩ + |111⟩)/√2, in which all the qubits always agree.
Not all entanglement looks like GHZ. The W state (|001⟩ + |010⟩ + |100⟩)/√3 shares a single 1 among three qubits, and it stays partly entangled even if one qubit is lost.
Worked example: a three-qubit GHZ state
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(3)
qc.h(0)
qc.cx(0, 1)
qc.cx(1, 2)
print(Statevector.from_instruction(qc).probabilities_dict(decimals=3))
# {'000': 0.5, '111': 0.5}Key Takeaways
- A product state gives each qubit its own state; an entangled state cannot be split that way.
- H then CX turns |00⟩ into the Bell state (|00⟩ + |11⟩)/√2.
- Each half of a Bell pair looks random alone, yet the two results always agree.
- Qiskit writes qubit 0 as the rightmost bit of every bitstring.
What To Practice
Practice preparing entangled states and using them as a resource.
- Bell State QuartetEasy ★Prepare all four Bell states and match each statevector.
- Phased GHZEasy ★Build a GHZ state that carries a chosen phase between its two branches.
- Logarithmic-Depth GHZMedium ★★Grow a GHZ state like a binary tree so the circuit stays shallow.
- W State for Any nMedium ★★Share a single excitation evenly over any number of qubits.
- Superdense CodingEasy ★Send two classical bits by touching only one half of a Bell pair.
- Quantum TeleportationMedium ★★Use a Bell pair as the shared resource in the teleportation protocol.