Diagonalizable matrix

In linear algebra, a square matrix ${\displaystyle A}$ is called diagonalizable or nondefective if it is similar to a diagonal matrix, i.e., if there exists an invertible matrix ${\displaystyle P}$ such that ${\displaystyle P^{-1}AP}$ is a diagonal matrix. If ${\displaystyle V}$ is a finite-dimensional vector space, then a linear map ${\displaystyle T:V\mapsto V}$ is called diagonalizable if there exists an ordered basis of ${\displaystyle V}$ with respect to which ${\displaystyle T}$ is represented by a diagonal matrix. Diagonalization is the process of finding a corresponding diagonal matrix for a diagonalizable matrix or linear map.[1] A square matrix that is not diagonalizable is called defective.

Diagonalizable matrices and maps are of interest because diagonal matrices are especially easy to handle; once their eigenvalues and eigenvectors are known, one can raise a diagonal matrix to a power by simply raising the diagonal entries to that same power, and the determinant of a diagonal matrix is simply the product of all diagonal entries. Geometrically, a diagonalizable matrix is an inhomogeneous dilation (or anisotropic scaling) — it scales the space, as does a homogeneous dilation, but by a different factor in each direction, determined by the scale factors on each axis (diagonal entries).

Definition

A square ${\displaystyle n\times n}$ matrix ${\displaystyle A}$ over a field ${\displaystyle F}$ is called diagonalizable or nondefective if there exists an invertible matrix ${\displaystyle P}$ such that ${\displaystyle P^{-1}AP}$ is a diagonal matrix. Formally,

${\displaystyle A\in F^{n\times n}{\text{ diagonalizable}}\iff \exists \,P,P^{-1}\in F^{n\times n}:\;P^{-1}AP{\text{ diagonal}}}$

Characterization

The fundamental fact about diagonalizable maps and matrices is expressed by the following:

• An ${\displaystyle n\times n}$ matrix ${\displaystyle A}$ over a field ${\displaystyle F}$ is diagonalizable if and only if the sum of the dimensions of its eigenspaces is equal to ${\displaystyle n}$, which is the case if and only if there exists a basis of ${\displaystyle F^{n}}$ consisting of eigenvectors of ${\displaystyle A}$. If such a basis has been found, one can form the matrix ${\displaystyle P}$ having these basis vectors as columns, and ${\displaystyle P^{-1}AP}$ will be a diagonal matrix. The diagonal entries of this matrix are the eigenvalues of ${\displaystyle A}$. The matrix ${\displaystyle P}$ is also known as a modal matrix for ${\displaystyle A}$.
• A linear map ${\displaystyle T:V\mapsto V}$ is diagonalizable if and only if the sum of the dimensions of its eigenspaces is equal to ${\displaystyle \operatorname {dim} (V)}$, which is the case if and only if there exists a basis of ${\displaystyle V}$ consisting of eigenvectors of ${\displaystyle T}$. With respect to such a basis, ${\displaystyle T}$ will be represented by a diagonal matrix. The diagonal entries of this matrix are the eigenvalues of ${\displaystyle T}$.

Another characterization: A matrix or linear map is diagonalizable over the field ${\displaystyle F}$ if and only if its minimal polynomial is a product of distinct linear factors over ${\displaystyle F}$. (Put in another way, a matrix is diagonalizable if and only if all of its elementary divisors are linear.)

The following sufficient (but not necessary) condition is often useful.

• An ${\displaystyle n\times n}$ matrix ${\displaystyle A}$ is diagonalizable over the field ${\displaystyle F}$ if it has ${\displaystyle n}$ distinct eigenvalues in ${\displaystyle F}$, i.e. if its characteristic polynomial has ${\displaystyle n}$ distinct roots in ${\displaystyle F}$; however, the converse may be false. Consider
${\displaystyle {\begin{bmatrix}-1&3&-1\\-3&5&-1\\-3&3&1\end{bmatrix}},}$

which has eigenvalues 1, 2, 2 (not all distinct) and is diagonalizable with diagonal form (similar to ${\displaystyle A}$)

${\displaystyle {\begin{bmatrix}1&0&0\\0&2&0\\0&0&2\end{bmatrix}}}$

and change of basis matrix ${\displaystyle P}$

