How to use Multi-Species Models like FermiHubbardModel2

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

How to use Multi-Species Models like FermiHubbardModel2

Post by kevln »

Hi,Tenpy Forum

I want to use Multi-Species Models like FermiHubbardModel2,and know that this can make diffenet Species such as up and down ,so l try my model as follow

Code: Select all

import numpy as np
import warnings

from tenpy.algorithms import dmrg
from tenpy.networks.mps import MPS
from tenpy.models import lattice

from tenpy.models.hubbard import FermiHubbardModel2
from tenpy.models.hubbard import FermiHubbardModel


def run(model_params):

    dmrg_params = {
        'mixer': True,  # setting this to True helps to escape local minima
        'mixer_params': {
            'amplitude': 1.e-5,
            'decay': 1.2,
            'disable_after': 60
        },
        'trunc_params': {
            'svd_min': 1.e-12,
        },
        'lanczos_params': {
            'N_min': 5,
            'N_max': 20
        },
        'chi_list': {
            0: 9,
            10: 49,
            20: 100,
            30: 200,
            40: 300,
            # 50: 600,
            # 60: 800,
            # 70: 1000,
            # 80: 2000,
            # 90: 3200,
        },
        'max_E_err': 1.e-10,
        'max_S_err': 1.e-7,
        # 'max_sweeps': 110,
        'max_sweeps': 50,

    }

    prod_state = [("full","empty"),("empty","full")]
    print('product_state = ')
    print(prod_state)
   
    eng = None
    psi = MPS.from_lat_product_state(M.lat, prod_state, bc=M.lat.bc_MPS)
    print(psi)

    eng = dmrg.TwoSiteDMRGEngine(psi, M, dmrg_params)

    E, psi = eng.run()
    
    print("================================================")
    print("E= ",E)
    print("================================================")



if __name__ == "__main__":
    t_value=1
    mu=0
    U=10
    V=0

    L_value=12
    model_params = dict(lattice = 'Chain',
                        cons_N = 'N',
                        cons_Sz = 'Sz',
                        t=t_value,
                        mu=mu,
                        V=0,
                        U=10,
                        bc_MPS='finite',                    
                        #order='Cstyle',
                        L=L_value,
                        #bc_y='cylinder',
                        )
    run(model_params)

l think this should get the initial Neel state like [up dn up dn...] and then run finite dmrg,but only get

Code: Select all

/public/someone/envs/tenpy/lib/python3.11/site-packages/tenpy/algorithms/dmrg.py:1885: UserWarning: H is zero in the given block, nothing to diagonalize.We just return the initial state again.
  warnings.warn("H is zero in the given block, nothing to diagonalize."
================================================
E=  -3.0413788419352747
================================================
Although get the warnings, it seems to be able to obtain the same results as the standard FermiHubbardModel use SpinHalfFermionSite.

Code: Select all

================================================
E=  -3.0413788419352747
================================================
And l also try to write my own two component 1Dmodel ,but also get the result in

Code: Select all

warnings.warn("H is zero in the given block, nothing to diagonalize."
l want to kwon why l get the warningt?Thanks for your help.Thanks for Tenpy Forum!
Post Reply