Re: [Kwant] NNN hopping with periodic BC

2018-04-09 Thread Joseph Weston
Sorry I only just saw this email; please remember to "reply All" so that
the email gets sent to the mailing list too!

> Thanks. But except the PBC imposed on transverse direction, I need
> attach the lead on longitude direction. So I want the transverse size
> of sample to be finite.
>

Ah I see. In this case your could consider using 'kwant.wraparound' [1].
In your case you would want to set the 'keep' paramter to '0' to keep
the 0th translational symmetry in the wrapped around system. Using
wraparound in this way will produce a Builder with a single
(longitudinal) translational symmetry that you may use as a lead. The
produced Builder will have an (additional) parameter 'k_y'; the
transverse momentum. Don't be confused by the name; it will also work
when the "wrapped" symmetry vector was not in the "y" direction!

There were already several people on the mailing list who used
wraparound, so you could also search the archives. If it's still not
clear after this post back to this thread.

Happy Kwanting,

Joe

[1]:
https://kwant-project.org/doc/1/reference/generated/kwant.wraparound.wraparound#kwant.wraparound.wraparound


Re: [Kwant] NNN hopping with periodic BC

2018-04-03 Thread Joseph Weston

Hi,

> I want to create a graphene-like system with periodic BC at transverse
> direction.  I’m following
>
> the discussion at
> https://www.mail-archive.com/kwant-discuss@kwant-project.org/msg00036.html.
>
>  
>

If you only want 1 direction to have periodic boundary conditions (and
finite in the other direction)
why not just create a system with a 1D translational symmetry? This will
make your life a lot easier.

Happy Kwanting,

Joe


[Kwant] NNN hopping with periodic BC

2018-04-03 Thread yuhao kang
Hello,

 

I want to create a graphene-like system with periodic BC at transverse
direction.  I'm following

the discussion at
https://www.mail-archive.com/kwant-discuss@kwant-project.org/msg00036.html.

 

For nearest-neighbor hopping, it works. There is hopping between the upper
and lower side.

 

But when I add NNN hopping using:

A,B=graphene.sublattices

sys[A.neighbors()]=hopp_qsvh

sys[B.neighbors()]=hopp_qsvh

 

The NNN hopping doesn't exist between the upper and lower side. 

 

Is there any way to solve it?

 

Thank you,

Yuhao

 

Attached is the code:

 

import numpy as np

import kwant

X,Y = 4, 4

s0=np.identity(2)

sz=np.array([[1,0],[0,-1]])

 

graphene = kwant.lattice.honeycomb(1,'b')

A,B=graphene.sublattices

 

def rectangle(pos):

x, y = pos

return -X/2 < x < X/2

 

def onsite_qsvh(site):

x,y=site.pos

if y<0:

onsite_a = .4*s0

onsite_b = -.4*s0

return onsite_a if site.family == A else onsite_b

else:

return np.zeros([2,2])

def hopp_qsvh(site1,site2):

x1,y1=site1.pos

x2,y2=site2.pos

hop_a = .4*1j*sz

hop_b = -.4*1j*sz

if (y1+0.1)*(y2+0.1)>0 and y1+0.1>0:

return hop_a if site1.family == A else hop_b

else:

return np.zeros([2,2])

 

sym = kwant.TranslationalSymmetry(graphene.vec((-Y/2,Y)))

anc = kwant.Builder(sym) 

anc[graphene.shape(rectangle,(0, 0))] = None

anc[graphene.neighbors()] = None 

sys = kwant.Builder()

  

sys[anc.sites()] = onsite_qsvh

sys[((a, sym.to_fd(b)) for a, b in anc.hoppings())] = -s0 

sys[A.neighbors()]=hopp_qsvh

sys[B.neighbors()]=hopp_qsvh

 

sys = sys.finalized() 

kwant.plot(sys,fig_size=(20, 10))