Physics
Universitymathematical-methods

Linear Algebra: Vector Spaces and Linear Operators

The minimal rules that make arrows, functions, polynomials, and quantum states behave alike — and the linear maps that become matrices once a basis is chosen.

Physics is crowded with things that can be added and scaled. Two displacements combine into a third displacement. Two electric fields superpose. Two possible quantum states can be added to form another state. Functions of time can be multiplied by numbers and added point by point. Even polynomials obey the same sort of arithmetic.

Only the first of these looks like the arrow introduced in kinematics. A polynomial has no obvious direction in physical space, and a quantum state is not a little arrow hidden inside an atom. Yet their algebra behaves so much like the algebra of arrows that using the same language is not a metaphor. It is a precise mathematical claim.

So what is the smallest set of rules that makes an object vector-like? Which properties actually mattered when we manipulated displacement, velocity, force, and fields, and which properties belonged only to the picture of an arrow with a length?

The answer is a vector space. Once we strip away the geometry and keep only the rules for addition and scaling, many apparently different physical objects become instances of one structure.

Vector spaces

A vector space VV over a field of scalars, usually R\mathbb{R} or C\mathbb{C} in physics, is a set equipped with two operations:

These operations must satisfy the following axioms for every u,v,wV\vec u,\vec v,\vec w\in V and all scalars a,ba,b.

  1. Closure under addition:

    u+vV.\vec u+\vec v\in V.
  2. Associativity of addition:

    (u+v)+w=u+(v+w).(\vec u+\vec v)+\vec w=\vec u+(\vec v+\vec w).
  3. Commutativity of addition:

    u+v=v+u.\vec u+\vec v=\vec v+\vec u.
  4. Existence of a zero vector: there is an element 0V\vec 0\in V such that

    v+0=v.\vec v+\vec 0=\vec v.
  5. Existence of additive inverses: for every vV\vec v\in V, there is an element vV-\vec v\in V such that

    v+(v)=0.\vec v+(-\vec v)=\vec 0.
  6. Closure under scalar multiplication:

    avV.a\vec v\in V.
  7. Compatibility of scalar multiplication:

    a(bv)=(ab)v.a(b\vec v)=(ab)\vec v.
  8. Scalar identity:

    1v=v.1\vec v=\vec v.
  9. Distributivity over vector addition:

    a(u+v)=au+av.a(\vec u+\vec v)=a\vec u+a\vec v.
  10. Distributivity over scalar addition:

    (a+b)v=av+bv.(a+b)\vec v=a\vec v+b\vec v.

These statements are deliberately abstract. They say nothing about arrows, angles, lengths, or coordinates. A vector space need not come with any notion of distance at all. It is the addition-and-scaling structure that earns its elements the name vectors.

Ordinary vectors in R3\mathbb{R}^3

The familiar example is

R3={(xyz):x,y,zR}.\mathbb{R}^3=\left\{ \begin{pmatrix} x\\y\\z \end{pmatrix}:x,y,z\in\mathbb{R} \right\}.

Addition and scalar multiplication are performed component by component:

(x1y1z1)+(x2y2z2)=(x1+x2y1+y2z1+z2),\begin{pmatrix} x_1\\y_1\\z_1 \end{pmatrix} + \begin{pmatrix} x_2\\y_2\\z_2 \end{pmatrix} = \begin{pmatrix} x_1+x_2\\y_1+y_2\\z_1+z_2 \end{pmatrix},

and

a(xyz)=(axayaz).a \begin{pmatrix} x\\y\\z \end{pmatrix} = \begin{pmatrix} ax\\ay\\az \end{pmatrix}.

The zero vector is (0,0,0)(0,0,0), the additive inverse of (x,y,z)(x,y,z) is (x,y,z)(-x,-y,-z), and the remaining axioms follow from the corresponding properties of real-number arithmetic. These are the displacement, velocity, acceleration, force, and electric-field vectors already used throughout mechanics and in Coulomb's law.

