[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


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

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...



More information about the Scipy-dev mailing list