Two qubits: CNOT and entanglement
Lesson 8 of 23 in the course “Quantum”. Free, with animations and a quiz.
Two qubits, four cells
One qubit has two options: 0 and 1. Two qubits have four: 00, 01, 10 and 11, and three have eight. Each combination has its own amplitude. That’s the doubling from the last lesson, now visible. A gate on one qubit changes the amplitudes in every cell that qubit is part of. That’s where the feeling that a quantum computer “computes everything at once” comes from, but as we know, you can only read one cell.
CNOT: the “if-then” gate
For qubits to affect each other, you need a gate acting on two at once. The main one is CNOT, “controlled NOT.” The first qubit is the control, the second is the target. If the control is 0, nothing happens. If it’s 1, the target flips, as if hit by an X gate. In a table it looks like ordinary logic. The magic starts when the control qubit itself is in superposition: then the target is flipped and not flipped at the same time.
The entanglement recipe: H + CNOT
Take two qubits at 0. Put an H on the first, it becomes 50/50. Then a CNOT with the first controlling the second. Result: “both 0” and “both 1” at once. Measure and you get 00 or 11 with equal chances, but never 01 or 10. This is a Bell pair, the entanglement from level one, except now you know how to build it. Three lines of code, and it runs on a real chip.
Try it on real hardware
In May 2016 IBM connected a five-qubit quantum processor to the internet, and anyone could run circuits on it. Today it’s IBM Quantum Platform: the free plan gives 10 minutes on a real chip every 28 days. That sounds small, but a circuit with a thousand repeats takes seconds. You can build the circuit with a mouse in an editor or write it in Python with the Qiskit library. A Bell pair is the classic first exercise.
Why the chip gives “extra” answers
Run a Bell pair on a real chip and you’ll see that besides 00 and 11, you sometimes get 01 and 10. That’s not a bug in your circuit, it’s noise. The qubits get nudged by heat, neighbouring qubits and imprecise pulses, and measurement sometimes misreads. Each error is small, but in a long circuit they pile up. Fighting noise is the industry’s main job, and a whole level of this course is about it.
Entangling 120 qubits
The recipe scales: one H, then a chain of CNOTs from qubit to qubit, and they all end up in the “all zeros or all ones” state. It’s called a GHZ state, after three physicists: Greenberger, Horne and Zeilinger. It’s a good stress test: the more qubits, the more noise. In 2025 an IBM team built such a state from 120 qubits with a fidelity of 0.56. That’s above the 0.5 threshold, which means all of them really are entangled.
Check yourself
- What does CNOT give if the input is control 1 and target 0?
Correct answer: 11. The control is 1, so the target flips: 0 becomes 1. The control itself doesn’t change. Result: 11. - The first qubit of a Bell pair showed 1. What will the second show?
Correct answer: Also 1. H + CNOT gives only 00 or 11. If the first is 1, the second is 1 too. - On a real chip a Bell pair sometimes gives 01. What does it mean?
Correct answer: It’s hardware noise; that’s normal until there’s error correction. A few percent of “extra” answers is typical of today’s chips. It’s noise, not a broken circuit.