# How to get a reduced density matrix on more than 2 qubits?

+1 vote

Hi I want to calculate entanglement entropy on more than 2 qubits. How could this be done using ITensor?

Hi, so depending on which qubits you want the entanglement for from a general N-qubit wavefunction, it can range from being straightforward to very difficult and computationally expensive.

But a common type of entanglement which is very efficiently computable is the entanglement entropy of a left-right bipartition of a state represented by an MPS. So this means the entanglement between a region "A" which is sites 1,2,3,...,L and region B which is sites L+1,L+2,...,N for an MPS with N sites.

To obtain this entanglement entropy, please see the following sample code provided on the ITensor website (in the "code formulas" section):
http://itensor.org/docs.cgi?page=formulas/entanglement_mps

As you may know, even if your system isn't strictly 1D, you can still often get away with representing its wavefunction by an MPS and by choosing the ordering of the MPS sites appropriately (or changing the ordering using swap gates) you can get the entanglement entropy of all sorts of bipartitions. I used this approach in the following paper:
https://arxiv.org/abs/1401.3504
(see Fig. 4)

Best regards,
Miles

commented by (130 points)
Hi Miles,

Thanks for your enthusiasm reply! The system that I want to look into is 1d. And what I want is the reduced density matrices in the middle, for example, rho_{i,i+1}. Is this doable?
commented by (28.8k points)
Hi, yes so you can certainly compute a reduced density matrix for some contiguous block in the middle. You just have to trace the other sites except sites i and i+1 (and possibly use the gauge conditions to skip tracing over any left- or right-orthogonal tensors). The resulting density matrix will have four indices so will be efficient to compute. The only caution is that if you want to do a bigger block of say "B" sites, then the cost of computing the reduced density matrix will scale exponentially with B.