# Computing Renyi entropy of a sub-system in the middle of a 1D chain

**URL:** <https://itensor.discourse.group/t/computing-renyi-entropy-of-a-sub-system-in-the-middle-of-a-1d-chain/2523>\
**Category:** ITensor Julia Questions\
**Tags:** julia, entanglement, mps, mpo\
**Created:** [November 6, 2025, 11:40am UTC](https://itensor.discourse.group/t/computing-renyi-entropy-of-a-sub-system-in-the-middle-of-a-1d-chain/2523 "2025-11-06T11:40:10Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![miles](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/miles/32/6_2.png) [@miles](https://itensor.discourse.group/u/miles)\
**Post date:** [November 6, 2025, 3:16pm UTC](https://itensor.discourse.group/t/computing-renyi-entropy-of-a-sub-system-in-the-middle-of-a-1d-chain/2523/2 "2025-11-06T15:16:04Z")

</div>

Yes, I’m not surprised that `outer(psi', psi)` is a bottleneck. The short answer is that making a density matrix that way is not an efficient way to do it and there are much more efficient ways.

One thing that might immediately help you is the ITensorEntropyTools.jl package:  
[https://itensor.discourse.group/t/introducing-itensorentropytools-jl/2192](https://itensor.discourse.group/t/introducing-itensorentropytools-jl/2192)  
One of the main features of this package is that it automatically determines the best strategy for computing density matrices of the type you are computing (there are roughly two good ways to compute these and it figures out which one).

If that package doesn’t cover your case, please reply below and we could give you additional pointers about how to do this calculation.

---

_[View the full topic](https://itensor.discourse.group/t/computing-renyi-entropy-of-a-sub-system-in-the-middle-of-a-1d-chain/2523)._
