VUMPS - 2D models and memory consumption

@kevinh thanks for sharing a code, that is helpful.

I can confirm that I see the same issue even with the latest version of the ITensorInfiniteMPS.jl package, so there must be some lingering performance bug in the VUMPS implementation that wasn’t addressed by my optimizations in Optimizations for VUMPS by mtfishman · Pull Request #64 · ITensor/ITensorInfiniteMPS.jl · GitHub.

It looks like there is a performance issue in the subspace expansion step, where the infinite MPS bond dimension is increased. That is where I’m seeing the code crash with an out-of-memory error, and also seeing the code using more memory and taking more time to run than I would expect.

From profiling just the subspace expansion step (using ProfileView.jl), I see it spending most of the time in this contraction: ITensorInfiniteMPS.jl/subspace_expansion.jl at db941c6c97ba006a2af441f74949811c05f03bb5 · ITensor/ITensorInfiniteMPS.jl · GitHub

Likely there is a relatively simple fix by improving the order of the tensor contractions in the function generate_twobody_nullspace along the lines of the optimizations I did in Optimizations for VUMPS by mtfishman · Pull Request #64 · ITensor/ITensorInfiniteMPS.jl · GitHub.