# Interface to the BrianQC GPU module by the BrianQC team¶

Code author: Gergely Kis

Section author: Gergely Kis

PSI4 contains code to interface to the BrianQC GPU module developed by the BrianQC team, which is available after a license agreement from https://brianqc.com/.

## Installing BrianQC¶

Note that there are several prerequisites for using BrianQC, including having a supported GPU available in the computing node and having the proper GPU drivers installed. Please refer to the BrianQC manual for a full list of prerequisites.

When installing BrianQC, choose the SDK installation by setting the BRIANQC_SDK_INSTALL envoronment variable to 1.

## Building BrianQC’s user-built components¶

After the installation, build BrianQC’s example and sample programs, which also creates the wrapper library and CMake configuration files required to build PSI4 with BrianQC.

1. Create a build directory to keep the source tree clean.

cd <brianqc_install_path>
mkdir build
cd build

1. Configure project and generate makefiles with CMake. You will require Eigen (tested with version 3.1.2) and boost (tested with version 1.62).

cmake ..

1. Build the examples and samples.

make

1. Test the installation by starting a small calculation. Make sure to set the BRIANQC_INSTALL_PATH environment variable to <brianqc_install_path>!

export BRIANQC_INSTALL_PATH=<brianqc_install_path>
bin/sample_hf_and_dft --molecule ../share/qc_molecules/cis-decalin.raw --basis ../share/basis_sets/cc-pvdz


## Building PSI4 with BrianQC¶

When CMake-ing PSI4, set the ENABLE_BrianQC CMake variable to 1 and set the BrianQC_DIR CMake variable to the path where BrianQC’s components have been built (usually <brianqc_install_path>/build), then build PSI4 normally.

## Using BrianQC from PSI4¶

To use BrianQC, the BRIANQC_INSTALL_PATH environment variable must be set to the full path of your BrianQC installation.

There are two ways to enable BrianQC for a specific calculation:

If both the input option and the environment variable are specified, then the environment variable takes precedence.

### When to enable BrianQC¶

The operation of BrianQC is transparent from a user’s point of view; every internal computation is either performed by PSI4 (if unsupported by BrianQC), or taken over by BrianQC, yielding the same result to within the required precision. In particular, BrianQC will respect all of PSI4’s usual precision parameters, like INTS_TOLERANCE and E_CONVERGENCE.

BrianQC can speed up a number of internal computations, including Fock and gradient computation. Thus, BrianQC will speed up any calculation involving those terms, such as

• HF and DFT single point energies

• HF and DFT geometry optimizations

• HF and DFT frequency analysis

Note that not every term of every calculation can be handled by BrianQC, thus, the actual speedup depends on the specifics of the calculation.

## Keywords¶

### BRIANQC_ENABLE¶

Whether to enable using the BrianQC GPU module

## Environment Variables¶

BRIANQC_SDK_INSTALL

Toggle for type of BrianQC installation. See https://s3.amazonaws.com/streamnovation-brianqc-manual/BrianQC_Manual_v1_1_0.pdf for details.

BRIANQC_INSTALL_PATH

Location of BrianQC installation. See https://s3.amazonaws.com/streamnovation-brianqc-manual/BrianQC_Manual_v1_1_0.pdf for details.

BRIANQC_ENABLE

Runtime toggle of whether to use BrianQC.