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



  • DKH is available as a conda package for Linux and macOS.

  • 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. 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.

  • To remove a conda installation, conda remove dkh.


  • 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.


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:

molecule {

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


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.



Relativistic Hamiltonian type

  • Type: string
  • Possible Values: NO, X2C
  • Default: NO


Order of Douglas-Kroll-Hess

  • Type: integer
  • Default: 2


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


  1. Build bundled
>>> cmake -DENABLE_dkh=ON
  1. Build without dkh
>>> cmake
  1. 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
  1. 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