QChem
PyOpenCAP supports an interface with the Q-Chem quantum chemistry package.
Importing data
System object
The geometry and basis set can be imported into a System
object using .fchk files.
import pyopencap
sys_dict = {"molecule": "qchem_fchk","basis_file": "path/to/qc.fchk"}
my_system = pyopencap.System(sys_dict)
CAP object Densities can be read in from .fchk files, and the zeroth order Hamiltonian can be read from Q-Chem output files for EOM-CC calculations. To export the full densities to .fchk, GUI=2 must be set in the $rem card, and PROJ_CAP=3 must be set in the $complex_ccman card. See the Q-Chem manual for more details.
The following snippet can be used to read the data from a Q-Chem output and properly formatted .fchk file, and calculate the CAP matrix:
cap_dict = {"cap_type": "box",
"cap_x":"2.76",
"cap_y":"2.76",
"cap_z":"4.88",
"Radial_precision": "14",
"angular_points": "110"}
nstates = 10
pc = pyopencap.CAP(my_system,cap_dict,nstates)
# read in densities
es_dict = {"method" : "eom",
"package": "qchem",
"qchem_output":"path/to/output.out",
"qchem_fchk":"path/to/qc.fchk"}
pc.read_data(es_dict)
# save the zeroth order Hamiltonian for later use
h0 = pc.get_H()
pc.compute_projected_cap()
W_mat=pc.get_projected_cap()
Generate and analyze eigenvalue trajectories
H0 and W, or the CAP
object can be used to construct a CAPHamiltonian
object.
from pyopencap.analysis import CAPHamiltonian
CAPH = CAPHamiltonian(H0=H0,W=W_mat)
# equivalently
CAPH = CAPHamiltonian(pc=pc)
Additionally, Q-Chem (starting from version 5.4) natively implements Projected CAP-EOM-CC and
Projected CAP-ADC methods, and prints the necessary matrices to the output. PyOpenCAP can parse
these output files to generate CAPHamiltonian
objects.
from pyopencap.analysis import CAPHamiltonian
CAPH = CAPHamiltonian(output="proj-eomcc.out",irrep="B2g")
CAPH = CAPHamiltonian(output="proj-adc.out",onset="3000")
See the analysis section for more details.