Quadratic polynomials as vectors

Now consider the set

P2={ax2+bx+c:a,b,cR},P_2=\{ax^2+bx+c:a,b,c\in\mathbb{R}\},

the set of all real polynomials of degree at most two. Its elements are functions, not arrows. Nevertheless, define addition and scalar multiplication in the usual way. If

p(x)=a1x2+b1x+c1p(x)=a_1x^2+b_1x+c_1

and

q(x)=a2x2+b2x+c2,q(x)=a_2x^2+b_2x+c_2,

then

p(x)+q(x)=(a1+a2)x2+(b1+b2)x+(c1+c2).p(x)+q(x) =(a_1+a_2)x^2+(b_1+b_2)x+(c_1+c_2).

The result is still a polynomial of degree at most two, so addition is closed. For a scalar ss,

sp(x)=(sa1)x2+(sb1)x+sc1,sp(x)=(sa_1)x^2+(sb_1)x+sc_1,

which is also in P2P_2, so scalar multiplication is closed.

The zero vector in this space is the zero polynomial,

0x2+0x+0,0x^2+0x+0,

and the additive inverse of p(x)p(x) is

p(x)=a1x2b1xc1.-p(x)=-a_1x^2-b_1x-c_1.

Associativity and commutativity follow because polynomial addition is coefficient-by-coefficient real-number addition. The distributive laws can be checked directly. For example,

s[p(x)+q(x)]=s[(a1+a2)x2+(b1+b2)x+(c1+c2)]s[p(x)+q(x)] =s[(a_1+a_2)x^2+(b_1+b_2)x+(c_1+c_2)]

becomes

(sa1+sa2)x2+(sb1+sb2)x+(sc1+sc2),(sa_1+sa_2)x^2+(sb_1+sb_2)x+(sc_1+sc_2),

which is exactly

sp(x)+sq(x).sp(x)+sq(x).

Likewise,

(s+t)p(x)=sp(x)+tp(x),(s+t)p(x)=sp(x)+tp(x), s[tp(x)]=(st)p(x),s[tp(x)]=(st)p(x),

and

1p(x)=p(x).1p(x)=p(x).

Every vector-space axiom is present. The polynomial 2x23x+12x^2-3x+1 is therefore a vector in P2P_2, just as (2,3,1)(2,-3,1) is a vector in R3\mathbb{R}^3. In fact, the correspondence

2x23x+1(231)2x^2-3x+1 \longleftrightarrow \begin{pmatrix} 2\\-3\\1 \end{pmatrix}

will soon turn out to be more than suggestive.

Linear combinations, independence, and basis

Given vectors v1,v2,,vn\vec v_1,\vec v_2,\ldots,\vec v_n, a linear combination is any vector of the form

a1v1+a2v2++anvn.a_1\vec v_1+a_2\vec v_2+\cdots+a_n\vec v_n.

The set of all such combinations is the span of those vectors. If their span equals the whole vector space VV, then they form a spanning set for VV.

But a spanning set can contain unnecessary vectors. In the plane, for example, three vectors may span every direction even though only two independent directions are needed. To identify redundancy, we ask whether the equation

a1v1+a2v2++anvn=0a_1\vec v_1+a_2\vec v_2+\cdots+a_n\vec v_n=\vec 0

has any solution other than

a1=a2==an=0.a_1=a_2=\cdots=a_n=0.

If the trivial solution is the only solution, the vectors are linearly independent. If some coefficients are not zero, the vectors are linearly dependent, and at least one can be expressed as a linear combination of the others.

A basis of VV is a linearly independent set that spans VV. Equivalently, it is a minimal spanning set: remove any basis vector and the remaining vectors no longer span the whole space. Every vector in VV has one and only one expansion in a given basis.

The dimension of a finite-dimensional vector space is the number of vectors in any basis. Different bases may point in different directions or look like entirely different objects, but they all contain the same number of vectors.

The standard basis of R3\mathbb{R}^3 is

