Dear L.M.,
You need to use
sys = sys.finalized()
Instead of what you have. The reason for this is that finalized method
returns the finalized system, instead of modifying the original system.
Best,
Anton
On Sun, Nov 29, 2015, 20:53 L.M J wrote:
> I was trying to calculate the arm-chair graphene nano ribbon band
> structure.
>
> I used translational symmetry to define the lead to be infinite, but I
> still got an error saying "TypeError: Expecting an instance of
> InfiniteSystem."
>
> I can't identify what's problem here. can anyone help?
>
> Thanks for advance.
>
> code:
>
> l_a=1.0
> agnr=kwant.lattice.general([(3*l_a,0),(0,sqrt(3)*l_a)],
>
> [(0,0),(0.5*l_a,sqrt(3)*l_a/2),(1.5*l_a,sqrt(3)*l_a/2),(2*l_a,0)])
>
> a,b,c,d=agnr.sublattices
> print agnr.vec((-1,0))
> ld=kwant.TranslationalSymmetry(agnr.vec((-1,0)))
>
> h=10
> w=h
>
> def shape1(pos):
> x,y=pos
> return (abs(y)
> left_lead=kwant.Builder(ld)
>
> left_lead[agnr.shape(shape1,(0,0))]=0
>
> left_lead[[kwant.builder.HoppingKind((0,0),a,b)]]=-2.74
> left_lead[[kwant.builder.HoppingKind((0,0),b,c)]]=-2.74
> left_lead[[kwant.builder.HoppingKind((0,0),c,d)]]=-2.74
>
> left_lead[[kwant.builder.HoppingKind((-1,0),d,a)]]=-2.74
> left_lead[[kwant.builder.HoppingKind((0,1),a,b)]]=-2.74
> left_lead[[kwant.builder.HoppingKind((0,1),d,c)]]=-2.74
>
> kwant.plot(left_lead);
>
> left_lead.finalized();
>
>
> bands=kwant.physics.Bands(left_lead);
>
> mom=np.linspace(-np.pi,np.pi,101)
> ee=[bands(k) for k in mom]
> pyplot.plot(mom, ee);
> pyplot.grid('on')
> pyplot.ylim(-2.2,2.2)
>