gives True if m is diagonalizable, and False otherwise.

Details and Options

  • A matrix m is diagonalizable if it is similar to a diagonal matrix. That is, if there is a nonsingular matrix such that is diagonal.
  • DiagonalizableMatrixQ works for symbolic as well as numerical matrices.
  • For approximate matrices, the option Tolerance->t can be used to indicate that the determinant of eigenvectors v of the matrix m satisfying Abs[Det[v]]t is taken to be zero, which means that the eigenvectors v are linearly dependent and the matrix m is not diagonalizable.
  • The option Tolerance has Automatic as its default value.


open allclose all

Basic Examples  (2)

Test if a 2×2 numeric matrix is diagonalizable:

Test if a 3×3 symbolic matrix is diagonalizable:

Put the eigenvectors of the matrix in columns:

Verify the matrix is similar to diagonal matrix:

Scope  (9)

Basic Uses  (5)

Test if a real machine-precision matrix is diagonalizable:

Verify the result:

The diagonal elements of the obtained matrix are the eigenvalues of :

Test if a complex matrix is diagonalizable:

Test if an exact matrix is diagonalizable:

Make the matrix diagonalizable:

Use DiagonalizableMatrixQ with an arbitrary-precision matrix:

A random square matrix is typically diagonalizable:

Use DiagonalizableMatrixQ with a symbolic matrix:

Specia; Matrices  (4)

Use DiagonalizableMatrixQ with sparse matrices:

Use DiagonalizableMatrixQ with structured matrices:

Use with a QuantityArray structured matrix:

The identity matrix is diagonalizable:

HilbertMatrix is diagonalizable:

Options  (1)

Tolerance  (1)

Generate a real-valued non-diagonalizable Jordan block matrix with some random perturbation of order :

q is diagonalizable:

But the eigenvectors v are numerically linearly dependent:

Adjust the option Tolerance so that the linear dependence of the eigenvectors is detected:

Applications  (6)

If a matrix is diagonalizable, it can be decomposed as , where is nonsingular and is diagonal. This can be used to compute a matrix function by using its power series representation as f(m)=p.(sum_(i=0)^inftya_i d^i).TemplateBox[{p}, Inverse]=p.f(d).TemplateBox[{p}, Inverse], and can be computed by simply applying to each of the diagonal elements. Use this method to compute several different matrix functions:

Compute the eigensystem of :

The matrix has the eigenvectors as columns, and the diagonal entries are the eigenvalues:

Compute and confirm using MatrixPower:

Compute and confirm using MatrixExp:

Compute and confirm using MatrixLog:

Compute and confirm using MatrixFunction:

Solve the system of ODEs , , . First, construct the coefficient matrix for the right-hand side:

The coefficient matrix is diagonalizable, so computing the matrix exponential will be straightforward:

Find the eigenvalues and eigenvectors:

Construct a diagonal matrix whose entries are the exponential of :

Construct the matrix whose columns are the corresponding eigenvectors:

The general solution is p.d.TemplateBox[{p}, Inverse].{TemplateBox[{1}, CTraditional],TemplateBox[{2}, CTraditional],TemplateBox[{3}, CTraditional]}, for three arbitrary starting values:

Verify the solution using DSolveValue:

Use the fact that the recurrence relation for Fibonacci, TemplateBox[{n}, Fibonacci]=TemplateBox[{{n, -, 1}}, Fibonacci]+TemplateBox[{{n, -, 2}}, Fibonacci], can be written in matrix form as f(n)=(TemplateBox[{n}, Fibonacci] ; TemplateBox[{{n, -, 1}}, Fibonacci] )=(TemplateBox[{{n, -, 1}}, Fibonacci]+TemplateBox[{{n, -, 2}}, Fibonacci] ; TemplateBox[{{n, -, 1}}, Fibonacci] )=(1 1; 1 0).(TemplateBox[{{n, -, 1}}, Fibonacci] ; TemplateBox[{{n, -, 2}}, Fibonacci] )=m.f(n-1) to derive a formula for the pair f(n)={TemplateBox[{n}, Fibonacci],TemplateBox[{{n, -, 1}}, Fibonacci]}. The solution to the recurrence relation is , where :

The matrix is diagonalizable:

