Looking for a documention on DMRGObserver for C++ version

Hi!
I am trying to optimize the convergence of DMRG algorithm by measuring operators like correlation and magnetization at each sweep. I see that the documentation on DMRG Observer for Julia version is very well written. Is there any place (except looking at the original DMRGObserver code) from where I can understand the procedure of writing my own Observable for c++ version.

Will it suffice to make another function (which is calculating come other observer, eg. correlation) similar to “void inline DMRGObserver::measure(Args const& args)” in DMRGObserver file? Or DMRGObserver Object needs to reconstructed?

Thanks.

1 Like

It’s a good question. I should have documented how to make a custom DMRGObserver already! I just added some documentation in the form of an example walkthrough here:

http://itensor.org/docs.cgi?vers=cppv3&page=formulas/dmrg_observer

Please let me know if you have any questions about it or spot any issues with it.

1 Like

Also the code for DMRGObserver itself could be instructive on how to write your own measure or checkDone methods:

https://github.com/ITensor/ITensor/blob/v3/itensor/mps/DMRGObserver.h