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)\).
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\)
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:
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)\):
and
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
Similarity, as defined here, compares square matrices of the same order. If the sizes differ, they are not similar under this definition.
Try rank if pivots are apparent, then trace if the diagonal entries are easy to add. Either mismatch immediately rules out similarity.
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.
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
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.
- Why does a rank mismatch between two same-sized square matrices rule out similarity?
- 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?
- 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?
- 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)\).
- Explain why four nonzero entries do not necessarily imply rank \(4\), using \(\begin{bmatrix}1&1\\1&1\end{bmatrix}\) as an example.