Hi dears 

Based on the code for zincblende structure inside the Kwant website, I
want to build a diamond lattice, but I don't know what I need to change
in this code to create a diamond structure, also I need to create one
lead for this structure. 

can you help me? 

Thank you in advance. 

>>>import kwant
>>>from matplotlib import pyplot 

>>>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)])
>>>a, b = lat.sublattices 

>>>def make_cuboid(a=15, b=10, c=5):
              def cuboid_shape(pos):
                    x, y, z = pos
              return 0 <= x < a and 0 <= y < b and 0 <= z < c 

>>>syst = kwant.Builder()
>>>syst[lat.shape(cuboid_shape, (0, 0, 0))] = None
>>>syst[lat.neighbors()] = None 

>>>return syst 

>>>def main():
>>># the standard plotting style for 3D is mainly useful for
>>># checking shapes:
>>>syst = make_cuboid() 

>>>kwant.plot(syst) 

>>># visualize the crystal structure better for a very small system
>>>syst = make_cuboid(a=1.5, b=1.5, c=1.5) 

>>>def family_colors(site):
              return 'r' if site.family == a else 'g' 

>>>kwant.plot(syst, site_size=0.18, site_lw=0.01, 
>>>hop_lw=0.05)#,site_color=family_colors) 

>>>if __name__ == '__main__':
       main()

Reply via email to