[SciPy-dev] sinm and cosm for matrices with real coefficients

Vanuxem Grégory g.vanuxem at wanadoo.fr
Sat Apr 29 13:02:10 CDT 2006


Hi,

The code of cosm and sinm for matrices with real coefficients can be
improved.

The actual code is something like:

sinm :  (expm(j * M) - expm(- j*M)) / (2 * j)

cosm :   (expm(j * M) + expm(- j* M)) / 2

But this can be changed to (only for matrices with real coefficients):

sinm : imaginary_part(expm(j * M))

cosm : real_part(expm(j * M))


Sorry, as you can see I'm not a python programmer, just reading the
scipy source code...

Cheers,

Greg





More information about the Scipy-dev mailing list