Page 1 of 1

norm_tol parameter for DMRG

Posted: 24 Apr 2019, 07:26
by bart
I am searching for a way to reliably get rid of the warning:

Code: Select all

/TeNPy/tenpy/algorithms/dmrg.py:523: UserWarning: final DMRG state not in canonical form within `norm_tol` = 1.00e-06
  warnings.warn(msg.format(nt=norm_tol))
I have tried running a simulation with the following DMRG parameters:

Code: Select all

dmrg_params = {
        'mixer': True,
        'mixer_params': {'amplitude': 1.e-5, 'decay': 1.2, 'disable_after': 30},
        'trunc_params': {
            # 'chi_max': chi_max,
            'svd_min': 1.e-10
        },
        # 'lanczos_params': {
        #     'reortho': True,
        #     'N_cache': 40
        # },
        'chi_list': {0: 9, 10: 49, 20: 100, 40: 600},
        # 'max_E_err': 1.e-10,
        # 'max_S_err': 1.e-6,
        'norm_tol': 1.e-6,
        'norm_tol_iter': 1000,
        # 'max_sweeps': 150,
        'verbose': 1,
        'N_sweeps_check': 10
    }
I was under the impression that the optional "norm_tol" parameter would keep the simulation running for "norm_tol_iter" sweeps until the desired tolerance had been reached. To my surprise, the simulation stopped after around 300 sweeps and still gave me the above warning... :cry:

1) Should specifying "norm_tol", without specifying "norm_tol_iter", keep the simulation running indefinitely until the desired norm_tol has been reached?

2) Why is my simulation stopping in less than 1000 sweeps without having reached my desired norm_tol?

3) How to reliably ensure that my final DMRG state is in canonical form?

For reference, here is the final verbose output from one of my simulations with these DMRG parameters:

Code: Select all

sweep 270, age = 60030
Energy = -0.9591375409272587, S = 1.9900301579609951, norm_err = 2.8e-04
Current memory usage 1792.1 MB, time elapsed: 2167.6 s
Delta E = 3.9906e-09, Delta S = 6.4814e-06 (per sweep)
max_trunc_err = 3.3170e-08, max_E_trunc = 5.5070e-07
MPS bond dimensions: [600, 600, 600, 600, 600, 600]
norm_tol=1.00e-06 not reached, norm_err=2.80e-04
Thanks in advance for any help or advice :)

Re: norm_tol parameter for DMRG

Posted: 13 Jun 2019, 17:52
by Qottmann
Any answer to this?

Re: norm_tol parameter for DMRG

Posted: 28 Jun 2019, 09:41
by Johannes
1) No, it doesn't.
The problem is that bringing the state into canonical form during the DMRG run will screw up the environments.
Thus, the `norm_tol` is only checking if the final state returned by DMRG is in canonical form.
It tries to ensure the canonical form by performing a few more environment updates, and if that didn't help, it calls psi.canonical_form().
The latter does always bring it to canonical form, at least down to half the machine precision because it needs to take square roots.
If you try psi.norm_test() after the DMRG run, it should give you an error smaller than norm_tol.

2) same reason

3) choose a small `norm_tol`, see above. If you think that this changed the state too much, you need to run another DMRG simulation.

The optimal solution would be to use something like VUMPS instead of DMRG, but that's currently not implemented. Also, I'm not sure how well this works for large unit cells of the infinite MPS.