logm

Matrix logarithm.

Syntax

R = logm(X)

Inputs

X
A square matrix.

Outputs

R
The matrix logarithm.

Example

A0 = [1,2;3,4];
r0 = logm(A0)
s0 = expm(logm(A0))
norm(A0 - s0)
A1=A0*A0';
r1=logm(A1)
s1 = expm(logm(A1))
norm(A1 - s1)
r0 = [Matrix] 2 x 2
-0.35044 + 2.39112i  0.92935 - 1.09376i
 1.39403 - 1.64064i  1.04359 + 0.75047i
s0 = [Matrix] 2 x 2
1.00000e+00 + 2.83107e-15i  2.00000e+00 + 1.05471e-15i
3.00000e+00 + 3.49720e-15i  4.00000e+00 - 8.88178e-16i
ans = 1.33087e-14
r1 = [Matrix] 2 x 2
-1.12547  2.00048
 2.00048  2.51177
s1 = [Matrix] 2 x 2
 5.00000  11.00000
11.00000  25.00000
ans = 1.21221e-13

Comments

References:

  • 'Evaluating Pade Approximants', SIAM J. MATRIX ANAL. APPL. 2001, Vol. 22, No. 4, pages 1126-1135
  • 'A Schur-Parlett Algorithm for Computing Matrix Functions', SIAM J. MATRIX ANAL. APPL. Vol. 25, No. 2, pages 464-485.