kwant.builder.HoppingKind#
- class kwant.builder.HoppingKind(delta, family_a, family_b=None)[source]#
Bases:
tupleA pattern for matching hoppings.
An alias exists for this common name:
kwant.HoppingKind.A hopping
(a, b)matches precisely when the site family ofaequalsfamily_aand that ofbequalsfamily_band(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 (
SiteFamilyorNone(default)) – The default value means: use the same family asfamily_a.
Notes
A
HoppingKindis a callable object: When called with aBuilderas 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
Buildercan be indexed with functions or iterables of functions,HoppingKindinstances (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