# kwant.builder.HoppingKind¶

class kwant.builder.HoppingKind[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))

Parameters: 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.

Notes

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


Methods

count($self, value, /)[source] Return number of occurrences of value. index($self, value, start=0, stop=sys.maxsize, /)[source]

Return first index of value.

Raises ValueError if the value is not present.

Attributes

delta[source]

The difference between the tags of the hopping’s sites

family_a[source]

The family of the first site in the hopping

family_b[source]

The family of the second site in the hopping

#### Previous topic

kwant.builder.Site

#### Next topic

kwant.builder.SimpleSiteFamily