${\displaystyle {\begin{bmatrix}1&1&-1\\1&1&0\\1&0&3\end{bmatrix}}.}$
The converse fails when ${\displaystyle A}$ has an eigenspace of dimension higher than 1. In this example, the eigenspace of ${\displaystyle A}$ associated with the eigenvalue 2 has dimension 2.
• A linear map ${\displaystyle T:V\mapsto V}$ with ${\displaystyle n=\operatorname {dim} (V)}$ is diagonalizable if it has ${\displaystyle n}$ distinct eigenvalues, i.e. if its characteristic polynomial has ${\displaystyle n}$ distinct roots in ${\displaystyle F}$.

Let ${\displaystyle A}$ be a matrix over ${\displaystyle F}$. If ${\displaystyle A}$ is diagonalizable, then so is any power of it. Conversely, if ${\displaystyle A}$ is invertible, ${\displaystyle F}$ is algebraically closed, and ${\displaystyle A^{n}}$ is diagonalizable for some ${\displaystyle n}$ that is not an integer multiple of the characteristic of ${\displaystyle F}$, then ${\displaystyle A}$ is diagonalizable. Proof: If ${\displaystyle A^{n}}$ is diagonalizable, then ${\displaystyle A}$ is annihilated by some polynomial ${\displaystyle \left(x^{n}-\lambda _{1}\right)\cdots \left(x^{n}-\lambda _{k}\right)}$, which has no multiple root (since ${\displaystyle \lambda _{j}\neq 0}$) and is divided by the minimal polynomial of ${\displaystyle A}$.

As a rule of thumb, over ${\displaystyle \mathbb {C} }$ almost every matrix is diagonalizable. More precisely: the set of complex ${\displaystyle n\times n}$ matrices that are not diagonalizable over ${\displaystyle \mathbb {C} }$, considered as a subset of ${\displaystyle \mathbb {C} ^{n\times n}}$, has Lebesgue measure zero. One can also say that the diagonalizable matrices form a dense subset with respect to the Zariski topology: the complement lies inside the set where the discriminant of the characteristic polynomial vanishes, which is a hypersurface. From that follows also density in the usual (strong) topology given by a norm. The same is not true over ${\displaystyle \mathbb {R} }$.

The Jordan–Chevalley decomposition expresses an operator as the sum of its semisimple (i.e., diagonalizable) part and its nilpotent part. Hence, a matrix is diagonalizable if and only if its nilpotent part is zero. Put in another way, a matrix is diagonalizable if each block in its Jordan form has no nilpotent part; i.e., each "block" is a one-by-one matrix.

Diagonalization

If a matrix ${\displaystyle A}$ can be diagonalized, that is,

${\displaystyle P^{-1}AP={\begin{pmatrix}\lambda _{1}&0&\dots &0\\0&\lambda _{2}&\dots &0\\\vdots &\vdots &\ddots &\vdots \\0&0&\dots &\lambda _{n}\end{pmatrix}},}$

then:

${\displaystyle AP=P{\begin{pmatrix}\lambda _{1}&0&\dots &0\\0&\lambda _{2}&\dots &0\\\vdots &\vdots &\ddots &\vdots \\0&0&\dots &\lambda _{n}\end{pmatrix}}.}$

Writing ${\displaystyle P}$ as a block matrix of its column vectors ${\displaystyle {\vec {\alpha }}_{i}}$

${\displaystyle P={\begin{pmatrix}{\vec {\alpha }}_{1}&{\vec {\alpha }}_{2}&\cdots &{\vec {\alpha }}_{n}\end{pmatrix}},}$

the above equation can be rewritten as

${\displaystyle A{\vec {\alpha }}_{i}=\lambda _{i}{\vec {\alpha }}_{i}\qquad (i=1,2,\cdots ,n).}$

So the column vectors of ${\displaystyle P}$ are right eigenvectors of ${\displaystyle A}$, and the corresponding diagonal entry is the corresponding eigenvalue. The invertibility of ${\displaystyle P}$ also suggests that the eigenvectors are linearly independent and form a basis of ${\displaystyle F^{n}}$. This is the necessary and sufficient condition for diagonalizability and the canonical approach of diagonalization. The row vectors of ${\displaystyle P^{-1}}$ are the left eigenvectors of ${\displaystyle A}$.

