MolSSI Integral Reference Project
Various Types of Functions for Integrals


Each integral implemented in MIRP has a few different functions for computing them.

The phrase 'single cartesian integral' refers to a single number. For example, a (px|px) overlap integral.


Functions with the pattern mirp_{name}_single compute a single cartesian component of an integral using arbitrary precision. These functions take arbitrary precision types as input and output.

A working precision is specified as an argument, along with all the parameters required for the integral.


This function also computes a single cartesian component of an integral using arbitrary precision, however takes strings as inputs. The strings are converted to interval arithmetic with the precision given by working_prec.

These types of functions can be created from other functions with the mirp_integral4_single_str wrapper.


Computes single cartesian integrals exact double precision. These functions take double precision inputs and output double precision. Internally, interval arithmetic is used such that there is no roundoff error in the final result. Therefore, the integral is 'exact' to double precision.

These types of functions can be created from other functions with the mirp_integral4_single_exact wrapper.

mirp_name, mirp_name_str, mirp_name_exact

These functions are analogous to their 'single' counterparts, however they take in contracted shells (both segmented and general) as inputs and return a complete set of integral.

Functions with the pattern mirp_{name} are created with mirp_integral4`. The others are created via mirp_integral4_str, and mirp_integral4_exact.

Wrapping functions and macros

The wrapping functions mentioned above are used to create the higher-level functions from (typically) the mirp_{name}_single. This can be done even easier with the MIRP_WRAP_ macros.

Four-center integrals

Macro Creates Requires Calls
MIRP_WRAP_SHELL4(name) mirp_name mirp_name_single mirp_integral4
MIRP_WRAP_SINGLE4_STR(name) mirp_name_single_str mirp_name_single mirp_integral4_single_str
MIRP_WRAP_SINGLE4_EXACT(name) mirp_name_single_exact mirp_name_single mirp_integral4_single_exact
MIRP_WRAP_SHELL4_STR(name) mirp_name_str mirp_name mirp_integral4_str
MIRP_WRAP_SHELL4_EXACT(name) mirp_name_exact mirp_name mirp_integral4_exact

See eri.h for an example