Practical guides to AI, computing, modelling, simulation, optimization and quantum computing, featuring hands-on tutorials, experiments and research.

Introduction to Quantum Computing: Qubits, Hadamard Gates, and Superposition

Part of the Quantum Computing: A Complete Learning Path series.
QUANTUM SERIES 2026
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:

|ψ⟩ = α|0⟩ + β|1⟩

Here α and β are complex numbers called probability amplitudes. They must satisfy the normalisation condition:

|α|² + |β|² = 1

The two computational basis states are represented as column vectors:

|0⟩ = 1
0
|1⟩ = 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.

Key distinction: The superposition is not just ignorance about a hidden value. The qubit genuinely occupies both states until measured, and this physical reality is what quantum algorithms exploit.

2  ·  The Hadamard Gate

The Hadamard gate H is a 2×2 unitary matrix that maps each computational basis state to an equal superposition:

H  =  (1/√2)    +1   +1 
 +1   −1 

Applying H to each basis state:

InputH |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.

Unitarity check: H†H = I. Since H is real and symmetric, H† = H, so H² = I. The Hadamard gate is its own inverse.

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(H|0⟩)
  = 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⟩ ✓
The +|1⟩ and −|1⟩ terms cancel completely (destructive interference) while the |0⟩ terms add (constructive interference). This is the fundamental mechanism behind quantum algorithms: arranging amplitudes so wrong answers cancel and the correct answer survives.

4  ·  Single-Qubit Circuit: H–H–Measure

A single qubit routed through two Hadamard gates and then measured always returns 0 with 100% probability:

q_0: H H M
StepStateNotes
1. Initialise|ψ₀⟩ = |0⟩Ground state
2. First H|ψ₁⟩ = (1/√2)(|0⟩+|1⟩)Superposition: 50/50
3. Second H|ψ₂⟩ = |0⟩Interference collapses back
4. MeasureResult = 0100% probability
This is a concrete demonstration that superposition is not just probabilistic noise. The deterministic outcome of 0 is only possible because the two Hadamard gates interact through interference, a purely quantum effect with no classical analogue.

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:

KetTensor formColumn 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⟩:

Tensor product calculation showing ket zero tensor ket one equals the column vector zero, one, zero, zero
Dimension growth: n qubits span a 2ⁿ-dimensional Hilbert space. A 3-qubit system already has 8 basis states; a 50-qubit system has 2⁵⁰ ≈ 10¹⁵, impossible to store classically.

6  ·  Two-Qubit Superposition: H⊗H on |00⟩

Applying independent Hadamard gates to both qubits starting from |00⟩:

q_0: H
q_1: H
(H⊗H)|00⟩
  = (H|0⟩) ⊗ (H|0⟩)
  = (1/√2)(|0⟩+|1⟩) ⊗ (1/√2)(|0⟩+|1⟩)
  = (1/2)( |00⟩ + |01⟩ + |10⟩ + |11⟩ )
