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 <tavakkolidjawad@ut.ac.ir> 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-f...) 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()
################