Vectorized operators and systems interface
Here I propose the low-level interface for vectorized systems, possibly suitable for Kwant 2.
The proposal (naming may be changed later after discussion, of course) is to organize the code as follows:
-
kwant/problems.py
describes what problems can be solved in Kwant. Essentially, it is whatkwant/system.py
was, but in this way adding possible new problems (other than 1D scattering) is straightforward. Currently it has scattering and Green's function problem. Problems are relatively simple and incapsulatekwant/operators
(contrary to Kwant 1 systems, that require inheritance), which makes code structure more straightforward. -
kwant/operators
module has essentially all the functionality, that was inFiniteSystem
andInfiniteSystem
classes.kwant/operators/abc.py
defines interfaces of generalOperator
,Term
,TermOperator
,Modes
andSelfEnergy
.Term
is a vectorized data storage andTermOperator
is an operator defined by a set of terms.Modes
andSelfEnergy
are essentially the interfaces for "something that has modes" and "something that has selfenergy".
Edited by Viacheslav Ostroukh