kwant.builder.HoppingKind

class kwant.builder.HoppingKind(delta, family_a, family_b=None)

Bases: object

A pattern for matching hoppings.

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)
sys[kind(sys)] = 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)]]
sys[kinds] = 1

Methods

Attributes

delta
family_a
family_b

Previous topic

kwant.builder.Site

Next topic

kwant.builder.SimpleSiteFamily

This Page