If all the values we encounter are zero, we declare that the matrix is diagonal. As soon as we encounter an nonzero value, we declare that the matrix is not diagonal. Explicitly, we check, for each entry not on the diagonal whether its value is zero. Given a matrix, testing whether it is a diagonal matrix requires checking the values of off-diagonal entries. (To confirm that the matrix is diagonal, we need to look at all non-diagonal matrix entries). In the reverse direction, given a matrix encoded in the usual manner, we can look up the diagonal entries and construct the encoding. In one direction, given this encoding rule, and numbers, we can easily determine. It is easy to convert back and forth between this encoding rule and the matrix description.This encoding rule takes times the space needed to store a single entry.For a matrix, this requires space for entries (in contrast with space for entries for an arbitrary square matrix).Įxplicitly, the ordered list can be used to describe the diagonal matrix. All the basis vectors are eigenvectors for the linear transformation.Ī matrix that is known to be diagonal may simply be encoded using an ordered list of its diagonal entries.The linear transformation sends every basis vector to a scalar multiple of itself.The matrix for a linear transformation in a given basis is a diagonal matrix if and only if the following equivalent conditions hold:
Note that for an actual diagonal matrix, the symbols will be replaced by values in the underlying set or ring the matrix is over.ĭefinition in terms of linear transformations In general, a diagonal matrix has the following appearance:
We say that is a diagonal matrix if the following holds: Note that it is also possible that some (or even all) the diagonal entries are zero.