Tutorials › Linear Algebra › Ruling Out Similarity with Invariants

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

Ruling Out Similarity with Invariants

Use the quickest unequal invariant to prove that two square matrices are not similar.

Intermediate 10 min read

What You'll Learn

  • State the necessary invariant conditions for two matrices to be similar.
  • Use rank comparisons to rule out similarity.
  • Compare traces and determinants when they give a decisive test.
  • Compute characteristic polynomials to distinguish matrices when simpler tests do not decide.
  • Choose an efficient order for testing specific matrix pairs.
  • Avoid confusing the number of nonzero entries with rank.

Similarity and Necessary Tests

Similarity asks whether two square matrices describe the same linear transformation in different bases. That is a strong relationship, so similar matrices must share several quantities: rank, determinant, trace, and characteristic polynomial. To prove that two matrices are not similar, it is enough to find one of these quantities that differs. The practical question is therefore not just how to compute an invariant, but which one is quickest and decisive for the pair at hand.

Throughout, matrices are over \(\mathbb{R}\). Two \(n\times n\) matrices \(\mathbf{A}\) and \(\mathbf{B}\) are similar if there is an invertible \(n\times n\) matrix \(\mathbf{P}\) such that \(\mathbf{A}=\mathbf{P}^{-1}\mathbf{B}\mathbf{P}\). The rank of a matrix is the dimension of its column space; its trace is the sum of its diagonal entries. Its characteristic polynomial, using the course convention, is \(p_{\mathbf{A}}(\lambda)=\det(\mathbf{A}-\lambda\mathbf{I}_n)\).

Theorem (Necessary conditions for similarity): If \(\mathbf{A}\) and \(\mathbf{B}\) are similar \(n\times n\) real matrices, then \(\operatorname{rank}\mathbf{A}=\operatorname{rank}\mathbf{B}\), \(\det\mathbf{A}=\det\mathbf{B}\), \(\operatorname{tr}\mathbf{A}=\operatorname{tr}\mathbf{B}\), and \(p_{\mathbf{A}}(\lambda)=p_{\mathbf{B}}(\lambda)\).

Proof. Suppose \(\mathbf{A}=\mathbf{P}^{-1}\mathbf{B}\mathbf{P}\) for an invertible \(\mathbf{P}\). Since \(\mathbf{P}\) maps \(\mathbb{R}^n\) onto \(\mathbb{R}^n\), the columns of \(\mathbf{B}\mathbf{P}\) span the same space as the columns of \(\mathbf{B}\): each column of \(\mathbf{B}\mathbf{P}\) is a combination of columns of \(\mathbf{B}\), and every column of \(\mathbf{B}\) is a combination of columns of \(\mathbf{B}\mathbf{P}\) because \(\mathbf{P}\) is invertible. Left multiplication by \(\mathbf{P}^{-1}\) applies an invertible linear map to that column space, which preserves its dimension. Thus \(\operatorname{rank}\mathbf{A}=\operatorname{rank}\mathbf{B}\). By multiplicativity of determinants, \(\det\mathbf{A}=\det(\mathbf{P}^{-1})\det(\mathbf{B})\det(\mathbf{P})=\det\mathbf{B}\). For any same-sized square matrices \(\mathbf{X},\mathbf{Y}\), the entry formula for trace gives \(\operatorname{tr}(\mathbf{X}\mathbf{Y})=\sum_i\sum_j x_{ij}y_{ji}=\sum_j\sum_i y_{ji}x_{ij}=\operatorname{tr}(\mathbf{Y}\mathbf{X})\). Therefore \(\operatorname{tr}\mathbf{A}=\operatorname{tr}(\mathbf{P}^{-1}\mathbf{B}\mathbf{P})=\operatorname{tr}(\mathbf{B}\mathbf{P}\mathbf{P}^{-1})=\operatorname{tr}\mathbf{B}\). Finally, for every \(\lambda\), \(\mathbf{A}-\lambda\mathbf{I}_n=\mathbf{P}^{-1}(\mathbf{B}-\lambda\mathbf{I}_n)\mathbf{P}\), so the same determinant argument gives \(p_{\mathbf{A}}(\lambda)=p_{\mathbf{B}}(\lambda)\). \(\square\)

Corollary (A mismatch rules out similarity): If two same-sized square matrices have unequal ranks, determinants, traces, or characteristic polynomials, then they are not similar.

Proof. If the matrices were similar, the theorem would force equality of each listed invariant. A difference in any one of them contradicts that necessary condition, so the matrices cannot be similar. \(\square\)

These conditions are one-way tests: a mismatch rules out similarity. For an efficient comparison, check a quantity that is easy to calculate first. Rank can be read from row reduction; trace is a diagonal sum; determinant can be convenient for small matrices. If those checks do not distinguish the pair, compare characteristic polynomials. There is no need to compute every invariant once one unequal value has settled the question.

