Complex Vector Spaces

4 hours ~7 min read
Prerequisites

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: Cn\mathbb{C}^n, the complex vector space. You know real vector spaces; the upgrade to C\mathbb{C} 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:

  1. State the axioms of a vector space over a field and verify them for Cn\mathbb{C}^n.
  2. Explain why quantum mechanics requires C\mathbb{C}, not R\mathbb{R}, as its scalar field.
  3. Determine whether a set of complex vectors is linearly independent and compute the dimension of its span.
  4. Identify subspaces and produce a basis for one.
  5. 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 F\mathbb{F} with addition and multiplication that are associative, commutative, distributive, have identities 00 and 11, and admit additive inverses and (for nonzero elements) multiplicative inverses. We care about two fields:

  • R\mathbb{R}, the real numbers.
  • C={a+bi:a,bR}\mathbb{C} = \{\,a + bi : a,b \in \mathbb{R}\,\} with i2=1i^2 = -1, the complex numbers.

We review C\mathbb{C} thoroughly in 0.3.1 Complex Numbers & Functions; here we need only that it is a field and that every complex number z=a+biz = a+bi has a conjugate z=abiz^* = a - bi and a modulus z=a2+b2=zz|z| = \sqrt{a^2+b^2} = \sqrt{z^* z}.

Definition: vector space over a field

A vector space over a field F\mathbb{F} is a set VV with two operations — vector addition +:V×VV+ : V \times V \to V and scalar multiplication :F×VV\cdot : \mathbb{F} \times V \to V — satisfying, for all u,v,wVu, v, w \in V and a,bFa, b \in \mathbb{F}:

(A1) associativity:(u+v)+w=u+(v+w)(A2) commutativity:u+v=v+u(A3) zero vector:0V s.t. v+0=v(A4) additive inverse:(v) s.t. v+(v)=0(M1) compatibility:a(bv)=(ab)v(M2) scalar identity:1v=v(D1) distributivity over V:a(u+v)=au+av(D2) distributivity over F:(a+b)v=av+bv \begin{aligned} &\textbf{(A1) associativity:} && (u + v) + w = u + (v + w) \\ &\textbf{(A2) commutativity:} && u + v = v + u \\ &\textbf{(A3) zero vector:} && \exists\, 0 \in V \text{ s.t. } v + 0 = v \\ &\textbf{(A4) additive inverse:} && \exists\, (-v) \text{ s.t. } v + (-v) = 0 \\ &\textbf{(M1) compatibility:} && a(bv) = (ab)v \\ &\textbf{(M2) scalar identity:} && 1\,v = v \\ &\textbf{(D1) distributivity over }V: && a(u+v) = au + av \\ &\textbf{(D2) distributivity over }\mathbb{F}: && (a+b)v = av + bv \end{aligned}

Elements of VV are vectors; elements of F\mathbb{F} are scalars. When F=C\mathbb{F} = \mathbb{C} we call VV a complex vector space.

The space Cn\mathbb{C}^n

The central example for us is

Cn={(z1z2zn):zkC}, \mathbb{C}^n = \left\{\, \begin{pmatrix} z_1 \\ z_2 \\ \vdots \\ z_n \end{pmatrix} : z_k \in \mathbb{C} \,\right\},

with componentwise addition and scalar multiplication:

(z1zn)+(w1wn)=(z1+w1zn+wn),a(z1zn)=(az1azn). \begin{pmatrix} z_1 \\ \vdots \\ z_n \end{pmatrix} + \begin{pmatrix} w_1 \\ \vdots \\ w_n \end{pmatrix} = \begin{pmatrix} z_1 + w_1 \\ \vdots \\ z_n + w_n \end{pmatrix}, \qquad a \begin{pmatrix} z_1 \\ \vdots \\ z_n \end{pmatrix} = \begin{pmatrix} a z_1 \\ \vdots \\ a z_n \end{pmatrix}.

The axioms (A1)–(D2) follow directly from the field axioms of C\mathbb{C} applied componentwise. A single qubit's state space is C2\mathbb{C}^2; nn qubits live in C2n\mathbb{C}^{2^n} (we'll see why the dimension is 2n2^n, not 2n2n, in 0.1.7 Tensor Products).

Note on dimension counting. As a real vector space, Cn\mathbb{C}^n has dimension 2n2n (each complex component contributes a real and imaginary part). As a complex vector space it has dimension nn. Unless stated otherwise, "dimension" means the complex dimension.

Linear combinations, span, independence

Let v1,,vmVv_1, \dots, v_m \in V.

  • A linear combination is any k=1makvk\sum_{k=1}^m a_k v_k with akFa_k \in \mathbb{F}.
  • Their span span{v1,,vm}\operatorname{span}\{v_1,\dots,v_m\} 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