x^=(100),y^=(010),z^=(001).\hat x= \begin{pmatrix} 1\\0\\0 \end{pmatrix}, \qquad \hat y= \begin{pmatrix} 0\\1\\0 \end{pmatrix}, \qquad \hat z= \begin{pmatrix} 0\\0\\1 \end{pmatrix}.

Every ordinary vector can be written uniquely as

v=vxx^+vyy^+vzz^.\vec v=v_x\hat x+v_y\hat y+v_z\hat z.

Mechanics has used this basis from the beginning, even when it was called only the xx, yy, and zz directions. Since it contains three vectors, R3\mathbb{R}^3 has dimension three.

The polynomial space P2P_2 has the basis

{x2,x,1}.\{x^2,x,1\}.

Every p(x)P2p(x)\in P_2 can be written as

p(x)=ax2+bx+c.p(x)=ax^2+bx+c.

The three basis polynomials span P2P_2, and they are linearly independent because

ax2+bx+c=0ax^2+bx+c=0

for every xx requires a=b=c=0a=b=c=0. Therefore

dimP2=3.\dim P_2=3.

This is why a quadratic polynomial can be represented by the coordinate column

[p]{x2,x,1}=(abc).[p]_{\{x^2,x,1\}}= \begin{pmatrix} a\\b\\c \end{pmatrix}.

Coordinates do not belong to a vector by themselves. They describe a vector relative to a chosen basis.

Linear operators

A linear transformation is a map

T:VWT:V\to W

between vector spaces that respects linear combinations. For every u,vV\vec u,\vec v\in V and all scalars a,ba,b,

T(au+bv)=aT(u)+bT(v).T(a\vec u+b\vec v)=aT(\vec u)+bT(\vec v).

When V=WV=W, the transformation is often called a linear operator on VV.

Linearity means that the transformation respects superposition. If two electric fields are added before an operation is performed, the result is the same as performing the operation on each field and then adding. This same structure lies behind the derivative operators used in vector calculus, since

ddx[af(x)+bg(x)]=adfdx+bdgdx.\frac{d}{dx}[af(x)+bg(x)] =a\frac{df}{dx}+b\frac{dg}{dx}.

A rotation of vectors in the plane is another linear operator. If two vectors are added and the sum is rotated, the result is the same as rotating each vector and then adding them. Scaling a vector before rotation is also the same as scaling it afterward.

Here is the crucial payoff: once bases have been chosen, every linear transformation between finite-dimensional vector spaces can be represented by a matrix. The columns of that matrix are the coordinates of the transformed basis vectors. Matrices are not a separate topic from vector spaces. They are linear operators after we have picked a basis.

To see why, let {e1,,en}\{\vec e_1,\ldots,\vec e_n\} be a basis of VV. Any vector can be written as

v=v1e1++vnen.\vec v=v_1\vec e_1+\cdots+v_n\vec e_n.

By linearity,

T(v)=v1T(e1)++vnT(en).T(\vec v) =v_1T(\vec e_1)+\cdots+v_nT(\vec e_n).

Once we know what TT does to every basis vector, we know what it does to every vector. Placing the coordinate vectors of T(e1),,T(en)T(\vec e_1),\ldots,T(\vec e_n) into the columns of a matrix records the entire transformation.

Deriving the rotation matrix

Consider a counterclockwise rotation through an angle θ\theta in the plane. Use the standard basis

x^=(10),y^=(01).\hat x= \begin{pmatrix} 1\\0 \end{pmatrix}, \qquad \hat y= \begin{pmatrix} 0\\1 \end{pmatrix}.

First track x^\hat x. It begins at angle zero and ends at angle θ\theta, so its rotated components are

R(θ)x^=(cosθsinθ).R(\theta)\hat x= \begin{pmatrix} \cos\theta\\ \sin\theta \end{pmatrix}.

Now track y^\hat y. It begins at angle π/2\pi/2 and ends at angle π/2+θ\pi/2+\theta. Therefore

