Lesson 2: Linear Algebra I: Complex Vector Spaces and Dirac Notation¶
2.1 Learning Outcomes¶
By the end of this hour a student will be able to:
- State the axioms of a complex vector space and verify them for \(\mathbb{C}^n\).
- Read and write Dirac (bra–ket) notation fluently and convert between ket, column-vector and coefficient forms.
- Test a set of vectors for linear independence and identify a basis and the dimension of a space.
- Expand an arbitrary vector in a given basis.
- Recognise the computational basis \(\{|0\rangle,|1\rangle\}\) and the Hadamard basis \(\{|+\rangle,|-\rangle\}\) of \(\mathbb{C}^2\).
2.2 Why Linear Algebra?¶
Quantum mechanics is linear algebra over the complex numbers, with a physical interpretation attached. Every object in the theory is one of three things:
| Physical object | Mathematical object |
|---|---|
| State of a system | Unit vector in a complex Hilbert space |
| Evolution (a gate) | Unitary matrix |
| Measurement / observable | Hermitian matrix and its eigen-decomposition |
If the linear algebra is secure, the rest of the course is bookkeeping. This lesson and the next two build that foundation.
2.3 Complex Numbers — a One-Page Refresher¶
A complex number is \(z = a + ib\) with \(a,b \in \mathbb{R}\) and \(i^2 = -1\).
- Complex conjugate: \(\bar z = z^* = a - ib\).
- Modulus: \(|z| = \sqrt{z\bar z} = \sqrt{a^2+b^2}\), so \(|z|^2 = a^2+b^2\).
- Polar form: \(z = re^{i\theta}\) where \(r = |z|\) and \(\theta = \arg z\).
- Euler's formula: \(e^{i\theta} = \cos\theta + i\sin\theta\).
- A phase factor is any \(e^{i\theta}\); note \(|e^{i\theta}| = 1\).
Frequently used values.
Common error. \(|a+ib|^2 \ne (a+ib)^2\). Always use \(z\bar z\). For example \(|3+4i|^2 = 9+16 = 25\), whereas \((3+4i)^2 = -7+24i\).
2.4 Complex Vector Spaces¶
Definition (Complex vector space). A set \(V\) with an addition \(+ : V\times V \to V\) and a scalar multiplication \(\cdot : \mathbb{C}\times V \to V\) is a complex vector space if for all \(u,v,w \in V\) and \(a,b \in \mathbb{C}\):
| Axiom | Statement |
|---|---|
| A1 Closure under \(+\) | \(u+v \in V\) |
| A2 Commutativity | \(u+v = v+u\) |
| A3 Associativity | \((u+v)+w = u+(v+w)\) |
| A4 Zero vector | \(\exists\, 0 \in V\) with \(v + 0 = v\) |
| A5 Additive inverse | \(\exists\, (-v)\) with \(v + (-v) = 0\) |
| M1 Closure under \(\cdot\) | \(a v \in V\) |
| M2 Compatibility | \(a(bv) = (ab)v\) |
| M3 Unit scalar | \(1\cdot v = v\) |
| D1 Distributivity over vectors | \(a(u+v) = au + av\) |
| D2 Distributivity over scalars | \((a+b)v = av + bv\) |
The space we use. \(\mathbb{C}^n\) = all \(n\)-tuples of complex numbers written as column vectors, with componentwise addition and scalar multiplication. Everything in this course lives in \(\mathbb{C}^{2^n}\) for some \(n\).
2.5 Dirac Notation¶
Paul Dirac introduced a notation that makes quantum linear algebra dramatically more readable.
Definition (Ket). A ket \(|\psi\rangle\) denotes a column vector in \(V\):
Definition (Bra). A bra \(\langle\psi|\) is the conjugate transpose (Hermitian adjoint) of the corresponding ket — a row vector:
The symbol \(\dagger\) ("dagger") means transpose then conjugate every entry.
The label inside the ket is just a name. \(|\psi\rangle\), \(|0\rangle\), \(|{\uparrow}\rangle\), \(|\text{cat}\rangle\) are all legitimate; what matters is the vector they denote.
The computational basis¶
These are not the numbers 0 and 1; they are orthonormal basis vectors of \(\mathbb{C}^2\). A general qubit state is
Arithmetic in Dirac notation¶
Linearity works exactly as expected:
and taking the dagger conjugates the scalars:
This conjugation of scalars is the single most common source of sign/phase errors. When you move from ket to bra, every complex coefficient picks up a star.
2.6 Linear Combinations, Span, Independence, Basis¶
Definition (Linear combination). Given \(|v_1\rangle,\dots,|v_k\rangle \in V\) and scalars \(c_1,\dots,c_k \in \mathbb{C}\), the vector \(\sum_{j=1}^k c_j|v_j\rangle\) is a linear combination.
Definition (Span). \(\mathrm{span}\{|v_1\rangle,\dots,|v_k\rangle\}\) is the set of all linear combinations of those vectors. It is itself a vector space (a subspace of \(V\)).
Definition (Linear independence). The vectors \(|v_1\rangle,\dots,|v_k\rangle\) are linearly independent if
Otherwise they are linearly dependent — at least one vector is redundant.
Definition (Basis and dimension). A basis of \(V\) is a linearly independent set that spans \(V\). Every basis of a given space has the same number of elements; that number is the dimension \(\dim V\).
Theorem (Unique expansion). If \(\{|v_1\rangle,\dots,|v_n\rangle\}\) is a basis of \(V\), then every \(|\psi\rangle \in V\) has a unique expression \(|\psi\rangle = \sum_j c_j|v_j\rangle\).
Proof. Existence follows from spanning. For uniqueness, suppose \(\sum_j c_j|v_j\rangle = \sum_j d_j |v_j\rangle\). Subtracting, \(\sum_j (c_j - d_j)|v_j\rangle = 0\). Independence forces \(c_j - d_j = 0\) for all \(j\), i.e. \(c_j = d_j\). \(\blacksquare\)
Practical test for independence¶
Place the \(k\) vectors as columns of a matrix \(M\) (size \(n\times k\)).
- If \(k = n\): independent \(\iff \det M \ne 0\).
- In general: independent \(\iff \mathrm{rank}(M) = k\) (row-reduce and count non-zero rows).
- If \(k > n\) in an \(n\)-dimensional space, the set is automatically dependent.
Two important bases of C²¶
| Basis | Vectors | Use |
|---|---|---|
| Computational (\(Z\)) | \(\lvert 0\rangle,\ \lvert 1\rangle\) | Default; what a measurement returns |
| Hadamard (\(X\)) | \(\lvert +\rangle = \tfrac{1}{\sqrt2}(\lvert 0\rangle+\lvert 1\rangle)\), \(\lvert -\rangle = \tfrac{1}{\sqrt2}(\lvert 0\rangle-\lvert 1\rangle)\) | Superposition, phase kick-back, interference |
| Circular (\(Y\)) | \(\lvert {+}i\rangle = \tfrac{1}{\sqrt2}(\lvert 0\rangle+i\lvert 1\rangle)\), \(\lvert {-}i\rangle = \tfrac{1}{\sqrt2}(\lvert 0\rangle-i\lvert 1\rangle)\) | \(Y\)-basis measurements |
Note the reversible relations
2.7 Solved Problems¶
Problem 1 — Expressing a state as a column vector and its bra¶
Write \(|\psi\rangle = (2-i)|0\rangle + 3i|1\rangle\) as a column vector, give \(\langle\psi|\), and normalise the state.
Solution.
(Each entry is conjugated: \(\overline{2-i} = 2+i\), \(\overline{3i} = -3i\).)
Norm squared:
Normalised state:
Check: \(\frac{5}{14} + \frac{9}{14} = 1\) ✓. Measurement probabilities are \(5/14 \approx 0.357\) and \(9/14 \approx 0.643\).
Problem 2 — Testing linear independence¶
Are the following vectors in \(\mathbb{C}^3\) linearly independent?
Solution. Three vectors in a 3-dimensional space, so compute the determinant of
Expand along the first row:
\(\det M = 0\), so the vectors are linearly dependent.
Find the relation: observe \(|v_1\rangle + |v_2\rangle = (1,1,1+i)^T = |v_3\rangle\). Hence
Problem 3 — Change of basis¶
Express \(|\psi\rangle = \frac{3}{5}|0\rangle + \frac{4}{5}|1\rangle\) in the Hadamard basis \(\{|+\rangle, |-\rangle\}\), and give the probabilities of the two outcomes of an \(X\)-basis measurement.
Solution. Substitute \(|0\rangle = \frac{1}{\sqrt2}(|+\rangle + |-\rangle)\) and \(|1\rangle = \frac{1}{\sqrt2}(|+\rangle - |-\rangle)\):
Check normalisation: \(\frac{49}{50} + \frac{1}{50} = 1\) ✓.
Interpretation. In the \(Z\) basis the state is quite uncertain (0.36 / 0.64); in the \(X\) basis it is almost deterministic. The randomness of a measurement outcome depends on which basis you measure in, not on the state alone.
Problem 4 — Verifying a vector space axiom fails¶
Let \(S = \{(z_1,z_2) \in \mathbb{C}^2 : |z_1|^2 + |z_2|^2 = 1\}\) — the set of normalised qubit states. Is \(S\) a vector space?
Solution. Test closure under addition. Take \(|0\rangle = (1,0) \in S\) and \(|1\rangle = (0,1) \in S\). Then
So \((1,1) \notin S\): closure fails, and \(S\) is not a vector space. Also \(0 = (0,0)\) has norm 0, so the zero vector is missing.
Why this matters. The set of physical states is the unit sphere inside \(\mathbb{C}^2\), not a subspace. We do linear algebra in the full space \(\mathbb{C}^2\) and re-normalise whenever we form a superposition. This is why every superposition you write carries a factor like \(1/\sqrt2\).
Problem 5 — Building a basis from a spanning set¶
Find a basis for \(\mathrm{span}\{|u_1\rangle,|u_2\rangle,|u_3\rangle\}\) where
Solution. Immediately \(|u_2\rangle = 2|u_1\rangle\), so \(|u_2\rangle\) is redundant.
Test whether \(\{|u_1\rangle,|u_3\rangle\}\) is independent. Suppose \(a|u_1\rangle + b|u_3\rangle = 0\). Componentwise:
- Row 1: \(a = 0\)
- Row 3: \(ib = 0 \Rightarrow b = 0\)
Both scalars vanish, so they are independent. Therefore
The span is a 2-dimensional plane through the origin in \(\mathbb{C}^3\).
2.8 Practice Problems¶
- Write \(|\phi\rangle = \frac{1}{\sqrt3}|0\rangle - \frac{i\sqrt2}{\sqrt3}|1\rangle\) as a column vector and give \(\langle\phi|\). Verify normalisation.
- Are \((1,i)^T\) and \((i,-1)^T\) linearly independent in \(\mathbb{C}^2\)? [Ans: no — the second is \(i\) times the first]
- Express \(|1\rangle\) in the \(\{|+i\rangle, |-i\rangle\}\) basis.
- Show that \(\{|+\rangle, |-\rangle\}\) is a basis of \(\mathbb{C}^2\) by computing a determinant.
- Prove that any 3 vectors in \(\mathbb{C}^2\) must be linearly dependent.
- If \(|\psi\rangle = a|0\rangle+b|1\rangle\) with \(a=\frac{1+i}{2}\), find \(b\) (real and positive) so that \(|\psi\rangle\) is normalised. [Ans: \(b = 1/\sqrt2\)]
2.9 Summary¶
- Quantum states are vectors in a complex vector space; gates are matrices acting on them.
- Ket \(|\psi\rangle\) = column vector; bra \(\langle\psi| = |\psi\rangle^\dagger\) = row vector with all entries conjugated.
- Linear independence, span, basis and dimension carry over unchanged from real linear algebra; only the scalar field changes to \(\mathbb{C}\).
- Expansion in a basis is unique; the computational basis \(\{|0\rangle,|1\rangle\}\) and Hadamard basis \(\{|+\rangle,|-\rangle\}\) are the two workhorses.
- Physical states form the unit sphere, not a subspace — always re-normalise after superposing.
Next lesson: L03 — Inner products, Hilbert spaces and orthonormality.
Practise now: Interactive-Web-Platform/unit1-qubit-lab.html → State Explorer shows the
column-vector, Dirac and basis-expansion forms of any state you build.