Custom sweep direction in DMRG

Dear all,

after using a python package for some DMRG-calculations, I wanted to give ITensor in Julia a try. For the specific problem and setting I am looking at, and from previous tries, I got the fastest convergence, with comparable accuracy, if I only did sweeps in one direction, and then redo the canonization after each sweep such that I can start from the same side.

It seems, that the DMRG in ITensor only supports “full” sweeps going forth and back. So I guess, I will have to implement my own version of DMRG. Fortunately, I should be able to modify the existing code. Since I am completely new to ITensor and Julia, I would like to get some advise and clarifications on a few points.

  • Would it be sufficient to have my own sweepnext function, that basically just gives out the tuples for one sweep-direction, end then after each sweep call orthogonalize! for the site that I want to start with for the next sweep (e.g. the first site for only sweeps to the right)? The first element of the tuple seems to give out the (first) site of interest and the second the sweep direction.

  • At various points in the code, the function checkflux is called. What specifically is its purpose?

  • In the struct ProjMPO, are the left and right environments, that are build during the DMRG, saved in the field “LR”? Do I have to change anything to have them build correctly, or are they already build (e.g. by orthogonalizing or calling the position! function)?

  • Is there anything else, that I should look out for? Maybe, in terms of efficiency?

Thanks a lot for your comments!

Best,
Arne

PS: It would be super nice, if there was a DMRG-function in ITensor, that would support custom sweep sequences, and handles redoing the canonization if necessary, i.e. if the sweep direction is the same. For example, Quimb in python has this option (but lacks other things, like adding noise, and not to mention the speed).

That’s very interesting to hear that sweeping in one direction leads to faster convergence for some use cases, I wasn’t aware of that! Which systems did you find that helped with?

This should already be possible with our new DMRG implementation in: GitHub - ITensor/ITensorTDVP.jl: Time dependent variational principle (TDVP) of MPS based on ITensors.jl.. There, we support various Trotter orders, and the uni-directional sweeping you describe corresponds to a Trotter order of 1 (Trotterization makes more sense in the context of the TDVP algorithm, but DMRG corresponds to TDVP with an infinite imaginary time step). You should be able to use ITensorTDVP.dmrg and pass a keyword argument order=1 (the default is order=2, the standard DMRG sweep).

We are also planning on adding a more general custom sweeping interface, as part of our effort to add a general DMRG/TDVP code for tree tensor networks (Sweeping algorithms for tree tensor networks by leburgel · Pull Request #43 · ITensor/ITensorTDVP.jl · GitHub), where there are various choices for how to sweep through the network for a given tree tensor network topology. Having said that, hopefully the current interface will suffice for your use case.