# Interface to DKH by A. Wolf, M. Reiher, and B. A. Hess

Code author: Justin M. Turney

Section author: Justin M. Turney

Module: Keywords, Samples

## Installation

Binary

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

- If using the PSI4 binary, dkh has already been installed alongside.

- If using PSI4 built from source, and anaconda or miniconda has already been installed (instructions at Quick Installation), dkh can be obtained through `conda install dkh -c psi4`. Then enable it as a feature with ENABLE_dkh, hint its location with CMAKE_PREFIX_PATH, and rebuild PSI4 to detect dkh and activate dependent code.

- Previous bullet had details. To build PSI4 from source and use dkh from conda without thinking, consult sec:condapsi4dev.

- To remove a conda installation, `conda remove dkh`.

Source

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

## Input

For all electron calculations one can use the Douglas-Kroll-Hess (DKH) Hamiltonian to take into account scalar relativistic effects.

Minimal input for DKH single-point computation looks like this:

    1
    2
    3
    4
    5
    6
    7
    8

    molecule {
    Mg
    }

    set basis aug-cc-pvdz-dk
    set relativistic dkh

    energy('scf')

By default a 2nd-order DKH calculation is performed. To change the default order use the DKH_ORDER option. The version of the code found in PSI4 is capable of up to 4th-order DKH calculations.

## Keywords

### RELATIVISTIC

> Relativistic Hamiltonian type

> - Type: string
> - Possible Values: NO, X2C
> - Default: NO

### DKH_ORDER

> Order of Douglas-Kroll-Hess

> - Type: integer
> - Default: 2

## Reference

When using this code please make reference to the appropriate following paper:

- “The Generalized Douglas-Kroll Transformation,” A. Wolf, M. Reiher, and B. A. Hess, J. Chem. Phys. 117, 9215 (2002). (doi: 10.1063/1.1515314)

## How to configure dkh for building Psi4

Role and Dependencies

- Role — In PSI4, DKH is a library that provides additional quantum chemical capabilities (relativistic effects).
- Downstream Dependencies — PSI4 (\(\Leftarrow\) optional) dkh
- Upstream Dependencies — dkh \(\Leftarrow\) Fortran

CMake Variables

- ENABLE_dkh — CMake variable toggling whether Psi4 builds with dkh
- CMAKE_PREFIX_PATH — CMake list variable to specify where pre-built dependencies can be found. For dkh, set to an installation directory containing `include/DKH/DKH_MANGLE.h`
- dkh_DIR — CMake variable to specify where pre-built dkh can be found. Set to installation directory containing `share/cmake/dkh/dkhConfig.cmake`
- CMAKE_DISABLE_FIND_PACKAGE_dkh — CMake variable to force internal build of dkh instead of detecting pre-built
- CMAKE_INSIST_FIND_PACKAGE_dkh — CMake variable to force detecting pre-built dkh and not falling back on internal build

Examples

1. Build bundled

>     >>> cmake -DENABLE_dkh=ON

2. Build without dkh

>     >>> cmake

3. Link against pre-built

>     >>> cmake -DENABLE_dkh=ON -DCMAKE_PREFIX_PATH=/path/to/dkh/root

>     >>> cmake -DENABLE_dkh=ON -Ddkh_DIR=/path/to/dkh/configdir

4. Build bundled despite pre-built being detectable

>     >>> cmake -DENABLE_dkh=ON -DCMAKE_PREFIX_PATH=/path/to/unwanted/dkh/root/and/wanted/other/dependencies/root -DCMAKE_DISABLE_FIND_PACKAGE_dkh=ON