AdelBest regards,This way, you will see that the links you put, do not define the nanotube you had in mind.kwant.plot(system, num_lead_cells=6)3) plot the system with many cells of the lead by using the option num_lead_cells:2) attach the lead to this sytem.1) define a central sytem.Dear Liu Feng,When you plot the lead cell, as you did it in your program, you can not see if your system is exactly what you were expecting. So I suggest to you,in order to see why you are getting a different spectrum then what you are expecting, is to do the following:On Thu, Oct 20, 2016 at 6:45 AM, Liu Feng <ruserzzz@gmail.com> wrote:Hi everyone,I am trying to use Kwant to calculate the band structure of a carbon nanotube.For example, I build a zigzag nanoribbon with translation symmetry (1,0). Then I add the hopping between the a and b sites at the ends of the ribbon by hand. This usually gives the correct nanotube spectrum in a tight-binding scheme. However, I got incorrect one using Kwant. I cannot figure out what is the missing part in the code. Could anyone help me out here?The following is the code, and in the attachments there are the graph of the system and also the incorrect spectrum given by Kwant.From the system plot, the a, b sites at the ends of the ribbon are indeed connected.The incorrect spectrum looks similar to the correct one, but for all the armchair nanotubes they should be metals not insulators.Many thanks in advance!Best regards,Feng Liuimport kwantimport numpy as npfrom types import SimpleNamespacew=4W=np.sqrt(3)*0.5*w+1/sqrt(3) #width of zigzag nanoribbonp = SimpleNamespace(t=1.0, mu = 0.0, B=0.0)def ribbon_shape(pos):return -W/2<= pos[1] < W/2def onsite(site,p):(x,y)=site.posreturn 0.0def hopping(site1,site2,p):x1, y1 = site1.posx2, y2 = site2.posreturn p.tlat = kwant.lattice.honeycomb()a,b=lat.sublatticessym_sys = kwant.TranslationalSymmetry((1, 0))sys = kwant.Builder(sym_sys)sys[lat.shape(ribbon_shape, (0, 0))] = onsitesys[lat.neighbors()] = hoppingsys[a(0, w/2), b(0, -w/2-1)] = p.t #connect the endskwant.plot(sys)sys=sys.finalized()kwant.plotter.bands(sys,args=[p],momenta=600)--Abbout Adel