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.pydescribes what problems can be solved in Kwant. Essentially, it is whatkwant/system.pywas, 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/operatorsmodule has essentially all the functionality, that was inFiniteSystemandInfiniteSystemclasses.kwant/operators/abc.pydefines interfaces of generalOperator,Term,TermOperator,ModesandSelfEnergy.Termis a vectorized data storage andTermOperatoris an operator defined by a set of terms.ModesandSelfEnergyare essentially the interfaces for "something that has modes" and "something that has selfenergy".
Edited by Viacheslav Ostroukh