kill(all)$

maxima : appendix: matrix to a power : A^^k (Numerical, Symbolic,'diag') ,version 1.0
peter.vlasschaert@gmail.com,03/02/2020

see : http://maxima.sourceforge.net/docs/manual/maxima_51.html

load packages
===========

load("diag")$
load(lrats)$

Matrix : example.

A: matrix([2,-1,0],[0,1,0],[-3,-2,-1])$

convert :        list ⇒ matrix
=====================
pa:[[2,-1,0],[0,1,0],[-3,-2,-1]];
pb:apply('matrix,pa);
=====================

1e) Numerical  :  A^k
================
k=3

operator : ^^

p1:'A^^3 = A^^3;

operator: .

p1a:'A^^3 = A.A.A;

check : p1 ? p1a
---------------------

is(rhs(p1)=rhs(p1a));

1e) Symbolic :  A^k
================
k

 integer_pow(x) := block ([k], declare (k, integer), x^k);
p2: mat_function (integer_pow, A);

k;

check : k=3
=========

p2a:subst([k=3],p2);

f(x) := x^k;
p3:mat_function (f, A);

check : k=3
=========

p3a:subst([k=3],p3);

check : p2a ? p3a;p2,p3
==============
both matrix :same

a) numerical
----------------

p4:is(p2a=p3a);

b) symbolic
--------------

p4a:is(p2=p3);