Hello,
I am generating this matrix in 2d:
0.7071 0.70710.7071 0.7071
But for even number (and of course greater than 2) I need to generate that:
0.7071 0.7071 0 00.7071 0.7071 0 00 0 0.7071 0.70710 0 0.7071 0.7071
But I can not handle with my size problem. Here is my code:
function [A,B] = CHSH2d(d) A=zeros(d,d,2,d); B=A; projectors_of_sigma_x = [1/sqrt(2)*[1;1],1/sqrt(2)*[1;-1]]; for k = 1:d for l =1:d A(:,:,1,k)=repmat(projectors_of_sigma_x(:,k),1,d); if d > 2 A(:,:,1,k) = blkdiag(A(:,:,1,k)); end end endend
Best Answer