Tutorials › Linear Algebra › Computing Similarity Transforms by Hand

Similarity and Change of Basis for Operators · Tutorial 470 of 1000

Computing Similarity Transforms by Hand

Compute a similarity transform by hand and verify that it represents the same linear operator in the basis given by the columns of \(P\).

Intermediate 10 min read

What You'll Learn

  • Interpret the columns of an invertible matrix as an ordered basis
  • Compute \(P^{-1}AP\) in the correct order
  • Find \(P^{-1}\) using row reduction and check the inverse
  • Verify transformed matrices by applying both sides to coordinate vectors
  • Recognise and correct common errors in basis-change calculations

What the Similarity Transform Computes

A matrix for a linear operator depends on the coordinates used to describe its inputs and outputs. Changing coordinates changes the matrix, but not the operator itself. The product \(P^{-1}AP\) gives the matrix of the same operator in a basis whose vectors are the columns of \(P\), provided \(A\) is the matrix in the standard basis and \(P\) is invertible.

Throughout, work over \(\mathbb{R}\). Let \(T:\mathbb{R}^n\to\mathbb{R}^n\) be a linear map with standard-basis matrix \(\mathbf{A}\). Let \(\mathcal{B}=(\mathbf{b}_1,\dots,\mathbf{b}_n)\) be an ordered basis and let \(\mathbf{P}=\begin{bmatrix}\mathbf{b}_1&\cdots&\mathbf{b}_n\end{bmatrix}\). A vector \(\mathbf{x}\) of \(\mathcal{B}\)-coordinates describes the standard-coordinate vector \(\mathbf{P}\mathbf{x}\). To apply \(T\), first form \(\mathbf{P}\mathbf{x}\), then apply \(\mathbf{A}\), then convert the result back to \(\mathcal{B}\)-coordinates using \(\mathbf{P}^{-1}\).

Definition: If \(\mathbf{A}\in\mathbb{R}^{n\times n}\) and \(\mathbf{P}\in\mathbb{R}^{n\times n}\) is invertible, the similarity transform of \(\mathbf{A}\) by \(\mathbf{P}\) is \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\). If the columns of \(\mathbf{P}\) form the ordered basis \(\mathcal{B}\), this product is the matrix of the operator represented by \(\mathbf{A}\) in the basis \(\mathcal{B}\).

The order of multiplication records the coordinate journey. The factor on the right converts \(\mathcal{B}\)-coordinates to standard coordinates; the middle factor applies the operator; the factor on the left converts standard coordinates back to \(\mathcal{B}\)-coordinates. Matrix multiplication acts from right to left, so changing the order changes the calculation.

Why the Formula Gives the New Matrix

Theorem: Let \(T:\mathbb{R}^n\to\mathbb{R}^n\) have standard-basis matrix \(\mathbf{A}\), and let \(\mathcal{B}\) be an ordered basis with column matrix \(\mathbf{P}\). For every \(\mathbf{x}\in\mathbb{R}^n\), the \(\mathcal{B}\)-coordinate vector of \(T\) applied to the vector with \(\mathcal{B}\)-coordinates \(\mathbf{x}\) is \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\mathbf{x}\). Thus the matrix of \(T\) in \(\mathcal{B}\) is \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\).

Proof. The vector with \(\mathcal{B}\)-coordinates \(\mathbf{x}\) has standard-coordinate vector \(\mathbf{P}\mathbf{x}\), because the columns of \(\mathbf{P}\) are the basis vectors. Applying \(T\) in standard coordinates gives \(\mathbf{A}(\mathbf{P}\mathbf{x})\). For any standard-coordinate vector \(\mathbf{y}\), its \(\mathcal{B}\)-coordinates are \(\mathbf{P}^{-1}\mathbf{y}\), since \(\mathbf{P}\mathbf{z}=\mathbf{y}\) has the unique solution \(\mathbf{z}=\mathbf{P}^{-1}\mathbf{y}\). Therefore the output coordinates are \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\mathbf{x}\), as required. \(\square\)

