class kwant.builder.HoppingKind(delta, family_a, family_b=None)[source]#

Bases: tuple

A pattern for matching hoppings.

An alias exists for this common name: kwant.HoppingKind.

A hopping (a, b) matches precisely when the site family of a equals family_a and that of b equals family_b and (a.tag - b.tag) is equal to delta. In other words, the matching hoppings have the form: (family_a(x + delta), family_b(x))

  • delta (Sequence of integers) – The sequence is interpreted as a vector with integer elements.

  • family_a (SiteFamily)

  • family_b (SiteFamily or None (default)) – The default value means: use the same family as family_a.


A HoppingKind is a callable object: When called with a Builder as sole argument, an instance of this class will return an iterator over all possible matching hoppings whose sites are already present in the system. The hoppings do not have to be already present in the system. For example:

kind = kwant.builder.HoppingKind((1, 0), lat)
syst[kind(syst)] = 1

Because a Builder can be indexed with functions or iterables of functions, HoppingKind instances (or any non-tuple iterables of them, e.g. a list) can be used directly as “wildcards” when setting or deleting hoppings:

kinds = [kwant.builder.HoppingKind(v, lat) for v in [(1, 0), (0, 1)]]
syst[kinds] = 1


count(value, /)[source]#

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)[source]#

Return first index of value.

Raises ValueError if the value is not present.



The difference between the tags of the hopping’s sites


The family of the first site in the hopping


The family of the second site in the hopping