beginner · Physics · Math Foundations: Linear Algebra
Matrix Multiplication
In quantum mechanics every operation on a state vector — every quantum gate, every time-evolution
operator, every measurement projector — is a matrix. To apply two operations in sequence you
multiply their matrices. Matrix multiplication is therefore not optional bookkeeping; it is
the language in which quantum dynamics is written.
The rule
Given two 2×2 matrices
A=(a00a10a01a11),B=(b00b10b01b11),
their product C=AB is the 2×2 matrix whose (i,j) entry is
cij=k∑aikbkj.
In words: take row i of A and column j of B, multiply them term by term, and sum the
results. This is the dot product of a row with a column.
So H2=I: applying the Hadamard gate twice brings a qubit back to its original state. This
identity, which follows purely from matrix multiplication, tells you that H is its own inverse.
XZ=ZX: the product depends on the order. In quantum computing this non-commutativity
is not an annoyance but a fundamental physical fact — it is the algebraic origin of the uncertainty
principle.
How matrix products act on state vectors
A matrix acts on a column vector by the same row-times-column rule. For a 2×2 matrix M
and a two-component ket
This is just matrix multiplication with the vector treated as a single-column matrix. Everything you
practice here carries over directly to applying gates in quantum circuits.
Try it
This is a numerical exercise — your code should return a number, not a circuit. Compute the
(0,1) entry — that is, row 0, column 1 — of the product XZ, where
X=(0110),Z=(100−1).
Run your code to see the quantum state.
Sign in on the full site to ask questions and join the discussion.