Tutorial for Input Processing with cclib

This tutorial shows how to use the cclib Python program package to process quantum chemical output files together with ORBKIT. It is prerequisite to install a current version cclib (>=1.3.1) beforehand by following the installation guide:

Note

Currently, the cclib interface is only tested for Gaussian .log files. If you find any incompatibilities, please do not hesitate to contact us!

General Aspects

In order to parse a quantum chemical output file with cclib, ORBKIT follows the standard procedure described in cclib’s tutorial, e.g. for a Gaussian output file:

from cclib.parser import Gaussian

p = Gaussian('mycalc.log')
ccData = p.parse()

Afterwards, ORBKIT converts the ccData data set to ORBKIT’s QCinfo class (cf. Central Variables), i.e.:

from orbkit import read

qc = read.convert_cclib(ccData)

Usage via the Terminal

For the standard ORBKIT terminal interface you have to specify two options: --itype=cclib and --cclib_parser=CCLIB_PARSER. The first tells ORBKIT to use cclib for parsing the output and the latter specifies which cclib.parser has to be imported. (The available parser may be found on the cclib website.)

Thus, to process the Gaussian output file mycalc.log, you have to call:

$ orbkit -i mycalc.log --itype=cclib --cclib_parser=Gaussian

Attention

The option --cclib_parser is case sensitive!

ORBKIT’s High-Level Interface

Again, to use the cclib paser, two options have to be called:

import orbkit as ok

ok.options.filename = 'mycalc.log'
ok.options.itype = 'cclib'
ok.options.cclib_parser = 'Gaussian'

data = ok.run_orbkit()

Attention

The option ok.options.cclib_parser is case sensitive!

ORBKIT’s Low-Level Interface

For ORBKIT’s low-level interface, there are two possible ways to use cclib. You can either tell ORBKIT, what cclib.parser shall be used:

from orbkit import read

qc = read.main_read(filename,itype='cclib',all_mo=False,cclib_parser='Gaussian')

# This is basically the same as
qc = read.read_with_cclib(filename, cclib_parser='Gaussian', all_mo=False)

or you can do the parsing by yourself and let ORBKIT only convert the data:

from orbkit import read
from cclib.parser import Gaussian

p = Gaussian('mycalc.log')
ccData = p.parse()

qc = read.convert_cclib(ccData)