Defining two site local operators as part of a local Hamiltonian

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, you could work out a factorization of CZ like this for yourself, either numerically or probably by hand if you worked on it a bit. Basically you could define it as:

P_0 \otimes I + P_1 \otimes Z

where P_0 projects the control site onto the 0 state and P_1 projects the control site onto the 1 state. That sum of terms would then be something our system can read in.