Diagonal matrix
This article defines a property that can be evaluated for a square matrix. In other words, given a square matrix (a matrix with an equal number of rows and columns) the matrix either satisfies or does not satisfy the property.
View other properties of square matrices
Definition
Verbal definition
A diagonal matrix is a square matrix for which all the off-diagonal entries are zero, or equivalently, all nonzero entries are on the diagonal. Note that it is also possible that some (or even all) the diagonal entries are zero.
Algebraic description
Suppose is a positive integer. Suppose is a matrix. We say that is a diagonal matrix if the following holds:
In general, a diagonal matrix has the following appearance:
Note that for an actual diagonal matrix, the symbols will be replaced by values in the underlying set or ring the matrix is over.
Small cases
General description of diagonal matrix | Number of free parameters (equals ) | |
---|---|---|
1 | 1 | |
2 | 2 | |
3 | 3 |
Encoding
A matrix that is known to be diagonal may simply be encoded using an ordered list of its diagonal entries. For a matrix, this requires space for entries (in contrast with space for entries for an arbitrary square matrix).
Explicitly, the ordered list can be used to describe the diagonal matrix . Further:
- This encoding rule takes times the space needed to store a single entry.
- It is easy to convert back and forth between this encoding rule and the matrix description. In one direction, given this encoding rule, and numbers , we can easily determine . In the reverse direction, given a matrix encoded in the usual manner, we can look up the diagonal entries and construct the encoding. (To confirm that the matrix is diagonal, we need to look at all non-diagonal matrix entries).
Matrix operations
Invariant computation
Unless otherwise specified, diagonal matrices are diagonal matrices.
Matrix operation | Description in terms of diagonal encoding: we use when there is only one matrix | Arithmetic complexity: number of additions | Arithmetic complexity: number of multiplications | Number of inverse computations |
---|---|---|---|---|
Computation of the trace | 0 | 0 | ||
Computation of the determinant | 0 | 0 |
Operations
Matrix operation | Description in terms of diagonal encoding: we denote matrices as and (if the operation is binary) | Arithmetic complexity: number of additions | Arithmetic complexity: number of multiplications | Number of inverse computations | Set of diagonal matrices closed under operation? |
---|---|---|---|---|---|
Addition of two diagonal matrices | 0 | 0 | Yes | ||
Multiplication of two diagonal matrices | 0 | 0 | Yes | ||
Computation of the inverse matrix | (inverse does not exist if any | 0 | 0 | Yes, though not all diagonal matrices are invertible |
The set of diagonal matrices has an algebraic structure of a ring. Explicitly, if the matrix entries are over a commutative unital ring , then the set of diagonal matrices form a commutative unital ring : an external direct product of copies of .