← Syllabus · 01 Mathematical Foundations
Learning mode

Topic 01.08 · 8 min

Matrices and matrix multiplication

A matrix is a little grid of numbers that acts like a machine: feed it an arrow, and it hands back a new arrow. Some machines swap, some flip, some turn. Quantum gates are exactly these machines.

  • The grid [[0, 1], [1, 0]] is the swap machine: feed it [1, 0] and you get [0, 1]. Feed that back in and you are home again.
  • Each number in the answer comes from one row of the grid: multiply across the row, add up.
  • A 2-by-2 grid acting on a 2-number arrow always gives a 2-number arrow — the shape never changes, only the contents.
  • Doing two machines one after another is like one bigger machine. Order matters: swap-then-flip is not flip-then-swap.

Watch it happen

0 11 0×10=10top: 0·1 + 1·0 · bottom: 1·1 + 0·0|0⟩ becomes |1⟩
[[0,1],[1,0]] swaps the components — this is Pauli-X

Check yourself · 4 questions

From the Quantum Physics Foundations bank; each comes with a worked answer.

1 / 4
Q7Mathematical Foundations

A 2 × 2 matrix multiplied by a two-component column vector produces

0 11 0×10=102 × 22 × 12 × 1a gate turns one qubit state into another
two rows × one column → two numbers: a column vector again