[SciPy-User] raising a matrix to float power

Sturla Molden sturla at molden.no
Sat Jul 10 19:39:25 EDT 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?

Sturla



More information about the SciPy-User mailing list