k=1makvk=0isa1=a2==am=0. \sum_{k=1}^m a_k v_k = 0 \quad\text{is}\quad a_1 = a_2 = \cdots = a_m = 0.

Otherwise it is linearly dependent: some vector is a linear combination of the others.

Basis and dimension

A basis of VV is a linearly independent set that spans VV. 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 dimV\dim V.
  • Unique representation: if {e1,,en}\{e_1, \dots, e_n\} is a basis, every vVv \in V has a unique expansion v=kckekv = \sum_k c_k e_k. The ckc_k are the coordinates of vv in that basis.

The standard (computational) basis of Cn\mathbb{C}^n is

e1=(100),  e2=(010), , en=(001). e_1 = \begin{pmatrix}1\\0\\\vdots\\0\end{pmatrix},\ \ e_2 = \begin{pmatrix}0\\1\\\vdots\\0\end{pmatrix},\ \dots,\ e_n = \begin{pmatrix}0\\0\\\vdots\\1\end{pmatrix}.

For C2\mathbb{C}^2 we rename these 0=e1|0\rangle = e_1 and 1=e2|1\rangle = e_2 — 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 WVW \subseteq V is a subspace if it is itself a vector space under the inherited operations. Equivalently (the subspace test), WW is a subspace iff:

  1. 0W0 \in W;
  2. WW is closed under addition: u,wWu+wWu, w \in W \Rightarrow u + w \in W;
  3. WW is closed under scalar multiplication: aF,wWawWa \in \mathbb{F},\, w \in W \Rightarrow a w \in W.

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 C2\mathbb{C}^2

Are v1=(1i)v_1 = \begin{pmatrix} 1 \\ i \end{pmatrix} and v2=(i1)v_2 = \begin{pmatrix} i \\ -1 \end{pmatrix} linearly independent over C\mathbb{C}?

Set av1+bv2=0a v_1 + b v_2 = 0:

a(1i)+b(i1)=(a+biaib)=(00). a\begin{pmatrix}1\\i\end{pmatrix} + b\begin{pmatrix}i\\-1\end{pmatrix} = \begin{pmatrix} a + bi \\ ai - b \end{pmatrix} = \begin{pmatrix}0\\0\end{pmatrix}.

From the top: a=bia = -bi. Substitute into the bottom: (bi)ib=bi2b=bb=0(-bi)i - b = -b i^2 - b = b - b = 0, which holds for every bb. So a nonzero solution exists (e.g. b=1, a=ib = 1,\ a = -i): the vectors are linearly dependent. Indeed v2=iv1v_2 = i\,v_1 — multiplying by ii is a legal complex scaling, so over C\mathbb{C} these are the "same direction." (Over R\mathbb{R}, treating ii as a forbidden scalar, they would look independent — a concrete reminder that the scalar field matters.)

Example 2 — A basis for a subspace

Let W={(z1,z2,z3)C3:z1+z2+z3=0}W = \{ (z_1, z_2, z_3) \in \mathbb{C}^3 : z_1 + z_2 + z_3 = 0 \}. Is WW a subspace, and what is dimW\dim W?

Subspace check. 00 satisfies the constraint. If u,wWu, w \in W then (u+w)(u+w)'s components sum to 0+0=00 + 0 = 0, and awa w's components sum to a0=0a \cdot 0 = 0. All three conditions hold, so WW is a subspace.

Basis. The constraint z3=z1z2z_3 = -z_1 - z_2 leaves z1,z2z_1, z_2 free. Write a general element as

(z1z2z1z2)=z1(101)+z2(011). \begin{pmatrix} z_1 \\ z_2 \\ -z_1 - z_2 \end{pmatrix} = z_1 \begin{pmatrix} 1 \\ 0 \\ -1 \end{pmatrix} + z_2 \begin{pmatrix} 0 \\ 1 \\ -1 \end{pmatrix}.

These two vectors span WW and are independent (neither is a scalar multiple of the other), so they form a basis and dimW=2\dim W = 2. One linear constraint dropped the dimension from 33 to 22.


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), (a+b)v=av+bv(a+b)v = av + bv, explicitly for C2\mathbb{C}^2 with a=1+ia = 1+i, b=2b = 2, v=(i,1)Tv = (i, 1)^T.

Solution

(a+b)=3+i(a+b) = 3 + i, so (a+b)v=(3+i)(i,1)T=((3+i)i, 3+i)T=(1+3i, 3+i)T(a+b)v = (3+i)(i,\,1)^T = ((3+i)i,\ 3+i)^T = (-1+3i,\ 3+i)^T. Separately, av=(1+i)(i,1)T=(i+i2, 1+i)T=(1+i, 1+i)Tav = (1+i)(i,1)^T = (i + i^2,\ 1+i)^T = (-1+i,\ 1+i)^T and bv=2(i,1)T=(2i,2)Tbv = 2(i,1)^T = (2i, 2)^T. Then av+bv=(1+i+2i, 1+i+2)T=(1+3i, 3+i)Tav + bv = (-1+i+2i,\ 1+i+2)^T = (-1+3i,\ 3+i)^T. They match. ∎

