Symbolic matrix power



*Michele Minelli* micheleminelli1 at gmail.com
<maxima%40math.utexas.edu?Subject=Re%3A%20%5BMaxima%5D%20Symbolic%20matrix%20power&In-Reply-To=%3C526A668D.7080605%40gmail.com%3E>
*Fri Oct 25 07:39:41 CDT 2013 wrote:*
**
*

>Hello everyone,
>is there a way to compute the k-th power of a >matrix .in a symbolic way?
>For example if the matrix is [2, 0, 0], [0, 2, 0],[-1, 0, 3] it should
>return [2^k, 0, 0], [0, 2^k, 0], [2^k-3^k, 0, 3^k].
>Thank you.
>Michele

*
**
*Do*

(%i1) A:matrix([2, 0, 0], [0, 2, 0], [-1, 0, 3])$
(%i2) load("diag")$
(%i3) integer_pow(x) := block ([k], declare (k, integer), x^k)$
(%i4) mat_function (integer_pow, A);
(%o4) matrix([2^k,0,0],[0,2^k,0],[2^k-3^k,0,3^k])

best

Aleksas D