(1) I want to simulate a self-defined 2D lattice with Finite lattice sizes along both the x and y directions. I am not sure how to define the boundary conditions. Is it the right way to define the boundary condition like this:
Code: Select all
class Mylattice(lattice.Lattice):
def __init__(self, Lx, Ly, siteA, **kwargs)
......
super().__init__([Lx, Ly], [siteA], **kwargs)
class Mymodel(CouplingMPOModel):
def init_lattice(self, model_params):
site = self.init_sites(model_params)
bc_MPS = get_parameter(model_params, 'bc_MPS', 'finite', self.name)
bc_y = get_parameter(model_params, 'bc_y', 'finite', self.name)
order = get_parameter(model_params, 'order', 'default', self.name)
bc_x = 'periodic' if bc_MPS == 'infinite' else 'open'
bc_y = 'periodic' if bc_y == 'cylinder' else 'open'
bc = [bc_x, bc_y]
lat = Mylattice(Lx, Ly, site, order=order, bc=bc, bc_MPS=bc_MPS) # Set Boundary Conditions.