
July 10, 2017
10:36 a.m.
Hi Steffen. Your code fails in the following lines:
LongBond = (((1, 0), a, b)) SSH_lead[[kwant.builder.HoppingKind(*hopping) for hopping in LongBond]] = 2
because the 'LongBond' variable is not instantiated correctly. In Python you have to leave a trailing comma when creating a single-element tuple:
LongBond = (((1, 0), a, b),)
to make things easier to read you can also just create a list:
LongBond = [((1, 0), a, b)]
In the future you can try inserting calls to 'print' into your code to check certain conditions and inspect what is going on. Happy Kwanting, Joe