Матусевич Евгений wrote:
I need to calculate conductivity of a graphene layer with defect (watch the picture). I have coordinates of atoms of this layer.
Kwant has the concept of “site family”. Everybody uses the site families provided by the module kwant.lattice which represent perfect Bravais lattices.
What most people do not realize is that Kwant contains another class of site families: kwant.builder.SimpleSiteFamily. It mostly exists so that the builder module can be tested independently of the lattice module, but it should be useful for your purpose as well.
An instance of SimpleSiteFamily is indexed by any Python object that satisfies the condition object == eval(repr(object)), e.g. by a tuple of real numbers. For example:
import kwant lat = kwant.builder.SimpleSiteFamily() syst = kwant.Builder() syst[lat(3.14, 2.72)] = 123
You can add more sites and hoppings as usual.
Note, however, that site lat(3.14, 2.72) is separate from site [lat(3.14 + 1e-10, 2.72)!
Also, TranslationalSymmetry won’t work with this site family. You can still attach leads either manually , or by adding a layer of sites that belong to a Bravais lattice by hand. Let us know if this works for you.
Support for imperfect lattices could be improved. There’s an open issue for that . Would you like to help us to improve this aspect of Kwant?