Mathwords logoMathwords

Hadamard Matrix — Definition, Formula & Examples

A Hadamard matrix is a square matrix whose every entry is either +1+1 or 1-1 and whose rows are all mutually orthogonal. When you multiply it by its own transpose, you get nn times the identity matrix, where nn is the matrix size.

An n×nn \times n matrix HH with entries hij{+1,1}h_{ij} \in \{+1, -1\} is a Hadamard matrix if it satisfies HHT=nInHH^T = nI_n, where InI_n is the n×nn \times n identity matrix and HTH^T denotes the transpose of HH.

Key Formula

HHT=nInHH^T = nI_n
Where:
  • HH = An n × n matrix with all entries +1 or −1
  • HTH^T = The transpose of H
  • nn = The order (size) of the matrix
  • InI_n = The n × n identity matrix

How It Works

To verify that a matrix is Hadamard, check two things: every entry must be +1+1 or 1-1, and the dot product of any two distinct rows must equal zero. The dot product of any row with itself equals nn, so the product HHTHH^T yields nInnI_n. Hadamard matrices exist only for n=1n = 1, n=2n = 2, or nn a multiple of 44. The famous Hadamard conjecture asserts that a Hadamard matrix exists for every positive multiple of 44, but this remains unproven.

Worked Example

Problem: Verify that the following 2×2 matrix is a Hadamard matrix: H=(1111)H = \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}.
Check entries: Every entry of H is either +1 or −1, so the entry condition is satisfied.
Compute H times H transpose: Since H is symmetric here, HT=HH^T = H. Compute the product:
HHT=(1111)(1111)=(2002)HH^T = \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} = \begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix}
Compare with nI: Here n=2n = 2, and 2I2=(2002)2I_2 = \begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix}. The result matches, confirming the orthogonality condition.
HHT=2I2HH^T = 2I_2 \checkmark
Answer: H is a Hadamard matrix of order 2 because all entries are ±1 and HHT=2I2HH^T = 2I_2.

Why It Matters

Hadamard matrices appear in error-correcting codes (like Reed–Muller codes), signal processing, and experimental design in statistics. In quantum computing, the 2×22 \times 2 Hadamard matrix (scaled by 12\frac{1}{\sqrt{2}}) is one of the most fundamental quantum gates, creating superposition states from basis states.

Common Mistakes

Mistake: Assuming a Hadamard matrix can exist for any size n.
Correction: Hadamard matrices can only exist when n = 1, n = 2, or n is a multiple of 4. There is no 3×3 or 5×5 Hadamard matrix.