ITensor / TDVP

ITensor implementation of the time dependent variational principle (TDVP) algorithm for finite MPS
24 stars 8 forks source link

LocalMPO as tdvp parameter #8

Open chuffa opened 3 years ago

chuffa commented 3 years ago

Hi,

While I am at it. If I use standard TDVP only providing a Hamiltonian and say I want to measure every time step, the current version of the code computes the contractions for the effective Hamiltonian anew each time step. By providing a TDVP function that takes a LocalMPO instead of the Hamiltonian as parameter this unnecessary work could be avoided. While this choice puts more responsibility on the user, because the MPS must not be changed without the LocalMPO knowing, I still think it would be a good thing to have for people who know what they are doing.

I can also make a pull request and test it if this functionality is wanted ... in the end, it is not much more than adding a new function declaration.

Daniel

mingruyang commented 3 years ago

Hi Daniel,

Thanks for the suggestion! Currently, I think the TDVPWorker function can already fulfill your purpose.

For the conventional TDVP, actually there is a better way to do measurement at every time step: you can custom the DMRGObserver class (see the source code here). The tdvp function accepts an DMRGObserver object as an argument. But this DMRGObserver is not user friendly enough so I'm thinking about some better ways to do it.