Start with Rank When Row Reduction Is Simple

Worked Example: Different Ranks

Decide whether \(\mathbf{A}=\begin{bmatrix}1&0\\0&0\end{bmatrix}\) and \(\mathbf{B}=\begin{bmatrix}1&0\\0&1\end{bmatrix}\) are similar.

For \(\mathbf{A}\), the matrix is already in reduced row echelon form (RREF), with one pivot. For \(\mathbf{B}\), it is also already in RREF, with two pivots:

$$ \mathbf{A}= \begin{bmatrix}1&0\\0&0\end{bmatrix}, \qquad \mathbf{B}= \begin{bmatrix}1&0\\0&1\end{bmatrix}. $$

Thus \(\operatorname{rank}\mathbf{A}=1\) and \(\operatorname{rank}\mathbf{B}=2\). The ranks differ, so the corollary rules out similarity.

Check: the columns of \(\mathbf{A}\) are \((1,0)^{\top}\) and \((0,0)^{\top}\), which span a one-dimensional space. The columns of \(\mathbf{B}\) are the two standard basis vectors of \(\mathbb{R}^2\), which span \(\mathbb{R}^2\). These column spaces confirm the ranks used in the comparison.

Rank is often a useful first test when the matrices visibly have different numbers of pivots. It is also robust for singular matrices: even if both determinants are zero, their ranks can differ. But if the ranks agree, move to another invariant rather than treating the rank calculation as a conclusion about similarity.

Trace and Determinant Can Decide Quickly

Worked Example: Equal Rank and Determinant, Different Trace

Compare \(\mathbf{A}=\begin{bmatrix}1&0\\0&0\end{bmatrix}\) and \(\mathbf{B}=\begin{bmatrix}2&0\\0&0\end{bmatrix}\).

Each matrix has one nonzero column, so each has rank \(1\). Their determinants are both zero: \(\det\mathbf{A}=1\cdot0-0\cdot0=0\) and \(\det\mathbf{B}=2\cdot0-0\cdot0=0\). The traces, however, are \(\operatorname{tr}\mathbf{A}=1+0=1\) and \(\operatorname{tr}\mathbf{B}=2+0=2\). The unequal traces show that the matrices are not similar.

Check: this conclusion depends on the trace comparison, not on rank or determinant: those two invariants match, while \(1\ne2\). A single unequal invariant is enough.

Worked Example: Equal Rank and Trace, Different Determinant

Decide whether \(\mathbf{A}=\begin{bmatrix}1&0&0\\0&1&0\\0&0&4\end{bmatrix}\) and \(\mathbf{B}=\begin{bmatrix}1&0&0\\0&2&0\\0&0&3\end{bmatrix}\) are similar.

Both are diagonal with three nonzero diagonal entries, so both have rank \(3\). Their traces agree: \(\operatorname{tr}\mathbf{A}=1+1+4=6\) and \(\operatorname{tr}\mathbf{B}=1+2+3=6\). For a diagonal matrix, its determinant is the product of its diagonal entries. Hence \(\det\mathbf{A}=1\cdot1\cdot4=4\), whereas \(\det\mathbf{B}=1\cdot2\cdot3=6\). Since \(4\ne6\), the matrices are not similar.

Check: the determinant calculations use all three diagonal entries, and the resulting values differ. The rank and trace comparisons do not decide this pair; the determinant does.

For diagonal matrices, rank, trace, and determinant are particularly quick to compute: rank counts the nonzero diagonal entries, trace sums them, and determinant multiplies them. For matrices that are not diagonal, trace is still just the diagonal sum, while rank can be found by row reduction and determinant by a suitable determinant calculation. Use only as much computation as the first decisive comparison requires.

Use the Characteristic Polynomial When Needed

The characteristic polynomial packages more information than a single rank, trace, or determinant value. To show two characteristic polynomials differ, it is enough to find one value of \(\lambda\) at which their evaluations differ. For diagonal matrices, \(\mathbf{A}-\lambda\mathbf{I}_n\) is diagonal, so its determinant is the product of its diagonal entries. This can make the comparison direct.

Worked Example: The Characteristic Polynomials Differ

Compare \(\mathbf{A}=\begin{bmatrix}1&0&0\\0&1&0\\0&0&0\end{bmatrix}\) and \(\mathbf{B}=\begin{bmatrix}3&0&0\\0&-1&0\\0&0&0\end{bmatrix}\).

Both matrices have rank \(2\), trace \(2\), and determinant \(0\). Calculate their characteristic polynomials using the convention \(p_{\mathbf{A}}(\lambda)=\det(\mathbf{A}-\lambda\mathbf{I}_3)\):