This also explains how to read the columns of the result: column \(j\) is the \(\mathcal{B}\)-coordinate vector of \(T(\mathbf{b}_j)\). Indeed, the \(j\)th standard coordinate vector \(\mathbf{e}_j\) represents \(\mathbf{b}_j\) in basis \(\mathcal{B}\), and multiplying the new matrix by \(\mathbf{e}_j\) selects its \(j\)th column.

Proposition: Two \(n\times n\) matrices define the same action on every coordinate vector if and only if their columns agree. In particular, to check that two matrices give the same linear map, it is enough to check their actions on \(\mathbf{e}_1,\dots,\mathbf{e}_n\).

Proof. If two matrices have the same action on every vector, they have the same action on each \(\mathbf{e}_j\). Multiplication by \(\mathbf{e}_j\) selects column \(j\), so their columns agree. Conversely, suppose their columns agree. Every \(\mathbf{x}\in\mathbb{R}^n\) can be written \(\mathbf{x}=\sum_{j=1}^n x_j\mathbf{e}_j\). By linearity, each matrix sends \(\mathbf{x}\) to the sum of its \(j\)th column multiplied by \(x_j\). Since the columns agree, these sums agree for every \(\mathbf{x}\). \(\square\)

A Reliable Hand Calculation

For a small explicit problem, compute the inverse first, then multiply \(\mathbf{A}\mathbf{P}\), and finally multiply on the left by \(\mathbf{P}^{-1}\). If the inverse is not immediately apparent, row-reduce \([\mathbf{P}\mid\mathbf{I}_n]\): each row operation applied to the whole augmented matrix preserves the equations being solved, and a left block reduced to \(\mathbf{I}_n\) leaves \(\mathbf{P}^{-1}\) in the right block. Check an inverse by multiplying it by \(\mathbf{P}\), and check the transformed matrix by applying both descriptions of the operator to the coordinate vectors.

Worked Example: A Two-Dimensional Change of Basis

Let \(\mathbf{A}=\begin{bmatrix}1&2\\0&3\end{bmatrix}\) and let the columns of \(\mathbf{P}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\) define the new basis. Compute \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\).

The candidate inverse is \(\mathbf{P}^{-1}=\begin{bmatrix}1&-1\\0&1\end{bmatrix}\). Check both products:

$$ \mathbf{P}\mathbf{P}^{-1} = \begin{bmatrix}1&1\\0&1\end{bmatrix} \begin{bmatrix}1&-1\\0&1\end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}, \qquad \mathbf{P}^{-1}\mathbf{P} = \begin{bmatrix}1&-1\\0&1\end{bmatrix} \begin{bmatrix}1&1\\0&1\end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}. $$

Now multiply in the specified order. First,

$$ \mathbf{A}\mathbf{P} = \begin{bmatrix}1&2\\0&3\end{bmatrix} \begin{bmatrix}1&1\\0&1\end{bmatrix} = \begin{bmatrix}1&3\\0&3\end{bmatrix}. $$

Then,

$$ \mathbf{P}^{-1}\mathbf{A}\mathbf{P} = \begin{bmatrix}1&-1\\0&1\end{bmatrix} \begin{bmatrix}1&3\\0&3\end{bmatrix} = \begin{bmatrix}1&0\\0&3\end{bmatrix}. $$

Check the action on both coordinate vectors. For \(\mathbf{e}_1\), the new-basis route gives \(\mathbf{P}\mathbf{e}_1=(1,0)^{\top}\), then \(\mathbf{A}\mathbf{P}\mathbf{e}_1=(1,0)^{\top}\), then \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\mathbf{e}_1=(1,0)^{\top}\). The computed matrix also gives \(\begin{bmatrix}1&0\\0&3\end{bmatrix}\mathbf{e}_1=(1,0)^{\top}\). For \(\mathbf{e}_2\), the route gives \(\mathbf{P}\mathbf{e}_2=(1,1)^{\top}\), \(\mathbf{A}\mathbf{P}\mathbf{e}_2=(3,3)^{\top}\), and \(\mathbf{P}^{-1}(3,3)^{\top}=(0,3)^{\top}\). The computed matrix gives \(\begin{bmatrix}1&0\\0&3\end{bmatrix}\mathbf{e}_2=(0,3)^{\top}\). Both columns check.

