Ejemplo n.º 1
0
 def __init__(self, model_param):
     # 0) read out/set default parameters
     L = get_parameter(model_param, 'L', 2, self.__class__)
     J = get_parameter(model_param, 'J', 1., self.__class__)
     V = get_parameter(model_param, 'V', 1., self.__class__)
     mu = get_parameter(model_param, 'mu', 0., self.__class__)
     bc_MPS = get_parameter(model_param, 'bc_MPS', 'finite', self.__class__)
     conserve = get_parameter(model_param, 'conserve', 'N', self.__class__)
     unused_parameters(model_param, self.__class__)
     # 1) - 3)
     site = FermionSite(conserve=conserve)
     # 4) lattice
     bc = 'periodic' if bc_MPS == 'infinite' else 'open'
     lat = Chain(L, site, bc=bc, bc_MPS=bc_MPS)
     # 5) initialize CouplingModel
     CouplingModel.__init__(self, lat)
     # 6) add terms of the Hamiltonian
     # (u is always 0 as we have only one site in the unit cell)
     self.add_onsite(-np.asarray(mu), 0, 'N')
     J = np.asarray(J)  # convert to array: allow `array_like` J
     self.add_coupling(-J, 0, 'Cd', 0, 'C', 1, 'JW', True)  # (for a nearest neighbor model, we
     self.add_coupling(-J, 0, 'Cd', 0, 'C', -1, 'JW', True)  # could leave the `JW` away)
     self.add_coupling(V, 0, 'N', 0, 'N', 1)
     # 7) initialize MPO
     MPOModel.__init__(self, lat, self.calc_H_MPO())
     # 8) initialize bonds (the order of 7/8 doesn't matter)
     NearestNeighborModel.__init__(self, lat, self.calc_H_bond())
Ejemplo n.º 2
0
 def init_sites(self, model_params):
     conserve = model_params.get('conserve', self.defaults['conserve'])
     filling = model_params.get(
         'filling',
         (model_params.get('fill_top', self.defaults['fill_top']),
          model_params.get('fill_bot', self.defaults['fill_bot'])))
     filling = float(filling[0]) / filling[1]
     print('init sites check ', filling)
     site = FermionSite(conserve=conserve, filling=filling)
     return site
Ejemplo n.º 3
0
 def init_sites(self, model_params):
     conserve = get_parameter(model_params, 'conserve', 'N', self.name)
     site = FermionSite(conserve=conserve)
     return site
Ejemplo n.º 4
0
 def init_sites(self, model_params):
     conserve = model_params.get('conserve', 'N')
     fs = FermionSite(conserve=conserve)
     gs = GroupedSite([fs, fs], labels=['A', 'B'], charges='same')
     gs.add_op('Ntot', gs.NA + gs.NB, False)
     return gs
Ejemplo n.º 5
0
 def init_sites(self, model_params):
     conserve = get_parameter(model_params, 'conserve', 'N', self.name)
     filling = get_parameter(model_params, 'filling', 1 / 2., self.name)
     site = FermionSite(conserve=conserve, filling=filling)
     return site
Ejemplo n.º 6
0
 def init_sites(self, model_params):
     conserve = model_params.get('conserve', 'N')
     site = FermionSite(conserve=conserve)
     return site
Ejemplo n.º 7
0
 def init_sites(self, model_params):
     conserve = model_params.get('conserve', 'N')
     filling = model_params.get('filling', (1, 8))
     filling = filling[0] / filling[1]
     site = FermionSite(conserve=conserve, filling=filling)
     return site