Everything in this book eventually comes down to multiplying a small list of numbers by a small grid of numbers. That's all a qubit state is, and that's all a gate is. The only thing quantum mechanics adds to ordinary linear algebra is that the numbers are allowed to be complex — the rules themselves don't change at all.
What a vector is, here
A vector is just an ordered list of numbers, written as a column:
v = [v₁, v₂, …, vₙ]ᵗ
For most of this chapter n = 2, because a single qubit's state will turn out to be a 2-entry vector. Everything below works identically for any size.
Adding vectors
Vector addition is component-by-component: add the first entries together, add the second entries together. Geometrically, this is the familiar "tip-to-tail" rule — slide the second arrow so its tail sits at the first arrow's tip, and the sum is the arrow from the very start to the very end.
Scalar multiplication
Multiplying a vector by a single number k scales every entry by k: (kv)ᵢ = k·vᵢ. Geometrically that stretches (|k| > 1), shrinks (|k| < 1), or reverses (k < 0) the arrow without changing its direction otherwise. You'll see this as a special case of the next section — try setting the matrix below to [[k,0],[0,k]] and watch it scale your vector uniformly.
Matrices as transformations
A matrix is a grid of numbers that turns one vector into another. For a 2×2 matrix acting on a 2-entry vector, the rule is:
Each output entry is a weighted sum of the input entries — nothing more exotic than that. The widget below lets you edit the matrix directly and drag the vector, so you can watch exactly which matrices stretch, rotate, reflect, or swap a vector's direction.
This is literally what a quantum gate does
Go back to Ch. 3's gate buttons for a moment: every one of them was a 2×2 matrix multiplying a 2-entry vector — exactly the operation in Fig. 1.2, just with complex entries and one extra rule (the result always has to land back on the unit-normalized state space, which is why gate matrices specifically have to be unitary — more on that in Ch. 4). The X gate is the "Swap" preset above, generalized to complex numbers. There's no new machinery between this chapter and that one — only new numbers.
Eigenvalues and eigenvectors
Look back at Fig. 1.2 for a second. For almost every choice of v, the matrix M knocks the vector off its original line — Mv points somewhere genuinely different from v. But for some special directions, M doesn't rotate the vector at all. It only stretches or shrinks it. Those special directions are called eigenvectors, and the stretch factor is the corresponding eigenvalue:
Mv = λv, v ≠ 0
In words: v is an eigenvector of M if applying M to v gives back the exact same direction, just scaled by the number λ.
Finding them
Rearranging Mv = λv gives (M − λI)v = 0. A nonzero v can only solve this if the matrix (M − λI) fails to be invertible — i.e. its determinant is zero. For a 2×2 matrix [[a,b],[c,d]], writing that out gives the characteristic equation:
That's just a quadratic in λ — the coefficients are the matrix's trace (a+d) and determinant (ad−bc). Solve it with the quadratic formula and you have both eigenvalues.
Worked example. Take M = [[2,1],[1,2]]. Trace = 4, determinant = 3, so λ² − 4λ + 3 = 0, which factors as (λ−1)(λ−3) = 0: the eigenvalues are λ = 1 and λ = 3. Plugging λ = 3 back into (M − 3I)v = 0 gives [[−1,1],[1,−1]]v = 0, solved by v = (1, 1). Plugging in λ = 1 gives v = (1, −1). Check it yourself in the code cell below, or just watch Fig. 1.4 confirm it live.
Why this matters in quantum computing
This is not a side topic — it's arguably the single most-used piece of linear algebra in the entire subject. A few direct connections you'll meet by name later in this book:
- Measurement outcomes are eigenvalues. An observable (a measurable quantity, like spin) is represented by a Hermitian matrix. The only values you can ever actually measure are that matrix's eigenvalues — Ch. 4 and Ch. 7 make this precise, and Ch. 4 explains exactly why Hermitian specifically guarantees those eigenvalues come out real, since a measurement outcome that was a complex number would be physically meaningless.
- Eigenvectors are the states measurement collapses to. Measuring an observable forces the system into one of that observable's eigenvectors. The Pauli Z gate's eigenvectors are exactly |0⟩ and |1⟩ (eigenvalues +1 and −1); Pauli X's eigenvectors are |+⟩ and |−⟩. You already met all four states in Ch. 3 — you just hadn't met the word "eigenvector" yet.
- Solving a quantum system means diagonalizing its Hamiltonian. The allowed energy levels of a quantum system are the eigenvalues of its Hamiltonian operator; the eigenvectors are the corresponding stable energy states. "Diagonalizing the Hamiltonian" — a phrase you'll see constantly in any quantum mechanics course — just means finding these.
Eigenvalues show up everywhere else, too
None of this machinery is quantum-specific — quantum mechanics just happens to be a field where eigenvalues are unavoidable. A few examples from elsewhere, each genuinely using the identical Mv = λv idea from this section:
- Data science (PCA): the eigenvectors of a dataset's covariance matrix are its principal components — the directions of greatest variance; the eigenvalues tell you how much variance each direction explains.
- Search engines: Google's original PageRank score is the dominant eigenvector of a giant matrix encoding which pages link to which.
- Structural engineering: the eigenvalues of a structure's stiffness matrix are its natural resonant frequencies; the eigenvectors are the shapes it physically vibrates into at each one.
- Markov chains: a system's long-run steady-state distribution is the eigenvector of its transition matrix with eigenvalue exactly 1.
Same equation, four unrelated fields. That's a fairly reliable sign you've found something fundamental rather than something specific to one subject.
Linear combinations and basis vectors
A linear combination is just a sum of scaled vectors: c₁v₁ + c₂v₂ + …. Two special vectors make this especially useful in 2 dimensions — the standard basis:
e₁ = [1, 0]ᵗ e₂ = [0, 1]ᵗ
Any 2-entry vector v = [v₁, v₂]ᵗ can be written as the linear combination v = v₁e₁ + v₂e₂ — the vector's own entries are exactly the coefficients needed to build it back out of the basis. Hold onto that sentence. In Ch. 3, e₁ and e₂ get renamed |0⟩ and |1⟩, and "v₁e₁ + v₂e₂" gets renamed "superposition." It's the identical fact, wearing different notation.
- Video3Blue1Brown — Essence of Linear AlgebraThe best visual intuition for vectors and matrices as transformations, full stop.
- TextbookNielsen & Chuang, §2.1The linear algebra primer the rest of the book leans on.
- ToolNumPy docs — matmul / @Reference for the exact operator used in Fig. 1.3's code cell.