comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » matrix log and exp
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
matrix log and exp [message #30300] Wed, 17 April 2002 12:01 Go to next message
G Karas is currently offline  G Karas
Messages: 12
Registered: March 2002
Junior Member
Hi group,
one quickie and possibly difficult:

IDL does not have a matrix logarithm logm and matrix
exponent expm function. I was thinking of calling lapack
routines which do it, but have no experience with lapack
or FORTRAN. Anyone with any tips on this one?

cheers!

Giorgos Karas, M.D.

Department of Radiology
'Vrije Universiteit' Medical Center
Amsterdam, Netherlands

email: jacobian_at_gmx.net
(replace the _at_)
Re: matrix log and exp [message #30323 is a reply to message #30300] Fri, 19 April 2002 10:21 Go to previous message
jeyadev is currently offline  jeyadev
Messages: 78
Registered: February 1995
Member
In article <a9n7dq$4hu$1@news.wrc.xerox.com>,
Surendar Jeyadev <jeyadev@wrc.xerox.bounceback.com> wrote:
> In article <a9kgr4$ur8$1@scavenger.euro.net>,
> G Karas <jacobianat@gmx.net> wrote:
>> Hi group,
>> one quickie and possibly difficult:
>>
>> IDL does not have a matrix logarithm logm and matrix
>> exponent expm function. I was thinking of calling lapack
>> routines which do it, but have no experience with lapack
>> or FORTRAN. Anyone with any tips on this one?
>
> It depends on the matrix. Can you diagonlise it? It so,
> you are done. You will need a support package to do the
> linear algebra, though.
>
> ......
>
> The trick is to do the basic operation in the diagonal
> representation and then transform back. If you can
> write the operation as a power series, then can see
> why this works.
>
> The same should work for the logarithm, if the e.values
> are all greater than zero.

I forgot to mention that this kind of thing is routine
in quantum mechanical calculations. You will find
information on things like exp(A) in any decent text:
try Schiff or Merzbacher or Gottfried or ....
What I described is routinely used is such calculations.

Hope this helps, but it does assume use of a linear
algebra package for determining the the eigenvalues
and eigenvectors.

Repeated matrix multiplications are tricky! I would
watch out .....

--

Surendar Jeyadev jeyadev@wrc.xerox.bounceback.com

Remove 'bounceback' for email address
Re: matrix log and exp [message #30345 is a reply to message #30300] Thu, 18 April 2002 12:39 Go to previous message
jeyadev is currently offline  jeyadev
Messages: 78
Registered: February 1995
Member
In article <a9kgr4$ur8$1@scavenger.euro.net>,
G Karas <jacobianat@gmx.net> wrote:
> Hi group,
> one quickie and possibly difficult:
>
> IDL does not have a matrix logarithm logm and matrix
> exponent expm function. I was thinking of calling lapack
> routines which do it, but have no experience with lapack
> or FORTRAN. Anyone with any tips on this one?

It depends on the matrix. Can you diagonlise it? It so,
you are done. You will need a support package to do the
linear algebra, though.

If A is the matrix and you need exp(A), you proceed as
follows:

1. Find the eigenvalues and eigenvectors of A

such that A u_i = l_i u_i

where u_i is the i-th eigenvector and l_i is the
corresponding eigenvalue

2. Form the 'rotation' matrix R = [u_1 u_2 .... ]
where each e.vector becomes a column. The R' be
the transpose of A.

Now, the product R A R' is a diagonal matrix
with the eigenvalues l_i as its diagonal elements.
Its exponetial is just the diagonal matrix with
elements that are exp(l_i).

What you have done is find the exponential of the
matrix in the representation in which the original
A is diagonal. Call this diagonal matrix B.

B_ij = exp(l_i) d_ij

where d_ij is the Kronecker delta symbol.

3. Then, exp(A) = R' A R



The trick is to do the basic operation in the diagonal
representation and then transform back. If you can
write the operation as a power series, then can see
why this works.

The same should work for the logarithm, if the e.values
are all greater than zero.


--

Surendar Jeyadev jeyadev@wrc.xerox.bounceback.com

Remove 'bounceback' for email address
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Global variables
Next Topic: Chain-Link Algorithm for Perimeter

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:47:51 PDT 2025

Total time taken to generate the page: 0.00793 seconds