[SciPy-user] function for sqrt of matrix

Travis E. Oliphant oliphant at ee.byu.edu
Tue Jun 29 12:03:50 CDT 2004

Sudheer Phani wrote:
> Hello
>    I am looking for a function to calculate the square root (sqrt) of
> matrix M. For e.g. x = sqrtm(M) such that M is square matrix and dot(x,x)
> = M.
In SciPy:

It would be good to have a specific sqrtm function.

But for now you can do:

x = linalg.funm(M, sqrt)


def sqrtm(M):
     return linalg.funm(M,sqrt)

x = sqrtm(M)

-Travis O.

More information about the SciPy-user mailing list