2D DMRG with boundary conditions and lattice index

How do I use this algorithm? What does that parameter do?
Post Reply
steven_tao
Posts: 5
Joined: 11 Mar 2020, 01:07

2D DMRG with boundary conditions and lattice index

Post 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

User avatar
Johannes
Site Admin
Posts: 135
Joined: 21 Jul 2018, 12:52
Location: UC Berkeley

Re: 2D DMRG with boundary conditions and lattice index

Post 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]

steven_tao
Posts: 5
Joined: 11 Mar 2020, 01:07

Re: 2D DMRG with boundary conditions and lattice index

Post by steven_tao »

Hi Johannes, thank you very much. I got it.

Post Reply