Page 1 of 1

2D DMRG with boundary conditions and lattice index

Posted: 22 Mar 2020, 04:58
by steven_tao
Hi everyone:

(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.
(2) For the 2D case, we calculate the each site occupation: A = psi.expectation_value('N'). The expectation value A is a 1D list. Whether the list index corresponds to the site index of the lattice indicated by the function ''ax.plot_site()" (For example, the following figure)? E.g., the 11th element A[10] is the occupation at lattice site 10 indicated by the figure.

Image

Re: 2D DMRG with boundary conditions and lattice index

Posted: 23 Mar 2020, 18:41
by Johannes
(1): Looks good to me. In fact, that's code taken from CouplingMPOModel.init_lattice() for the case of a 2D lattice.

(2): Yes.
You might want to take a look at mps2lat_values in that case.
Use it like this:

Code: Select all

exp_vals_mps = psi.expectation_value("N")
exp_vals_lat = model.lat.mps2lat_values(exp_vals_mps)
While the 1D array exp_vals_mps is indexed by MPS indices i,
exp_vals_lat will be indexed by lattice indices x, y, u.
In the example of your question, you can verify this:

Code: Select all

assert exp_vals_mps[10] == exp_vals_lat[0, 3,1]

Re: 2D DMRG with boundary conditions and lattice index

Posted: 24 Mar 2020, 01:20
by steven_tao
Hi Johannes, thank you very much. I got it.