Compression of MPO

Hi Itensor team,
Is there any general algorithm to compress an MPO already implemented in Itensor? Maybe something naive like a sweep of SVD decomposition across all tensors of the MPO. If yes, could you please point to me to right portion of code? And in general, do you have any advice on what’s the best method to compress an MPO?
Thank you as always,
Francesco

You should be able to use the truncate! function. The documentation for that can be found here.

Thank you for your answer! So truncate does indeed a sweep of SVDs over all specified sites, if I understand correctly. Why is ::Algorithm"frobenius" an argument?

Yes. That makes it so that truncate! can be overloaded with other backends, which can be selected with a keyword argument truncate!(::MPO; cutoff=1e-5, alg="frobenius").

"frobenius" refers to the fact that an SVD is an optimal truncation when using the Frobenius norm, which isn’t always the best metric/norm to use to truncate an MPO (it depends on the MPO, and what properties you are trying to preserve). So that is a “hidden” interface right now, anticipating that we might have other backends in the future.

For example, there is an experimental package GitHub - JanReimers/ITensorMPOCompression.jl: Block respecting compression of MPOs and iMPOs for providing another algorithm for truncating MPOs, which is designed for truncating MPOs representing sums of local operators, which can provide better truncation and avoid issues with numerical overflow which can be seen when naively using SVD truncation for MPOs with a large number of sites. Ideally that would be provided as a different backend to truncate! through the alg interface but that isn’t set up right now.

Ok I see, thank you a lot for your clarification.