04/09/2026
Entanglement: Linking Qubits With CNOT Gates
After the layer of Hadamard gates, our 5-qubit QRNG circuit applies three CNOT (controlled-NOT) gates: q0 controls q1, q2 controls q3, and q1 controls q4.
This is the entanglement layer, and it's where the circuit becomes genuinely quantum in a way that goes beyond what five independent coin flips could give you.
A CNOT gate works on two qubits â a control and a target. If the control qubit is in state |1âŠ, the target qubit is flipped; if the control is |0âŠ, the target is left alone.
That sounds like ordinary classical logic (it's the same truth table as an XOR), but because our control qubits are in superposition after the Hadamard layer â not simply 0 or 1, but both at once â the CNOT gate doesn't just flip a bit. It creates entanglement: a correlation between qubits that has no classical equivalent.
Look at the first pair: q0 and q1. Before the CNOT, both are in independent 50/50 superpositions. After CNOT(q0âq1), the two qubits become entangled such that when they are eventually measured, their outcomes will always agree â both 0 or both 1 â even though, individually, each still has a 50% chance of being either value.
Neither outcome is decided until measurement, but the two are now linked. The same thing happens between q2 and q3.
Then the circuit does something more interesting: it applies CNOT(q1âq4). Since q1 is already entangled with q0, this gate pulls q4 into that same correlated group.
The result is a three-qubit entangled cluster â q0, q1, and q4 â that will always agree with each other on measurement, structurally similar to what's known in quantum information theory as a GHZ-like state. Meanwhile, q2 and q3 remain a separate, independent entangled pair.
Why build this structure into a random number generator at all, rather than just using five independent H-gate-and-measure qubits? A few reasons.
First, entanglement is a genuinely quantum resource â building circuits that exercise it, even in a randomness-generation context, is valuable for testing and characterizing how well a quantum processor preserves these correlations, which matters far beyond QRNG. Second, structured entanglement patterns like this are the same primitive building blocks used in quantum error correction, quantum key distribution protocols, and more advanced sampling circuits â so a QRNG circuit like this doubles as a compact testbed for verifying that entangling operations behave as expected before they're used in larger algorithms.
In short: the Hadamard layer gives us uncertainty, and the CNOT layer gives that uncertainty structure â linking specific qubits together into correlated groups rather than leaving all five as isolated, unconnected coin flips.
Next up: what actually happens at the MEA (measurement) layer, and how five entangled qubits collapse into the random bits we actually use.