|
|
Out of all the features that the Kwant developers and Kwant users miss, there are only two that require changes in the low-level structure as opposed to extending what is there already. These are:
|
|
|
Out of all the features that the Kwant developers and Kwant users miss, there
|
|
|
are only two that require changes in the low-level structure as opposed to
|
|
|
extending what is there already. These are:
|
|
|
|
|
|
* Higher-dimensional band structures
|
|
|
* Speed of evaluating the system Hamiltonian or applying it to a vector (useful for the real time evolution calculations in t-kwant).
|
|
|
* Speed of evaluating the system Hamiltonian or applying it to a vector
|
|
|
(useful for the real time evolution calculations in t-kwant).
|
|
|
|
|
|
Accordingly the main change in Kwant 2 is going to be the rewrite of the low level system format that would allow these improvements to be made.
|
|
|
Accordingly the main change in Kwant 2 is going to be the rewrite of the low
|
|
|
level system format that would allow these improvements to be made.
|
|
|
|
|
|
Here we outline the proposed new functionality, new low level system format, and the corresponding rewrite of the `Builder`.
|
|
|
Here we outline the proposed new functionality, new low level system format,
|
|
|
and the corresponding rewrite of the `Builder`.
|
|
|
|
|
|
# Planned features
|
|
|
|
|
|
## Symmetries with multiple directions
|
|
|
The low-level system format will support symmetries with multiple directions, this will allow
|
|
|
us to implement calculation of band structures of arbitrary dimension.
|
|
|
The low-level system format will support symmetries with multiple directions,
|
|
|
this will allow us to implement calculation of band structures of arbitrary
|
|
|
dimension.
|
|
|
|
|
|
## Vectorized evaluation of the Hamiltonian
|
|
|
The low-level system will know about vectorized value functions, which take an "array of sites"
|
|
|
(probably implemented as a site family and an array of tags) or a pair of such arrays and returns
|
|
|
an array of values. This will mean that a given value function only has to be called *once*.
|
|
|
|
|
|
## Multiple values for Hamiltonian elements
|
|
|
It should be possible to do the following:
|
|
|
```python
|
|
|
sys[onsite] = 1.
|
|
|
sys[onsite] += lambda site, Vb, time: Vb * cos(time)
|
|
|
|
|
|
sys[hopping] = lambda s1, s2, t: -t
|
|
|
sys[hopping] += lambda s1, s2, t, time: -t * time
|
|
|
```
|
|
|
With the meaning that the result of the function evaluations is added together
|
|
|
when the system Hamiltonian is evaluated.
|
|
|
The low-level system will know about vectorized value functions, which take an
|
|
|
"array of sites" (probably implemented as a site family and an array of tags)
|
|
|
or a pair of such arrays and returns an array of values. This will mean that a
|
|
|
given value function only has to be called *once*.
|
|
|
|
|
|
## Indexing wavefunctions by `Site`
|
|
|
`wave_function` and `ldos` should return objects which can be used like an array, but which can also
|
|
|
be indexed with `Site` objects, if the system was a finalized `Builder`.
|
|
|
`wave_function` and `ldos` should return objects which can be used like an
|
|
|
array, but which can also be indexed with `Site` objects.
|
|
|
|
|
|
|
|
|
# Data structures
|
|
|
|
|
|
## [[Builder | Builder]]
|
|
|
The builder will need to be modified so that it supports the above "multiple
|
|
|
value" interface, but also so that it supports vectorized system construction
|
|
|
(e.g. vectorized `shape` functions). In addition it should be in a format that
|
|
|
is easy to finalize to the new low-level format. [[This page | Builder]] will
|
|
|
hold the specification for the new builder.
|
|
|
The builder will need to be modified so that it supports it supports vectorized
|
|
|
system construction (e.g. vectorized `shape` functions). In addition it should
|
|
|
be in a format that is easy to finalize to the new low-level format. [[This
|
|
|
page | Builder]] will hold the specification for the new builder.
|
|
|
|
|
|
## [[Low-level system | Low-Level-System-Format]]
|
|
|
The low-level system format is rather involved, and so is described in a separate document,
|
|
|
[[here|Low-Level-System-Format]]. Roughly, instead of having a single graph with values
|
|
|
associated with each node/edge, in Kwant-2 there will be multiple graphs, one for each set of
|
|
|
site families, values, and symmetry group elements represented in the system. This will allow
|
|
|
for efficient building of the Hamiltonian. |
|
|
The low-level system format is rather involved, and so is described in a
|
|
|
separate document, [[here|Low-Level-System-Format]]. Roughly, instead of having
|
|
|
a single graph with values associated with each node/edge, in Kwant-2 there
|
|
|
will be multiple graphs, one for each set of site families, values, and
|
|
|
symmetry group elements represented in the system. This will allow for
|
|
|
efficient building of the Hamiltonian. |