Code: Select all
class myTFLIMModel(CouplingMPOModel):
def init_sites(self, model_params):
site = SpinHalfSite(conserve=None)
Nj = np.array([[1,0],[0,0]])
site.add_op('Nj', Nj)
return site
def init_terms(self, model_params):
U = model_params.get('U',1.)
self.add_coupling(U, 0, 'Nj',1,'Nj',np.array([0]))
Code: Select all
model_params = dict(lattice = Ladder(L = 20, site = SpinHalfSite(conserve=None)), L=20, U=1.,bc_MPS='finite', conserve='None')
M = myTFLIMModel(model_params)
Code: Select all
"ValueError: unknown onsite operator 'Nj' for u=0
SpinHalfSite('None')"