Hi.

I'm using the infinite dmrg in your TeNPy to simulate the spin-1 chain in the external field.

and I fix the length of unit cell as 20 (L=20)

When 'N_sweeps_check'= 10(default) in the gapless phase, the ground state does not converge very well (other dmrg_params are also default except 'chi_max'=200) as the entanglement entropy fluctuates greatly.

So, i change 'N_sweeps_check' as 100 and thereby it converges very well!

It might be a stupid question, but Is there any relation between 'N_sweeps_check' and 'L' to get a good ground state?

## N_sweeps_check & unit cell in infinite dmrg

### Re: N_sweeps_check & unit cell in infinite dmrg

In general, the parameter

Let's look at what it influences:

`N_sweeps_check`

should not change the convergence properties - at least not much....Let's look at what it influences:

- For checking the convergence, DMRG checks the average change of the energy / entropy per sweep in the last
`N_sweeps_check`

steps. - The parameter
`update_env`

defaults to half of`N_sweeps_check`

.

Did you set this parameter explicitly?

`update_env`

defines how many sweeps we do without changing the state to converge the environment, every`N_sweeps_check`

sweeps before checking the convergence.

In general, a large number of`update_env`

is needed if you have a large correlation length. Also, it helps to get back into canonical form; what's the "norm_error" reported by DMRG?

### Re: N_sweeps_check & unit cell in infinite dmrg

Thank you for your reply.

I was a bit late to check it.

As you mentioned above, 'nomr_error' is larger than 1.00e-05 and "UserWarning" pops up when 'N_sweeps_check'=1.

On the other hand, the case of 'N_sweeps_check'=100 is not.

In addition, while checking dmrg_params in tenpy.algorithms.dmrg,
I found that the last line in above code is not

So, is it fine to miss

I was a bit late to check it.

As you mentioned above, 'nomr_error' is larger than 1.00e-05 and "UserWarning" pops up when 'N_sweeps_check'=1.

On the other hand, the case of 'N_sweeps_check'=100 is not.

In addition, while checking dmrg_params in tenpy.algorithms.dmrg,

Code: Select all

```
while True:
# check convergence criteria
if self.sweeps >= max_sweeps:
break
if (self.sweeps > min_sweeps and -Delta_E < max_E_err * max(abs(E), 1.)
and abs(Delta_S) < max_S_err):
```

`abs(Delta_S) < max_S_err * S`

, i.e., `S`

is not included. So, is it fine to miss

`S`

? or is it typo?### Re: N_sweeps_check & unit cell in infinite dmrg

That should be fine, it's just the difference between checking the absolute and the relative error.

For the energy, we need to check the relative error: the energy scale can vary by quite a bit simply by rescaling your Hamiltonian.

However, the entropy can not vary that much - it will be between 0 and log(chi) < 10 (for chi <~ 10000). Hence, we can check the absolute error of the entropy - checking the relative error of the entropy would be bad for the exact value of S being (very close) to 0 (i.e. the true ground state being a product state, which can happen from time to time) due to a division by (almost) 0.