When a complex matrix ${\displaystyle A}$[lower-alpha 1] is a Hermitian matrix (or a real matrix[lower-alpha 2], a symmetric matrix), eigenvectors of ${\displaystyle A}$ can be chosen to form an orthonormal basis of ${\displaystyle \mathbb {C} ^{n}}$ (or ${\displaystyle \mathbb {R} ^{n}}$ for a real matrix). Under such circumstance ${\displaystyle P}$ will be a unitary matrix (resp. orthogonal matrix) and ${\displaystyle P^{-1}}$ equals the conjugate transpose of ${\displaystyle P}$ (if real, then the transpose of ${\displaystyle P}$).

For most practical work matrices are diagonalized numerically using computer software. Many algorithms exist to accomplish this.

Simultaneous diagonalization

A set of matrices is said to be simultaneously diagonalizable if there exists a single invertible matrix ${\displaystyle P}$ such that ${\displaystyle P^{-1}AP}$ is a diagonal matrix for every ${\displaystyle A}$ in the set. The following theorem characterises simultaneously diagonalizable matrices: A set of diagonalizable matrices commutes if and only if the set is simultaneously diagonalizable.[1]:pp. 51-53

The set of all ${\displaystyle n\times n}$ diagonalizable matrices (over ${\displaystyle \mathbb {C} }$) with ${\displaystyle n>1}$ is not simultaneously diagonalizable. For instance, the matrices

${\displaystyle {\begin{bmatrix}1&0\\0&0\end{bmatrix}}\quad {\text{and}}\quad {\begin{bmatrix}1&1\\0&0\end{bmatrix}}}$

are diagonalizable but not simultaneously diagonalizable because they do not commute.

A set consists of commuting normal matrices if and only if it is simultaneously diagonalizable by a unitary matrix; that is, there exists a unitary matrix ${\displaystyle U}$ such that ${\displaystyle U^{*}AU}$ is diagonal for every ${\displaystyle A}$ in the set.

In the language of Lie theory, a set of simultaneously diagonalizable matrices generate a toral Lie algebra.

Examples

Diagonalizable matrices

• Involutions are diagonalizable over the reals (and indeed any field of characteristic not 2), with ±1 on the diagonal.
• Finite order endomorphisms are diagonalisable over ${\displaystyle \mathbb {C} }$ (or any algebraically closed field where the characteristic of the field does not divide the order of the endomorphism) with roots of unity on the diagonal. This follows since the minimal polynomial is separable, because the roots of unity are distinct.
• Projections are diagonalizable, with 0s and 1s on the diagonal.
• Real symmetric matrices are diagonalizable by orthogonal matrices; i.e., given a real symmetric matrix ${\displaystyle A}$, ${\displaystyle Q^{\mathrm {T} }AQ}$ is diagonal for some orthogonal matrix ${\displaystyle Q}$. More generally, matrices are diagonalizable by unitary matrices if and only if they are normal. In the case of the real symmetric matrix, we see that ${\displaystyle A=A^{\mathrm {T} }}$, so clearly ${\displaystyle AA^{\mathrm {T} }=A^{\mathrm {T} }A}$ holds. Examples of normal matrices are real symmetric (or skew-symmetric) matrices (e.g. covariance matrices) and Hermitian matrices (or skew-Hermitian matrices). See spectral theorems for generalizations to infinite-dimensional vector spaces.

Matrices that are not diagonalizable

In general, a rotation matrix is not diagonalizable over the reals, but all rotation matrices are diagonalizable over the complex field. Even if a matrix is not diagonalizable, it is always possible to "do the best one can", and find a matrix with the same properties consisting of eigenvalues on the leading diagonal, and either ones or zeroes on the superdiagonal – known as Jordan normal form.

Some matrices are not diagonalizable over any field, most notably nonzero nilpotent matrices. This happens more generally if the algebraic and geometric multiplicities of an eigenvalue do not coincide. For instance, consider

${\displaystyle C={\begin{bmatrix}0&1\\0&0\end{bmatrix}}.}$

This matrix is not diagonalizable: there is no matrix ${\displaystyle U}$ such that ${\displaystyle U^{-1}CU}$ is a diagonal matrix. Indeed, ${\displaystyle C}$ has one eigenvalue (namely zero) and this eigenvalue has algebraic multiplicity 2 and geometric multiplicity 1.

Some real matrices are not diagonalizable over the reals. Consider for instance the matrix

${\displaystyle B={\begin{bmatrix}0&1\\-1&0\end{bmatrix}}.}$

