Sat 10 Mar 2012 01:38:15 AM UTC, original submission:
I'd like to report following.
In my understanding, logm is inverse function of expm, namely, following should be satisfied for any square matrix M.
M=logm(expm(M))
I tried following calculation using octave3.6.1.
A=[0 -i;i 0]
B=expm(A)
C=logm(B)
We expect A=C.
However, I got following results.
A=
0 + 0i -0 - 1i
0 + 1i 0 + 0i
B=
1.54308 + 0.00000i 0.00000 - 1.17520i
0.00000 + 1.17520i 1.54308 + 0.00000i
C=
-7.8496e-017 0.00000e+000
0.0000e+000 1.09991e-015
Obviously, C is different from A.
Moreover, I tried following.
A=[0 -1;1 0]
B=expm(A)
C=logm(B)
I got following.
A=
0 -1
1 0
B=
0.54030 -0.84147
0.84147 0.54030
C=
-5.4911e-016 1.4142e+000
-1.4142e+000 -1.8647e-016
Obviously, C is different from A.
I think that the matrix [0 -i;i 0] or [0 -1;1 0] are relatively simple matrix.
If octave can not give correct answer to this kind of relatively simple matrix, I concern this fact may spoile trust of octave.
For your information, I'd like to add results of same kind of calculation by scilab.
A=
0 - 1i
i 0
B= (=expm(A))
1.5430806 -1.1752012i
1.1752012i 1.5430806
C= (=logm(B))
0 -i
i -3.331E-16
A=
0 -1
1 0
B= (=expm(A))
0.5403023 -0.8414710
0.8414710 0.5403023
C= (=logm(B))
5.370D-14-2.220D-16i -1.+9.192D-17
1.-1.579D-16i 2.516D-16+2.22D-16i
I think scilab give correct answer to same calculation.
|