Complex Vector Spaces
- Appendix B — Python/NumPy Refresher
- Undergraduate linear algebra over the reals
Complex Vector Spaces
A quantum state is a vector. Not a metaphor — literally a unit vector in a complex vector space. Before we can say what a qubit is, we need to be precise about the space it lives in: , the complex vector space. You know real vector spaces; the upgrade to is small in definition but consequential in physics, because complex phases are where quantum interference lives.
Learning Objectives
After this lesson you will be able to:
- State the axioms of a vector space over a field and verify them for .
- Explain why quantum mechanics requires , not , as its scalar field.
- Determine whether a set of complex vectors is linearly independent and compute the dimension of its span.
- Identify subspaces and produce a basis for one.
- Represent and manipulate complex vectors and bases in NumPy.
Intuition
A vector space is a setting where two operations make sense and play nicely together: you can add two vectors, and you can scale a vector by a number (a scalar). That's it. Everything else — bases, dimension, linear maps — is built from those two operations.
In high-school physics the scalars were real numbers and vectors were arrows in space. In quantum mechanics the scalars are complex numbers and the "vectors" are abstract lists of complex amplitudes. Why complex? Because a quantum amplitude carries a phase as well as a magnitude, and relative phases between components are physically observable — they produce interference, the engine of quantum speedups. A real-amplitude theory cannot reproduce the observed physics (you'll prove a sharp version of this when we hit the Bloch sphere and interference in Term 1).
For now: think "lists of complex numbers you can add and scale."
Theory
Fields
The scalars of a vector space form a field: a set with addition and multiplication that are associative, commutative, distributive, have identities and , and admit additive inverses and (for nonzero elements) multiplicative inverses. We care about two fields:
- , the real numbers.
- with , the complex numbers.
We review thoroughly in 0.3.1 Complex Numbers & Functions; here we need only that it is a field and that every complex number has a conjugate and a modulus .
Definition: vector space over a field
A vector space over a field is a set with two operations — vector addition and scalar multiplication — satisfying, for all and :
Elements of are vectors; elements of are scalars. When we call a complex vector space.
The space
The central example for us is
with componentwise addition and scalar multiplication:
The axioms (A1)–(D2) follow directly from the field axioms of applied componentwise. A single qubit's state space is ; qubits live in (we'll see why the dimension is , not , in 0.1.7 Tensor Products).
Note on dimension counting. As a real vector space, has dimension (each complex component contributes a real and imaginary part). As a complex vector space it has dimension . Unless stated otherwise, "dimension" means the complex dimension.
Linear combinations, span, independence
Let .
- A linear combination is any with .
- Their span is the set of all such linear combinations. It is always a subspace (see below).
- The set is linearly independent if the only solution to
Otherwise it is linearly dependent: some vector is a linear combination of the others.
Basis and dimension
A basis of is a linearly independent set that spans . Two foundational facts (proved in any linear algebra text, e.g. [Axl]):
- Every basis of a finite-dimensional space has the same number of elements. That number is the dimension .
- Unique representation: if is a basis, every has a unique expansion . The are the coordinates of in that basis.
The standard (computational) basis of is
For we rename these and — the computational basis of a qubit. (That bra–ket notation is the subject of 0.1.3 Dirac Notation; we adopt it as soon as inner products are in hand.)
Subspaces
A subset is a subspace if it is itself a vector space under the inherited operations. Equivalently (the subspace test), is a subspace iff:
- ;
- is closed under addition: ;
- is closed under scalar multiplication: .
Spans are the prototypical subspaces. Subspaces matter physically: a measurement outcome corresponds to projecting a state onto a subspace (the eigenspace of an observable), which we develop in Term 1.3.
Worked Examples
Example 1 — Verifying linear independence in
Are and linearly independent over ?
Set :
From the top: . Substitute into the bottom: , which holds for every . So a nonzero solution exists (e.g. ): the vectors are linearly dependent. Indeed — multiplying by is a legal complex scaling, so over these are the "same direction." (Over , treating as a forbidden scalar, they would look independent — a concrete reminder that the scalar field matters.)
Example 2 — A basis for a subspace
Let . Is a subspace, and what is ?
Subspace check. satisfies the constraint. If then 's components sum to , and 's components sum to . All three conditions hold, so is a subspace.
Basis. The constraint leaves free. Write a general element as
These two vectors span and are independent (neither is a scalar multiple of the other), so they form a basis and . One linear constraint dropped the dimension from to .
Hands-on (Python)
We make these abstractions concrete with NumPy. Recall from
Appendix B: always use dtype=complex for states.
import numpy as np
# The computational basis of C^2 (a single qubit).
ket0 = np.array([1, 0], dtype=complex) # |0>
ket1 = np.array([0, 1], dtype=complex) # |1>
# A linear combination (a superposition): (3 + 4i)|0> + (1 - 2i)|1>
v = (3 + 4j) * ket0 + (1 - 2j) * ket1
print(v) # [3.+4.j 1.-2.j]
def is_independent(*vectors):
"""A set of vectors is independent iff the matrix with them as columns has full column rank."""
M = np.column_stack(vectors) # shape (n, m)
return np.linalg.matrix_rank(M) == M.shape[1]
v1 = np.array([1, 1j], dtype=complex)
v2 = np.array([1j, -1], dtype=complex)
print(is_independent(v1, v2)) # False -> v2 = i*v1 (Example 1)
# A genuinely independent pair:
print(is_independent(ket0, ket1)) # True# Coordinates in the standard basis are just the components themselves.
# Expansion v = sum_k c_k e_k is recovered trivially for the standard basis:
coords = v # [3+4j, 1-2j] are the coordinates of v
reconstructed = coords[0] * ket0 + coords[1] * ket1
print(np.allclose(reconstructed, v)) # True
# Dimension of a span = rank of the matrix of spanning vectors.
W_basis = [np.array([1, 0, -1], dtype=complex),
np.array([0, 1, -1], dtype=complex)]
print(np.linalg.matrix_rank(np.column_stack(W_basis))) # 2 (Example 2)Computing coordinates in a non-standard basis requires solving a linear system or inverting the basis matrix — we'll do that systematically once we have the inner product in 0.1.2, where for orthonormal bases it collapses to a simple projection.
Exercises
Attempt before expanding. Solutions use the conventions of this lesson.
E1 (easy). Verify axiom (D2), , explicitly for with , , .
Solution
, so . Separately, and . Then . They match. ∎
E2 (easy). Show that is a basis of and find the coordinates of in it.
Solution
Independence: forces and , hence . Two independent vectors in a 2-dimensional space form a basis. For coordinates solve . So . (Up to normalization these are .)
E3 (medium). Let (bar = complex conjugate). Is a subspace of the complex vector space ? Is it a subspace of viewed as a real vector space?
Solution
Not a complex subspace: take (since ). Scale by : ; but , so — closure under complex scaling fails. It is a real subspace: it contains , and is closed under addition and real scaling (for real , ). This is the recurring lesson that "subspace" depends on the scalar field.
E4 (medium). Prove that any list of vectors containing the zero vector is linearly dependent.
Solution
Suppose is among , say . Then is a vanishing linear combination with a nonzero coefficient (). By definition the list is linearly dependent. ∎
E5 (hard). Show that is a vector space over of dimension , but over of dimension . Generalize to state vs .
Solution
Over : is independent (no real with except ) and spans (every ), so . Over : spans (every ) and is independent, so . In general while , because each complex coordinate contributes two real degrees of freedom. This is why a single qubit, living in , has real parameters before we impose normalization and discard global phase — leaving the real parameters of the Bloch sphere (Term 1.2).
Checkpoint
- State the eight vector-space axioms from memory (group them: 4 additive, 2 multiplicative, 2 distributive).
- Why does quantum mechanics use rather than as its scalar field?
- What is the difference between a spanning set, a linearly independent set, and a basis?
- Give the complex and real dimensions of .
- State the three conditions of the subspace test.
Answers
- (A1) associativity, (A2) commutativity, (A3) zero vector, (A4) additive inverses; (M1) scalar-mult compatibility, (M2) scalar identity ; (D1) distributivity over vector addition, (D2) distributivity over scalar addition.
- Quantum amplitudes carry a relative phase; complex scalars encode magnitude and phase, and relative phases produce interference, which experiment confirms. A real theory cannot reproduce it.
- A spanning set reaches every vector by linear combinations; an independent set has no redundancy; a basis is both at once (minimal spanning set / maximal independent set).
- ; .
- Contains ; closed under vector addition; closed under scalar multiplication.
Further Reading
- [Axl] Axler, Linear Algebra Done Right, Ch. 1–2 — vector spaces, span, independence, bases.
- [NC] Nielsen & Chuang, §2.1.1 — bases and linear independence in the QC context.
- [Pre] Preskill, Ph219, Ch. 2 — the linear-algebra setup as physicists use it.
← Prev: Term 0 Overview · Up: Term 0 · Next: Inner Products & Norms →