Hi all. So I am trying to calculate von Neumann entropy (not entanglement entropy, namely I am not trying to bipartite the system) by using the ground state psi after DMRG. The ground state energy matches well with exact diagonalization (ED), so I am trying to find out whether the von Neumann entropy of the density matrix constructed from psi matches that from ED.
I fully realize that there is an official way of computing entanglement entropy from psi provided by itensors team. The code is as following:
orthogonalize!(psi, b)
U,S,V = svd(psi[b], (linkind(psi, b-1), siteind(psi,b)))
SvN = 0.0
for n=1:dim(S, 1)
p = S[n,n]^2
SvN -= p * log(p)
end
However, this is not what I want. I am asking how to modify this block of code to calculate just von Neumann entropy. Thanks!