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 what
kwant/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 incapsulate
kwant/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 in
kwant/operators/abc.py defines interfaces of general
Term is a vectorized data storage and
TermOperator is an operator defined by a set of terms.
SelfEnergy are essentially the interfaces for "something that has modes" and "something that has selfenergy".