The matrix ${\displaystyle B}$ does not have any real eigenvalues, so there is no real matrix ${\displaystyle Q}$ such that ${\displaystyle Q^{-1}BQ}$ is a diagonal matrix. However, we can diagonalize ${\displaystyle B}$ if we allow complex numbers. Indeed, if we take

${\displaystyle Q={\begin{bmatrix}1&{\textrm {i}}\\{\textrm {i}}&1\end{bmatrix}},}$

then ${\displaystyle Q^{-1}BQ}$ is diagonal. It is easy to find that B is the rotation matrix which rotates counterclockwise by angle ${\displaystyle \theta ={\tfrac {3\pi }{2}}}$

Note that the above examples show that the sum of diagonalizable matrices need not be diagonalizable.

How to diagonalize a matrix

Consider a matrix

${\displaystyle A={\begin{bmatrix}1&2&0\\0&3&0\\2&-4&2\end{bmatrix}}.}$

This matrix has eigenvalues

${\displaystyle \lambda _{1}=3,\quad \lambda _{2}=2,\quad \lambda _{3}=1.}$

${\displaystyle A}$ is a ${\displaystyle 3\times 3}$ matrix with 3 different eigenvalues; therefore, it is diagonalizable. Note that if there are exactly n distinct eigenvalues in an ${\displaystyle n\times n}$ matrix then this matrix is diagonalizable.

These eigenvalues are the values that will appear in the diagonalized form of matrix A, so by finding the eigenvalues of A we have diagonalized it. We could stop here, but it is a good check to use the eigenvectors to diagonalize A.

The eigenvectors of ${\displaystyle A}$ are

${\displaystyle v_{1}={\begin{bmatrix}-1\\-1\\2\end{bmatrix}},\quad v_{2}={\begin{bmatrix}0\\0\\1\end{bmatrix}},\quad v_{3}={\begin{bmatrix}-1\\0\\2\end{bmatrix}}.}$

One can easily check that ${\displaystyle Av_{k}=\lambda _{k}v_{k}.}$

Now, let ${\displaystyle P}$ be the matrix with these eigenvectors as its columns:

${\displaystyle P={\begin{bmatrix}-1&0&-1\\-1&0&0\\2&1&2\end{bmatrix}}.}$

Note that there is no preferred order of the eigenvectors in ${\displaystyle P}$; changing the order of the eigenvectors in ${\displaystyle P}$ just changes the order of the eigenvalues in the diagonalized form of ${\displaystyle A}$.[2]

Then ${\displaystyle P}$ diagonalizes ${\displaystyle A}$, as a simple computation confirms, having calculated ${\displaystyle P^{-1}}$ using any suitable method:

${\displaystyle P^{-1}AP={\begin{bmatrix}0&-1&0\\2&0&1\\-1&1&0\end{bmatrix}}{\begin{bmatrix}1&2&0\\0&3&0\\2&-4&2\end{bmatrix}}{\begin{bmatrix}-1&0&-1\\-1&0&0\\2&1&2\end{bmatrix}}={\begin{bmatrix}3&0&0\\0&2&0\\0&0&1\end{bmatrix}}.}$

In fact, this follows abstractly from the fact that for the standard basis ${\displaystyle e_{1},e_{2},e_{3}}$ we have

${\displaystyle P^{-1}APe_{k}=P^{-1}Av_{k}=P^{-1}\lambda _{k}v_{k}=\lambda _{k}e_{k}.}$

where we make use of the fact that ${\displaystyle Pe_{k}=v_{k}}$ is the k-th column of ${\displaystyle P}$ and hence ${\displaystyle P^{-1}v_{k}=e_{k}}$. Note that the eigenvalues ${\displaystyle \lambda _{k}}$ appear in the diagonal matrix.

An application

Diagonalization can be used to compute the powers of a matrix ${\displaystyle A}$ efficiently, provided the matrix is diagonalizable. Suppose we have found that

${\displaystyle P^{-1}AP=D\Rightarrow PP^{-1}APP^{-1}=PDP^{-1}\Rightarrow A=PDP^{-1}}$

where ${\displaystyle D}$ is a diagonal matrix. Then, as the matrix product is associative,

{\displaystyle {\begin{aligned}A^{k}&=\left(PDP^{-1}\right)^{k}=\left(PDP^{-1}\right)\cdot \left(PDP^{-1}\right)\cdots \left(PDP^{-1}\right)\\&=PD\left(P^{-1}P\right)D\left(P^{-1}P\right)\cdots \left(P^{-1}P\right)DP^{-1}\\&=PD^{k}P^{-1}\end{aligned}}}

