The Namespace Tree

The MPQC code is organized into a hierarchy of C++ namespaces, as described below:

mpqc

The top-level namespace for all code. All code in MPQC lives in this namespace, aside from few exceptions (e.g. instantiations of template classes defined in namespaces external to MPQC).

mpqc::math

This namespace includes MPQC-specific math functionality.

mpqc::molecule

This namespace includes functionality used by collections of atoms, namely by mpqc::Molecule and mpqc::UnitCell classes.

mpqc::lcao

This namespace includes all functionality related to computing in LCAO (Linear Combination of Atomic Orbitals) representation. (For our purposes LCAO stands for any algebraic/spectral representation in which the structure of the basis is not explicitly specified). E.g., the factories for computing operators in LCAO representation should go here. This namespace also contains (or exports via a using declaration) all end-user quantum chemistry classes (RHF, MP2, CCSD) implemented in the LCAO form.

mpqc::lcao::gaussian

This namespace includes all functionality related to computing in a Gaussian AO representation. Gaussian AO representation is the only currently used in MPQC.

mpqc::lcao::model

This namespace includes all functionality related to computing with lattice model Hamiltonians.

mpqc::lcao::cc

This namespace includes all functionality related to the coupled-cluster methods in LCAO representation.

mpqc::lcao::f12

This namespace includes all functionality related to the explicitly correlated methods in LCAO representation.

Each of these namespaces is indended to contain the functionality needed for all users of MPQC libraries. The code indended only for advanced users should be placed in the nested utility namespace. For example, the package-wide functionality that is intended only for advanced users should go into mpqc::utility. Similarly, the advanced functionality related to the Gaussian AO representation should go to mpqc::lcao::gaussian::utility.

Similarly, the implementation details of the code in each namespace that are not intended for any users of MPQC should go into the nested detail namespace, e.g. mpqc::lcao::gaussian::detail should contain the implementation details of classes in mpqc::lcao::gaussian.

When adding or reogranizing code you should adhere to a set of guidelines to decide which namespace should be chosen for a given variable, function, or class.

  • Most of the MPQC code should be placed into one of namespaces contained in namespace mpqc ; the global namespace should not be used.
  • The top-level mpqc namespace should contain the unique functionality that is likely to be used by every user of the MPQC libraries. This includes for example the mpqc::Energy class as well as all exception classes. Note that this does not include classes that implement electronic structure methods that could have multiple implementations that e.g. use different numerical representations; to avoid having two DFT classes, one based on LCAO and another based on the finite-difference/finite-element representation each should go into the nested namespace for that numerical representation.
  • All LCAO-based code should be placed in the mpqc::lcao namespace. Although in chemistry we almost exclusively use Gaussians, it is recommended that Gaussian-specific code is placed in the mpqc::lcao::gaussian subspace (this is only partially implemented) so that it is possible to re-use the LCAO technology in non-Gaussian contexts, e.g. with model Hamiltonians.
  • Most of the code located under src/mpqc/math should live in mpqc::math namespace.
  • Most of the code located under src/mpqc/util should live in mpqc::utility namespace.