|
|
# Low-level System Format
|
|
|
This document specifies a proposal for the new low-level system format in Kwant-2.0 |
|
|
\ No newline at end of file |
|
|
This document specifies a proposal for the new low-level system format in Kwant-2.0.
|
|
|
The requirements are:
|
|
|
+ Efficient evaluation and construction of the Hamiltonian matrix
|
|
|
+ Efficient evaluation of submatrices of the Hamiltonian (e.g. all elements which
|
|
|
have a value function which depends on time)
|
|
|
|
|
|
We will start by describing the format for a *finite* system, that is, a system with no symmetries.
|
|
|
We will then move on to *infinite* systems with symmetries.
|
|
|
|
|
|
## Finite Systems
|
|
|
### Site Ordering
|
|
|
Sites are arranged in the following way:
|
|
|
|
|
|
indices: 0 1 2 N N+1 N+2 N+M
|
|
|
sites: [a1, a1, a3, ..., aN, b1, b2, ..., bM, ....]
|
|
|
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
|
|
|
site family "a" site family "b"
|
|
|
|
|
|
Where the families are ordered lexicographically and the sites within a particular family are ordered
|
|
|
lexicographically by their tag. This permits a unique numbering of sites as indicated above.
|
|
|
The above choice of ordering makes dealing with quantities such as wavefunctions easier, as all sites
|
|
|
belonging to the same site family necessarily have the same number of orbitals.
|
|
|
|
|
|
Even though generic low-level systems will not have to provide an explicit interface to `Site` objects,
|
|
|
such as those found in a `Builder`, it will nevertheless have to have a concept of `SiteFamily` where
|
|
|
sites from the same family have the same number of orbitals.
|
|
|
|
|
|
### On-Site Hamiltonian Elements
|
|
|
For a given site family, `fam`, with `n_orbs` orbitals per site the sites and values are stored in the
|
|
|
following way.
|
|
|
|
|
|
All of the sites which have *constant* values assigned to them are stored like so:
|
|
|
|
|
|
(fam, [i1, i2, i3, ..., iN], [v1, v2, v3, ..., vn])
|
|
|
|
|
|
where the `i<n>` are the site indices [1] and the `v<n>` are the values assigned to each
|
|
|
site. The two sequences can be efficiently stored as arrays, as the shape is known (`(N,)` for the indices
|
|
|
and `(N, n_orbs, n_orbs)` for the values).
|
|
|
|
|
|
All of the sites which have a value given by a function `func` are stored like so:
|
|
|
|
|
|
(fam, func, [i1, i2, i3, ..., iN])
|
|
|
|
|
|
If `func` is vectorized then it can be called *once*, passing all the sites [2], if not
|
|
|
then it can be called `N` times, passing each site individually.
|
|
|
|
|
|
### Hopping Hamiltonian Elements
|
|
|
The hoppings are stored in an analogous way to the on-sites, except that now there is a *pair*
|
|
|
of families, instead of a single one.
|
|
|
|
|
|
For constant hoppings we store everything in the following way
|
|
|
|
|
|
(fam_to, fam_from, [i1, i2, ..., iN], [j1, j2, ..., jN], [v1, v2, ..., vN])
|
|
|
|
|
|
Where the values each have shape `(fam_to.n_orbs, fam_from.n_orbs)`.
|
|
|
|
|
|
For hoppings given by a function `func` we store:
|
|
|
|
|
|
(fam_to, fam_from, func, [i1, i2, ..., iN], [j1, j2, ..., jN])
|
|
|
|
|
|
As for the on-site value functions, `func` can be evaluated just once if vectorised, or
|
|
|
called for each pair `i<n>, j<n>` if not.
|
|
|
|
|
|
---------------------
|
|
|
##### Footnotes
|
|
|
[1]: Should the indices be the *global* site indices, or just the offset from the start of the sites
|
|
|
from the current site family?
|
|
|
|
|
|
[2]: The functions may expect a bona-fine `SiteArray` in the case of a finalized `Builder`,
|
|
|
can we efficiently construct such a thing? Seems a bit of a waste to construct a new
|
|
|
array and then immediately discard it. If the sites were ordered by their value functions
|
|
|
then we could just use a slice.
|
|
|
|
|
|
|
|
|
## Infinite Systems
|
|
|
The difference between finite and infinite systems is that the latter have a discrete
|
|
|
*translational symmetry*. In Kwant-2 the translational symmetry is characterised by N linearly
|
|
|
independent real-space vectors (as opposed to a single realspace vector, as in Kwant-1).
|
|
|
There is an isomorphism from the symmetry group to `(Z^N, +)`, the additive group of
|
|
|
N-tuples of integers.
|
|
|
|
|
|
|
|
|
## Implementation of Common Operations
|
|
|
Here we note down the various common operations that the low-level format has to efficiently support
|
|
|
and how they would be implemented with the above definition for the low-level format. |
|
|
\ No newline at end of file |