[SciPy-user] Re: expm, funm

Travis Oliphant oliphant at ee.byu.edu
Thu Mar 7 09:27:16 CST 2002


> Travis,
>
> Finally, I have used the latest CVS. It turned out all right.
>
> BTW, how can I invoke funm for the computation of an arbitrary matrix
> function ?
> A small example would be very helpful.
>
> >>> help(funm)
>  funm(A, func, disp=1)
>
> Matrix function for arbitrary callable object func.


func is just an arbitrary callable object that will be called on the schur
values.  The only restriction is that it needs to take a vector of
arguments and return the function evaluated elementwise over that vector.

(See special.genera_function) if you want to "vectorize" a function.

So, for example

from scipy import *

linalg.funm(A, sqrt)

should compute the matrix square-root (the algorithm is general purpose
and can fail).  The disp flag controls whether or not a warning is printed
if something doesn't seem right.

>
>
> Moreover I agree to submit algorithms for both sqrtm and logm.
> How can I contribute ?
>

Send them to me.

It would be preferrable if there is a test sent along with the algorithm.

-Travis






More information about the SciPy-user mailing list