# Summing two MPOs calls an eigensolver ?

**URL:** <https://itensor.discourse.group/t/summing-two-mpos-calls-an-eigensolver/1579>\
**Category:** ITensor Julia Questions\
**Tags:** julia, mpo\
**Created:** [March 24, 2024, 7:00pm UTC](https://itensor.discourse.group/t/summing-two-mpos-calls-an-eigensolver/1579 "2024-03-24T19:00:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nichola](https://avatars.discourse-cdn.com/v4/letter/n/f0a364/32.png) [@Nichola](https://itensor.discourse.group/u/Nichola)\
**Post date:** [March 24, 2024, 7:00pm UTC](https://itensor.discourse.group/t/summing-two-mpos-calls-an-eigensolver/1579/1 "2024-03-24T19:00:57Z")

</div>

I have noticed that when I add two MPO’s together, the itensor’s ‘+’ operator end up calling lapack syevr.  
This happens even when I set a common bound dimension by using `truncate` before summing the MPOs. Why does summing requires ED ? I would have expected that summing two MPO’s with the same bond dimension only requires to sum the entries together.

This is critical and surprising because my lanczos code ends up spending most of its time doing trivial steps in lapack syevr instead of doing tensor contractions.

Is there a more efficient way to sum two MPOs with the same bond dimension ?

---

<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:** [March 25, 2024, 3:05am UTC](https://itensor.discourse.group/t/summing-two-mpos-calls-an-eigensolver/1579/2 "2024-03-25T03:05:30Z")

</div>

Hi Nichola,  
It’s a good question. While it may seem that adding MPO’s would be done by adding the elements of the tensors, that’s actually not the correct mathematical procedure and the correct one is more interesting. The actual procedure is to sum MPO’s A + B, one creates a new MPO C which is block diagonal with the blocks consisting of the tensors of A and B:

 ![Screenshot 2024-03-25 at 12.01.09 PM](https://global.discourse-cdn.com/free1/uploads/itensor/original/1X/baf5e4d542e1827f0410501d6e20481e731d8e20.png)

So you can see if the bond dimension or rank of the MPO’s is \chi\_A and \chi\_B, then the bond dimension of C can be as large as \chi\_C = \chi\_A + \chi\_B. But in many cases the bond dimension is less than this, and can even be as small as \chi\_C depending on the details of the MPO’s one is summing. To find out the actual bond dimension of C, one has to **diagonalize** the C tensors and truncate these diagonalizations to the desired accuracy of the sum.

So that is why you see something like syevr running. We aren’t performing “ED” per ses, which is more of a physics term for finding a few dominant eigenvectors very large matrices using techniques like Lanczos. But we are just diagonalizing certain intermediate matrices appearing in a procedure like that sketched above.
