RCCout.mw

 > k:=2:J2:=IdentityMatrix(binomial(n,k)):print(matrans(R),matrans(B));

 > print(seq({i,choose(n,k)[i]},i=1..binomial(n,k)));

 > y:=vector(NN):

 > for i1 in 1 do for i2 in 1,2 do for i3 in 1,2 do for i4 in 1,2 do  for i5 in 1,2 do   for i6 in 1,2 do  ee:=[bit[i1],bit[i2],bit[i3],bit[i4],bit[i5],bit[i6]];phi:=diag(seq(ee[q],q=1..n)); Detta:=Matrix(multiply(phi,Delta));

 > Rx:=(evalm(A+Detta)):Bx:=(evalm(A-Detta));AA:=evalm((1/2)*(RR+BB)):print(ee);for k from 1 to n-1 do NK:=binomial(n,k):JJ:=evalm(IdentityMatrix(NK)):AK:=evalm((1/2)*(extpowf(Rx,k)+extpowf(Bx,k))):g:=evalm(1/x[1]*linsolve(JJ-AK,vector(NK,0),'r',x));h:=evalm(1/x[1]*linsolve(JJ-transpose(AK),vector(NK,0),'r',x));print(k,h,g); od;print("-------------------------------------")

 > od;od;od;od;od;od;

 > for i1 in 1 do for i2 in 1,2 do for i3 in 1,2 do for i4 in 1,2 do  ee:=[bit[i1],bit[i2],bit[i3],bit[i4]];phi:=diag(seq(ee[q],q=1..n)); Detta:=Matrix(multiply(phi,Delta));Rx:=evalm(A+Detta); Bx:=evalm(A-Detta);print(ee);

 > for k from 1 to n-1 do NK:=binomial(n,k):uu:=vector(NK,1):JJ:=evalm(IdentityMatrix(NK)):AK:=evalm((1/2)*(extpowf(Rx,k)+extpowf(Bx,k))):

 > g:=evalm(1/x[1]*(linsolve(AK-JJ,vector(NK,0),'r',x)));h:=evalm(1/x[1]*linsolve(JJ-transpose(AK),vector(NK,0),'r',x));print(k,h,g) od;  print("------------------");   od;od;od;od;