Hi, everyone!
I need to compute a mutual information matrix of a MPS:
where
Following this topic, I’ve computed the reduced density matrix for each pair of sites.
Then, I tried to implement this function to compute each entropy term
function MI_matrix(rdm)
A,B = size(rdm);
I_AB = zeros(A,B);
for a in 1:A, b in a+1:B
rho_AB = copy(rdm[a,b]);
delta_AA = delta(dag(inds(rho_AB)[1]), dag(inds(rho_AB)[2]));
delta_BB = delta(dag(inds(rho_AB)[3]), dag(inds(rho_AB)[4]));
rho_B = delta_AA*rho_AB;
rho_A = delta_BB*rho_AB;
S_AB = -tr(reshape(Array(rho_AB,inds(rho_AB)[1], inds(rho_AB)[3], inds(rho_AB)[2], inds(rho_AB)[4]),16,16)
* log(reshape(Array(rho_AB,inds(rho_AB)[1], inds(rho_AB)[3], inds(rho_AB)[2], inds(rho_AB)[4]),16,16)));
S_A = -tr(Array(rho_B, inds(rho_B)[1], inds(rho_B)[2]) * log(Array(rho_B, inds(rho_B)[1], inds(rho_B)[2])));
S_B = -tr(Array(rho_A, inds(rho_A)[1], inds(rho_A)[2]) * log(Array(rho_A, inds(rho_A)[1], inds(rho_A)[2])));
I_AB[a,b] = I_AB[b,a] = S_A + S_B - S_AB;
end
return I_AB
end
rdm is the matrix cotaining all the 2-sites reduced density matrices.
For the part of S(A,B) , it is correct to compute the value in this way?
First, i need to convert each rank-4 tensor \rho_{AB} into a matrix (16x16 because each site has dimension 4) and then I apply the function tr.
For \rho_{A} and \rho_{B} , I’ve used a delta tensor.
For the single site entropy, I obtain something then seems right, but for S(A,B) when I compute log\rho_{AB } the result is NaN.
Do you think that the procedure is correct?