⚛️ Quantum Computing
📅 March 2026⏱ 13 min🟡 Intermediate

Quantum Computing Basics: Qubits, Superposition & Entanglement

Quantum computers are not faster classical computers — they are fundamentally different machines that exploit the weird rules of quantum mechanics to solve specific problems exponentially faster. Understanding them requires letting go of classical intuitions about bits and logic gates.

1. Classical Bits vs Qubits

A classical bit is a switch: it is either 0 or 1. No ambiguity. A qubit is a quantum two-level system such as an electron spin, a photon polarisation, or a superconducting Josephson junction. While un-measured, it exists in a quantum state described by:

|ψ⟩ = α|0⟩ + β|1⟩ where α, β ∈ ℂ and |α|² + |β|² = 1 |α|² = probability of measuring 0 |β|² = probability of measuring 1

α and β are complex amplitudes. This is not the same as saying "the qubit is probably 0 or probably 1" — the superposition is a genuine quantum state with interference effects. Upon measurement, the state collapses to either |0⟩ or |1⟩ irreversibly.

Classical bit

  • Definite value: 0 OR 1
  • Copying is trivial
  • No entanglement
  • Read without disturbing
  • N bits store one N-bit number

Qubit

  • Superposition: both 0 AND 1 (until measured)
  • Cannot be cloned (no-cloning theorem)
  • Can be entangled with others
  • Measurement collapses the state
  • N qubits simultaneously encode 2ᴺ complex amplitudes

2. Superposition & the Bloch Sphere

Any single-qubit state |ψ⟩ = α|0⟩ + β|1⟩ can be visualised as a point on the unit sphere (the Bloch sphere) using two angles θ and φ:

|ψ⟩ = cos(θ/2)|0⟩ + e^(iφ)·sin(θ/2)|1⟩ North pole (0,0,1): |0⟩ South pole (0,0,−1): |1⟩ Equator: equal superposition |+⟩ = (|0⟩ + |1⟩)/√2 (along +X) |−⟩ = (|0⟩ − |1⟩)/√2 (along −X)

Quantum gates are rotations of the Bloch sphere. The Hadamard gate H flips a |0⟩ to |+⟩ — an equal superposition of 0 and 1. It is the quantum "coin flip" that creates superposition from a definite state.

Decoherence: Real qubits are fragile. Any interaction with the environment (vibration, electromagnetic noise, stray photons) causes the quantum state to decohere into a classical mixture, destroying the superposition. Qubits must be isolated at millikelvin temperatures (15 mK — colder than outer space at 2.7 K) to achieve coherence times of microseconds to milliseconds.

3. Entanglement

Two qubits can be put into an entangled state that cannot be factored into individual qubit states. The four Bell states are maximally entangled:

|Φ⁺⟩ = (|00⟩ + |11⟩)/√2 |Φ⁻⟩ = (|00⟩ − |11⟩)/√2 |Ψ⁺⟩ = (|01⟩ + |10⟩)/√2 |Ψ⁻⟩ = (|01⟩ − |10⟩)/√2

In |Φ⁺⟩: if Alice measures qubit 1 and gets 0, qubit 2 is instantly 0. If she gets 1, qubit 2 is instantly 1 — regardless of how far apart the qubits are. Einstein called this "spooky action at a distance" and believed it indicated quantum mechanics was incomplete. Bell's theorem (1964) and Aspect's experiments (1982) confirmed: entanglement is real and cannot be explained by hidden local variables.

Entanglement is a computational resource: it creates correlations between qubits that allow algorithms to process 2ᴺ states simultaneously through quantum parallelism.

4. Quantum Gates & Circuits

Quantum gates are unitary matrices that rotate qubit states. They are reversible (unlike classical NAND gates). Common single-qubit gates:

The essential two-qubit gate is CNOT (controlled-NOT): flips the target qubit if and only if the control qubit is |1⟩. CNOT + Hadamard together can create entanglement:

Start: |00⟩ After H: (|0⟩+|1⟩)/√2 ⊗ |0⟩ = (|00⟩+|10⟩)/√2 After CNOT: = (|00⟩+|11⟩)/√2 = |Φ⁺⟩ ← entangled!

Any quantum algorithm — Shor's, Grover's, VQE — is ultimately a sequence of these gates arranged in a quantum circuit. Measurement at the output collapses the superposition and produces the answer (probabilistically; circuits are run thousands of times and results averaged).

5. Interference: Why It Computes

Superposition alone doesn't give a speedup — a superposition of all inputs would collapse to a random single answer upon measurement. The key is quantum interference: carefully crafting the algorithm so that wrong answers' amplitudes cancel (destructive interference) and correct answers' amplitudes reinforce (constructive interference).

This is exactly what Shor's algorithm does: it sets up a superposition of all 2ᴺ possible periods, uses the Quantum Fourier Transform (essentially quantum interference at scale) to amplify the correct period, then classical post-processing extracts the factors. The exponential speedup comes from computing all input/output pairs simultaneously then using interference to extract the answer.

Not magic parallelism: You can't just read out all 2ᴺ computed values — measurement collapses to one. The art of quantum algorithm design is engineering interference patterns so that the outcome you want is the one made exponentially more probable.

6. Key Quantum Algorithms

7. Hardware: How Qubits Are Built

Quantum advantage timeline: "Quantum supremacy" was demonstrated by Google in 2019 on a contrived sampling problem. Practical, commercially useful quantum advantage for real-world problems (drug discovery, logistics, cryptography) is estimated to require millions of physical qubits and is likely 10–20 years away.