A diagonal matrix is a square matrix of the form
|
(1)
|
where
is the Kronecker delta,
are constants, and
, 2, ...,
, with no implied summation over indices. The general diagonal
matrix is therefore of the form
|
(2)
|
often denoted .
The diagonal matrix with elements can be computed in the Wolfram
Language using DiagonalMatrix[l],
and a matrix
may be tested to determine if it is diagonal using DiagonalMatrixQ[m].
The determinant of a diagonal matrix given by is
. This means that
, so for
, 2, ..., the first few values are 1, 2, 6, 24, 120, 720,
5040, 40320, ... (OEIS A000142).
For matrices over a field, given a matrix equation of the form
|
(3)
|
multiply through to obtain
|
(4)
|
If the diagonal entries are pairwise distinct, this equation forces every off-diagonal
entry of
to vanish, so
is diagonal. With repeated diagonal entries, a commuting matrix
need not be diagonal.
Given a diagonal matrix and a positive integer
, the matrix
power is computed by taking each diagonal entry to that power,
|
(5)
| |||
|
(6)
|
The same formula holds for negative integer when all diagonal entries are nonzero.
For a real or complex diagonal matrix, its matrix
exponential is obtained by exponentiating the diagonal entries,
|
(7)
|