How to adjust the 'N_sweeps_check' and 'update_env' parameters in Tenpy's idmrg calculation

How do I use this algorithm? What does that parameter do?
Post Reply
kevln
Posts: 18
Joined: 12 May 2022, 07:02

How to adjust the 'N_sweeps_check' and 'update_env' parameters in Tenpy's idmrg calculation

Post by kevln »

When using the idmrg algorithm in Tenpy for calculations, there are two parameters, 'N_sweeps_check' and 'update_env', that have been confusing for me.

Here are my concerns regarding the role of these parameters in the idmrg calculation:
  • By default, 'N_sweeps_check' is set to 10. If I reduce 'N_sweeps_check' to 2, it seems that the calculation information is output every two sweeps. Does this result in longer computation time and more accurate results (such as momentum entanglement spectra)? If my results (such as momentum entanglement spectra) are not satisfactory, should I adjust the 'update_env' parameter?
  • Based on my experience, 'update_env' seems to be important during the charge_pump process in the calculation. A larger value for 'update_env' appears to help achieve the desired shape of the charge_pump. My question is, if max_sweep = 100, 'N_sweeps_check' = 2, and 'update_env' = 10, does this mean that the environment is updated 100/2*10 = 500 times or 10 times? If it is 500 times, does it imply that I need to adjust both 'update_env' and 'N_sweeps_check' simultaneously to obtain a reasonable total number of environment updates when computing charge_pump?
  • In summary, I am unsure how to properly adjust these two parameters when calculating momentum entanglement spectra and charge_pump. Could you provide specific guidance on how to adjust these parameters to obtain more accurate results when the entanglement spectra and charge_pump results are not satisfactory?
User avatar
Johannes
Site Admin
Posts: 428
Joined: 21 Jul 2018, 12:52
Location: TU Munich

Re: How to adjust the 'N_sweeps_check' and 'update_env' parameters in Tenpy's idmrg calculation

Post by Johannes »

the N_sweeps_check defines how often you check for convergence and print the status output to the log. Many iDMRG runs need >100 sweeps to converge, but every sweep is much faster than comparable finite-size DMRG runs (since L_x_infinite ~1-2 << L_x_fininte ~ 50=200 for typical runs).
Assuming that you still have N_sweeps_check << total (i)DMRG sweeps, it does not really affect the result (since it only prints and checks whether to stop).
There is one exception, though, which is the exactly the environment sweeps you mention. The environment sweeps are done every time we check for convergence, so yes, if you choose a large `N_sweeps_check`, it does less environment updates. In your example, it's indeed the 100/2*10=500 environment sweeps.

The environment sweeps are effectivly a poor-man's version of the VUMPS algorithm - the latter performs a full updates of the environment until convergence. Plain iDMRG with environment_sweeps=0 is the other extreme. Choosing non-zero environment_sweeps allows you to trade computation time between updating tensors with lanczos (during the DMRG sweep) to lower the energy, and spending significant computational time on converging the environments without updating the MPS tensors.

How many environment_sweeps you need to do, and whether you can get away to not do them after each sweep really depends on the system you're looking at, so I can't give generic values how to choose those parameters.
In general, the larger your correlation length the more environment sweeps you have to do to fully converge the environments.
On the other hand, note that the Lx also plays a role here - if you double Lx, the environment_sweeps can half to reach the same distance by which you grow the system (i.e. converge the environments).
kevln
Posts: 18
Joined: 12 May 2022, 07:02

Re: How to adjust the 'N_sweeps_check' and 'update_env' parameters in Tenpy's idmrg calculation

Post by kevln »

Thank you very much for your reply. It has been very helpful in addressing my concerns. Based on your explanation, does this mean that by changing the parameters of the sweeps (such as truncation bond dimension and the number of sweeps) and adjusting the total number of environment updates through 'N_sweeps_check' and 'update_env', Tenpy can achieve a better ground state in the idmrg calculation? And is it necessary for me to experiment with these parameters based on the specific system I am studying?
Post Reply