Thus, the matrix power can be computed simply using Eigensystem[m]:

Complete the definition of :

Compute TemplateBox[{100}, Fibonacci] and TemplateBox[{99}, Fibonacci]:

Confirm the result using Fibonacci:

Normal matrices are the most general kind of matrix that can be unitarily diagonalized as with diagonal and unitary. All Hermitian matrices are normal because both sides of the equality are simply :

Similarly, all antihermitian matrices are normal because both sides of the equality are simply :

Unitary matrices are normal, as substituting in the definition TemplateBox[{u}, ConjugateTranspose]=TemplateBox[{u}, Inverse] gives an identity matrix on both sides:

Show that the following matrix is normal, then diagonalize it:

Confirm using NormalMatrixQ:

A normal matrix like can be unitarily diagonalized using Eigensystem:

The entries on the diagonal can be arbitrary complex numbers:

Normalizing the eigenvectors and putting them in columns gives a unitary matrix:

Confirm the diagonalization n=u.d.TemplateBox[{u}, ConjugateTranspose]:

Skipping normalization of the eigenvectors suffices to show that is diagonalizable (though not unitarily):

In quantum mechanics, the energy operator is called the Hamiltonian , and a state with energy evolves according to the Schrödinger equation . An important assumption is that any state can be written as a sum of eigenstates. Show that this is the case for Hamiltonian for a spin-1 particle in constant magnetic field in the direction:

The matrix is diagonalizable, so its eigenvectors must form a basis for TemplateBox[{}, Complexes]^3:

Computing the eigensystem, the energy levels are and :

Confirm that the eigenvectors are linearly independent and thus a basis:

Normalize the eigenvectors:

Decompose an arbitrary state as a sum of the eigenvectors:

Many matrix distributions produce matrices that are guaranteed to be diagonalizable, including CircularRealMatrixDistribution:



GaussianUnitaryMatrixDistribution :

Properties & Relations  (9)

A diagonalizable matrix can be factored as m=p.d.TemplateBox[{p}, Inverse] with diagonal using Eigensystem:

Put the eigenvectors in columns and the eigenvalues on the diagonal of a matrix:

Confirm the decomposition:

A matrix is diagonalizable if and only if it has a complete set of eigenvectors:

Although it has repeated eigenvalues, has three linearly independent eigenvectors:

Despite having the same eigenvalues as , the matrix is not diagonalizable:

It only has two independent eigenvectors, as indicated by the zero vector returned by Eigensystem:

Any matrix with no repeated eigenvalues is diagonalizable:

Any real symmetric matrix is diagonalizable:

As is any Hermitian matrix:

Any real antisymmetric matrix is diagonalizable:

As is any antihermitian matrix:

Any real orthogonal matrix is diagonalizable:

As is any unitary matrix:

Any normal matrix is diagonalizable:

A matrix m is diagonalizable if and only if the matrix of JordanDecomposition[m] is diagonal:

An × matrix is nilpotent if for some :

Consider a non-diagonalizable matrix :

Use JordanDecomposition to write as with diagonalizable and nilpotent:

Confirm that is diagonalizable:

The matrix is nilpotent:

Moreover, and commute:

Wolfram Research (2014), DiagonalizableMatrixQ, Wolfram Language function, https://reference.wolfram.com/language/ref/DiagonalizableMatrixQ.html.


Wolfram Research (2014), DiagonalizableMatrixQ, Wolfram Language function, https://reference.wolfram.com/language/ref/DiagonalizableMatrixQ.html.


Wolfram Language. 2014. "DiagonalizableMatrixQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DiagonalizableMatrixQ.html.


Wolfram Language. (2014). DiagonalizableMatrixQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DiagonalizableMatrixQ.html


@misc{reference.wolfram_2024_diagonalizablematrixq, author="Wolfram Research", title="{DiagonalizableMatrixQ}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/DiagonalizableMatrixQ.html}", note=[Accessed: 21-June-2024 ]}


@online{reference.wolfram_2024_diagonalizablematrixq, organization={Wolfram Research}, title={DiagonalizableMatrixQ}, year={2014}, url={https://reference.wolfram.com/language/ref/DiagonalizableMatrixQ.html}, note=[Accessed: 21-June-2024 ]}