Linear Algebra / Unit 4, Vector Spaces / Topic 4.6
Unit 4. Vector Spaces
This topic shows how the coordinates of a vector change when the basis changes, and how the matrix of a linear map changes with them. A good choice of basis can turn a complicated matrix into a simple one.
You need Topics 3.2, 3.5, 4.3, and 4.5 for this topic.
From Topic 4.3, the coordinates of a vector depend on the basis. In this topic, a list of numbers such as (3, 1) means coordinates in the standard basis unless the text says otherwise.
Take a basis b₁, b₂ of ℝ², and write the basis vectors as the columns of a matrix P. This matrix is called the change of basis matrix. If a vector x has the coordinates c = (c₁, c₂) in the new basis, then x = c₁b₁ + c₂b₂, which is the product Pc.
x = Pc and c = P⁻¹xThe matrix P has an inverse, because its columns are independent.
For the basis (1, 1), (1, −1) of Topic 4.3,
P = 111−1 P⁻¹ = 1/21/21/2−1/2 P⁻¹ 31 = 21The vector (3, 1) has the coordinates (2, 1) in this basis, as Topic 4.3 found by solving two equations.
Suppose that there are two bases, with the change of basis matrices P and Q. The same vector has the coordinates c in the first basis and d in the second basis. Both describe the same x.
x = Pc = Qd so d = Q⁻¹PcRead the product from right to left: P changes the first coordinates into standard coordinates, and Q⁻¹ changes standard coordinates into the second coordinates.
For example, let the first basis be (1, 1), (1, −1) and the second basis be (1, 0), (1, 1). A vector has the coordinates c = (3, 1) in the first basis.
Q = 1101the second basis, as columnsQ⁻¹ = 1−101the inverse of QQ⁻¹P = 021−1the matrix that changes the coordinatesd = 021−1 31 = 22the coordinates in the second basisCheck:
3(1, 1) + 1(1, −1) = (4, 2)the first description2(1, 0) + 2(1, 1) = (4, 2)the second descriptionLet A be the matrix of a linear map of ℝⁿ in the standard basis, so that the map takes x to y = Ax. In a new basis, the input has the coordinates c and the output has the coordinates d, with x = Pc and y = Pd. Then Pd = APc, and
d = P⁻¹APcThe matrix of the same map in the new basis is B = P⁻¹AP. Read it from right to left: P changes the new coordinates into standard coordinates, A applies the map, and P⁻¹ changes the result back into the new coordinates.
For example, take the map with the matrix A below and the basis (1, 1), (1, −1).
A = 2112the matrix in the standard basisAP = 313−1A times the basis vectorsB = P⁻¹AP = 3001the matrix in the new basisIn the new basis the matrix is diagonal, and the map is easy to describe. It stretches each vector along (1, 1) by the factor 3, and it leaves each vector along (1, −1) unchanged. The standard matrix A describes the same map, but this description is not easy to read from A.
Try it: find a basis that makes the matrix diagonal
Choose a map. Drag the tips of the blue and red arrows to choose a basis. The dashed arrows show where the map sends the two basis vectors. The readout shows the matrix of the map in your basis. Try to find a basis in which the matrix is diagonal.
The matrix is diagonal when the map sends each basis vector to a multiple of itself. In the drawing, each dashed arrow is then on the same line as its basis vector. Vectors with this property are called eigenvectors of the map, and Unit 5 shows how to find them without trial and error. The rotation has no such vectors in the plane, so no basis of real vectors makes its matrix diagonal.
Two square matrices A and B are called similar when B = P⁻¹AP for some matrix P that has an inverse. Similar matrices are the matrices of one map in two different bases. They share the properties that belong to the map.
| Property | Reason |
|---|---|
| The same determinant | det(P⁻¹AP) = det(P⁻¹) det(A) det(P) = det A |
| The same trace | The cyclic property of Topic 3.5 |
| The same rank | The dimension of the range does not depend on the basis |
For the example, A and B both have the determinant 3 and the trace 4.
In physics, the most common change of basis is a rotation of the coordinate axes. The new basis vectors are the standard unit vectors turned by an angle θ, so P is the rotation matrix of Topic 3.1. Its inverse is the rotation by −θ, which is also its transpose.
P = cos θ−sin θsin θcos θ P⁻¹ = PT = cos θsin θ−sin θcos θA vector with the components (x, y) on the original axes has these components on the rotated axes:
x′ = x cos θ + y sin θ y′ = −x sin θ + y cos θYou have used this in problems with an inclined plane, where the weight is split into a component along the incline and a component perpendicular to it. The weight is the same vector in both descriptions. The length of a vector does not change when the axes are rotated.
A change of basis whose matrix satisfies P⁻¹ = PT keeps all lengths and angles. Unit 6 studies these matrices. In quantum mechanics, the state of a particle can be described in a basis of positions or in a basis of momenta, and the change between these two descriptions is a change of basis of this kind.
| Fact | Statement |
|---|---|
| Change of basis matrix | P has the new basis vectors as its columns |
| Coordinates | x = Pc and c = P⁻¹x |
| Between two bases | d = Q⁻¹Pc |
| Matrix of a map in the new basis | B = P⁻¹AP |
| Similar matrices | They have the same determinant, trace, and rank |
| Rotated axes | P is a rotation matrix, and P⁻¹ = PT |
Work each problem on paper first. Then open the answer to check your work.
P = 2111 has the determinant 1, so P⁻¹ = 1−1−12.
c = P⁻¹(5, 3)the coordinates in the new basisc = (5 − 3, −5 + 6) = (2, 1)2(2, 1) + 1(1, 1) = (5, 3)the check
x = Pcthe vector from its coordinatesx = 3(1, 1) − 2(1, −1) = (1, 5)
P = 1101 and P⁻¹ = 1−101.
AP = 1303, and P⁻¹AP = 1003.
The matrix is diagonal in this basis.
Similar matrices have the same determinant and the same trace, so det B = 6 and tr B = 5.
x′ = 2 cos 30° + 0 = √3 ≈ 1.73y′ = −2 sin 30° + 0 = −1x′² + y′² = 3 + 1 = 4the length is still 2
From Part 2, d = Q⁻¹Pc with Q⁻¹P = 021−1.
d = (0 + 2, 1 − 1) = (2, 0)
Check: both descriptions give the vector (2, 0).
The instruction np.column_stack builds the change of basis matrix P from the basis vectors. The instruction np.linalg.inv calculates an inverse, and the @ sign multiplies matrices and vectors. The code below finds the coordinates of (3, 1) in the basis (1, 1), (1, −1).
Python
The result is [2. 1.], as in Part 1.
In the next box, the coordinates are given and the vector is wanted. Change the line that starts with x so that x holds the standard coordinates of the vector with the coordinates (3, −2) in this basis. This is Practice Problem 2.
Python
From Part 2, coordinates c in a first basis become coordinates d in a second basis through d = Q⁻¹Pc. In the next box, the line that calculates d is not complete: it leaves out the matrix P. Correct that line.
Python
The code below calculates B = P⁻¹AP for the example of Part 3.
Python
The result is the diagonal matrix with the entries 3 and 1.
Now change P to the matrix of the basis (1, 0), (1, 1). The basis vectors are the columns of P, and a matrix is typed by its rows.
Python
The code below prints the trace and the determinant of A and of B = P⁻¹AP. The instruction round removes very small rounding errors.
Python
The traces are both 4, and the determinants are both 3. Change P to any other matrix that has an inverse and run the code again. The four results do not change.
The code below finds the components of the vector (2, 0) on axes that are rotated by 30 degrees, as in Practice Problem 5. The instructions np.cos and np.sin need the angle in radians, so np.radians changes degrees to radians. For a rotation, the inverse of P is its transpose, P.T.
Python
The components are about 1.73 and −1. The second result is the length of the vector, which is still 2.
Now rotate the axes by 90 degrees. Before you press Run, decide what the components should be from a sketch.
Python
This quiz has 5 questions on this topic. A question asks you either to choose one answer or to type numbers. The page grades your answers and explains each one. A number can be typed as a whole number, a decimal, a fraction such as 1/3, or a calculation such as sqrt(18)/2 or arccos(1/2). The page shows the value of a calculation next to the box. Angles in a calculation are in degrees. The Calculator button under each question opens a calculator. Your answers are saved in your browser, so they are still on the page when you come back to it.
Choose how your answers are checked
1. A vector has the coordinates (2, 3) in the basis (1, 1), (1, −1). Find its standard coordinates.
x = 2(1, 1) + 3(1, −1)each coordinate multiplies one basis vectorx = (5, −1)This is the product Pc, where the columns of P are the basis vectors.
2. Find the coordinates of the vector (6, 2) in the basis (1, 1), (1, −1).
Solve a(1, 1) + b(1, −1) = (6, 2).a + b = 6the first componentsa − b = 2the second components2a = 8add the two equationsa = 4divide both sides by 2b = 6 − 4 = 2substitute a = 4 into the first equationThis is the product P⁻¹x.
3. A map has the matrix A in the standard basis. The columns of P are the vectors of a new basis. Which matrix is the matrix of the map in the new basis?
Read the product P⁻¹AP from right to left. P changes the new coordinates into standard coordinates, A applies the map, and P⁻¹ changes the result back into the new coordinates.
4. Which properties are always the same for two similar matrices?
Similar matrices are the matrices of one map in two different bases. They share the properties that belong to the map, such as the determinant, the trace, and the rank. Their entries are usually different.
5. Let A = 3102. Calculate A times the vector (1, −1).
A(1, −1) = (3 − 1, 0 − 2)multiplyA(1, −1) = (2, −2) = 2(1, −1)2 times the vectorThe map only stretches this vector.