This manual describes C++QED: a framework for simulating open quantum dynamics.
It is mainly for developers who wish to extend the framework for their own further purposes. For a first introduction and the description of some basic ideas underlying the framework cf. the User Guide.
The organization of the framework may be sketched as follows:
This manual is organized accordingly:
A general problem is that the use of int, size_t, and ptrdiff_t is not consistent. In the framework we tried to use them consistently, but in Blitz only int is used in all situations like indexing, extents and even rank template parameters, so in the interaction with Blitz we could not remain consistent.
We have used the main trunk of Blitz throughout, but later it might be desirable to switch to the 64-bit trunk.
Our own extensions to blitz can be found in utils and are defined in
namespace blitzplusplus
The following definitions are in effect throughout the framework and the present manual:
typedef std::complex<double> dcomp;
const dcomp DCOMP_I(0,1);
In this manual, we are relying on the C++11 feature of template aliases to make documentation easier. However, in the framework, we are not using this feature (nor any other C++11 feature), as this would limit too much the range of compilers able to cope with the framework.
For instance:
template <int RANK>
is assumed in this document to be a template alias:
template <int RANK> using TTD_DArray=blitz::Array<double,RANK>;
In the framework, however, it is simply defined as a macro (with all capitals):
#define TTD_DARRAY(r) blitz::Array<double,r>
template <int RANK>:
template <int RANK> using TTD_CArray=blitz::Array<dcomp,RANK>;
template <int RANK>:
template <int RANK> using TTD_ExtTiny=blitz::TinyVector<size_t,RANK>;
template <int RANK>:
template <int RANK> using TTD_IdxTiny=blitz::TinyVector<ptrdiff_t,RANK>
namespace linalg {
typedef TTD_CArray<1> CVector;
} // linalg
namespace linalg {
typedef TTD_CArray<2> CMatrix;
} // linalg
The prefix TTD stands for “template typedef” here and throughout the framework.
Metafunctions are class templates used to “compute” some type. By convention, the resulting type is stored as a type typename.
In the framework, metafunctions are named with an MF suffix. Many of them are simple template aliases, but with some extra functionality, as e.g. compile-time assertions.
We will also use the following namespace alias
namespace mpl=boost::mpl;
However, in the framework we are not using this alias globally, as this would lead to all sorts of name clashes.
We assume that the following definitions are in effect:
const mpl::true_ mpl::constants_true;
const mpl::false_ mpl::constant_false;
The content of the directory utils in the distribution is a small library of very diverse but quite general tools, that I have abstracted during the development of the framework, and used also in several other projects. This may in time become a project on its own. The reader is encouraged to have a look in there, too: some modules may be useful in themselves.