Great question! The reason why this works in DMRG is that there is an outer loop repeatedly calling Lanczos, when we repeatedly sweep over the various bonds of the MPS. This outer loop is effectively restarting the Lanczos algorithm once you get close to the ground state and converge, and in that case the 20 iterations are definitely enough: often times, just two or three Lanczos iterations are needed in the end for each bond update once the state is close to the ground state.Yida Chu wrote: Actually, I have a few more questions for you about lanczos in TeNPy. I notice that in TeNPy you set the default maximum number of iterations for lanczos (i.e. the attribute N_max) to be 20. However, when I tried to realize DMRG and lanczos algorithm on my own, I found that for a Hermitian matrix with a large dimension or a tensor-form effective Hamitonian in DMRG, 20 iterations may not be able to accurately obtain its lowest eigenvalue. So I was wondering if you've used any tricks in TeNPy to make sure that you can get a good result for only 20 iterations?
This restarting through the outer loop also helps to avoid the numerical instability of Lanczos of spurious eigenvectors appearing after just a moderate number of Lanczos iterations.