Using Row Reduction and Checking Every Column

Worked Example: A Three-Dimensional Transformation

Take \(\mathbf{A}=\begin{bmatrix}1&0&0\\0&2&0\\0&0&3\end{bmatrix}\) and \(\mathbf{P}=\begin{bmatrix}1&1&0\\0&1&1\\0&0&1\end{bmatrix}\). Find the new matrix, reducing an augmented matrix to obtain the inverse.

Starting with \([\mathbf{P}\mid\mathbf{I}_3]\), apply \(R_1\to R_1-R_2\), then \(R_2\to R_2-R_3\):

$$ \left[\begin{array}{ccc|ccc} 1&1&0&1&0&0\\ 0&1&1&0&1&0\\ 0&0&1&0&0&1 \end{array}\right] \sim \left[\begin{array}{ccc|ccc} 1&0&-1&1&-1&0\\ 0&1&0&0&1&-1\\ 0&0&1&0&0&1 \end{array}\right] \sim \left[\begin{array}{ccc|ccc} 1&0&0&1&-1&1\\ 0&1&0&0&1&-1\\ 0&0&1&0&0&1 \end{array}\right]. $$

Thus \(\mathbf{P}^{-1}=\begin{bmatrix}1&-1&1\\0&1&-1\\0&0&1\end{bmatrix}\). The inverse check in both orders is

$$ \mathbf{P}\mathbf{P}^{-1} = \begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix}, \qquad \mathbf{P}^{-1}\mathbf{P} = \begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix}. $$

Compute the first product in the similarity transform:

$$ \mathbf{A}\mathbf{P} = \begin{bmatrix}1&1&0\\0&2&2\\0&0&3\end{bmatrix}. $$

Multiplying on the left by the inverse gives

$$ \mathbf{P}^{-1}\mathbf{A}\mathbf{P} = \begin{bmatrix}1&-1&1\\0&1&-1\\0&0&1\end{bmatrix} \begin{bmatrix}1&1&0\\0&2&2\\0&0&3\end{bmatrix} = \begin{bmatrix}1&-1&1\\0&2&-1\\0&0&3\end{bmatrix}. $$

For \(\mathbf{e}_1\), the sequence \(\mathbf{P}\mathbf{e}_1\), \(\mathbf{A}\mathbf{P}\mathbf{e}_1\), \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\mathbf{e}_1\) is \((1,0,0)^{\top}\), \((1,0,0)^{\top}\), \((1,0,0)^{\top}\), matching column 1. For \(\mathbf{e}_2\), it is \((1,1,0)^{\top}\), \((1,2,0)^{\top}\), \((-1,2,0)^{\top}\), matching column 2. For \(\mathbf{e}_3\), it is \((0,1,1)^{\top}\), \((0,2,3)^{\top}\), \((1,-1,3)^{\top}\), matching column 3. Thus each computed column has the required coordinate interpretation.

A Change of Basis Without Triangular Matrices

Worked Example: A Non-Triangular Basis Matrix

Let \(\mathbf{A}=\begin{bmatrix}2&1\\1&2\end{bmatrix}\) and \(\mathbf{P}=\begin{bmatrix}1&2\\1&1\end{bmatrix}\). Compute the similarity transform using row reduction.

Reduce the augmented matrix. First apply \(R_2\to R_2-R_1\), then \(R_2\to -R_2\), then \(R_1\to R_1-2R_2\):

$$ \left[\begin{array}{cc|cc} 1&2&1&0\\ 1&1&0&1 \end{array}\right] \sim \left[\begin{array}{cc|cc} 1&2&1&0\\ 0&-1&-1&1 \end{array}\right] \sim \left[\begin{array}{cc|cc} 1&2&1&0\\ 0&1&1&-1 \end{array}\right] \sim \left[\begin{array}{cc|cc} 1&0&-1&2\\ 0&1&1&-1 \end{array}\right]. $$

