Page 1 of 1

Error drawing Lattice in Tenpy

Posted: 24 Feb 2019, 05:35
by DHIMAN002
I was experimenting to construct lattices using Tenpy and I found two errors,

1) ERROR IN FIGURE FOR SPECIFIC "PRIORITY" AND "SNAKE_WINDING":

I made my own ordering function in Honeycomb lattice as:

Code: Select all

   elif order=="user_order":
                priority=(1,2,0)
                snake_winding=(True,False,False)
                return get_order(self.shape,snake_winding, priority)
If I use this order in the python script like,

Code: Select all

lat = Honeycomb(4, 4, None, bc=['open','open'],order="user_order")
and then plot it. The plot contains wrong nearest neighbour bonds in the figure.

2) ERROR IN FIGURE FOR PERIODIC BOUNDARY CONDITION:

I want a lattice with periodic boundaries along y-axis with some shift and open boundaries along x-axis.
So I used this command to get the lattice,

Code: Select all

lat = Honeycomb(4, 4, None, bc=['open',-1],order="default")
But, after plotting , the figure does not have dangling-bonds (which is the sign of periodic boundary condition) along the y-axis.

Please, correct me, If my understanding is wrong. But I made many experiments in Tenpy to construct the lattices and also checked "get_bc" function in tenpy.models.lattice, to understand how tenpy is implementing boundary condition.

Thanks, in advance. :) :)

Re: Error drawing Lattice in Tenpy

Posted: 26 Feb 2019, 11:01
by Johannes
Thanks for pointing that out.
Luckily, both problems were just a problem of the Lattice.plot_coupling(ax) function, and not the actual couplings of the model.
I just fixed the bug in the most recent version on github.

Re: Error drawing Lattice in Tenpy

Posted: 26 Feb 2019, 11:36
by DHIMAN002
Thanks a lot for ur help.
:D :D