... | ... | @@ -99,7 +99,7 @@ Infinite systems are stored in the following way. The on-sites are stored in the |
|
|
same way as for finite systems; only sites in the finite representation are stored.
|
|
|
For each element of the connection set, the associated hoppings (i.e. the hoppings
|
|
|
between the fundamental domain and its image under the action of the connection
|
|
|
set element) are stored in the same way as for the finite system.
|
|
|
set element) are stored in the same way as for the finite system.
|
|
|
|
|
|
|
|
|
group element: g1 g2
|
... | ... | @@ -147,7 +147,11 @@ and how they would be implemented with the above definition for the low-level fo |
|
|
This requires evaluating the full Hamiltonian matrices associated with *each* of the elements
|
|
|
of the connection set, and then solving an eigenvalue equation like:
|
|
|
|
|
|
[H + V_0 exp(i k_x x) + V_1 exp(i k_y y) + ... + h.c] u = E u
|
|
|
[H + V_1 exp(i k_x x) + V_2 exp(2 i k_x x) + ... + h.c
|
|
|
+ W_1 exp(i k_y y) + W_2 exp(2 i k_y y) + ... + h.c] u = E u
|
|
|
|
|
|
We can easily evaluate the matrices individually, as they correspond to all blocks with
|
|
|
a particular symmetry group element.
|
|
|
|
|
|
### Evaluating all elements which depend on some parameter (e.g. time)
|
|
|
Iterate over the blocks, inspect the `value`, if the `value` takes a parameter with the correct
|
... | ... | @@ -165,6 +169,53 @@ that contains the sites for which they wish to extract a submatrix. As the sites |
|
|
site family, this enables efficient construction of the submatrix.
|
|
|
|
|
|
|
|
|
## Abstract API
|
|
|
The above proposal will need to be supported by an abstract API that allows
|
|
|
systems to be implemented in C/C++ by users if they so wish. Below is a
|
|
|
sketch of a Cython implementation of this abstract API
|
|
|
```python
|
|
|
class System:
|
|
|
|
|
|
# An array of site families. Each site family has the format
|
|
|
# (offset, n_orbs) where "offset" is the offset in the ordering
|
|
|
# of sites where sites of this site_family start, and "n_orbs" is
|
|
|
# the number of orbitals on each site.
|
|
|
ndarray[int, ndim=2] site_families
|
|
|
|
|
|
# An array of symmetry group elements. Each symmetry group element
|
|
|
# is represented as a 1D array of integers.
|
|
|
ndarray[int, ndim=2] symmetry_elements
|
|
|
|
|
|
# An array of pairs (i, j). These are organized into chunks which
|
|
|
# have a homogeneous pair of site families.
|
|
|
ndarray[int, ndim=2] hoppings
|
|
|
|
|
|
# An array storing the offsets of the different chunks of the
|
|
|
# `hoppings` array.
|
|
|
ndarray[int, ndim=1] chunks
|
|
|
|
|
|
# An array of blocks. A block has the format (sym, fam1, fam2, chunk, conj)
|
|
|
# where `sym` is an index into the `symmetry_elements` array, `fam1` and
|
|
|
# `fam2` are indices into the `site_families`, `chunk` is an index
|
|
|
# into `chunks`, and `conj` is a boolean flag that indicates that the
|
|
|
# complex conjugate should be calculated (this allows efficient storage
|
|
|
# for Hermitian Hamiltonians).
|
|
|
ndarray[int, ndim=2] blocks
|
|
|
|
|
|
# Get the Hamiltonian of the given block. Returns am array of shape
|
|
|
# (N, fam2.n_orbs, fam1.n_orbs)
|
|
|
def hamiltonian_block(int block_index):
|
|
|
...
|
|
|
|
|
|
# just a convenience function around "hamiltonian_block
|
|
|
# to construct the Hamiltonian corresponding to a symmetry group element
|
|
|
def hamiltonian(int symmetry_element):
|
|
|
...
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
## C API
|
|
|
In addition to the new low-level format, systems in Kwant-2 should have a C API.
|
|
|
This is needed in order to interface Kwant systems with external codes
|
... | ... | |