10.16. lib — Helper functions, parameters, and C extensions

10.16.1. lib.parameters

10.16.2. lib.logger

10.16.2.1. Logger object

10.16.3. numpy extensions

10.16.4. scipy extensions

10.16.5. lib.chkfile

Chkfile is a HDF5 file.

10.16.5.1. Functions to access key/value in chkfile

10.16.5.2. Quickly loading object from chkfile

The results of SCF and MCSCF methods are saved as a Python dictionary in the chkfile. One can fast load the results and update the SCF and MCSCF objects using the python built in methods .__dict__.update, e.g.:

from pyscf import gto, scf, mcscf, lib
mol = gto.M(atom='N 0 0 0; N 1 1 1', basis='ccpvdz')
mf = mol.apply(scf.RHF).set(chkfile='n2.chk).run()
mc = mcscf.CASSCF(mf, 6, 6).set(chkfile='n2.chk').run()

# load SCF results
mf = scf.RHF(mol)
mf.__dict__.update(lib.chkfile.load('n2.chk', 'scf'))

# load MCSCF results
mc = mcscf.CASCI(mf, 6, 6)
mc.__dict__.update(lib.chkfile.load('n2.chk', 'mcscf'))
mc.kernel()

10.16.6. lib.diis

10.16.7. Other helper functions

10.16.7.1. Background mode

10.16.7.2. Temporary HDF5 file

10.16.7.3. OpenMP threads

10.16.7.4. Capture stdout

10.16.7.5. Other helper functions in lib.misc