# Matrix Exponential to a Matrix

1. Jan 5, 2016

### DuckAmuck

If we have two square matrices of the same size P and Q, we can put one in the exponent of the other by:
$$M = P^Q = e^{ln(P)Q}$$
ln(P) may give multiple results R, which are square matrices the same size as P.
So then we have:
$$M = e^{RQ}$$
which can be Taylor expanded to arrive at a final square matrix (matrices) M.

I've been wondering about this, and want to know if my approach is valid. Thank you.

Also, does anyone know any tricks in computing the log of a matrix?
If P is not diagonalizable, it seems you'd have to use the Taylor series expansion. So you'd have an expansion within an expansion for M.

Last edited: Jan 5, 2016
2. Jan 5, 2016

### suremarc

$\ln(P)$ is only well-defined when P is invertible; otherwise P does not have a logarithm.

The wikipedia article on matrix logarithms has some discussion on computing the logarithm in the non-diagonalizable case.

3. Jan 5, 2016

### Twigg

MATLAB has a logm function to take matrix logs for numerical calculations.

If you're doing symbolic work, there's one trick I remember from doing exponentials by hand. I don't know the fancy/correct term for it, but often times when evaluating a matrix power series the powers of the matrix will repeat after a certain number of powers. For example, the generator of the 2D special orthogonal group is [0, -1; 1, 0]. Square that and you get [-1, 0; 0, -1]. Cube it and you get [0, 1; -1, 0]. Fourth power gives you [1, 0; 0, 1]. Since that's just the identity you the fifth power is [0, -1; 1, 0] and the cycle repeats. The fifth power equals the first, the sixth equals the second, and so on. I suppose you could say that in such cases the sequence of all powers of [0, -1; 1, 0] is homomorphic to Z4 under matrix multiplication, or I could be just making a fool outta myself. That way the power series reduces to a sum over four terms. It should apply to any convergent Taylor series if the powers of the generating matrix repeat.

Can you give us a little more info on what logs you want to take?

4. Jan 5, 2016

### DuckAmuck

I just recently discovered logm and expm, which are quite handy for this sort of thing.
I'm not trying to take any particular logs. I am more curious about what the limitations of this operation are.
Obviously recursive and idempotent/nilpotent matrices would be nice here. :)