All four two-qubit basis states appear with equal amplitude 1/2. Each has measurement probability (1/2)² = 25%. This is the two-qubit analogue of the uniform superposition that opens algorithms like Grover’s.

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⊗HAfter (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 stateAmplitude sum (× 1/4)Result
|00⟩+1 +1 +1 +14/4 = 1 ✓ constructive
|01⟩+1 −1 +1 −10 destructive
|10⟩+1 +1 −1 −10 destructive
|11⟩+1 −1 −1 +10 destructive
Only |00⟩ survives. This is the same interference structure that the Grover diffusion operator exploits at scale: constructive interference on the target state, destructive on all others.

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:

H⊗H  =  (1/2)    +1   +1   +1   +1 
 +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:

PhaseOperationPurpose
1. OpenHadamard on all qubitsCreate uniform superposition over all 2ⁿ states
2. OperateOracle / phase manipulationMark or bias the amplitude of the target answer
3. CloseHadamard again (+ measurement)Interference concentrates probability on the answer
The bottom line: the qubit and the Hadamard gate are the entry point to everything. Grover’s O(√N) search, Shor’s O((log N)³) factoring, and every other quantum speedup ultimately trace back to this interference mechanism operating at scale.

Hadamard tensor powers: H², H ⊗ H, and H⊗n

Why does H² = I?

The Hadamard matrix is H = (1/√2)[[1, 1], [1, −1]]. Multiplying it by itself gives:

Matrix derivation showing the Hadamard matrix multiplied by itself equals the two-by-two identity matrix

The first H changes the computational basis into the |+⟩ and |−⟩ basis. The second H changes it back. In amplitude terms, the unwanted paths cancel through destructive interference while the original basis-state amplitude adds constructively. Therefore H is its own inverse: applying it twice restores any one-qubit state.

Two qubits: H ⊗ H

Applying H independently to two qubits is written H ⊗ H = H⊗2. In the basis order |00⟩, |01⟩, |10⟩, |11⟩, its matrix is:

H ⊗ H = (1/2)
[[ 1,   1,   1,   1],
 [ 1,  −1,   1,  −1],
 [ 1,   1,  −1,  −1],
 [ 1,  −1,  −1,   1]]

For example, (H ⊗ H)|00⟩ = (|00⟩ + |01⟩ + |10⟩ + |11⟩)/2. Each basis state has amplitude 1/2 and probability 1/4.

Three qubits: H⊗3

For three qubits the operator is an 8 × 8 matrix. Using basis order |000⟩ through |111⟩:

H⊗3 = (1/√8)
[[ 1,   1,   1,   1,   1,   1,   1,   1],
 [ 1,  −1,   1,  −1,   1,  −1,   1,  −1],
 [ 1,   1,  −1,  −1,   1,   1,  −1,  −1],
 [ 1,  −1,  −1,   1,   1,  −1,  −1,   1],
 [ 1,   1,   1,   1,  −1,  −1,  −1,  −1],
 [ 1,  −1,   1,  −1,  −1,   1,  −1,   1],
 [ 1,   1,  −1,  −1,  −1,  −1,   1,   1],
 [ 1,  −1,  −1,   1,  −1,   1,   1,  −1]]

Applied to |000⟩, this produces all eight three-qubit basis states with amplitude 1/√8 and probability 1/8 each.

The general n-qubit rule

Applying H to every qubit is written H⊗n. It acts on a computational basis state |x⟩ as:

H⊗n|x⟩ = (1/√(2n)) Σy∈{0,1}n (−1)x·y|y⟩

The binary inner product x·y determines each plus or minus sign. For x = 0…0, every sign is positive, giving a uniform superposition over all 2n basis states. Independent Hadamard gates do not create entanglement by themselves; an interaction such as a controlled-NOT gate is needed.

Small Qiskit example

This Qiskit example creates the three-qubit uniform superposition, confirms that every outcome has probability 1/8, and then applies H to all three qubits again to recover |000⟩.

from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector

qc = QuantumCircuit(3)
qc.h(range(3))

uniform = Statevector.from_instruction(qc)
print(uniform.probabilities_dict())
# 000 through 111 each have probability 0.125

qc.h(range(3))
restored = Statevector.from_instruction(qc)
print(restored.probabilities_dict())
# {'000': 1.0}
Key result: (H⊗n)² = I⊗n. The uniform superposition is reversible because the Hadamard transform preserves information and uses interference rather than randomisation.
Related interactive experiment: Ready to see entanglement outperform classical physics? Try the CHSH game simulator and compare the 75% classical limit with the 85.4% quantum strategy. Play and learn with the CHSH game.
Continue the Quantum Series
About the author

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

Comments

6 responses to “Introduction to Quantum Computing: Qubits, Hadamard Gates, and Superposition”

  1. Quantum Computing: A Complete Learning Path – Techucation Avatar

    […] to the algorithms in Section 4. 1  ·  Start Here: Qubits and Superposition 1 Introduction to Quantum Computing: Qubits, Hadamard Gates, and Superposition First principles: what a qubit is, how the Hadamard gate builds superposition, and why tensor […]

    Like

  2. Understanding Phase Kickback in Quantum Computing – Techucation Avatar

    […] the Quantum Series ← Qubits and Hadamard gates View the complete Quantum Computing learning path → Deutsch’s […]

    Like

  3. CHSH Game Simulator: Bell’s Inequality and Quantum Entanglement – Techucation Avatar

    […] Continue the Quantum Series ← Quantum Computing learning path View the complete Quantum Computing learning path → Qubits, Hadamard gates and superposition […]

    Like

  4. Quantum Teleportation in Quantum Computing, and Why It Isn’t Cloning – Malcolm Low | Practical AI, Simulation & Quantum Computing Avatar

    […] the foundations first? Review qubits, superposition and measurement before working through the teleportation […]

    Like

  5. Euler’s Formula: Why e^(iφ) Is Just Shorthand for a Circle – Malcolm Low | Practical AI, Simulation & Quantum Computing Avatar

    […] learning: Start with qubits, phase and superposition, then follow the complete quantum computing learning […]

    Like

  6. Quantum Fourier Transform (QFT) of a Single Qubit is Hadamard Transform – Malcolm Low | Practical AI, Simulation & Quantum Computing Avatar

    […] the Quantum Series ← Previous: Introduction to Quantum Computing: Qubits, Hadamard Gates, and Superposition Next: Quantum Computing: The Walsh-Hadamard Matrix — Backbone of Grover’s Diffusion […]

    Like

Leave a comment