How to attach the leads manually?
Hi! How to attach the leads manually, if I have the coordinates. I use class kwant.builder.Lead and I have an error: "TypeError: Can't instantiate abstract class Lead with abstract methods finalized". What does it mean? For example, for two atoms: left_lead = kwant.builder.Lead() #add site left_lead[lat(-90.26501, 13.2107)] = 4 left_lead[lat(-91.60269, 12.67463)] = 4 #add hopping left_lead[lat(-90.26501, 13.2107), lat(-91.60269, 12.67463)] = 1 sys.attach_lead(left_lead) С уважением, Татьяна Григоренко grigorenochka@mail.ru
дорогая Татьяна, kwant.builder.Lead is an abstract base class. This means it cannot be instantiated directly, it’s purpose it to be subclassed. Instead, you may create instances of its “children”: kwant.builder.BuilderLead, kwant.builder.SelfEnergyLead, or kwant.builder.ModesLead. You probably want to use the first of these. It should be all clear when you read https://kwant-project.org/doc/1/reference/generated/kwant.builder.Lead and https://kwant-project.org/doc/1/reference/generated/kwant.builder.BuilderLea... Do let us know if any questions remain. Christoph
Dear Christoph, thank you for your help. Now I have the following question: I manually set leads, how to connect them to my sys? sys.attach_lead () is not suitable for my case . That's what I have: sys = kwant.Builder() left_sequence = [lat(-90.26501, 13.2107), lat(-91.60269, 12.67463), lat(-91.59045, 11.58774), lat(-90.26237, 11.08828), lat(-90.26083, 10.04835), lat(-91.58949, 9.55088), lat(-91.58643, 8.46444), lat(-90.25538, 7.968154), lat(-90.25217, 6.928836), lat(-91.58071, 6.431348), lat(-91.57723, 5.345146), lat(-90.24561, 4.849877), lat(-90.24225, 3.810792), lat(-91.57085, 3.31342), lat(-91.56733, 2.2273), lat(-90.23556, 1.732352), lat(-90.23221, 0.6933518), lat(-91.56081, 0.19601), lat(-91.55732, -0.8900915), lat(-90.22549, -1.384972), lat(-90.22213, -2.423986), lat(-91.55071, -2.921435), lat(-91.5472, -4.007565), lat(-90.21539, -4.502484), lat(-90.21201, -5.541591), lat(-91.54037, -6.039403), lat(-91.53681, -7.125625), lat(-90.20502,-7.620638), lat(-90.20139, -8.659995), lat(-91.52917, -9,158857), lat(-91.52507, -10.24531), lat(-90.1931, -10.74025), lat(-90.18774, -11.7802), lat(-91.51251, -12.28222), lat(-91.51754, -13,36915), lat(-90.17627, -13.9026)] left_lead = kwant.builder.BuilderLead(sys, left_sequence) right_sequence = [lat(-41.91176, 13.2618), lat(-40.57049, 12.72834), lat(-40.57551, 11.64143), lat(-41.90027, 11.13939), lat(-41.8949, 10.09944), lat(-40.56293, 9.604507), lat(-40.55882, 8.518044 ), lat(-41.88659, 8.019171 ), lat(-41.88295, 6.979813), lat(-40.55117, 6.484797), lat(-40.5476, 5.398573), lat(-41.87595, 4.900758), lat(-41.87258, 3.861642), lat(-40.54078, 3.36673), lat(-40.53728, 2.280592), lat(-41.86583, 1.783134), lat(-41.86248, 0.7441266), lat(-40.53065, 0.2492565), lat(-40.52715, -0.8368476), lat(-41.85576, -1.334199), lat(-41.85238, -2.373199), lat(-40.5206, -2.868142), lat(-40.51707, -3.954266), lat(-41.84566, -4.451642), lat(-41.8423, -5.490723), lat(-40.51068, -5.985983), lat(-40.50717, -7.072186), lat(-41.83571, -7.56968), lat(-41.8325, -8.609), lat(-40.50143, -9.105271), lat(-40.49837, -10.19172), lat(-41.82703, -10.68919), lat(-41.82547, -11.72912), lat(-40.49739, -12.22857), lat(-40.48512, -13.31546), lat(-41.82278, -13.85154)] right_lead = kwant.builder.BuilderLead(sys, right_sequence) С уважением, Татьяна Григоренко
Dear Tatiana, If you have constructed your BuilderLead's correctly (it is not obvious from the code you share, `sys` you use in BuilderLead constructor must be a Builder with translational symmetry), it is enough just to add them to list of your bulk system's (bulk_sys) leads: bulk_sys.leads.append(left_lead) bulk_sys.leads.append(right_lead) Builder.attach_lead(), in fact, does the same, but tries to calculate interface itself and add extra sites to sys, if needed. (Sorry, duplicating, since accidentally didn't reply to mailing list originally) On 2016-12-20 17:28, Татьяна Григоренко wrote:
Dear Christoph, thank you for your help. Now I have the following question: I manually set leads, how to connect them to my sys? sys.attach_lead () is not suitable for my case .
That's what I have:
sys = kwant.Builder()
left_sequence = [lat(-90.26501, 13.2107), lat(-91.60269, 12.67463), lat(-91.59045, 11.58774), lat(-90.26237, 11.08828), lat(-90.26083, 10.04835), lat(-91.58949, 9.55088), lat(-91.58643, 8.46444), lat(-90.25538, 7.968154), lat(-90.25217, 6.928836), lat(-91.58071, 6.431348), lat(-91.57723, 5.345146), lat(-90.24561, 4.849877), lat(-90.24225, 3.810792), lat(-91.57085, 3.31342), lat(-91.56733, 2.2273), lat(-90.23556, 1.732352), lat(-90.23221, 0.6933518), lat(-91.56081, 0.19601), lat(-91.55732, -0.8900915), lat(-90.22549, -1.384972), lat(-90.22213, -2.423986), lat(-91.55071, -2.921435), lat(-91.5472, -4.007565), lat(-90.21539, -4.502484), lat(-90.21201, -5.541591), lat(-91.54037, -6.039403), lat(-91.53681, -7.125625), lat(-90.20502,-7.620638), lat(-90.20139, -8.659995), lat(-91.52917, -9,158857), lat(-91.52507, -10.24531), lat(-90.1931, -10.74025), lat(-90.18774, -11.7802), lat(-91.51251, -12.28222), lat(-91.51754, -13,36915), lat(-90.17627, -13.9026)]
left_lead = kwant.builder.BuilderLead(sys, left_sequence)
right_sequence = [lat(-41.91176, 13.2618), lat(-40.57049, 12.72834), lat(-40.57551, 11.64143), lat(-41.90027, 11.13939), lat(-41.8949, 10.09944), lat(-40.56293, 9.604507), lat(-40.55882, 8.518044 ), lat(-41.88659, 8.019171 ), lat(-41.88295, 6.979813), lat(-40.55117, 6.484797), lat(-40.5476, 5.398573), lat(-41.87595, 4.900758), lat(-41.87258, 3.861642), lat(-40.54078, 3.36673), lat(-40.53728, 2.280592), lat(-41.86583, 1.783134), lat(-41.86248, 0.7441266), lat(-40.53065, 0.2492565), lat(-40.52715, -0.8368476), lat(-41.85576, -1.334199), lat(-41.85238, -2.373199), lat(-40.5206, -2.868142), lat(-40.51707, -3.954266), lat(-41.84566, -4.451642), lat(-41.8423, -5.490723), lat(-40.51068, -5.985983), lat(-40.50717, -7.072186), lat(-41.83571, -7.56968), lat(-41.8325, -8.609), lat(-40.50143, -9.105271), lat(-40.49837, -10.19172), lat(-41.82703, -10.68919), lat(-41.82547, -11.72912), lat(-40.49739, -12.22857), lat(-40.48512, -13.31546), lat(-41.82278, -13.85154)]
right_lead = kwant.builder.BuilderLead(sys, right_sequence)
С уважением, Татьяна Григоренко
-- With best regards, Viacheslav Ostroukh Leiden University, Instituut-Lorentz Niels Bohrweg 2, Office 259 2333 CA Leiden, Netherlands +31 6 44 49 68 12 +380 99 721 76 06
participants (3)
-
Christoph Groth
-
Viacheslav Ostroukh
-
Татьяна Григоренко