[SciPy-User] raising a matrix to float power
Sun Jul 11 12:23:20 CDT 2010
On Sun, Jul 11, 2010 at 8:26 AM, Andrew Jaffe <email@example.com> wrote:
> On 11/07/2010 00:26, Alexey Brazhe wrote:
> > 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 :)
> Although most people already know this, since nobody's actually said it
> yet in this thread, and there seems to be some confusion, the generic
> meaning of matrix exponentiation is usually the following.
> We can diagonalize a matrix
> M = R^T E R
> where R is the matrix of eigenvectors (^T is transpose or hermitian
> conjugate) and
> E = diag(lambda_1, lambda_2, ...) is the diagonal matrix of
> Then, we can define
> M^a = R^T E^a R
> where E^a = diag(lambda_1^a, lambda_2^a, ...)
> in particular, this gives the obvious answers for integer powers and
> even negative integers, including -1 for the inverse. (+1/2 doesn't give
> the Cholesky decomposition, but the Hermitian square root)
Thanks, Andrew, I was wanting to provide something like this, but I was
going to have to go look it up and, well, have higher priorities at the
moment. :-) But you left off one "intuitive" identity that one would want
to be true, which would appear to be trivially so, unless something
unexpected screws it up, namely: (M^a)^(1/a) = (M^(1/a))^a = M; I assume
this is valid, correct?
> SciPy-User mailing list
Mathematician: noun, someone who disavows certainty when their uncertainty
set is non-empty, even if that set has measure zero.
Hope: noun, that delusive spirit which escaped Pandora's jar and, with her
lies, prevents mankind from committing a general suicide. (As interpreted
by Robert Graves)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User