Qubits, the Hadamard gate, superposition, tensor products, and quantum interference from first principles.
Classical computers store information in bits that are always exactly 0 or 1. Quantum computers exploit the principles of quantum mechanics to do something fundamentally different: they operate on qubits, which can exist in a superposition of both states simultaneously. The Hadamard gate is the simplest gate that creates this superposition, and understanding it from first principles is the entry point to every quantum algorithm that follows.
1 · The Qubit
A qubit is the fundamental unit of quantum information. Unlike a classical bit, a qubit can exist in a superposition of |0⟩ and |1⟩ simultaneously. We write its general state using Dirac (bra-ket) notation:
Here α and β are complex numbers called probability amplitudes. They must satisfy the normalisation condition:
The two computational basis states are represented as column vectors:
0
1
When we measure the qubit in state |ψ⟩ = α|0⟩ + β|1⟩, we get |0⟩ with probability |α|² and |1⟩ with probability |β|². The act of measurement destroys the superposition and collapses the qubit to a definite classical state.
2 · The Hadamard Gate
The Hadamard gate H is a 2×2 unitary matrix that maps each computational basis state to an equal superposition:
+1 −1
Applying H to each basis state:
| Input | H |input⟩ | Short name |
|---|---|---|
| |0⟩ | (1/√2)( |0⟩ + |1⟩ ) | |+⟩ |
| |1⟩ | (1/√2)( |0⟩ − |1⟩ ) | |−⟩ |
Both outputs have equal amplitudes of 1/√2, giving a 50% measurement probability for each outcome. The sign difference between |+⟩ and |−⟩ is what drives interference later.
3 · H² = I: Quantum Interference
Applying H twice to |0⟩ returns the qubit to |0⟩. The algebra shows exactly why the |1⟩ amplitudes cancel through destructive interference:
= H( (1/√2)(|0⟩ + |1⟩) )
= (1/√2)( H|0⟩ + H|1⟩ )
= (1/√2)( (1/√2)(|0⟩+|1⟩) + (1/√2)(|0⟩−|1⟩) )
= (1/2)( |0⟩ + |1⟩ + |0⟩ − |1⟩ )
= (1/2)( 2|0⟩ )
= |0⟩ ✓
4 · Single-Qubit Circuit: H–H–Measure
A single qubit routed through two Hadamard gates and then measured always returns 0 with 100% probability:
| Step | State | Notes |
|---|---|---|
| 1. Initialise | |ψ₀⟩ = |0⟩ | Ground state |
| 2. First H | |ψ₁⟩ = (1/√2)(|0⟩+|1⟩) | Superposition: 50/50 |
| 3. Second H | |ψ₂⟩ = |0⟩ | Interference collapses back |
| 4. Measure | Result = 0 | 100% probability |
5 · Tensor Products and Multi-Qubit States
Multi-qubit systems are described using the tensor product (⊗). For two qubits, the four computational basis states are:
| Ket | Tensor form | Column vector |
|---|---|---|
| |00⟩ | |0⟩ ⊗ |0⟩ | [1, 0, 0, 0]ᵀ |
| |01⟩ | |0⟩ ⊗ |1⟩ | [0, 1, 0, 0]ᵀ |
| |10⟩ | |1⟩ ⊗ |0⟩ | [0, 0, 1, 0]ᵀ |
| |11⟩ | |1⟩ ⊗ |1⟩ | [0, 0, 0, 1]ᵀ |
The tensor product of two vectors is computed by multiplying each element of the first vector by the entire second vector and stacking the results. For |0⟩ ⊗ |1⟩:
= [1, 0]ᵀ ⊗ [0, 1]ᵀ
= [ 1×[0,1]ᵀ ] = [0, 1, 0, 0]ᵀ = |01⟩
[ 0×[0,1]ᵀ ]
6 · Two-Qubit Superposition: H⊗H on |00⟩
Applying independent Hadamard gates to both qubits starting from |00⟩:
= (H|0⟩) ⊗ (H|0⟩)
= (1/√2)(|0⟩+|1⟩) ⊗ (1/√2)(|0⟩+|1⟩)
= (1/2)( |00⟩ + |01⟩ + |10⟩ + |11⟩ )
7 · Interference in a Two-Qubit H–H Circuit
Applying H⊗H twice to |00⟩ returns it to |00⟩. The interference analysis on each basis state shows the mechanism:
| Input to 2nd H⊗H | After (H⊗H) |
|---|---|
| |00⟩ | (1/2)( |00⟩ + |01⟩ + |10⟩ + |11⟩ ) |
| |01⟩ | (1/2)( |00⟩ − |01⟩ + |10⟩ − |11⟩ ) |
| |10⟩ | (1/2)( |00⟩ + |01⟩ − |10⟩ − |11⟩ ) |
| |11⟩ | (1/2)( |00⟩ − |01⟩ − |10⟩ + |11⟩ ) |
The initial superposition has equal weight 1/2 on each of the four states. Summing contributions to each output:
| Output state | Amplitude sum (× 1/4) | Result |
|---|---|---|
| |00⟩ | +1 +1 +1 +1 | 4/4 = 1 ✓ constructive |
| |01⟩ | +1 −1 +1 −1 | 0 destructive |
| |10⟩ | +1 +1 −1 −1 | 0 destructive |
| |11⟩ | +1 −1 −1 +1 | 0 destructive |
8 · The H⊗H Matrix and Why It Matters
The combined H⊗H operator is a 4×4 Walsh-Hadamard matrix (scaled by 1/2). Its sign pattern is exactly the two-qubit case of the popcount rule derived in the Walsh-Hadamard post:
+1 −1 +1 −1
+1 +1 −1 −1
+1 −1 −1 +1
Every quantum algorithm that achieves a speedup over classical computation does so through the same three-phase structure:
| Phase | Operation | Purpose |
|---|---|---|
| 1. Open | Hadamard on all qubits | Create uniform superposition over all 2ⁿ states |
| 2. Operate | Oracle / phase manipulation | Mark or bias the amplitude of the target answer |
| 3. Close | Hadamard again (+ measurement) | Interference concentrates probability on the answer |
Malcolm Low is an Associate Professor at the Singapore Institute of Technology, writing on quantum computing, programming, and applied computing from Singapore.
Website: malcolmlow.com · Singapore
Quantum Series 2026 · Built with Qiskit 1.x
✦ This article was generated with the assistance of Claude by Anthropic ✦
Share this:
- Share on X (Opens in new window) X
- Share on Facebook (Opens in new window) Facebook
- Print (Opens in new window) Print
- Email a link to a friend (Opens in new window) Email
- Share on LinkedIn (Opens in new window) LinkedIn
- Share on Reddit (Opens in new window) Reddit
- Share on Tumblr (Opens in new window) Tumblr
- Share on Threads (Opens in new window) Threads
- Share on Pinterest (Opens in new window) Pinterest
- Share on Telegram (Opens in new window) Telegram
- Share on WhatsApp (Opens in new window) WhatsApp
- Share on Bluesky (Opens in new window) Bluesky






You must be logged in to post a comment.