R(θ)y^=(cos(π/2+θ)sin(π/2+θ)).R(\theta)\hat y= \begin{pmatrix} \cos(\pi/2+\theta)\\ \sin(\pi/2+\theta) \end{pmatrix}.

Using

cos(π/2+θ)=sinθ\cos(\pi/2+\theta)=-\sin\theta

and

sin(π/2+θ)=cosθ,\sin(\pi/2+\theta)=\cos\theta,

we obtain

R(θ)y^=(sinθcosθ).R(\theta)\hat y= \begin{pmatrix} -\sin\theta\\ \cos\theta \end{pmatrix}.

The images of the basis vectors become the columns of the matrix. Thus

R(θ)=(cosθsinθsinθcosθ).R(\theta)= \begin{pmatrix} \cos\theta & -\sin\theta\\ \sin\theta & \cos\theta \end{pmatrix}.

Now take an arbitrary vector

v=(xy)=xx^+yy^.\vec v= \begin{pmatrix} x\\y \end{pmatrix} =x\hat x+y\hat y.

Linearity gives

R(θ)v=xR(θ)x^+yR(θ)y^.R(\theta)\vec v =xR(\theta)\hat x+yR(\theta)\hat y.

Substituting the rotated basis vectors,

R(θ)v=x(cosθsinθ)+y(sinθcosθ).R(\theta)\vec v =x \begin{pmatrix} \cos\theta\\ \sin\theta \end{pmatrix} +y \begin{pmatrix} -\sin\theta\\ \cos\theta \end{pmatrix}.

Combining components,

R(θ)v=(xcosθysinθxsinθ+ycosθ).R(\theta)\vec v = \begin{pmatrix} x\cos\theta-y\sin\theta\\ x\sin\theta+y\cos\theta \end{pmatrix}.

This is exactly what ordinary matrix multiplication produces:

(xy)=(cosθsinθsinθcosθ)(xy)=(xcosθysinθxsinθ+ycosθ).\begin{pmatrix} x'\\y' \end{pmatrix} = \begin{pmatrix} \cos\theta & -\sin\theta\\ \sin\theta & \cos\theta \end{pmatrix} \begin{pmatrix} x\\y \end{pmatrix} = \begin{pmatrix} x\cos\theta-y\sin\theta\\ x\sin\theta+y\cos\theta \end{pmatrix}.

The matrix is not an arbitrary rectangular array. Its first column says where x^\hat x goes, its second column says where y^\hat y goes, and linearity determines everything between them.

A 2D vector before and after being rotated by angle theta, showing the standard basis vectors x-hat and y-hat and where they map to under the rotation.

A rotation is fixed once the images of the two basis vectors are known; those two images become the columns of the rotation matrix.

Worked example

Verify directly that the rotation matrix R(θ)R(\theta) preserves the length of every vector v\vec v, and show explicitly that this follows from RTR=IR^{T}R=I. (click to reveal the solution)

Writing the rotation and its transpose: let

R=(cosθsinθsinθcosθ).R= \begin{pmatrix} \cos\theta & -\sin\theta\\ \sin\theta & \cos\theta \end{pmatrix}.

Transposing exchanges rows and columns, so

RT=(cosθsinθsinθcosθ).R^T= \begin{pmatrix} \cos\theta & \sin\theta\\ -\sin\theta & \cos\theta \end{pmatrix}.

Multiplying RTRR^TR explicitly:

RTR=(cosθsinθsinθcosθ)(cosθsinθsinθcosθ).R^TR = \begin{pmatrix} \cos\theta & \sin\theta\\ -\sin\theta & \cos\theta \end{pmatrix} \begin{pmatrix} \cos\theta & -\sin\theta\\ \sin\theta & \cos\theta \end{pmatrix}.

Computing each entry gives

