[SciPy-User] raising a matrix to float power

Sturla Molden sturla@molden...
Sat Jul 10 18:39:25 CDT 2010

Alexey Brazhe skrev:
> Hi,
> I failed to find a way to raise a matrix to a non-integer power in 
> numpy/scipy
> In Octave/Matlab, one would write M^0.5 to get the result
> whereas in numpy
> >>> maxtrix(M, 0.5)
> raises the "TypeError: exponent must be an integer"
> Is there a way to do matrix exponentiation to non-integer powers in 
> numpy or scipy?
> Hope the answer is positive :)
Sure, M**0.5 is cho_factor(M). For other non-integers I am not sure what 
matrix exponentiation could possibly mean.

Are you sure you don't mean array exponentiation?


More information about the SciPy-User mailing list