OpenCAP
Electronic structure of metastable states
Developer Notes

Key Classes

System

The System class stores the geometry and the basis set. OpenCAP supports both inline specification and parsing from post-processing files generated by the package such as Molden and FCHK. The latter is preferred as it greatly decreases the odds of getting the GTO ordering wrong. The System class computes the overlap matrix, which is used to verify the GTO ordering.

Basis Set

In the BasisSet class, basis functions are stored in the form of Shell objects, which contain the angular momentum, exponents, coefficients, and center. The ordering of the individual basis functions is stored in bf_ids vector. Each basis function has a four-part bf_id:

atom index, shell number, angular momentum quantum number(l), magnetic quantum number(m)

e.g: (1,1,3,-2)

These IDs are used to create the mapping between OpenCAP ordering of GTOs and the quantum chemistry package's ordering.

CAP

The CAP class handles computing the CAP matrix and post-processing of densities and the zeroth order Hamiltonian. The densities are stored in two 2D vectors, one for alpha and the other for beta densities. It ultimately computes and stores the CAP matrices in atomic orbital and state basis.

AOCAP

The AOCAP class handles numerical integration of the CAP matrix. It uses the Numgrid library to allocate the grid for each atom.

How to add support for new packages

The following is required to develop an interface with a new package:

  • Knowledge of ordering of GTOs, both Cartesian and Harmonic
  • Overlap matrix
  • 1 particle transition density matrices between each state and 1RDMs
  • Zeroth order Hamiltonian
  • New keywords

GTOs and Overlap Matrix

It is not possible to represent the CAP in state basis without knowing the ordering of the one-particle densities. Unfortunately, this information is seldom documented in easy to find places. The overlap matrix is our best tool for figuring out how the basis set is ordered, as it is almost always computed by electronic structure packages, and is usually available in post-processing files. Once you have figured out how the basis set is ordered, you need to add functions to gto_ordering.cpp which describe the mapping from your packages ordering to OpenCAP ordering. Use the IDs described in the Basis Set section to create this mapping.

One-particle densities

One particle densities should be represented in AO basis, and then transformed to OpenCAP ordering using "to_opencap_ordering", for use by the CAP class. In principle, one can read them in in MO basis, and then transform to AO basis, but this requires knowledge of the MO coefficients. When adding support for a new package, a new file 'package_interface.cpp' should be added.

Zeroth Order Hamiltonian

It is strongly recommended to create functions which parse the zeroth order Hamiltonian from standard output files. These functions should be added to the 'package_interface.cpp' file.

Keywords

keywords.cpp must be edited to allow new for new keywords. There are two types of keywords: "open", which can have many different values, and "closed", which can only have certain values. Additionally, the verify_method, read_in_dms, and read_in_zero_order_H methods of CAP must be modified, as well as anywhere else where GTO ordering is required to include the new interface.