[SciPy-User] raising a matrix to float power
Sat Jul 10 18:47:04 CDT 2010
On Sat, Jul 10, 2010 at 3:39 PM, Sturla Molden <firstname.lastname@example.org> wrote:
> Alexey Brazhe skrev:
>> I failed to find a way to raise a matrix to a non-integer power in
>> 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?
> SciPy-User mailing list
I don't know the answer, but I did play around with Octave, and I
figured out that the meaning of float exponentiation in octave is:
A^x = B such that B^(1/x) = A
So, for example:
0.55369 + 0.46439i 0.80696 - 0.21243i
1.21044 - 0.31864i 1.76413 + 0.14575i
1.0000 - 0.0000i 2.0000 - 0.0000i
3.0000 - 0.0000i 4.0000 + 0.0000i
I'd never really heard of this before, but it does seem to work for floats.
(josef said the same while I was writing this, but whatever. >:o )
More information about the SciPy-User