## New to tenpy

How do I use this algorithm? What does that parameter do?
pileyan
Posts: 2
Joined: 18 Sep 2020, 08:16

### New to tenpy

Hello!

Previously I used pyalps in order to calculate energy using DMRG. Could you tell me how to implement this Hubbard ladder alps configuration on TenPy?
There are lots of parameters in TenPy like trunc_params, chi_max and so on.
import pyalps

Code: Select all

parameters = [ {
'LATTICE'                   : "open square lattice",  # open boundary conditions parallel to plane
'MODEL'                     : "fermion Hubbard",     #fermionic Hubbard model
'CONSERVED_QUANTUMNUMBERS'  : 'Nup, Ndown',
'Nup_total'                 : 1,
'Ndown_total'               : 0,
't'                         : 1,
'U'                         : -7,
'SWEEPS'                    : 8,
'NUMBER_EIGENVALUES'        : 2,
'L'                         : 40,
'W'                         : 2,
'MAXSTATES'                 : 800
} ]

res = pyalps.runApplication('dmrg',input_file,writexml=True)
E=data.y

I'd also like to experiment with three-leg ladder, Toblerone-shaped-ladder (3 legs cigar-shaped form with cylindric boundary conditions on y and open boundary conditions on x) and so on.

Johannes
Posts: 209
Joined: 21 Jul 2018, 12:52
Location: UC Berkeley

### Re: New to tenpy

Take a look at the overview and readthe other "introductions".

You want to use the tenpy.models.hubbard.FermiHubbardModel with the tenpy.models.lattice.Ladder (for the other ladders, implement your own "Lattice" class as described in the various introductions).
The t,U,L are model parameters in TeNPy. The model parameters cons_N and cons_Sz correspond to the CONSERVED_QUANTUMNUMBERS of ALPS.
The MAXSTATES of ALPS is just the chi_max parameter within the trunc_params subdictionary in TeNPy.

I can't tell what the W parameter of ALPS is supposed to be.

I guess the Nup_total and Ndown_total of ALPS are determining the initial state (although I'm not sure how...).
The corresponding setting is done in TeNPy directly by initializing the MPS, e.g. with
from_product_state or from_lat_product_state.

The NUMBER_EIGENVALUES tells ALPS to calculate both the ground state and first excited state (in the same quantum number eigenstate.
In TeNPy this requires two separate DMRG runs, roughly like this:

Code: Select all

# assuming M.lat to be a Ladder with two sites in the unit cell
psi0 = mps.MPS.from_lat_product_state(M.lat, [['up', 'down']])
dmrg_params = {'trunc_params': {'chi_max': 800}}
psi1 = psi0.copy()
info0 = dmrg.run(psi0, M, dmrg_params)
# now psi0 is the ground state
print("ground state: E0=", info1['E'])
drmg_params['orthogonal_to'] = [psi0]
info1 = dmrg.run(psi1, M, dmrg_params)
# now psi1 is the first excited state in the same charge sector
print("first excited state: E1 = ", info1['E'])

pileyan
Posts: 2
Joined: 18 Sep 2020, 08:16