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.sublatticesdef 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()################