kwant.lattice.Monatomic

class kwant.lattice.Monatomic(prim_vecs, offset=None, name='')

Bases: kwant.builder.SiteFamily, kwant.lattice.Polyatomic

A Bravais lattice with a single site in the basis.

Instances of this class provide the SiteFamily interface. Site tags (see SiteFamily) are sequences of integers and describe the lattice coordinates of a site.

Monatomic instances are used as site families on their own or as sublattices of Polyatomic lattices.

Parameters:

prim_vecs : sequence of sequences of floats

Primitive vectors of the Bravais lattice.

offset : vector of floats

Displacement of the lattice origin from the real space coordinates origin.

Attributes

offset (vector) Displacement of the lattice origin from the real space coordinates origin.
prim_vecs (sequence of vectors) prim_vecs[i] is the i-th primitive basis vector of the lattice

Methods

closest(pos)

Find the lattice coordinates of the site closest to position pos.

n_closest(pos, n=1)

Find n sites closest to position pos.

Returns:

sites : numpy array

An array with sites coordinates.

neighbors(n=1, eps=1e-08)

Return n-th nearest neighbor hoppings.

Parameters:

n : integer

Order of the hoppings to return.

eps : float

Tolerance relative to the length of the shortest lattice vector for when to consider lengths to be approximately equal.

Returns:

hoppings : list of kwant.builder.HopplingKind objects

A list n-th nearest neighbor hoppings.

Notes

The hoppings are ordered lexicographically according to sublattice from which they originate, sublattice on which they end, and their lattice coordinates. Out of the two equivalent hoppings (a hopping and its reverse) only the lexicographically larger one is returned.

normalize_tag(tag)
pos(tag)

Return the real-space position of the site with a given tag.

shape(function, start)

Return a key for all the lattice sites inside a given shape.

The object returned by this method is primarily meant to be used as a key for indexing kwant.Builder instances. See example below.

Parameters:

function : callable

A function of real space coordinates that returns a truth value: true for coordinates inside the shape, and false otherwise.

start : float vector

The origin for the flood-fill algorithm.

Returns:

shape_sites : function

Notes

When the function returned by this method is called, a flood-fill algorithm finds and yields all the lattice sites inside the specified shape starting from the specified position.

A Symmetry or Builder may be passed as sole argument when calling the function returned by this method. This will restrict the flood-fill to the fundamental domain of the symmetry (or the builder’s symmetry). Note that unless the shape function has that symmetry itself, the result may be unexpected.

Examples

>>> def circle(pos):
...     x, y = pos
...     return x**2 + y**2 < 100
...
>>> lat = kwant.lattice.honeycomb()
>>> sys = kwant.Builder()
>>> sys[lat.shape(circle, (0, 0))] = 0
>>> sys[lat.neighbors()] = 1
vec(int_vec)

Return the coordinates of a Bravais lattice vector in real space.

Parameters:vec : integer vector
Returns:output : real vector
wire(center, radius)

Return a key for all the lattice sites inside an infinite cylinder.

This method makes it easy to define cylindrical (2d: rectangular) leads that point in any direction. The object returned by this method is primarily meant to be used as a key for indexing kwant.Builder instances. See example below.

Parameters:

center : float vector

A point belonging to the axis of the cylinder.

radius : float

The radius of the cylinder.

Notes

The function returned by this method is to be called with a TranslationalSymmetry instance (or a Builder instance whose symmetry is used then) as sole argument. All the lattice sites (in the fundamental domain of the symmetry) inside the specified infinite cylinder are yielded. The direction of the cylinder is determined by the symmetry.

Examples

>>> lat = kwant.lattice.honeycomb()
>>> sym = kwant.TranslationalSymmetry(lat.a.vec((-2, 1)))
>>> lead = kwant.Builder(sym)
>>> lead[lat.wire((0, -5), 5)] = 0
>>> lead[lat.neighbors()] = 1

Attributes

prim_vecs

Previous topic

kwant.lattice.general

Next topic

kwant.lattice.Polyatomic

This Page