On 2020-02-23 14:02, Adel Belayadi wrote:

> Dear Sir. Your system is not well organized. If you follow the link you 
> provided you can make it easily. One thing wrong in your system is you have 
> defined the lat and lat from zero to a certain limit. You have to be careful 
> the end of lat sould be the beginning of latt not both start from zero as was 
> explained in the link you have provided. I urge you to plot both systems lat 
> and latt separately and then you would a just the beginning of the second 
> system based on the plot of the fist one. Also your notation lat and latt is 
> not good for us to follow your code. Please try to be objectif in your 
> notation 
> Hop will help 
> 
> Le sam. 22 févr. 2020 à 11:48, tavakkolidjawad <[email protected]> a 
> écrit : 
> 
> On 2020-02-15 14:25, tavakkolidjawad wrote: 
> 
> Hello everyone 
> 
> I want to use different lattices structure (honeycomb and diamond) for the 
> scattering region. if I have a honeycomb structure, is it possible in Kwant 
> to add sites from the diamond structure to the system and add hoppings from 
> these sites to the sites from the honeycomb lattice? 
> 
> I have already read Section 2.11 
> (https://kwant-project.org/doc/1/tutorial/faq#how-to-use-different-lattices-for-the-scattering-region-and-a-lead)
>  in the documentation but this is challenging for me and I have no idea how 
> to solve it. 
> 
> Thanks 
> 
> Hi 
> 
> In the previous email attachment, the code is as follows and I got this 
> error: (ValueError: Input has irregular shape). 
> 
> If possible please help me to fix the error 
> 
> Thanks. 
> 
> ########## 
> 
> import kwant 
> 
> latt = kwant.lattice.honeycomb()
> A , B = latt.sublattices 
> 
> lat = kwant.lattice.general([(0, 0.5, 0.5), (0.5, 0, 0.5), (0.5, 0.5, 0)],
> [(0, 0, 0), (0.25, 0.25, 0.25)], name=['a1', 'a2'])
> a1, a2 = lat.sublattices 
> 
> def make_systems(a=10, b=10, c=15, W=20, L=20):
> 
> syst = kwant.Builder()
> syst[(A(i,j) for i in range(L) for j in range(W))] = 4
> syst[(B(i,j) for i in range(L) for j in range(W))] = 4
> syst[latt.neighbors()] = -1
> 
> def lead_shape(pos):
> x,y,z = pos
> return 0 <= x < a and 0 <= y < b and 0 <= z < c
> 
> lead = kwant.Builder(kwant.TranslationalSymmetry((0,0,1)))
> lead[lat.shape(lead_shape, (0, 0, 0))] = 1
> lead[lat.neighbors()] = 1
> 
> def cuboid_shape(pos):
> x, y, z = pos
> return 0 <= x < a and 0 <= y < b and 0 <= z < c
> 
> syst[a1.shape(cuboid_shape, (0, 0, 0))] = 1 
> syst[a2.shape(cuboid_shape, (0, 0, 0))] = 1
> syst[lat.neighbors()] = 1
> 
> syst[((a1(i+5,9,0),B(i,15)) for i in range(9))] = -1
> 
> return syst, lead 
> 
> def main():
> 
> syst,lead = make_systems() 
> 
> kwant.plot(syst)
> 
> syst = syst.finalized()
> 
> syst,lead = make_systems(a=1.1, b=1.1, c=1.1)
> 
> def family_colors(site):
> return 'r' if site.family == a1 else 'g' 
> 
> syst.attach_lead(lead)
> 
> kwant.plot(syst, site_size=0.18, site_lw=0.01, hop_lw=0.05,
> site_color=family_colors) 
> 
> if __name__ == '__main__':
> main() 
> 
> ################

Hi dear Adel 

First, I would like to apologize for these simple questions.
after the last email, I tried to solve the problem but it didn't work. 

According to your guidance, I have considered systems with different
origins, but I got the same error (Input has irregular shape).  

I have another question if I want to calculate conductance in this
problem, is it important how many sites of the lattices are involved in
the hopping? basically, I want to put the diamond lattice on the
honeycomb lattice, but if Kwant restricts I have to put the two lattices
together. 

I would appreciate your attention to this matter. 

Best regards 

Javad 

############################ 

############################ 

import kwant 

lat = kwant.lattice.general([(0, 0.5, 0.5), (0.5, 0, 0.5), (0.5, 0.5,
0)],
[(0, 0, 0), (0.25, 0.25, 0.25)], name=['a1', 'a2'])
a1, a2 = lat.sublattices 

honeycomb = kwant.lattice.honeycomb()
subA , subB = honeycomb.sublattices 

def make_system(a=10, b=10, c=15):

sys = kwant.Builder()

def cuboid_shape(pos):
x, y, z = pos
return 0 <= x < a and 0 <= y < b and 0 <= z < c

sys[lat.shape(cuboid_shape, (0, 0, 0))] = 1 
sys[lat.neighbors()] = 1

def lead_shape(pos):
x,y,z = pos
return 0 <= x < a and 0 <= y < b and 0 <= z < c

lead1 = kwant.Builder(kwant.TranslationalSymmetry((0,0,1)))
lead1[lat.shape(lead_shape, (0, 0, 0))] = 1
lead1[lat.neighbors()] = 1

def graphene_shape(pos):
x,y = pos
return 11 <= x < 20 and 0 <= y < 10

sys[honeycomb.shape(graphene_shape,(11,0))] = 1
sys[honeycomb.neighbors()] = 1

symlead = kwant.TranslationalSymmetry(honeycomb.vec((0, -1)))
lead = kwant.Builder(symlead)
lead[(subA(i,0) for i in range(10,14) )] = 4
lead[(subB(i,0) for i in range(10,14) )] = 4
lead[honeycomb.neighbors()] = -1

#syst.attach_lead(lead)

return sys , lead1 

def main():

sys,lead1= make_system() 

kwant.plot(sys)

sys,lead1,lead = make_system(a=1.1, b=1.1, c=1.1)

#syst.attach_lead(lead1)

if __name__ == '__main__':
main() 

################################## 

##################################

Reply via email to