RTR=(cos2θ+sin2θcosθsinθ+sinθcosθsinθcosθ+cosθsinθsin2θ+cos2θ).R^TR = \begin{pmatrix} \cos^2\theta+\sin^2\theta & -\cos\theta\sin\theta+\sin\theta\cos\theta \\ -\sin\theta\cos\theta+\cos\theta\sin\theta & \sin^2\theta+\cos^2\theta \end{pmatrix}.

The off-diagonal entries cancel, and the identity

sin2θ+cos2θ=1\sin^2\theta+\cos^2\theta=1

reduces the product to

RTR=(1001)=I.R^TR= \begin{pmatrix} 1&0\\ 0&1 \end{pmatrix} =I.

A real matrix satisfying RTR=IR^TR=I is called an orthogonal matrix. Equivalently,

R1=RT.R^{-1}=R^T.

For a rotation, this has a direct geometric meaning: rotating backward through θ-\theta undoes rotating forward through θ\theta.

Proving length preservation from orthogonality: the squared length of a column vector v\vec v is

v2=vTv.|\vec v|^2=\vec v^{\,T}\vec v.

The rotated vector is RvR\vec v, so its squared length is

Rv2=(Rv)T(Rv).|R\vec v|^2=(R\vec v)^T(R\vec v).

Using (Rv)T=vTRT(R\vec v)^T=\vec v^{\,T}R^T,

Rv2=vTRTRv.|R\vec v|^2 =\vec v^{\,T}R^TR\vec v.

Since RTR=IR^TR=I,

Rv2=vTIv=vTv=v2.|R\vec v|^2 =\vec v^{\,T}I\vec v =\vec v^{\,T}\vec v =|\vec v|^2.

Lengths are nonnegative, so taking the square root gives

Rv=v.|R\vec v|=|\vec v|.

Checking the same result in components: for

v=(xy),\vec v= \begin{pmatrix} x\\y \end{pmatrix},

the rotated components are

x=xcosθysinθx'=x\cos\theta-y\sin\theta

and

y=xsinθ+ycosθ.y'=x\sin\theta+y\cos\theta.

Therefore

Rv2=(x)2+(y)2.|R\vec v|^2=(x')^2+(y')^2.

Substituting,

Rv2=(xcosθysinθ)2+(xsinθ+ycosθ)2.|R\vec v|^2 =(x\cos\theta-y\sin\theta)^2 +(x\sin\theta+y\cos\theta)^2.

Expanding both squares,

Rv2=x2cos2θ2xysinθcosθ+y2sin2θ|R\vec v|^2 =x^2\cos^2\theta-2xy\sin\theta\cos\theta+y^2\sin^2\theta +x2sin2θ+2xysinθcosθ+y2cos2θ.\qquad +x^2\sin^2\theta+2xy\sin\theta\cos\theta+y^2\cos^2\theta.

The cross terms cancel. Grouping the remaining terms,

Rv2=x2(cos2θ+sin2θ)+y2(sin2θ+cos2θ).|R\vec v|^2 =x^2(\cos^2\theta+\sin^2\theta) +y^2(\sin^2\theta+\cos^2\theta).

Thus

Rv2=x2+y2=v2,|R\vec v|^2=x^2+y^2=|\vec v|^2,

and once again

Rv=v.|R\vec v|=|\vec v|.

The component calculation and the compact matrix calculation say the same thing. Orthogonality packages the length-preserving geometry of a rotation into the single equation RTR=IR^TR=I.

Where this leads

Vector spaces and linear operators are the language in which quantum mechanics is secretly written. Quantum states are vectors, though not generally arrows in ordinary space, and observables are linear operators acting on those states. On the page about angular momentum and spin, the eigenvalues and eigenvectors of Pauli matrices were already being computed without this general vocabulary.

The next topic makes that vocabulary explicit. An eigenvector is a special direction in a vector space along which a linear operator acts by pure scaling, with no turning into any other direction. Its scale factor is the corresponding eigenvalue. Finding those directions is what allows a complicated operator to reveal its simplest possible action.