Adel Belayadi wrote: > Jerry wrote : > > > Then I would like to attach leads along the new X-axis (just > > normally connect to the rectangular sample that doesn't need adding > > extra sites). I put the translation symmetry rotated to X and > > confine the lead shape in Y. I expected the lead would just connect > > to the sample with the interface in Y direction. However, many > > extra sites are added and the interface is rendered in the old > > y direction, although the lead does extend in X. > > I guess it might work if you add site family to your symmetry. > your_sym.add_site_family(your_latice.sublattices[0], > other_vectors=[v]), where v is a tuple and in your case it might be > like v=(-1, 2)
Thanks, Adel. The following thread offers background information: https://mail.python.org/archives/list/kwant-discuss@python.org/thread/M4PUQD2RCHA46ND3Z22ZWIW7NFWLWQ7Q/#M4PUQD2RCHA46ND3Z22ZWIW7NFWLWQ7Q Also note that the unwanted sites do not change the physics of the system since the Hamiltonian of the complete system (central region + leads) is the same no matter what the inclination of the lead unit cells is. Still, I agree that it would be better if attach_lead would avoid adding sites to the central region whenever this is possible. If someone feels motivated to work on this, I’d be happy to lend a hand. Here is an old and unfinished (but if I recall correctly mostly working) attempt to solve the problem: https://gitlab.kwant-project.org/cwg/kwant/-/commits/adrien_no_add Christoph
smime.p7s
Description: S/MIME cryptographic signature