Hello All, I am trying to attach a 3D lead to a 3D system that I have built, but am facing troubles in the same. I am aware of another thread ( https://mailman-mail5.webfaction.com/pipermail/kwant-discuss/2014-May/000125.html) highlighting my question, but having gone through that thread I was still unable to successfully attach a lead to my system.
Ideally, I want to attach gold leads to my system but I started by attaching a simple cubic lattice (by breaking it into 2 different lattices). Following is my code. *h = 2.707 * np.cos(13.69*np.pi/180)* *dx = 4.43* *dy = 3.27* *shift_x = 2.164 * np.cos(0.5*98.15*np.pi/180)* *shift_y = 2.164 * np.sin(0.5*98.15*np.pi/180)* *lat0 = kwant.lattice.general([(dx, 0, 0), (0, dy, 0)], [(0, 0, 0), (shift_x, shift_y, 0)])* *lat1 = kwant.lattice.general([(dx, 0, 0), (0, dy, 0)], [(0.5*dx, 0.5*dy, h), (0.5*dx + shift_x, 0.5*dy + shift_y, h)])* *a_const = 2* *b_const = 2* *c_const = 1* *def make_cuboid(a = a_const*dx, b = b_const*dy, c = c_const*h):* * def cuboid_shape(pos):* * x, y, z = pos* * return -a <= x <= a and -b <= y <= b and -c <= z <= c* * sys = kwant.Builder()* * sys[lat0.shape(cuboid_shape, (0, 0, 0))] = None* * sys[lat0.neighbors(1)] = 1* * sys[lat0.neighbors(2)] = 1* * sys[lat1.shape(cuboid_shape, (0.5*dx, 0.5*dy, h))] = None* * sys[lat1.neighbors(1)] = 1* * sys[lat1.neighbors(2)] = 1* * # Diagonally going up-right/down_left bonds* * for j in range(-a_const, a_const):* * for i in range(-b_const, b_const):* * sys[lat0.sublattices[1](j,i), lat1.sublattices[0](j,i)] = 1* * # Diagonally going up-left/down-right bonds* * for m in range(a_const, -a_const, -1):* * for n in range(-b_const, b_const):* * sys[lat0.sublattices[0](m,n), lat1.sublattices[1](m-1,n-1)] = 1* * # Define the leads* * lat0_lead = kwant.lattice.square(dy)* * sym_lead0 = kwant.TranslationalSymmetry((dy, 0))* * lead0 = kwant.Builder(sym_lead0)* * lead0[(lat0_lead(0, i) for i in range(-2,3))] = 0* * lead0[lat0_lead.neighbors()] = 1* * sys[(lat0_lead(3, i) for i in range(-2,3))] = 0* * sys[lat0_lead.neighbors()] = 1* * # Manually attach sites from the base (height=0) lattice to square lattice* * sys[((lat0_lead(3, i), lat0.sublattices[0](2, i)) for i in range(-2,3))] = 1* * def family_colors(site):* * if site.family == lat0.sublattices[0]:* * return 'b'* * elif site.family == lat0.sublattices[1]:* * return 'b'* * elif site.family == lat1.sublattices[0]:* * return 'g'* * elif site.family == lat1.sublattices[1]:* * return 'g'* * kwant.plot(sys, site_size=0.2, hop_lw=0.1, site_color=family_colors)* * return sys.finalized()* *def main():* * sys = make_cuboid()* *if __name__ == '__main__':* * main()* >From my knowledge, this should attach a 2D square lattice lead (or to be precise, just 1 layer of the 2D square lattice lead as shown in https://kwant-project.org/doc/1.3/tutorial/faq) to one side of my 3D system. I would be really glad if someone could help me out with this problem. Best Regards, Shivang -- *Shivang Agarwal* Senior Undergraduate Discipline of Electrical Engineering IIT Gandhinagar Contact: +91-9869321451
