A logarithm of a square matrix is a matrix such that , where is the matrix exponential. Just as in the scalar case, the matrix logarithm is not unique, since if then for any integer . However, for matrices the nonuniqueness is complicated by the presence of repeated eigenvalues. For example, the matrix

is an upper triangular logarithm of the identity matrix for any , whereas the obvious logarithms are the diagonal matrices , for integers , , and . Notice that the repeated eigenvalue of has been mapped to the distinct eigenvalues , , and in . This is characteristic of nonprimary logarithms, and in some applications such strange logarithms may be required—an example is the embeddability problem for Markov chains.

An important question is whether a nonsingular real matrix has a real logarithm. The answer is that it does if and only if the Jordan canonical form contains an even number of Jordan blocks of each size for every negative eigenvalue. This means, in particular, that if has an unrepeated negative eigenvalue then it does not have a real logarithm. Minus the identity matrix has a real logarithm for even but not for odd . Indeed, for ,

satisfies , as does for any nonsingular , since .

For most practical purposes it is the *principal logarithm* that is of interest, defined for any matrix with no negative real eigenvalues as the unique logarithm whose eigenvalues lie in the strip . From this point on we assume that has no negative eigenvalues and that the logarithm is the principal logarithm.

Various explicit representations of the logarithm are available, including

where the spectral radius . A useful relation is for , with important special cases and (where the square root is the principal square root). Recurring the latter expression gives, for any positive integer ,

This formula is the basis for the inverse scaling and squaring method for computing the logarithm, which chooses so that is small enough that can be efficiently approximated by Padé approximation. The MATLAB function `logm`

uses the inverse scaling and squaring method together with a Schur decomposition.

## References

This references contains more on the facts above, as well as further references.

- Nicholas J. Higham, Functions of Matrices: Theory and Computation, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2008.

## Related Blog Posts

- What Is a Matrix Function? (2020)
- What Is a Matrix Square Root? (2020)
- What Is the Matrix Exponential? (2020)

This article is part of the “What Is” series, available from https://nhigham.com/category/what-is and in PDF form from the GitHub repository https://github.com/higham/what-is.