Why is finite DMRG running so slowly?

How do I use this algorithm? What does that parameter do?
Post Reply
DragonCat
Posts: 1
Joined: 18 Jul 2024, 05:56

Why is finite DMRG running so slowly?

Post by DragonCat »

Hi! I want to use Tenpy to find the ground state and first excited state energies. However, DMRG is running very slowly. For small system sizes, it is even slower than exact diagonalization! (~25 seconds for 10 spins; ~145 seconds for 12 spins.) My model is an Ising-type spin model with nearest and next-nearest neighbor interactions (I'm using the CouplingMPOModel class on a "chain" lattice). It runs faster for certain coupling strengths than others--but how fast it runs does not seem to be correlated with any physics I am aware of.

These are the DMRG parameters I'm using:

Python: Select all

dmrg_params = {
    'trunc_params': {
        'chi_max': 300, 
        'svd_min': 1.e-10
    },
    'mixer': True,
    'max_sweeps': 30
    } 
Then, I run DMRG like this to get the ground state:

Python: Select all

eng = dmrg.TwoSiteDMRGEngine(mps, model, dmrg_params)
E0, psi0 = eng.run()
And again, to get the first excited state:

Python: Select all

eng_excited = dmrg.TwoSiteDMRGEngine(mps, model, dmrg_params, orthogonal_to=[psi0])
E1, psi1 = eng_excited.run()
I also tried One-Site DMRG, but that doesn't give me the correct results. My model has translational symmetry, but when I checked, that is not reflected in the bond dimensions across the chain. What is causing the code to be so slow? Could I get some guidance on choosing dmrg_params? Some of my collaborators use other DMRG packages and their code seems to run much faster... your help is greatly appreciated!

P.S. Eventually, I would like to extend this to infinite DMRG, so if you have any guidance on choosing parameters for that, I would greatly appreciate it as well! Thanks!
User avatar
Johannes
Site Admin
Posts: 457
Joined: 21 Jul 2018, 12:52
Location: TU Munich

Re: Why is finite DMRG running so slowly?

Post by Johannes »

TeNPy has comparable speed with other libraries like ITensor, if you fix parameters for a fair comparison.

One big difference is the default dmrg_params['lanczos_params']['N_max'], the maximum number of lanczos iterations for finding the "ground state" before moving on to the next site. This defaults to 20 for TeNPy, but most other libraries set it to something like 5 or even 3. Personally, I found that such a low value is good for speed for finite DMRG, but can hinder a convergence for infinite DMRG at all. Since we have the same default value for both finite and infinite DMRG, I am hesitant to reduce it for the general setting.
Maybe we should think about changing the default value depending on which case one runs (finite vs infinite DMRG).
Post Reply