Hence \(\mathbf{P}^{-1}=\begin{bmatrix}-1&2\\1&-1\end{bmatrix}\). Multiplying back verifies this: \(\mathbf{P}\mathbf{P}^{-1}=\begin{bmatrix}1&0\\0&1\end{bmatrix}\) and \(\mathbf{P}^{-1}\mathbf{P}=\begin{bmatrix}1&0\\0&1\end{bmatrix}\). Now calculate

$$ \mathbf{A}\mathbf{P} = \begin{bmatrix}2&1\\1&2\end{bmatrix} \begin{bmatrix}1&2\\1&1\end{bmatrix} = \begin{bmatrix}3&5\\3&4\end{bmatrix}, \qquad \mathbf{P}^{-1}\mathbf{A}\mathbf{P} = \begin{bmatrix}-1&2\\1&-1\end{bmatrix} \begin{bmatrix}3&5\\3&4\end{bmatrix} = \begin{bmatrix}3&3\\0&1\end{bmatrix}. $$

For \(\mathbf{e}_1\), the sequence through standard coordinates is \(\mathbf{P}\mathbf{e}_1=(1,1)^{\top}\), \(\mathbf{A}(1,1)^{\top}=(3,3)^{\top}\), and \(\mathbf{P}^{-1}(3,3)^{\top}=(3,0)^{\top}\). This matches the first column. For \(\mathbf{e}_2\), it is \((2,1)^{\top}\), \((5,4)^{\top}\), and \((3,1)^{\top}\), matching the second column. The two coordinate-vector checks verify the full matrix action by the proposition.

Common Mistakes and a Practical Check

Reversing the order is not a harmless change. In the first example, the correct result is \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}=\begin{bmatrix}1&0\\0&3\end{bmatrix}\). A wrong calculation using \(\mathbf{P}\mathbf{A}\mathbf{P}^{-1}\) gives \(\begin{bmatrix}1&4\\0&3\end{bmatrix}\): indeed, \(\mathbf{P}\mathbf{A}=\begin{bmatrix}1&5\\0&3\end{bmatrix}\), and \(\begin{bmatrix}1&5\\0&3\end{bmatrix}\begin{bmatrix}1&-1\\0&1\end{bmatrix}=\begin{bmatrix}1&4\\0&3\end{bmatrix}\). This is not the matrix for the stated coordinate conversion. Check the sequence: convert new coordinates to standard coordinates on the right, apply \(\mathbf{A}\), then convert back on the left.

Also distinguish the basis vectors from their coordinates: the columns of \(\mathbf{P}\) are vectors in standard coordinates, while an input \(\mathbf{x}\) to \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\) is a coordinate vector relative to those columns. The columns of the transformed matrix describe the images of the basis vectors, expressed in that same basis. Checking \(\mathbf{P}^{-1}\mathbf{P}=\mathbf{I}\) and checking each transformed column against the coordinate-conversion sequence catch many arithmetic and interpretation errors.

Check Your Understanding

For each problem, keep track of which vectors are standard coordinates and which are coordinates in the chosen basis.

  1. For \(\mathbf{A}=\begin{bmatrix}2&0\\0&1\end{bmatrix}\) and \(\mathbf{P}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\), compute \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\) and check both columns by applying the operator to the corresponding basis vectors.
  2. For \(\mathbf{P}=\begin{bmatrix}1&2\\1&1\end{bmatrix}\), use an augmented matrix to find \(\mathbf{P}^{-1}\), then verify both inverse products.
  3. Explain why multiplying a matrix by \(\mathbf{e}_j\) selects its \(j\)th column.
  4. In the formula \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\), describe the role of each factor in the order it acts on an input coordinate vector.
  5. Give a concrete reason why \(\mathbf{P}\mathbf{A}\mathbf{P}^{-1}\) is not the coordinate-change formula used here.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon