Dear Joseph Thank you for your response. My problem for zigzag nanoribbon with defect (hole) was solved with your help. Now I have a bit problem with armchair nanoribbon. I have changed zigzag nanoribbon according to making the armchair nanoribbon. It is OK when we have no defect on the system but when I try to make hole on the scattering region and leads I have a problem. The shape of holes on the scattering region and leads are not same. My code is as the following. That is very king of you if you help me where is the problem. Thanks In advance for your help. Beat wishes, Nafise import kwant from math import sqrt import matplotlib.pyplot as plt import tinyarray import numpy as np import math import cmath #import scipy.linalg as la import matplotlib d=1.42; a1=d*math.sqrt(3); #on-site energy................................................... t=-2.7; latt = kwant.lattice.general([(0,a1),(a1*math.sqrt(3)/2,a1*0.5)], [(-d/2,a1/2),(d/2,a1/2)]) a,b = latt.sublattices syst= kwant.Builder() def rectangle(pos): x, y = pos z=x**2+y**2 return -2.4*a1<x<2.4*a1 and -5*d<y<5*d syst[latt.shape(rectangle,(1,1))]=0 def delet(pos): x, y = pos z=x**2+y**2 return z<(2*a1)**2 del syst[latt.shape(delet, (1,1))] #nearest neighbors............................................................. syst[[kwant.builder.HoppingKind((0,0),a,b)]] =t syst[[kwant.builder.HoppingKind((0,1),a,b)]] =t syst[[kwant.builder.HoppingKind((-1,1),a,b)]] =t ax=kwant.plot(syst); sym = kwant.TranslationalSymmetry(latt.vec((-2,4))) lead = kwant.Builder(sym) def lead_shape(pos): x, y = pos return -5*d<y<5*d lead[latt.shape(lead_shape, (1,1))]=0 def delet_lead(pos): x, y = pos z=x**2+y**2 return z<(2*a1)**2 del lead[latt.shape(delet_lead, (1,1))] lead[[kwant.builder.HoppingKind((0,0),a,b)]]=t lead[[kwant.builder.HoppingKind((0,1),a,b)]]=t lead[[kwant.builder.HoppingKind((-1,1),a,b)]]=t syst.attach_lead(lead,add_cells=0) syst.attach_lead(lead.reversed(),add_cells=0) ax=kwant.plot(syst); Joseph Weston [image: Attachments]Sun, Nov 3, 1:10 PM (1 day ago) to me Hi, Please post Kwant usage questions to the Kwant mailing list, not my personal email address. Thanks, Joe On Sun, Nov 3, 2019 at 1:10 PM Joseph Weston <joseph.weston08@gmail.com> wrote:
Hi,
Please post Kwant usage questions to the Kwant mailing list, not my personal email address.
Thanks,
Joe
On 11/3/19 9:29 AM, Nafise Nouri wrote:
Dear Joseph
At first thank you for your previous help. My problem for zigzag nanoribbon with defect (hole) was solved with your help. Now I have a bit problem with armchair nanoribbon. I have changed zigzag nanoribbon according to making the armchair nanoribbon. It is OK when we have no defect on the system but when I try to make hole on the scattering region and leads I have a problem. The shape of holes on the scattering region and leads are not same. My code is as the following. That is very king of you if you help me where is the problem.
Thanks In advance for your help.
Beat wishes, Nafise
import kwant from math import sqrt import matplotlib.pyplot as plt import tinyarray import numpy as np import math import cmath #import scipy.linalg as la import matplotlib d=1.42; a1=d*math.sqrt(3);
#on-site energy................................................... t=-2.7;
latt = kwant.lattice.general([(0,a1),(a1*math.sqrt(3)/2,a1*0.5)], [(-d/2,a1/2),(d/2,a1/2)]) a,b = latt.sublattices syst= kwant.Builder()
def rectangle(pos): x, y = pos z=x**2+y**2 return -2.4*a1<x<2.4*a1 and -5*d<y<5*d
syst[latt.shape(rectangle,(1,1))]=0
def delet(pos): x, y = pos z=x**2+y**2 return z<(2*a1)**2
del syst[latt.shape(delet, (1,1))]
#nearest neighbors............................................................. syst[[kwant.builder.HoppingKind((0,0),a,b)]] =t syst[[kwant.builder.HoppingKind((0,1),a,b)]] =t syst[[kwant.builder.HoppingKind((-1,1),a,b)]] =t
ax=kwant.plot(syst);
sym = kwant.TranslationalSymmetry(latt.vec((-2,4)))
lead = kwant.Builder(sym)
def lead_shape(pos): x, y = pos return -5*d<y<5*d
lead[latt.shape(lead_shape, (1,1))]=0
def delet_lead(pos): x, y = pos z=x**2+y**2 return z<(2*a1)**2
del lead[latt.shape(delet_lead, (1,1))]
lead[[kwant.builder.HoppingKind((0,0),a,b)]]=t lead[[kwant.builder.HoppingKind((0,1),a,b)]]=t lead[[kwant.builder.HoppingKind((-1,1),a,b)]]=t
syst.attach_lead(lead,add_cells=0) syst.attach_lead(lead.reversed(),add_cells=0) ax=kwant.plot(syst);
participants (1)
-
Nafise Nouri