kwant.builder.HoppingKind#
- 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 ofa
equalsfamily_a
and that ofb
equalsfamily_b
and(a.tag - b.tag)
is equal todelta
. 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
orNone
(default)) – The default value means: use the same family asfamily_a
.
Notes
A
HoppingKind
is a callable object: When called with aBuilder
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
- index(value, start=0, stop=9223372036854775807, /)[source]#
Return first index of value.
Raises ValueError if the value is not present.
Attributes