
Hello everyone, i would appreciate any suggestion you could give me to solve this
I'm trying to attach a couple of leads to my structure, I have the code for both, but I want to know how to make that both leads begin with the same atom,
In the code below you can see that the left lead starts in a gray atom, while the lead in the right side starts in the couple of atoms blue and yellow, if I increase the size of the structure it only creates another primitive cell and the case is the same
Is there a way to make that the right lead starts in a gray atom as the left lead, like only creating half primitive cell?
Thanks in advance Here is the code
import kwant from matplotlib import pyplot
%matplotlib tk
PrimVec = [(3.176, 0, 0), (1.588, 2.7504, 0), (0, 0, 17.49)] base = [(0, 0, 0), (1.588, 0.9168, 0.8745), (0, 0, 1.749)] lat = kwant.lattice.general(prim_vecs = PrimVec, basis = base) d, e, f= lat.sublattices
def make_cuboid(t=1.0, 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))] = 4 * t hoppings = (((1, 0, 0), d, e), ((0, 0, 0), d, e),((0, 1, 0), d, e), ((0, 0, 0), f, e), ((1, 0, 0), f, e), ((0, 1, 0), f, e)) syst[[kwant.builder.HoppingKind(*hopping) for hopping in hoppings]] = -6 lead = kwant.Builder(kwant.TranslationalSymmetry((-3.176, 0, 0))) def lead_shape(pos): return 0 <= pos[1] < b and 0 <= pos[2] < c lead[lat.shape(lead_shape, (0, 0, 0))] = 4 * t lead[[kwant.builder.HoppingKind(*hopping) for hopping in hoppings]] = -6 syst.attach_lead(lead) syst.attach_lead(lead.reversed()) return syst
def main():
syst = make_cuboid(a=30, b=14, c=4) def family_colors(site): if site.family == d: return 'yellow' elif site.family == e: return 'gray' else: return 'blue' kwant.plot(syst, site_size=0.25, site_lw=0.025, hop_lw=0.05, site_color=family_colors) syst = syst.finalized()
if __name__ == '__main__': main()

Sergio Castillo Robles wrote:
In the code below you can see that the left lead starts in a gray atom, while the lead in the right side starts in the couple of atoms blue and yellow, if I increase the size of the structure it only creates another primitive cell and the case is the same
Is there a way to make that the right lead starts in a gray atom as the left lead, like only creating half primitive cell?
Yes, there is a way, but it's unfortunately tricky.
The builder module is written in such a way that the unit cell of a builder with a translational symmetry (i.e. a lead) is determined by the fundamental domains of the relevant symmetry, which in turn is fixed to be parallelogram-shaped.
For example, it's not possible to have a builder-made lead with U-shaped unit cells that protrude into each other. (This is a limitation of the builder. Kwant itself would support such leads.)
When designing Kwant, we believed that this restriction does not matter because it is still possible to represent any 1-d periodic lead. It's only the choice of the shape of the unit cell that is restricted.
Still, there is some freedom in choosing the unit cell. For example, the second figure of the Kwant graphene tutorial [1] shows leads whose unit cells are oblique. To improve the example script [2], we can add the following code just after 'sym0' gets created:
for sl in graphene.sublattices: sym0.add_site_family(sl, other_vectors=[(-1, 2)])
To understand how this works, please see the documentation of add_site_family [3] and an earlier post to this list [4].
You can apply the above trick also in your case to tweak the angle of the unit cell. In order to have both leads begin at the same type of atom, as you want, you'll have to use a different angle on the left and on the right (so that the unit cells of both leads have a mirror symmetry). But since the shape of the unit cell is determined by the symmetry, you will have to use two different symmetry objects, one for the left lead, and one for the right.
I hope that the above is clear, if not do not hesitate to ask.
The proper solution to this problem and similar ones would be to stop basing the unit cell shape on the shape of the symmetry fundamental domain. For example, in most cases the unit cell of the lead could be determined by attach_lead such that no further sites need to be added to the scattering region.
We have an open issue about fixing that [5]. I would be happy to accompany a person who is motivated to work on this!
Christoph
[1] https://kwant-project.org/doc/1/tutorial/graphene [2] https://kwant-project.org/doc/1/_downloads/graphene.py [3] https://kwant-project.org/doc/1/reference/generated/kwant.lattice.Translatio... [4] https://www.mail-archive.com/kwant-discuss@kwant-project.org/msg00174.html [5] https://gitlab.kwant-project.org/kwant/kwant/issues/4
participants (2)
-
Christoph Groth
-
Sergio Castillo Robles