# MPO construction from two site custom op

**URL:** <https://itensor.discourse.group/t/mpo-construction-from-two-site-custom-op/1924>\
**Category:** ITensor Julia Questions\
**Tags:** mpo\
**Created:** [August 13, 2024, 6:41pm UTC](https://itensor.discourse.group/t/mpo-construction-from-two-site-custom-op/1924 "2024-08-13T18:41:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ryanlevy](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/ryanlevy/32/150_2.png) [@ryanlevy](https://itensor.discourse.group/u/ryanlevy)\
**Post date:** [August 13, 2024, 7:58pm UTC](https://itensor.discourse.group/t/mpo-construction-from-two-site-custom-op/1924/2 "2024-08-13T19:58:30Z")

</div>

See Miles’ answer from here:

> [@Defining two site local operators as part of a local Hamiltonian](https://itensor.discourse.group/t/defining-two-site-local-operators-as-part-of-a-local-hamiltonian/386/2):
>
> It’s an interesting thing to do, and would be a good feature for us to have, but unfortunately right now the AutoMPO system (since renamed the OpSum system) doesn’t support two-site operators like “CZ” currently. Internally what it would have to do is to compute the SVD of this operator to write it as a sum of products of single-site operators, and then put these into the sum of terms (like a rewriting rule). So it’s something we could add but would take a bit of development. As a workaround, y…

Essentially the OpSum system can’t do that at the moment, however if you can write it as a string (O\_i \otimes O\_j \dots ) or a sum of strings as in the post then that can be used. And for generic 2 site matrices you would have to decompose it by hand into that format

---

_[View the full topic](https://itensor.discourse.group/t/mpo-construction-from-two-site-custom-op/1924)._