$$ p_{\mathbf{A}}(\lambda) =(1-\lambda)(1-\lambda)(-\lambda) =-\lambda(1-\lambda)^2, $$

and

$$ p_{\mathbf{B}}(\lambda) =(3-\lambda)(-1-\lambda)(-\lambda). $$

Evaluate both at \(\lambda=1\). The first gives \(p_{\mathbf{A}}(1)=-(1)(1-1)^2=0\). The second gives \(p_{\mathbf{B}}(1)=(3-1)(-1-1)(-1)=2(-2)(-1)=4\). Since the values differ, the polynomials are different, and the matrices are not similar.

Check: each polynomial was obtained by subtracting \(\lambda\) from each diagonal entry and multiplying the resulting entries. The evaluation \(0\ne4\) confirms the polynomial mismatch without needing to expand either polynomial.

When using this test, keep the sign convention consistent. Here the polynomial is \(\det(\mathbf{A}-\lambda\mathbf{I}_n)\), not \(\det(\lambda\mathbf{I}_n-\mathbf{A})\). Those expressions can differ by an overall sign depending on \(n\). A sign change applied consistently to both matrices would not change whether their polynomials are equal, but mixing conventions can create a false comparison.

A Practical Order for the Tests

1
Confirm the matrices have the same size.
Similarity, as defined here, compares square matrices of the same order. If the sizes differ, they are not similar under this definition.
2
Compare an easy invariant.
Try rank if pivots are apparent, then trace if the diagonal entries are easy to add. Either mismatch immediately rules out similarity.
3
Use the determinant when it is convenient.
For diagonal or triangular matrices the determinant is the product of the diagonal entries. If the values differ, stop; if they agree, continue only if needed.
4
Compare characteristic polynomials if simpler tests do not decide.
Compute them using the same convention, and show they differ either by expanding or by finding a value of \(\lambda\) where their evaluations differ.

This order is a practical guide, not a theorem requiring that rank always be tested before trace. If a trace comparison takes one line and a rank calculation would take several row operations, compare traces first. The proof of nonsimilarity needs one correct mismatch, not a complete inventory of the pair's invariants.

Common Pitfall: Counting Nonzero Entries as Rank

A matrix's rank is not the number of its nonzero entries. For example, consider \(\mathbf{C}=\begin{bmatrix}1&1\\1&1\end{bmatrix}\) and \(\mathbf{D}=\begin{bmatrix}1&0\\0&1\end{bmatrix}\). A wrong calculation counts four nonzero entries in \(\mathbf{C}\), calls its rank \(4\), and compares that with the rank \(2\) of \(\mathbf{D}\). This is incorrect: rank is the number of pivots in RREF, not the number of nonzero entries. Subtracting row 1 from row 2 gives

$$ \begin{bmatrix}1&1\\1&1\end{bmatrix} \sim \begin{bmatrix}1&1\\0&0\end{bmatrix}. $$

Thus \(\operatorname{rank}\mathbf{C}=1\), while \(\mathbf{D}\) has two pivots and rank \(2\). The ranks differ, so \(\mathbf{C}\) and \(\mathbf{D}\) are not similar. As a check, the columns of \(\mathbf{C}\) are identical and span a one-dimensional space; the columns of \(\mathbf{D}\) are independent and span \(\mathbb{R}^2\).

More generally, a failed comparison is not itself a proof either way: if one invariant matches, that particular test has not ruled out similarity. To prove nonsimilarity using these tools, identify a specific invariant, compute it correctly for both matrices, and state the unequal values explicitly.

Check Your Understanding

For each question, identify what calculation would be enough to settle the comparison.

  1. Why does a rank mismatch between two same-sized square matrices rule out similarity?
  2. Find the ranks and traces of \(\begin{bmatrix}2&0\\0&0\end{bmatrix}\) and \(\begin{bmatrix}1&0\\0&1\end{bmatrix}\). Which unequal invariant gives a decisive test?
  3. Compute the determinant and trace of \(\begin{bmatrix}1&0\\0&5\end{bmatrix}\) and \(\begin{bmatrix}2&0\\0&4\end{bmatrix}\). Do either of these invariants rule out similarity?
  4. For \(\mathbf{A}=\begin{bmatrix}2&0\\0&0\end{bmatrix}\), compute \(p_{\mathbf{A}}(1)\) using \(p_{\mathbf{A}}(\lambda)=\det(\mathbf{A}-\lambda\mathbf{I}_2)\).
  5. Explain why four nonzero entries do not necessarily imply rank \(4\), using \(\begin{bmatrix}1&1\\1&1\end{bmatrix}\) as an example.

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