+1 vote
asked by (770 points)

Hi,

I was wondering if it would be possible to get some information out about the MPS that is obtained in each sweep of DMRG. Specifically, I would like to print out the variance of the energy in the supposed ground state for each DMRG sweep to see how good the approximation is.

On the other hand, is it possible to suppress the natural results that a DMRG routine prints out as shown below?

After sweep 1 energy=-350.877237923946 maxlinkdim=10 maxerr=1.22E-02 time=2.687
After sweep 2 energy=-351.335659342829 maxlinkdim=20 maxerr=1.68E-06 time=2.759
After sweep 3 energy=-351.419459673139 maxlinkdim=50 maxerr=2.49E-09 time=11.168
After sweep 4 energy=-351.440265798309 maxlinkdim=81 maxerr=1.00E-10 time=25.016
After sweep 5 energy=-351.451576318809 maxlinkdim=103 maxerr=9.99E-11 time=27.875
After sweep 6 energy=-351.458798958939 maxlinkdim=118 maxerr=9.99E-11 time=29.819
After sweep 7 energy=-351.463802923464 maxlinkdim=110 maxerr=1.00E-10 time=35.929
After sweep 8 energy=-351.467183778837 maxlinkdim=113 maxerr=9.99E-11 time=40.620
After sweep 9 energy=-351.469479929706 maxlinkdim=138 maxerr=1.00E-10 time=49.070
After sweep 10 energy=-351.470973171373 maxlinkdim=133 maxerr=1.00E-10 time=56.519

Best,
Arnab

1 Answer

+1 vote
answered by (70.1k points)
selected by
 
Best answer

Hi Arnab,
This is about the Julia version of ITensor, correct?

Yes, we have two features of the DMRG code that can do the things you want:

  1. by passing the keyword argument outputlevel=0 to the dmrg function you can turn off all the output

  2. by making and passing a custom observer object, you can perform arbitrary measurements and print extra custom output throughout a DMRG calculation. For the case of getting the variance, you would just get the wavefunction on a certain step of DMRG, and then use the inner(H,psi,H,psi) and inner(psi,H,psi) functions to get <H^2> and E.

Docs about Observer system:
https://itensor.github.io/ITensors.jl/stable/Observer.html

Welcome to ITensor Support Q&A, where you can ask questions and receive answers from other members of the community.

Formatting Tips:
  • To format code, indent by four spaces
  • To format inline LaTeX, surround it by @@ on both sides
  • To format LaTeX on its own line, surround it by $$ above and below
  • For LaTeX, it may be necessary to backslash-escape underscore characters to obtain proper formatting. So for example writing \sum\_i to represent a sum over i.
If you cannot register due to firewall issues (e.g. you cannot see the capcha box) please email Miles Stoudenmire to ask for an account.

To report ITensor bugs, please use the issue tracker.

Categories

...