TeraChem interface
TeraChem is a quantum chemistry code written exclusively for the Nvidia GPU. The program is commercial, however, the demo version can be used for up to 15 minutes per session.
ASH features a simple interface to it that allows TeraChem energy+gradient calculations on the GPU. Can be used in a QM/MM setting allowing both the QM and MM steps to run on the GPU via TeraChem and OpenMM. Interface is a bit limited at the moment.
TeraChemTheory class:
class TeraChemTheory:
def __init__(self, terachemdir=None, filename='terachem', printlevel=2,
teracheminput=None, numcores=1):
Keyword |
Type |
Default value |
Details |
|---|---|---|---|
|
string |
None |
Directory where TeraChem binaries are. |
|
Python dict |
None |
Python dictionary containing string key-value pairs of TeraChem input options. |
|
integer |
2 |
Printlevel |
|
string |
'terachem' |
Filename used for TeraChem input/output files. |
TeraChem needs to be installed separately.
DFT-SCF example:
from ash import *
frag = Fragment(databasefile="h2o.xyz", charge=0, mult=1)
#Python dictionary with TeraChem input options. See manual: http://www.petachem.com/doc/userguide.pdf
teracheminput_dict={
'method':'ublyp',
'basis':'6-31g*',
'sphericalbasis':'false',
'scf':'diis+a',
'timings':'yes'
}
terachem = TeraChemTheory(teracheminput=teracheminput_dict)
Singlepoint(theory=terachem, fragment=frag)
GPU control:
How Terachem runs on the GPU/GPUs is controlled outside of ASH via environment variables. The most important variable to control is what GPU device to use (1 or multiple).
#Use GPU device 0 and 1
export CUDA_VISIBLE_DEVICES=0,1