from IPython.display import *
var('a:z')
V=Matrix(3,1,[u,v,w])
A=Matrix(3,3,[s,1,1,1,0,0,0,1,0])
B=A*V
A,B
N=3
mm=Poly((u+v+w)**N).monoms()
mm
dd=len(mm)
xx=eye(dd)
X=[]
for i in range(dd):
F=x**mm[i][0]*y**mm[i][1]*z**mm[i][2]
GG=F.subs(x,B[0]).subs(y,B[1]).subs(z,B[2]);FF=expand(GG)
X.append([FF.coeff(u**mm[i][0]*v**mm[i][1]*w**mm[i][2]) for i in range(dd)])
#display(X)
MX=Matrix(1,dd,X[0])
for i in range(1,dd):
XM=Matrix(1,dd,X[i])
MX=MX.col_join(XM)
MX
This is the Nth symmetric power of A. In this example, N=3.
IX=eye(A.shape[0])
delta=series(((IX-t*A).det())**(-1),t,0,10)
for i in range(10):
display(delta.coeff(t,i))
These are the traces of the symmetric powers of A.
Res=series(trace((IX-t*A).inv()),t,0,10)
for i in range(10):
display(Res.coeff(t,i))
These are the traces of the powers of A.