How to calculate von Neumann entropy from MPS

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!

Hi, so the code should compute the von Neumann entropy, as defined here:
https://en.wikipedia.org/wiki/Von_Neumann_entropy
If you believe it isn’t, please let us know why not but I think it is.

Hi Miles. Thank you! It seems like I have some misunderstanding of the code I posted.

1 Like

Can we apply the method for the matrix product density operator (MPDO).

If the definition of entropy you are wanting to compute would be the same as if you treated an MPDO as an MPS i.e. a “purification” of the density matrix then yes. However, if you are asking if you can compute the thermodynamic entropy (i.e. the entropy in the formula F = E-TS) this way then no, because that entropy is defined differently.