Q-Chem Scratch Files

Q-chem stores a lot of useful electronic structure information in undocumented binary scratch files. Since the precision of q-chem output is usually limited to a few decimal places, being able to extract data from the binary files is highly desirable. I’m compiling here what I’ve learnt about these files.

First, to get access to these files, you’ll want to run q-chem with the -save flag. Then, they’ll be saved under $QCSAVEDIR/

53.0
This file stores the MO coefficients and orbital energies, in increasing energetic order. Each record is a real(8).

22.0
This file stores non-zero 2e integrals in the MO basis. Unfortunately, it seems q-chem only writes one of these files, up to 2Gb, so you’re limited to small molecules/basis. To get this file, you need to specify some special input parameters (see Yihan’s post here):

$rem
IPRINT 200
CORRELATION 105
SAVE_MO_INTEGRALS 2
...
$end

Each record is a real(8). Since only non-zero integrals are printed, you also need file 809.0 for the indices.

809.0
This file is a list of the 2e integral indices printed in file 22.0. The first record is a real(8) corresponding to the number of integrals. Next, is a list of orbital indices: p, q, r, s, for each 2e integral (pq|rs). Note: for restricted calculations, the integrals are un-anti-symmetrized, while for unrestricted calculations they are anti-symmetrized (pq||rs).

819.0
This file contains the number of orbitals. For unrestricted calculations, there are three integer records. The first two are the number of alpha and beta orbitals. Not sure what the last one is.