Question: how to calculate this combination of matrix?

not a full combinations yet

restart;
G := (L::list(name),n::posint)->op((`*`@op)~(combinat[choose](L,n))):
G( [q,r,s], 3 );
with(LinearAlgebra):
aa := Matrix([[1,3,1],[3,1,3],[3,3,3]]);
num1 := 1;
for i from 1 to 3 do
for j from 1 to 3 do
num1 := num1* nops([G( [a,b,c], aa[i,j] )]);
od:
od:
numcol := nops(aa);
for ii from 1 to numcol do
for jj from 1 to numcol do
alist := [G( [a,b,c], aa[ii,jj] )];
num1 := num1 - nops(alist);
for zz from 1 to nops(alist) do
m := Matrix([[0,0,0],[0,0,0],[0,0,0]]);
m[ii,jj]:=alist[zz];
for ii2 from 1 to numcol do
for jj2 from 1 to numcol do
if ii <> ii2 && jj <> jj2 then
m[ii2,jj2] := aa[ii2, jj2];
end if:
od:
od:
print(m);
od:
od:
od:

then i change simpler

m := Matrix([[0,0,0],[0,0,0],[0,0,0]]);
delta := proc(m,bb,ii2,jj2,poin)
finish := 0;
for ii from 1 to numcol do
for jj from 1 to numcol do
num1 := num1 - nops(alist);
if poin <= 3 and finish = 0 and ii = ii2 and jj = jj2 then
m[ii,jj]:=bb[poin];
finish := 1;
end if:
od:
od:
return m;
end proc:
ii := 1;
jj := 1;
alist := [G([a,b,c], aa[ii,jj] )];
delta(m,alist,ii,jj,2);

not completed yet

Please Wait...