The last piece. A matrix is a machine: an arrow goes in, a moved arrow comes out. Every quantum gate is exactly one of these little boxes acting on the state arrow — so once you can see a matrix bend space, and you know what its four numbers mean, gates hold no surprises.
↩ before you start · keep these handy
·A vector is an arrow written [x, y] = across, up (page 0.1). A matrix's whole job is to turn one such arrow into another.
·You can multiply two numbers and add the results. That single skill — "multiply pairs, then add" — is all of matrix arithmetic.
·The two "home" arrows: [1, 0] (one step across) and [0, 1] (one step up). Watch where these two land — that is the trick of the whole page.
🔑 symbol decoder · every new mark, in plain words
Mthe name of a matrix — the "machine."[[a, b], [c, d]]the four numbers inside it, arranged in two rows and two columns.w = M·v"run arrow v through machine M and get arrow w out."columna top-to-bottom pair, e.g. (a, c). Each column is where one home-arrow lands.rowa left-to-right pair, e.g. (a, b). Each row is the recipe for one output number.detthe "determinant" — how much the machine scales area. det = 1 means area is untouched.unitarya machine that never changes any arrow's length — only rigid turns and flips. Quantum gates are always these.
feel
A box: arrow in, arrow out
Feed an arrow into the box and it hands you back another arrow — perhaps turned, perhaps stretched, perhaps flipped. The four numbers inside the matrix are simply the box's instructions. The same arrow in always gives the same arrow out; the box does not change between uses.
🏭 everyday picture
A matrix is like a printing press for space. You hand it a flat sheet with a grid drawn on it; it always squashes, rotates or shears that whole sheet the same fixed way. To describe what the press does, you only need to know where two reference corners of the grid end up — and that is precisely what the four numbers record.
recapA matrix is a fixed machine that turns any input arrow into an output arrow.
see
What each of the four numbers means
This is the part that trips everyone up, so we go one number at a time. There are two equally correct ways to read the box — by its rows, and by its columns. Both say the same thing; having both in your head is what makes matrices click.
reading 1 · by rows — each output number is a recipe
[
abcd
]·[
xy
]
new across = a·x + b·y
new up = c·x + d·y
a — how much of the old across feeds the new across
b — how much of the old up feeds the new across
c — how much of the old across feeds the new up
d — how much of the old up feeds the new up
reading 2 · by columns — where the two home-arrows land
[
abcd
]
column 1 = (a, c) = where [1, 0] (one step across) lands
Why columns work: any arrow [x, y] is just "x of the across-arrow plus y of the up-arrow." So once you know where those two land, the output is x·(column 1) + y·(column 2) — the press carries the rest along.
recapRows are recipes for each output number; columns are the landing spots of the two home-arrows.
play
Watch the box bend the grid
Now see both readings live. Pick a machine. The grey unit square is space before; the green shape is where it goes. The two columns — teal and amber — are the landing spots of the two home-arrows. Drag the grey input arrow and the green output follows the recipe w = M·v.
▸ matrix machinew = M · v
[
{{ ma }}{{ mb }}{{ mc }}{{ md }}
]↑col1 ↑col2
v in[ {{ vx }}, {{ vy }} ]
w = [ a·x+b·y , c·x+d·y ]
w out[ {{ wx }}, {{ wy }} ]
|v| → |w|{{ vlen }} → {{ wlen }}
area ×{{ det }}
recapThe teal and amber arrows ARE the two columns — drag the input and the output rides the bent grid.
math
Row meets column
Multiplying is bookkeeping: each output number is one row of the matrix marched across the input arrow, multiplying pair‑by‑pair and adding.
[ ab ] [ x ] [ a·x + b·y ]
[ cd ] [ y ] = [ c·x + d·y ]
worked example · the 90° rotation, by hand
take M = [[0, −1], [1, 0]]. send the two home-arrows through it:
1.[1, 0]: new across = 0·1 + (−1)·0 = 0; new up = 1·1 + 0·0 = 1 → [0, 1]
2.[0, 1]: new across = 0·0 + (−1)·1 = −1; new up = 1·0 + 0·1 = 0 → [−1, 0]
3.so the across-axis swung up, and the up-axis swung left — the whole grid turned a quarter-circle. Notice the two answers are exactly the matrix's two columns. ✓
recapOutput = row·input, pair-by-pair, added. Feeding in the home-arrows reads off the columns.
why · the gentle machines
Try rotate and flip in the lab: the length |v| → |w| never changes. Try scale or shear and it does. The length‑preserving boxes — rigid turns and reflections — are the ones called unitary, and quantum gates are only ever these. That is why a gate can rearrange a state but never change the total probability: the pie always stays full.
⚠ common misconceptions
"You multiply a matrix by a vector entry-by-entry, like lining up a grid." No — it is row times column: each output number mixes both input numbers (a·x + b·y). The top number is not just "a·x."
"Order doesn't matter when you apply two machines." It usually does. Rotating then flipping is generally not the same as flipping then rotating — and the matrices multiply in the reverse of the order you apply them. We will lean on this when gates start stacking up.
✓ you can now
✓say what each of the four numbers in a 2×2 matrix does — by rows and by columns
✓multiply a matrix by a vector by hand (row · column, multiply-and-add)
✓recognise a unitary (length-preserving) machine — the only kind a quantum gate can be