In linear algebra, a

**diagonal matrix**is a square matrix in which only the entries in the main diagonal are non-zero. The diagonal entries themselves may or may not be zero. Thus, the matrix D = (d

_{i,j}) is diagonal if:

**R**or

**C**) also a normal matrix. The identity matrix

*I*

_{n}is diagonal.

Table of contents |

2 Eigenvectors, eigenvalues, determinant 3 Uses |

## Matrix operations

The operations of matrix addition and matrix multiplication are especially simple for diagonal matrices. Write diag(*a*_{1},...,*a*_{n}) for a diagonal matrix whose diagonal entries starting in the upper left corner are *a*_{1},...,*a*_{n}. Then, for addition, we have

- diag(
*a*_{1},...,*a*_{n}) + diag(*b*_{1},...,*b*_{n}) = diag(*a*_{1}+*b*_{1},...,*a*_{n}+*b*_{n})

- diag(
*a*_{1},...,*a*_{n}) · diag(*b*_{1},...,*b*_{n}) = diag(*a*_{1}*b*_{1},...,*a*_{n}*b*_{n}).

*a*

_{1},...,

*a*

_{n}) is invertible if and only if the entries

*a*

_{1},...,

*a*

_{n}are all non-zero. In this case, we have

- diag(
*a*_{1},...,*a*_{n})^{-1}= diag(*a*_{1}^{-1},...,*a*_{n}^{-1}).

*n*-by-

*n*matrices.

Multiplying the matrix *A* from the *left* with diag(*a*_{1},...,*a*_{n}) amounts to multiplying the *i*-th *row* of *A* by *a*_{i} for all *i*; multiplying the matrix *A* from the *right* with diag(*a*_{1},...,*a*_{n}) amounts to multiplying the *i*-th *column* of *A* by *a*_{i} for all *i*.

## Eigenvectors, eigenvalues, determinant

The eigenvalues of diag(*a*_{1},...,*a*_{n}) are *a*_{1},...,*a*_{n}. The unit vectors **e**_{1},...,**e**_{n} form a basis of eigenvectors. The determinant of diag(*a*_{1},...,*a*_{n}) is the product *a*_{1}...*a*_{n}.

## Uses

Diagonal matrices occur in many areas of linear algebra. Because of the simple description of the matrix operation and eigenvalues/eigenvectors given above, it is always desirable to represent a given matrix or linear map by a diagonal matrix.

In fact, a given *n*-by-*n* matrix is similar to a diagonal matrix if and only if it has *n* linearly independent eigenvectors. These matrices are called diagonalizable.

Over the field of real or complex numbers, more is true: every normal matrix is unitarily similar to a diagonal matrix (the spectral theorem), and every matrix is unitarily equivalent to a diagonal matrix with nonnegative entries (the singular value decomposition).