|
Your reply reads;
> syms p
> A = [1 p;0 1];
> B = [1 p;0 1-p];
>
> mat = npermutek(['A' 'B'],4);
>
> for i=1:length(mat)
> a=eval(sym(mat(i,1)));
> b=eval(sym(mat(i,2)));
> c=eval(sym(mat(i,3)));
> d=eval(sym(mat(i,3)));
> kron(kron(kron(a,b),c),d)
> end
> ------------------------------------
>
> answer for first row AAAA is
>
>
> [ 1, p, p, p^2, p, p^2, p^2, p^3, p, p^2, p^2, p^3, p^2, p^3, p^3, p^4]
> [ 0, 1, 0, p, 0, p, 0, p^2, 0, p, 0, p^2, 0, p^2, 0, p^3]
> [ 0, 0, 1, p, 0, 0, p, p^2, 0, 0, p, p^2, 0, 0, p^2, p^3]
> [ 0, 0, 0, 1, 0, 0, 0, p, 0, 0, 0, p, 0, 0, 0, p^2]
> [ 0, 0, 0, 0, 1, p, p, p^2, 0, 0, 0, 0, p, p^2, p^2, p^3]
> [ 0, 0, 0, 0, 0, 1, 0, p, 0, 0, 0, 0, 0, p, 0, p^2]
> [ 0, 0, 0, 0, 0, 0, 1, p, 0, 0, 0, 0, 0, 0, p, p^2]
> [ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, p]
> [ 0, 0, 0, 0, 0, 0, 0, 0, 1, p, p, p^2, p, p^2, p^2, p^3]
> [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, p, 0, p, 0, p^2]
> [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, p, 0, 0, p, p^2]
> [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, p]
> [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, p, p, p^2]
> [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, p]
> [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, p]
> [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
>
> --Nasser
Kindly clarify and help further
1. d=eval(sym(mat(i,3))); whether it should be d=eval(sym(mat(i,4))); or not?
2. I have to further use these 16 matrices, generated by the code you have supplied through kron(kron(kron(a,b),c),d), for multiplication with another 16x16 matrix, say the first one you have given in your reply and to sum up the result.
please help also for it.
i.e. tensor(A,A,A,A).(16x16 matrix).ctranspose(tensor(A,A,A,A))+.......+tensor(B,B,B,B).(16x16 matrix).ctranspose(tensor(B,B,B,B))
where tensor(A,A,A,A) means the first 16x16 matrix generated by your code and given by you above.
Regards,
Ramzan.
|