Matrix logarithm

`L = logm(A)`

- example
`[L,exitflag] = logm(A)`

`L = logm(`

is the
principal matrix logarithm of `A`

)`A`

, the inverse of `expm(A)`

.
The output, `L`

, is the unique logarithm for which
every eigenvalue has imaginary part lying strictly between –*π* and *π*.
If `A`

is singular or has any eigenvalues on the
negative real axis, then the principal logarithm is undefined. In
this case, `logm`

computes a nonprincipal logarithm
and returns a warning message.

`[L,exitflag] = logm(A)`

returns a scalar `exitflag`

that
describes the exit condition of `logm`

:

If

`exitflag = 0`

, the algorithm was successfully completed.If

`exitflag = 1`

, too many matrix square roots had to be computed. However, the computed value of`L`

might still be accurate.

For most matrices:

logm(expm(A)) = A = expm(logm(A))

These identities can fail for some

`A`

. For example, if the computed eigenvalues of`A`

include an exact zero, then`logm(A)`

generates infinity. Or, if the elements of`A`

are too large,`expm(A)`

can overflow.

[1] Al-Mohy, A. H. and Nicholas J. Higham, "Improved
inverse scaling and squaring algorithms for the matrix logarithm," *SIAM
J. Sci. Comput.*, 34(4), pp. C153–C169, 2012

[2] Al-Mohy, A. H., Higham, Nicholas J. and
Samuel D. Relton, "Computing the Frechet derivative of the
matrix logarithm and estimating the condition number," *SIAM
J. Sci. Comput.,*, 35(4), pp. C394–C410, 2013

Was this topic helpful?