Tool to diagonalize a matrix. The diagonalization of a matrix consists of writing it in a base where its elements outside the diagonal are null.
Matrix Diagonalization - dCode
Tag(s) : Matrix
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
A diagonal matrix is a matrix whose elements out of the trace (the main diagonal) are all null (zeros).
A square matrix $ M $ is diagonal if $ M_{i,j} = 0 $ for all $ i \neq j $.
Example: A diagonal matrix: $$ \begin{bmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \end{bmatrix} $$
Diagonalization is a transform used in linear algebra usually to simplify calculations (like powers of matrices).
A matrix is diagonalizable if there exists an invertible matrix $ P $ and a diagonal matrix $ D $ such that $ M = PDP^{-1} $
To diagonalize a matrix, a diagonalisation method consists in calculating its eigenvectors and its eigenvalues.
Example: The matrix $$ M = \begin{bmatrix} 1 & 2 \\ 2 & 1 \end{bmatrix} $$ has for eigenvalues $ 3 $ and $ -1 $ and eigenvectors respectively $ \begin{bmatrix} 1 \\ 1 \end{bmatrix} $ and $ \begin{bmatrix} -1 \\ 1 \end{bmatrix} $
The diagonal matrix $ D $ is composed of eigenvalues.
Example: $$ D = \begin{bmatrix} 3 & 0 \\ 0 & -1 \end{bmatrix} $$
The order of the eigenvalues in $ D $ has no intrinsic importance, but it must match the order of the eigenvectors in $ P $.
The invertible matrix $ P $ is composed of the eigenvectors respectively in the same order of the columns than its associated eigenvalues.
P must be a normalized matrix.
Example: $$ P = \begin{bmatrix} 1 & -1 \\ 1 & 1 \end{bmatrix} $$ Normalization of P: $$ P = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & -1 \\ 1 & 1 \end{bmatrix} $$
A matrix is not diagonalizable if it does not have as many dimensions as distinct eigenvectors.
Example: The matrix of dimension 2: $$ M = \begin{bmatrix} 5 & 1 \\ 0 & 5 \end{bmatrix} $$ has a double eigenvalue: $ 5 $ and therefore a single eigenvector $ \begin{bmatrix} 1 \\ 0 \end{bmatrix} $ so it is not diagonalizable.
Example: A 3x3 matrix with a triple eigenvalue therefore a single eigenvector is not diagonalizable.
Calculate the inverse of the matrix $ P $
Diagonalization should give $ PDP^{-1} = M $
Orthogonal diagonalization is a specific type of matrix diagonalization applicable to symmetric matrices. It consists of expressing a symmetric matrix $ M $ as $ M = Q D Q ^ T $ or the product of an orthogonal matrix $ Q $ (so $ Q.Q^T = Q^T.Q = I $), a diagonal matrix $ D $, and the transpose of $ Q $, denoted $ Q^T $.
Orthogonal diagonalization is useful because it preserves the orthogonality of the eigenvectors and can simplify computations involving symmetric matrices.
dCode retains ownership of the "Matrix Diagonalization" source code. Except explicit open source licence (indicated Creative Commons / free), the "Matrix Diagonalization" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Matrix Diagonalization" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Matrix Diagonalization" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.
The copy-paste of the page "Matrix Diagonalization" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Matrix Diagonalization on dCode.fr [online website], retrieved on 2024-11-18,