Hi T.C.,

You've merely forgot a pair of brackets:

You should use
kwant.HoppingKind((0,0,1), lat)
instead of
kwant.HoppingKind(0, 0, 1), lat

kwant.HoppingKing expect at least two arguments: direction of the
hopping and a lattice. (0, 0, 1) is the direction of a hopping.

By the way, it does seem weird that you try to assign lead_onsite to a hopping.

To Kwant developers: is it possible to validate the arguments of
HoppingKind? In T.C.'s code 0 was interpreted as the direction of the
hopping, second 0 as the first lattice, and 1 as the second lattice.

Cheers,
Anton

On Tue, Jul 21, 2015 at 3:10 PM, T.C. Wu <[email protected]> wrote:
> Hi Joe,
>
> Thanks for your reply! I have another small problem is that when I want to
> modify the hopping in z-direction, I put
> lead[kwant.HoppingKind(0,0,1),lat] = lead_onsite
> right after
> lead = kwant.Builder(sym_lead)
> and an error pops up:
> AttributeError: 'HoppingKind' object has no attribute 'family'
>
> I have read several examples using HoppingKind to define the hopping. I
> don't know what's wrong in my case. Could you please help me with that?
>
> Thank you very much.
>
> Best,
> T.C.
>
> On 20 July 2015 at 17:01, Joseph Weston <[email protected]> wrote:
>>
>> Hi,
>>
>> > I apologize for inconvenience caused.
>>
>> First off, no need to apologize; this is what the mailing list is for!
>>
>>
>> > I should replace
>> > sym_lead_vertical = kwant.TranslationalSymmetry((0,-1,0))
>> >
>> > by
>> > sym_lead_vertical = kwant.TranslationalSymmetry((0,1,0))
>> >
>> > although I don't understand why it is the case.
>>
>> So by changing (0, -1, 0) to (0, 1, 0) you changed the symmetry
>> direction. Initially your symmetry vector was pointing
>> towards -∞ in the y direction, which means that the lead will
>> come from -∞ in the y direction to attach to the system. By
>> changing the symmetry direction the lead now attaches to the
>> other side of the system.
>>
>> Looking at your code I see that you attach 4 leads in the "vertical"
>> direction it would seem that all you have done by changing the
>> symmetry direction is "rename" your leads  0 <-> 2 and 1 <-> 3
>>
>> I would guess that you were perhaps not using the correct
>> leads for calculating the Hall conductances in your
>> "calculate sigmas" function.
>>
>> Hope that helps!
>>
>> Joe
>>
>>
>>
>

Reply via email to