# Interface to ERD by N. Flocke and V. Lotrich

Code author: Andrew C. Simmonett and Benjamin P. Pritchard

Section author: Lori A. Burns

These are the AcesIII electron repulsion integrals that have been partially interfaced into libmints. Enabling erd and adding `set integral_package erd` (do this in `~/.psi4rc` for universal effect) runs libderiv from Libint for derivative integrals and erd for non-derivative integrals.

Warning

The interface between erd and libderiv is not fully debugged. So analytic gradients, particularly density-fitted ones, are wrong, as are ESP calculations and some energies for long-range corrected (“omega”) functionals. Insofar as faulty answers are anticipated with INTEGRAL_PACKAGE `erd`, PSI4 will throw an error if you try to execute that class of computation. But there may be more, so use with caution.

Warning

erd seems to be having some problems with Intel 2018 compilers. presently disabled in conda package.

## Installation

Binary

- ERD is available as a conda package for Linux and macOS (and Windows, through the Ubuntu shell).

- If using PSI4 built from source, and anaconda or miniconda has already been installed (instructions at Quick Installation), erd can be obtained through `conda install erd -c psi4`. Then enable it as a feature with ENABLE_erd, hint its location with CMAKE_PREFIX_PATH, and rebuild PSI4 to detect erd and activate dependent code.
- Previous bullet had details. To build PSI4 from source and use erd from conda without thinking, consult sec:condapsi4dev.
- To remove a conda installation, `conda remove erd`.

Source

- If using PSI4 built from source and you want erd built from from source also, enable it as a feature with ENABLE_erd, and let the build system fetch and build it and activate dependent code.

## How to configure erd for building Psi4

Role and Dependencies

- Role — In PSI4, ERD is a library that provides alternate integrals.
- Downstream Dependencies — PSI4 (\(\Leftarrow\) optional) erd
- Upstream Dependencies — erd \(\Leftarrow\) Fortran

CMake Variables

- ENABLE_erd — CMake variable toggling whether PSI4 builds with erd
- CMAKE_PREFIX_PATH — CMake list variable to specify where pre-built dependencies can be found. For erd, set to an installation directory containing `include/ERD/ERD_MANGLE.h`
- erd_DIR — CMake variable to specify where pre-built erd can be found. Set to installation directory containing `share/cmake/erd/erdConfig.cmake`
- CMAKE_DISABLE_FIND_PACKAGE_erd — CMake variable to force internal build of erd instead of detecting pre-built
- CMAKE_INSIST_FIND_PACKAGE_erd — CMake variable to force detecting pre-built erd and not falling back on internal build

Examples

1. Build bundled

>     >>> cmake -DENABLE_erd=ON

2. Build without erd

>     >>> cmake

3. Link against pre-built

>     >>> cmake -DENABLE_erd=ON -DCMAKE_PREFIX_PATH=/path/to/erd/root

>     >>> cmake -DENABLE_erd=ON -Derd_DIR=/path/to/erd/configdir

4. Build bundled despite pre-built being detectable

>     >>> cmake -DENABLE_erd=ON -DCMAKE_PREFIX_PATH=/path/to/unwanted/erd/root/and/wanted/other/dependencies/root -DCMAKE_DISABLE_FIND_PACKAGE_erd=ON