template <bool IS_EX, bool IS_HA, bool IS_LI>
There are eight possible versions of this class determined by whether the binary system’s dynamics has exactly solved part (IS_EX=true) or not, whether the system has Hamiltonian evolution (IS_HA=true) or not, whether it is lossy (IS_LI=true) or conservative.
These characteristics are determined by those of its subsystems, e.g. if either subsystem has Hamiltonian evolution, then the whole system has. The inspection of the subsystems is performed by binary::make()
Assume that we have a system composed of modes and particles layed out in the following way: (Free No. 0) mode (1) particle (2) mode (3) particle (4) mode (5) particle (6) mode (7) particle. Assume that we need the interaction ParticleTwoModes2D acting between (4) (0) (7) (1). Furthermore assume that
const int RANK=8;
structure::Types<8>::StateVectorLow psi, dpsidt;
represent state vectors of the complete system. Then the action of the Hamiltonian of this interaction in this complete Hilbert space can be calculated as
for_each(fullRange(psi,Vector<4,0,7,1>()),basi::begin(dpsidt,Vector<4,0,7,1>()),PTM2D_Hamiltonian);
...
It is the task of this class to keep track of the elements of the system together with their corresponding slices, and implement the operations of the full system in terms of such loops...
Consistency checks for Composite at compile time come on three levels:
Composite itself only checks whether all the quantum numbers are addressed by an Act. So this is e.g. not allowed:
composite::result_of::Make<Act<0,1>,Act<0,2>,Act<0,3>,Act<3,2,5,1> >::type
because 4 is not addressed and hence the Composite object has no way to figure out what kind of Free object is there.
The instantiated slice iterators do some further checks for each Act individually:
Finally, tmptools::Vector checks for the non-negativity of each element (as it is supposed to be a non-negative compile-time vector).
Note that this incidentally makes that the three checks performed by the slice interators for each Act are redundant (the first condition follows from the last two plus the nonnegativity of tmptools::Vector). However, these checks are still necessary for the slice iterators because they accept classes other than tmptools::Vector for the specification of retained index positions.
This is followed by a check at runtime, when the actual elements become available, whether the legs of the Act objects are consistent among each other. Cf. composite::FillFrees::Inner::operator().