Introduction
In classical computing, bits are independent. In Quantum Computing, entangled qubits share a joint state. This means that measuring one qubit collapses both – if you get ‘0’ on the first, the second is guaranteed ‘0’ (100% correlation), defying classical intuition.
Complexity Level For Quantum Entanglement
We will be adding just one more qubit and a CNOT (Controlled NOT) Gate compared to the superposition example in the previous post — still tiny (2 qubits), so simulation is fast and exact.
This example builds directly on our previous working superposition code. It creates two entangled qubits (Q0 and Q1) as shown below.
- Put Q0 in superposition (Hadamard).
- Entangle them with a CNOT gate (Q0 controls Q1) – the CNOT Gate is pictured above.
- Measure both.
- Run each simulation 1024 times and plot the outcome.
The beauty of this Python example is that it has been run locally on my desktop and I have tested the same with the IBM Quantum Computers in their Cloud!
Python Program: The program name is “QE” and can be accessed as a PDF file by clicking the link — QE
Expected Results
(1) Plot: A bar chart with ’00’ and ’11’ roughly equal (e.g., 511 for ’00’ and 513 for ’11’ in the case of just one simulation, consisting of 1024 runs, as shown below — running the same simulation program several times will result in 512 for each of ’00’ and ’11’).
(2) Console:
- If there is any real hardware issue: “channel” can only be “ibm_cloud”, or “ibm_quantum_platform”, would be displayed.
- Falling back to – “simulator” – will be displayed if “ibm_cloud” or “ibm_quantum_platform” are not in use.
- If everything goes well, the measurement outcomes will be displayed: {’00’: 511, ’11’: 513} – as shown in the above plot for our simulation.
- A message “Perfect correlation: Only 00 and 11” — “quantum entanglement in action!” will be shown if everything has worked well.
-
Quantum entanglement is a phenomenon where two or more particles become linked, such that the state of one particle instantly influences the state of the other, regardless of the distance separating them.
-
This concept challenges classical Physics and is a fundamental aspect of Quantum Mechanics, often referred to as “spooky action at a distance“.
Beyond Simulation
-
Classical simulations are deterministic.
-
Real qubits interact with the Quantum World (photons, microwaves, etc.), showing true probabilistic collapse.
-
Errors are a feature — teaching us about decoherence and this is the key to building scalable Quantum Computers.


