beginner · Physics · Math Foundations: Linear Algebra
Unitary Matrices
Definition
A square matrix U with complex entries is unitary if its conjugate transpose equals its
inverse:
U†U=UU†=I.
Equivalently, the columns of U form an orthonormal set in Cn: each column has
unit norm and every pair of distinct columns is orthogonal. The same is true of the rows.
Two ways to verify unitarity
Method 1 — column norms and inner products. Extract the columns c1,c2,…
and check:
∥ck∥=1 for every k (unit norm).
⟨cj,ck⟩=0 for every j=k (mutual orthogonality).
Method 2 — direct product. Compute U†U explicitly and check that it equals the
identity matrix I.
Both methods are equivalent; which is faster depends on the matrix.
Why unitarity is the right condition for quantum gates
In quantum mechanics a state ∣ψ⟩ must remain normalised: ⟨ψ∣ψ⟩=1.
If evolution is described by a matrix U, the evolved state is ∣ψ′⟩=U∣ψ⟩.
Normalisation after evolution requires
⟨ψ′∣ψ′⟩=⟨ψ∣U†U∣ψ⟩=1
for every choice of ∣ψ⟩. The only matrices that satisfy this for all unit vectors
∣ψ⟩ are the unitary matrices U†U=I. Unitarity is therefore the
algebraic expression of conservation of total probability.
Key properties of unitary matrices
From the definition several useful facts follow immediately.
Determinant has unit modulus. If U†U=I then det(U†)det(U)=1, so
∣det(U)∣2=1 and therefore ∣det(U)∣=1. The determinant lies on the unit circle in the
complex plane but is not necessarily 1.
Eigenvalues have unit modulus. If U∣ψ⟩=λ∣ψ⟩ then
∥λ∣ψ⟩∥=∥U∣ψ⟩∥=∥∣ψ⟩∥, which forces
∣λ∣=1.
Unitary matrices form a group. The product of two unitary matrices is unitary:
(UV)†(UV)=V†U†UV=V†V=I. The inverse of a unitary matrix is
its conjugate transpose, also unitary. This group structure matches the physical requirement that
composing two valid quantum operations gives another valid quantum operation.
A worked example — the Hadamard matrix
The Hadamard matrix is
H=21(111−1).
Its entries are real, so H†=HT. Let us compute H†H directly.
Reading off the columns, the first column is c1=21(11) and
the second is c2=21(−11).
Both columns are unit vectors and they are orthogonal, so H is unitary: H†H=I.
Equivalently, since H is also symmetric (HT=H) and H†H=I, we have H=H−1,
confirming that H2=I — applying the Hadamard gate twice returns any state to its original form.
Complex unitary matrices
The condition U†U=I extends beyond real orthogonal matrices. Consider the phase matrix
P(θ)=(eiθ00e−iθ).
Here P(θ)†=(e−iθ00eiθ), so
P(θ)†P(θ)=(e−iθeiθ00eiθe−iθ)=(1001)=I.
This matrix is unitary for every real θ even though its entries are in general not real.
The standard quantum gates S=(100i) and
T=(100eiπ/4) are diagonal unitaries of exactly this
kind — each column is a unit-modulus phase times a standard basis vector — and they appear
throughout quantum computing. They coincide with members of the family P(θ) only up to an
overall global phase (for example P(π/4)=eiπ/4diag(1,e−iπ/2)), and such
a global phase has no physical effect.
Try it
This is a numerical exercise — your code should return a number, not a circuit. The Hadamard
matrix H=21(111−1) is real, so
H†=HT. Compute the (0,0) entry of H†H. A unitary matrix satisfies
H†H=I, so the result should be exactly 1.
Run your code to see the quantum state.
Sign in on the full site to ask questions and join the discussion.