Diagonalization and Similarity
Diagonalization changes coordinates so that a linear transformation becomes simple. A diagonal matrix acts independently on coordinate axes; a diagonalizable matrix acts independently along eigenvector directions. Similarity formalizes the idea that two matrices can describe the same linear transformation in different bases.
This is where eigenvectors become computationally powerful. If a matrix can be written as , then powers, recurrences, and many qualitative questions reduce to the diagonal entries of . The matrix changes from eigenvector coordinates to standard coordinates, while changes back.
Definitions
Square matrices and are similar if there is an invertible matrix such that
A matrix is diagonalizable if it is similar to a diagonal matrix:
Equivalently,
The columns of are usually chosen to be eigenvectors of , and the corresponding diagonal entries of are their eigenvalues.
The algebraic multiplicity of an eigenvalue is its multiplicity as a root of the characteristic polynomial. The geometric multiplicity is the dimension of its eigenspace.
Similarity is an equivalence relation: is similar to itself, similarity is symmetric, and similarity is transitive. Similar matrices represent the same linear map in different bases.
Key results
An matrix is diagonalizable if and only if it has linearly independent eigenvectors. If and , then
Multiplying by gives .
If an matrix has distinct eigenvalues, then it is diagonalizable, because eigenvectors corresponding to distinct eigenvalues are linearly independent. The converse is false: a diagonalizable matrix can have repeated eigenvalues as long as the eigenspaces are large enough.
For each eigenvalue,
A matrix is diagonalizable exactly when the sum of the geometric multiplicities of its eigenvalues is .
If , then powers are easy:
This works because the middle factors cancel:
The same cancellation repeats for higher powers.
Similarity preserves the characteristic polynomial. If , then
Using multiplicativity of determinants gives
because . Therefore similar matrices have the same eigenvalues, determinant, and trace. They may look different entry by entry, but their coordinate-independent spectral information is the same.
Diagonalization is best understood as an eigenbasis test. The standard basis vectors are ideal for a diagonal matrix because each one is an eigenvector. A diagonalizable matrix is one whose action becomes diagonal after choosing a better basis. In that basis, the first coordinate evolves independently from the second, the second independently from the third, and so on. Coupled equations become uncoupled scalar equations.
Not every failure of diagonalization is caused by missing eigenvalues. A matrix can have all eigenvalues real and still lack enough independent eigenvectors. The matrix
has only the eigenvalue , and its eigenspace is one-dimensional. Since a matrix needs two independent eigenvectors to be diagonalizable, it fails the test. This kind of example is the reason geometric multiplicity matters.
When diagonalization is available, it is especially effective for discrete dynamical systems. If and , then
The entries of are powers of eigenvalues. Large absolute eigenvalues dominate long-term behavior, eigenvalues with absolute value less than one decay, and negative eigenvalues alternate signs. This is the bridge from algebraic factorization to qualitative dynamics.
Visual
| Property | Similar matrices | Diagonalizable matrices |
|---|---|---|
| Definition | diagonal | |
| Preserves eigenvalues | yes | yes |
| Preserves determinant and trace | yes | yes |
| Requires eigenbasis | no | yes |
| Main use | change coordinates | compute powers and decouple dynamics |
Worked example 1: Diagonalize a 2 by 2 matrix
Problem: diagonalize
Step 1: use the eigenpairs from the eigenvalue computation:
Step 2: build from the eigenvectors and from the matching eigenvalues:
Step 3: compute . Since ,
Step 4: verify . First compute
Then
Checked answer: .
Worked example 2: Use diagonalization to compute a power
Problem: compute for the same matrix.
Step 1: use
Step 2: cube the diagonal matrix entrywise:
Step 3: multiply.
Now
Step 4: check by repeated multiplication. , and
Checked answer: .
Code
import numpy as np
A = np.array([[4, 1],
[2, 3]], dtype=float)
values, P = np.linalg.eig(A)
D = np.diag(values)
A_rebuilt = P @ D @ np.linalg.inv(P)
print(values)
print(A_rebuilt)
print(np.linalg.matrix_power(A, 3))
print(P @ np.linalg.matrix_power(D, 3) @ np.linalg.inv(P))
Numerical eigensolvers may return eigenvectors scaled differently or ordered differently. The diagonalization is valid as long as the columns of match the corresponding diagonal entries of .
Common pitfalls
- Putting eigenvalues in in an order that does not match the eigenvectors in .
- Assuming a repeated eigenvalue automatically prevents diagonalization. It depends on eigenspace dimension.
- Assuming every matrix is diagonalizable. Some matrices do not have enough independent eigenvectors.
- Confusing with . The basis-change order matters.
- Forgetting that similar matrices are the same size.
- Computing powers as . The cancellation gives , not that expression.
The most important diagnostic for diagonalization is the eigenvector count. After finding each eigenspace, add their dimensions. If the total is for an matrix, the matrix is diagonalizable. If the total is less than , it is not. Distinct eigenvalues are a convenient sufficient condition, but they are not the definition.
When constructing , order is bookkeeping. If the first column of is an eigenvector for , then the first diagonal entry of must be . If the second column is an eigenvector for , the second diagonal entry must be . Many incorrect diagonalizations come from correct eigenvectors and correct eigenvalues placed in mismatched order.
Similarity should be read as a change of coordinates, not as an arbitrary algebraic trick. The matrix converts a standard-coordinate input into coordinates in the new basis. The diagonal matrix performs the simple action in that basis. The matrix converts the result back. This interpretation makes the formula natural.
Diagonalization is powerful but not always numerically ideal. If the eigenvector matrix is poorly conditioned, computations using may amplify rounding error. Orthogonal diagonalization for symmetric matrices avoids this issue because orthogonal matrices preserve lengths and have condition number in the Euclidean norm. This is one reason symmetric eigenvalue problems are especially well behaved.
A diagonal form also makes invariant subspaces visible. Each coordinate axis in the diagonal basis is preserved by the transformation. If several eigenvectors correspond to the same eigenvalue, every vector in their eigenspace is preserved as a direction up to the same scaling. This explains why repeated eigenvalues can still be harmless when their eigenspaces are large enough.
Similarity is not the same as row equivalence. Row-equivalent matrices arise from left multiplication by elementary matrices and generally do not have the same eigenvalues. Similar matrices involve both and , representing a change of basis in the same space, and they preserve spectral data. Confusing these two equivalence notions leads to incorrect eigenvalue arguments.
When a matrix is not diagonalizable, one can still study it through other forms, such as Jordan form in more advanced courses or Schur form in numerical work. The introductory lesson is simpler: diagonalization is a powerful special case, and the test is the existence of an eigenbasis.
A good final verification is to multiply and . If the columns of are correctly matched with the diagonal entries of , these two products are equal. This avoids computing just to check the eigenvector pairing.
This check catches most ordering mistakes.