[SciPy-User] Faster approach to calculate the matrix exponential

Moore, Eric (NIH/NIDDK) [F] eric.moore2 at nih.gov
Thu Jun 26 10:42:46 EDT 2014


From: Troels Emtekær Linnet [mailto:tlinnet at gmail.com] 
Sent: Thursday, June 26, 2014 7:08 AM
To: SciPy Users List
Subject: Re: [SciPy-User] Faster approach to calculate the matrix exponential

Dear Gregor. 
Using the scripy method does not sound viable. 
It was discussed here,  post 2
http://thread.gmane.org/gmane.science.nmr.relax.devel/6446/match=eliminating+86+bottleneck+numeric+r1rho
The problem is also, that this function expects square matrices. 
I need to tweak to data of dimension a, b, c, d, e, X, X where X, X is the square matrices.  
A universal method for the data array. 
Best
Troels 
On 26 Jun 2014 12:52, "Gregor Thalhammer" <gregor.thalhammer at gmail.com> wrote:

Am 26.06.2014 um 10:31 schrieb Troels Emtekær Linnet <tlinnet at gmail.com>:

> Dear NMR wizards.
>
> Do any of you know any faster approach to calculate the matrix exponential ?
>
> I currently do it via eigenvalue decomposition approach.
> But my profiling scripts tells me, that my bottleneck is the eig function.
> Stealing 86% of the time.
>

scipy.linalg.expm provides a matrix exponential using Padé approximation. Is this sufficiently accurate for your application?

Gregor



There are expansions for the matrix exponential in terms of Chebyshev and Laguerre matrix polynomials. (The first of which does get use a bit for calculating propagators in NMR, for instance, spinevolution and simpson both can/do use it.)  However, your matrices seem quite small, even if there are a large number of them, so it may be very difficult to speed this up by much.

Eric



_______________________________________________
SciPy-User mailing list
SciPy-User at scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user


More information about the SciPy-User mailing list