E2 (easy). Show that {(1,1)T,(1,1)T}\{(1,1)^T, (1,-1)^T\} is a basis of C2\mathbb{C}^2 and find the coordinates of (0,1)T(0,1)^T in it.

Solution

Independence: a(1,1)T+b(1,1)T=(a+b, ab)T=0a(1,1)^T + b(1,-1)^T = (a+b,\ a-b)^T = 0 forces a+b=0a+b=0 and ab=0a-b=0, hence a=b=0a=b=0. Two independent vectors in a 2-dimensional space form a basis. For coordinates solve a+b=0, ab=1a=12, b=12a+b = 0,\ a-b = 1 \Rightarrow a = \tfrac12,\ b = -\tfrac12. So (0,1)T=12(1,1)T12(1,1)T(0,1)^T = \tfrac12(1,1)^T - \tfrac12(1,-1)^T. (Up to normalization these are +,|+\rangle, |-\rangle.)

E3 (medium). Let W={(z1,z2)C2:z1=z2}W = \{ (z_1, z_2) \in \mathbb{C}^2 : z_1 = \overline{z_2} \} (bar = complex conjugate). Is WW a subspace of the complex vector space C2\mathbb{C}^2? Is it a subspace of C2\mathbb{C}^2 viewed as a real vector space?

Solution

Not a complex subspace: take w=(1,1)Ww = (1,1) \in W (since 1=1\overline{1}=1). Scale by ii: iw=(i,i)iw = (i, i); but i=ii\overline{i} = -i \neq i, so iwWiw \notin W — closure under complex scaling fails. It is a real subspace: it contains 00, and is closed under addition and real scaling (for real aa, az2=az2\overline{a z_2} = a\overline{z_2}). 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 00 is among v1,,vmv_1, \dots, v_m, say v1=0v_1 = 0. Then 1v1+0v2++0vm=01\cdot v_1 + 0\cdot v_2 + \cdots + 0\cdot v_m = 0 is a vanishing linear combination with a nonzero coefficient (a1=1a_1 = 1). By definition the list is linearly dependent. ∎

E5 (hard). Show that C\mathbb{C} is a vector space over R\mathbb{R} of dimension 22, but over C\mathbb{C} of dimension 11. Generalize to state dimRCn\dim_\mathbb{R} \mathbb{C}^n vs dimCCn\dim_\mathbb{C} \mathbb{C}^n.

Solution

Over R\mathbb{R}: {1,i}\{1, i\} is independent (no real a,ba,b with a1+bi=0a\cdot 1 + b\cdot i = 0 except a=b=0a=b=0) and spans (every z=a+biz = a + bi), so dimRC=2\dim_\mathbb{R}\mathbb{C} = 2. Over C\mathbb{C}: {1}\{1\} spans (every z=z1z = z\cdot 1) and is independent, so dimCC=1\dim_\mathbb{C}\mathbb{C} = 1. In general dimCCn=n\dim_\mathbb{C}\mathbb{C}^n = n while dimRCn=2n\dim_\mathbb{R}\mathbb{C}^n = 2n, because each complex coordinate contributes two real degrees of freedom. This is why a single qubit, living in C2\mathbb{C}^2, has 22=42\cdot 2 = 4 real parameters before we impose normalization and discard global phase — leaving the 22 real parameters of the Bloch sphere (Term 1.2).


Checkpoint

  1. State the eight vector-space axioms from memory (group them: 4 additive, 2 multiplicative, 2 distributive).
  2. Why does quantum mechanics use C\mathbb{C} rather than R\mathbb{R} as its scalar field?
  3. What is the difference between a spanning set, a linearly independent set, and a basis?
  4. Give the complex and real dimensions of C3\mathbb{C}^3.
  5. State the three conditions of the subspace test.
Answers
  1. (A1) associativity, (A2) commutativity, (A3) zero vector, (A4) additive inverses; (M1) scalar-mult compatibility, (M2) scalar identity 1v=v1v=v; (D1) distributivity over vector addition, (D2) distributivity over scalar addition.
  2. 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.
  3. 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).
  4. dimCC3=3\dim_\mathbb{C}\mathbb{C}^3 = 3; dimRC3=6\dim_\mathbb{R}\mathbb{C}^3 = 6.
  5. Contains 00; 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

Ready to measure your state?

5 exercises · 10 checkpoint questions

Start the quiz