
Hi, thanks again for your time and your input. I tried what you said, by setting by hand the onsite elements of the lead, but it's not solving the problem. The result is identical to the one with the previous onsite function. Diego On 25/3/14 2:04 AM, Joseph Weston wrote:
Hi again,
I've just had a thought as to what it could be, but I can't test it myself right now as I don't have access to a proper computer. I think this may be due to the way that kwant handles leads.
When you create a Builder with a symmetry and add sites to it then kwant first translates the sites into the fundamental domain of the symmetry and adds those to the Builder. For translational symmetries the fundamental domain is the one which contains the point (0, 0). This means that when you construct your leads with::
lead[lat.shape(lead_shape, (0, 0))] = onsite
then some of the onsites will actually evaluate to ``mu_inside`` as the lead sites satisfy the condition within ``onsite``. You can test this hypothesis by setting the "sub-region" to something which does not include the lead's fundamental domain (in your case a single line of sites in the y-direction between -W/2 and W/2 passing through the origin), or by setting the lead onsites "manually" for testing.
Joe