Error drawing Lattice in Tenpy

How do I use this algorithm? What does that parameter do?
Post Reply
DHIMAN002
Posts: 7
Joined: 24 Feb 2019, 05:03

Error drawing Lattice in Tenpy

Post 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. :) :)
User avatar
Johannes
Site Admin
Posts: 413
Joined: 21 Jul 2018, 12:52
Location: TU Munich

Re: Error drawing Lattice in Tenpy

Post 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.
DHIMAN002
Posts: 7
Joined: 24 Feb 2019, 05:03

Re: Error drawing Lattice in Tenpy

Post by DHIMAN002 »

Thanks a lot for ur help.
:D :D
Post Reply