I am trying to define the Anyon-Hubbard model(AHM):
\(H = -J {\sum}^{L}_{j=2} ({\hat b}^{\dagger}_{j} {\hat b}_{j-1} e^{i \theta {\hat n}_{j}} + H.c.) + U \sum^{L}_{j=1} {\hat n}_{j} ({\hat n}_{j} - 1)\)
Code: Select all
import numpy as np
import matplotlib.pyplot as plt
import tenpy
import tenpy.linalg.np_conserved as npc
from tenpy.algorithms import dmrg
from tenpy.networks.mps import MPS
from tenpy.networks.site import BosonSite
from tenpy.models.lattice import Chain
from tenpy.models.model import CouplingModel, NearestNeighborModel, MPOModel
"""Definition of a model: the Anyon-Hubbard chain."""
class AHChain(CouplingModel, NearestNeighborModel, MPOModel):
def __init__(self, L=20, Nmax=2, filling=0.2, J=1, U=1, theta=0.5*np.pi):
boson = BosonSite(Nmax=Nmax, conserve='N', filling=filling)
boson.add_op('gJWd', npc.expm(-1.j*theta*boson.N), hc='gJW')
boson.add_op('gJW', npc.expm(1.j*theta*boson.N), hc='gJWd')
# the lattice defines the geometry
lattice = Chain(L, boson, bc='open', bc_MPS='finite')
CouplingModel.__init__(self, lattice)
# add terms of the Hamiltonian
self.add_coupling(-J, 0, 'Bd', 0, 'B', -1, 'gJW', str_on_first=True, plus_hc=True)
self.add_onsite(U, 0, 'NN')
self.add_onsite(-U, 0, 'N')
# finish initialization
# generate MPO for DMRG
MPOModel.__init__(self, lattice, self.calc_H_MPO())
# generate H_bond for TEBD
NearestNeighborModel.__init__(self, lattice, self.calc_H_bond())
Code: Select all
M = AHChain(L=20, Nmax=2, filling=0.2, J=1, U=0, theta=0.5*np.pi)
p_state = [[0], [0], [0], [0], [1]] * 4
psi = MPS.from_lat_product_state(M.lat, p_state)
And if I try to run the DMRG algorithm:
Code: Select all
dmrg_params = {
'mixer': None, # setting this to True helps to escape local minima
'max_E_err': 1.e-8,
'trunc_params': {
'chi_max': 100,
'svd_min': 1.e-8,
},
'verbose': True,
'combine': True
}
eng = dmrg.TwoSiteDMRGEngine(psi, M, dmrg_params)
E, psi = eng.run() # the main work; modifies psi in place
`...\Anaconda3\lib\site-packages\tenpy\algorithms\dmrg.py 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."
...\Anaconda3\lib\site-packages\tenpy\linalg\lanczos.py:250: UserWarning: Poorly conditioned Lanczos!
warnings.warn("Poorly conditioned Lanczos!")`
Finally, I get another UserWarning:
`...\Anaconda3\lib\site-packages\tenpy\algorithms\dmrg.py:420: UserWarning: final DMRG state not in canonical form within 'norm_tol' = 1.00e-05
warnings.warn(msg.format(nt=norm_tol))`
Of course, the result is not correct... Any help will be appreciated!
Thanks.