Table Of Contents

Previous topic

The quantumdata namespace

Next topic

State vector

DimensionsBookkeeper

class DimensionsBookkeeper

template <int RANK, bool IS_CONST> (cf. template parameters)

This class is designed to store and manipulate dimensions of constructs on composite Hilbert spaces of arity RANK.

It can be either constant or non-constant depending on the second template parameter.

It has a straightforward interface which does not need documentation, the only notable point being a technique which is used from time to time throughout the framework. Consider the following constructor:

explicit DimensionsBookkeeper(mpl::bool_<IS_CONST> is_const=mpl::constant_false)

The aim of the dummy argument with a default value—which creates a nonsensical function signature in the case when IS_CONST is true—is that this constructor only compiles in the case when IS_CONST is false because it is only in the non-constant case that we allow default construction of the class. Since from a template only such parts are compiled as are actually used, a client can use the class in the case when IS_CONST is true without problems, getting a compile-time error only when trying to default-construct such an object.

type Dimensions
typedef TTD_ExtTiny<RANK> Dimensions;

Types

class quantumdata::Types

template <int RANK, typename B> (cf. template parameters)

This class is basically only a metafunction defining the following types:

type StateVectorLow
typedef TTD_CArray<RANK> StateVectorLow;
type DensityOperatorLow
typedef TTD_CArray<2*RANK> DensityOperatorLow;