and the latter is easy to calculate since it only involves the powers of a diagonal matrix. This approach can be generalized to matrix exponential and other matrix functions that can be defined as power series.

This is particularly useful in finding closed form expressions for terms of linear recursive sequences, such as the Fibonacci numbers.

Particular application

For example, consider the following matrix:

${\displaystyle M={\begin{bmatrix}a&b-a\\0&b\end{bmatrix}}.}$

Calculating the various powers of ${\displaystyle M}$ reveals a surprising pattern:

${\displaystyle M^{2}={\begin{bmatrix}a^{2}&b^{2}-a^{2}\\0&b^{2}\end{bmatrix}},\quad M^{3}={\begin{bmatrix}a^{3}&b^{3}-a^{3}\\0&b^{3}\end{bmatrix}},\quad M^{4}={\begin{bmatrix}a^{4}&b^{4}-a^{4}\\0&b^{4}\end{bmatrix}},\quad \ldots }$

The above phenomenon can be explained by diagonalizing ${\displaystyle M}$. To accomplish this, we need a basis of ${\displaystyle \mathbb {R} ^{2}}$ consisting of eigenvectors of ${\displaystyle M}$. One such eigenvector basis is given by

${\displaystyle \mathbf {u} ={\begin{bmatrix}1\\0\end{bmatrix}}=\mathbf {e} _{1},\quad \mathbf {v} ={\begin{bmatrix}1\\1\end{bmatrix}}=\mathbf {e} _{1}+\mathbf {e} _{2},}$

where ei denotes the standard basis of Rn. The reverse change of basis is given by

${\displaystyle \mathbf {e} _{1}=\mathbf {u} ,\qquad \mathbf {e} _{2}=\mathbf {v} -\mathbf {u} .}$

Straightforward calculations show that

${\displaystyle M\mathbf {u} =a\mathbf {u} ,\qquad M\mathbf {v} =b\mathbf {v} .}$

Thus, a and b are the eigenvalues corresponding to u and v, respectively. By linearity of matrix multiplication, we have that

${\displaystyle M^{n}\mathbf {u} =a^{n}\,\mathbf {u} ,\qquad M^{n}\mathbf {v} =b^{n}\,\mathbf {v} .}$

Switching back to the standard basis, we have

{\displaystyle {\begin{aligned}M^{n}\mathbf {e} _{1}&=M^{n}\mathbf {u} =a^{n}\mathbf {e} _{1},\\M^{n}\mathbf {e} _{2}&=M^{n}\left(\mathbf {v} -\mathbf {u} \right)=b^{n}\mathbf {v} -a^{n}\mathbf {u} =\left(b^{n}-a^{n}\right)\mathbf {e} _{1}+b^{n}\mathbf {e} _{2}.\end{aligned}}}

The preceding relations, expressed in matrix form, are

${\displaystyle M^{n}={\begin{bmatrix}a^{n}&b^{n}-a^{n}\\0&b^{n}\end{bmatrix}},}$

thereby explaining the above phenomenon.

Quantum mechanical application

In quantum mechanical and quantum chemical computations matrix diagonalization is one of the most frequently applied numerical processes. The basic reason is that the time-independent Schrödinger equation is an eigenvalue equation, albeit in most of the physical situations on an infinite dimensional space (a Hilbert space).

A very common approximation is to truncate Hilbert space to finite dimension, after which the Schrödinger equation can be formulated as an eigenvalue problem of a real symmetric, or complex Hermitian matrix. Formally this approximation is founded on the variational principle, valid for Hamiltonians that are bounded from below.

First-order perturbation theory also leads to matrix eigenvalue problem for degenerate states.

Notes

1. ${\displaystyle A}$ in ${\displaystyle \mathbb {C} ^{n\times n}}$
2. ${\displaystyle A}$ in ${\displaystyle \mathbb {R} ^{n\times n}}$

References

1. Horn, Roger A.; Johnson, Charles R. (2013). Matrix Analysis, second edition. Cambridge University Press. ISBN 9780521839402.
2. Anton, H.; Rorres, C. (22 Feb 2000). Elementary Linear Algebra (Applications Version) (8th ed.). John Wiley & Sons. ISBN 978-0-471-17052-5.