[SciPy-user] Matrix square root
nwagner at mecha.uni-stuttgart.de
Mon Oct 4 06:44:38 CDT 2004
Nils Wagner wrote:
> Stuart Murdock wrote:
>> I am trying to calculate the matrix square root (lets say B) of a
>> Matrix (A) which is an array.
>> A = array([[1,2],[3,4]])
>> such that
>> A = matrixmultiply(B,B)
>> are there any functions in SciPy to do that ?
> AFAIK there is no direct support for sqrtm but you may use funm.
BTW, some algorithms for sqrtm can be found at
This might be a starting point for an implementation of sqrtm in scipy.
Any comments ?
> >>> a = array(([1,2],[3,4]))
> >>> b = linalg.funm(a,sqrt)
> >>> b
> array([[ 0.55368857+0.46439416j, 0.80696073-0.21242648j],
> [ 1.21044109-0.31863972j, 1.76412966+0.14575444j]])
> >>> dot(b,b)-a
> array([[ 2.22044605e-16 -3.19839641e-17j, 0.00000000e+00
> [ 4.44089210e-16 -1.06821019e-16j, 0.00000000e+00
More information about the SciPy-user