To perform QM/MM calculations, the user must assign MM atom types for each atom in the $molecule section. The format for this specification is modeled upon that used by the Tinker molecular modeling package,957 although the Tinker program is not required to perform QM/MM calculations using Q-Chem. Force field parameters and MM atom type numbers used within Q-Chem are identical to those used Tinker for the AMBER99, CHARMM27, and OPLSAA force fields, and the format of the force field parameters files is also the same.
The $molecule section must use Cartesian coordinates to define the molecular geometry for internal QM/MM calculations; the Z-matrix format is not valid. MM atom types are specified in the $molecule section immediately after the Cartesian coordinates on a line so that the general format for the $molecule section is
$molecule <Charge> <Multiplicity> <Atom> <X> <Y> <Z> <MM atom type> . . . $end
For example, one can define a TIP3P water molecule using AMBER99 atom types, as follows:
$molecule 0 1 O -0.790909 1.149780 0.907453 2001 H -1.628044 1.245320 1.376372 2002 H -0.669346 1.913705 0.331002 2002 $end
When the input is specified as above, Q-Chem will determine the MM bond connectivity based on the distances between atoms; if two atoms are sufficiently close, they are considered to be bonded. Occasionally this approach can lead to problems when non-bonded atoms are in close proximity of one another, in which case Q-Chem might classify them as bonded regardless of whether the appropriate MM bond parameters are available. To avoid such a scenario, the user can specify the bonds explicitly by setting the $rem variable USER_CONNECT = TRUE, in which case the $molecule section must have the following format
$molecule <Charge> <Multiplicity> <Atom> <X> <Y> <Z> <MM atom type> <Bond 1> <Bond 2> <Bond 3> <Bond 4> . . . $end
Each <Bond #> is the index of an atom to which <Atom> is bonded. Four bonds must be specified for each atom, even if that atom is connected to fewer than four other atoms. (For non-existent bonds, use zero as a placeholder.) Currently, Q-Chem supports no more than four MM bonds per atom.
After setting USER_CONNECT = TRUE, a TIP3P water molecule in the AMBER99 force field could be specified as follows:
$molecule 0 1 O -0.790909 1.149780 0.907453 2001 2 3 0 0 H -1.628044 1.245320 1.376372 2002 1 0 0 0 H -0.669346 1.913705 0.331002 2002 1 0 0 0 $end
Explicitly defining the bonds in this way is highly recommended.
In many cases, all atoms types (within both the QM and MM subsystems) will be defined by a given force field. In certain cases, however, a particular atom type may not be defined in a given force field. For example, a QM/MM calculation on the propoxide anion might consist of a QM subsystem containing an alkoxide functional group, for which MM parameters do not exist. Even though the alkoxide moiety is described using quantum mechanics, van der Waals parameters are nominally required for atoms within the QM subsystem, which interact with the MM atoms via Lennard-Jones-type interactions.
In such cases, there are four possible options, the choice of which is left to the user’s discretion:
Use a similar MM atom type as a substitute for the missing atom type.
Ignore the interactions associated with the missing atom type.
Define a new MM atom type and associated parameters.
Define a new force field.
These options should be applied with care. Option 1 involves selecting an atom type that closely resembles the undefined MM atom. For example, the oxygen atom of an alkoxide moiety could perhaps use the MM atom type corresponding to the oxygen atom of a neutral hydroxyl group. Alternatively, the atom type could be ignored altogether (option 2) by specifying MM atom type 0 (zero). Setting the atom type to zero should be accompanied with setting all four explicit bond connections to placeholders if USER_CONNECT = TRUE. An atom type of zero will cause all MM energies involving that atom to be zero.
The third option in the list above requires the user to specify a $force_field_params section in the Q-Chem input file. This input section can be used to add new MM atom type definitions to one of Q-Chem’s built-in force fields. At a minimum, the user must specify the atomic charge and two Lennard-Jones parameters (radius and well depth, ), for each new MM atom type. Bond, angle, and torsion parameters for stretches, bends, and torsions involving the new atom type may also be specified, if desired. The format for the $force_field_params input section is
$force_field_params NumAtomTypes <n> AtomType -1 <Charge> <LJ Radius> <LJ Epsilon> AtomType -2 <Charge> <LJ Radius> <LJ Epsilon> . . . AtomType -n <Charge> <LJ Radius> <LJ Epsilon> Bond <a> <b> <Force constant> <Equilibrium Distance> . . . Angle <a> <b> <c> <Force constant> <Equilibrium Angle> . . . Torsion <a> <b> <c> <d> <Force constant> <Phase Angle> <Multiplicity> . . . $end
The first line in this input section specifies how many new MM atom types appear in this section (<n>). These are specified on the following lines labeled with the AtomType tag. The atom type numbers are required to be negative and to appear in the order . The $molecule section for a water molecule, with user-defined MM parameters for both oxygen and hydrogen, might appear as follows:
$molecule 0 1 O -0.790909 1.149780 0.907453 -1 2 3 0 0 H -1.628044 1.245320 1.376372 -2 1 0 0 0 H -0.669346 1.913705 0.331002 -2 1 0 0 0 $end
The remainder of each AtomType line in the $force_field_params section consists of a charge (in elementary charge units), a Lennard-Jones radius (in Å), and a Lennard-Jones well depth (, in kcal/mol).
Each (optional) Bond line in the $force_field_params section defines bond-stretching parameters for a bond that contains a new MM atom type. The bond may consist of both atoms <a> and <b> defined an AtomType line, or else <a> may be defined with an AtomType line and <b> defined as a regular atom type for the force field. In the latter case, the label for <b> should be the number of its general van der Waals type. For example, the atom type for a TIP3P oxygen in AMBER99 is 2001, but its van der Waals type is 21, so the latter would be specified in the Bond line. The remaining entries of each Bond line are the harmonic force constant, in kcal/mol/Å, and the equilibrium distance, in Å.
Similar to the Bond lines, each (optional) Angle line consists of one or more new atom types along with existing van der Waals types. The central atom of the angle is <b>. The harmonic force constant (in units of kcal/mol/degree) and equilibrium bond angle (in degrees) are the final entries in each Bond line.
Each (optional) Torsion line consists of one or more new MM atom types along with regular van der Waals types. The connectivity of the four atoms that constitute the dihedral angle is <a>–<b>–<c>–<d>, and the torsional potential energy function is
The force constant () is specified in kcal/mol and the phase angle () in degrees. The multiplicity () is an integer.
Option 4 in the list on page 22.214.171.124 is the most versatile, and allows the user to define a completely new force field. This option is selected by setting FORCE_FIELD = READ, which tells Q-Chem to read force field parameters from a text file whose name is specified in the $force_field_params section as follows:
$force_field_params Filename <path/filename> $end
Here, <path/filename> is the full (absolute) path and name of the file that Q-Chem will attempt to read for the MM force field. E.g., if the user has a file named MyForceField.prm that resides in the path /Users/me/parameters/, then this would be specified as
$force_field_params Filename /Users/me/parameters/MyForceField.prm $end
Within the force field file, the user should first declare various rules that the force field will use, including how van der Waals interactions will be treated, scaling of certain interactions, and the type of improper torsion potential. The rules are declared in the file as follows:
RadiusRule <option> EpsilonRule <option> RadiusSize <option> ImptorType <option> vdw-14-scale <x> chg-14-scale <x> torsion-scale <x>
Currently, only a Lennard-Jones potential is available for van der Waals interactions. RadiusRule and EpsilonRule control how to average and , respectively, between atoms A and B in their Lennard-Jones potential. The options available for both of these rules are Arithmetic [e.g., ] or Geometric [e.g., ]. RadiusSize has options Radius or Diameter, which specify whether the parameter is the van der Waals radius or diameter in the Lennard-Jones potential.
ImptorType controls the type of potential to be used for improper torsion (out-of-plane bending) energies, and has two options: Trigonometric or Harmonic. These options are described in more detail below.
The scaling rules takes a floating point argument <x>. The vdw-14-scale and chg-14-scale rules only affect van der Waals and Coulomb interactions, respectively, between atoms that are separated by three consecutive bonds (atoms 1 and 4 in the chain of bonds). These interaction energies will be scaled by <x>. Similarly, torsion-scale scales dihedral angle torsion energies.
After declaring the force field rules, the number of MM atom types and van der Waals types in the force field must be specified using:
NAtom <n> Nvdw <n>
where <n> is a positive integer.
Next, the atom types, van der Waals types, bonds, angles, dihedral angle torsion, improper torsions, and Urey-Bradley parameters can be declared in the following format:
Atom 1 <Charge> <vdw Type index> <Optional description> Atom 2 <Charge> <vdw Type index> <Optional description> . . . Atom <NAtom> <Charge> <vdw Type index> <Optional description> . . . vdw 1 <Sigma> <Epsilon> <Optional description> vdw 2 <Sigma> <Epsilon> <Optional description> . . . vdw <Nvdw> <Sigma> <Epsilon> <Optional description> . . . Bond <a> <b> <Force constant> <Equilibrium Distance> . . . Angle <a> <b> <c> <Force constant> <Equilibrium Angle> . . . Torsion <a> <b> <c> <d> <Force constant 1> <Phase Angle 1> <Multiplicity 1> . . . Improper <a> <b> <c> <d> <Force constant> <Equilibrium Angle> <Multiplicity> . . . UreyBrad <a> <b> <c> <Force constant> <Equilibrium Distance>
The parameters provided in the force field parameter file correspond to a basic MM energy functional of the form
Coulomb and van der Waals interactions are computed for all non-bonded pairs of atoms that are at least three consecutive bonds apart (i.e., 1–4 pairs and more distant pairs). The Coulomb energy between atom types 1 and 2 is simply
where and are the respective charges on the atoms (specified with <Charge> in elementary charge units) and is the distance between the two atoms. For 1–4 pairs, is defined with chg-14-scale but is unity for all other valid pairs. The van der Waals energy between two atoms with van der Waals types a and b, and separated by distance , is given by a “6-12” Lennard-Jones potential:
Here, is the scaling factor for 1–4 interactions defined with vdw-14-scale and is unity for other valid interactions. The quantities and are the averages of the parameters of atoms a and b as defined with EpsilonRule and RadiusRule, respectively (see above). The units of <Sigma> are Å , and the units of <Epsilon> are kcal/mol. Hereafter, we refer to atoms’ van der Waals types with a, b, c, ... and atoms’ charges with 1,2, 3, ....
The bond energy is a harmonic potential,
where is provided by <Force Constant> in kcal/mol/Å and by <Equilibrium Distance> in Å. Note that <a> and <b> in the Bond definition correspond to the van der Waals type indices from the vdw definitions, not the Atom indices.
The bending potential between two adjacent bonds connecting three different atoms (<a>-<b>-<c>) is also taken to be harmonic,
Here, is provided by <Force Constant> in kcal/mol/degrees and by <Equilibrium Angle> in degrees. Again, <a>, <b>, and <c> correspond to van der Waals types defined with vdw.
The energy dependence of the <a>-<b>-<c>-<d> dihedral torsion angle, where <a>, <b>, <c>, and <d> are van der Waals types, is defined by
Here, is the scaling factor defined by torsion-scale. The force constant is defined with <Force constant> in kcal/mol, and the phase angle is defined with <Phase Angle> in degrees. The summation is over multiplicities, , and Q-Chem supports up to three different values of per dihedral angle. The force constants and phase angles may depend on , so if more than one multiplicity is used, then <Force constant> <Phase Angle> <Multiplicity> should be specified for each multiplicity. For example, to specify a dihedral torsion between van der Waals types 2–1–1–2, with multiplicities and , we might have:
Torsion 2 1 1 2 2.500 180.0 2 1.500 60.0 3
Improper torsion angle energies for four atoms <a>-<b>-<c>-<d>, where <c> is the central atom, can be computed in one of two ways, as controlled by the ImptorType rule. If ImptorType is set to Trigonometric, then the improper torsion energy has a functional form similar to that used for dihedral angle torsions:
Here, is the out-of-plane angle of atom <c>, in degrees, and is the force constant defined with <Force Constant>, in kcal/mol. The phase and multiplicity need to be specified in the Improper declaration, although the definition of an improper torsion suggests that these values should be set to and . The quantity accounts for the number of equivalent permutations of atoms <a>, <b>, and <d>, so that the improper torsion angle is only computed once. If ImptorType is set to Harmonic, then in place of Eq. (11.56), the following energy function is used:
The Urey-Bradley energy, which accounts for a non-bonded interaction between atoms <a> and <c> that are separated by two bonds (i.e., a 1-3 interaction through <a>-<b>-<c>), is given by
The distance in Å between atoms <a> and <c> is , the equilibrium distance is provided by <Equilibrium Distance> in Å, and the force constant is provided by <Force Constant> in kcal/mol/Å.
A short example of a valid text-only file defining a force field for a flexible TIP3P water could be as follows:
//-- Force Field Example --// // -- Rules -- // RadiusRule Geometric RadiusSize Radius EpsilonRule Geometric ImptorType Trigonometric vdw-14-scale 1.0 chg-14-scale 0.8 torsion-scale 0.5 // -- Number of atoms and vdw to expect -- // NAtom 2 Nvdw 2 // -- Atoms -- // Atom 1 -0.8340 2 TIP3P Oxygen Atom 2 0.4170 1 TIP3P Hydrogen // -- vdw -- // vdw 1 0.0000 0.0000 H parameters vdw 2 1.7682 0.1521 O parameters // -- Bond -- // Bond 1 2 553.0 0.9572 // -- Angle -- // Angle 1 2 1 100.0 104.52
Lines that do not begin with one of the keywords will be ignored, and have been used here as comments.
For QM/MM calculations (but not for purely MM calculations) the user must specify the QM subsystem using a $qm_atoms input section, which assumes the following format:
$qm_atoms <QM atom 1 index> <QM atom 2 index> . . . . . . <QM atom n index> $end
Multiple indices can appear on a single line and the input can be split across multiple lines. Each index is an integer corresponding to one of the atoms in the $molecule section, beginning at 1 for the first atom in the $molecule section. Link atoms for the ONIOM model and YinYang atoms for the Janus model are not specified in the $qm_atoms section, as these are inserted automatically whenever a bond connects a QM atom and an MM atom.
Q-Chem 4.2.2 and later versions also support, for example
$qm_atoms 18:31 35 $end
which specifies 15 QM atoms (atoms 18 through 31; atom 35).
For Janus QM/MM calculations, there are several ways of dealing with van der Waals interactions between the QM and MM atoms. By default, van der Waals interactions are computed for all QM–MM and MM–MM atom pairs but not for QM–QM atom pairs. In some cases, the user may prefer not to neglect the van der Waals interactions between QM–QM atoms, or the user may prefer to neglect any van der Waals interaction that involves a QM atom. Q-Chem allows the user this control via two options in the $forceman section. To turn on QM–QM atom van der Waals interactions, the user should include the following in their input:
$forceman QM-QMvdw $end
Similarly, to turn off all van der Waals interactions with QM atoms, the following should be included:
$forceman NoQM-QMorQM-MMvdw $end
Periodic boundary conditions (using Ewald summation for the long-range Coulomb interactions) can be used in conjunction with both MM-only calculations and QM/MM calculations. The approach is based off of the work of Nam et al.804 and (independently) Riccardi et al.,965 as implemented in both the Amber1178 and Charmm965, 134 programs. These approaches use Mulliken charges to represent the periodic images of the wave function, and while suitable for semi-empirical calculations with minimal basis sets, instabilities in the Mulliken charges for extended basis sets lead to SCF convergence failure in the QM/MM-Ewald calculations.479 The implementation in Q-Chem thus allows for the use of ChElPG charges to represent the image wave functions, affording an algorithm that is stable in extended basis sets.479, 478
The efficiency of the Ewald summation is governed by the parameter, , that controls the partition of the Coulomb potential into short- and long-range components, and in the QM/MM-Ewald method there are separate values of for the QM and MM portions of the calculations. Improper selection of and/or can greatly increase the computational time, and the choices that are optimal for MM calculations need not be optimal for QM/MM calculations.479 The cost of the MM Ewald summation scales as , where is the number of reciprocal-space lattice vectors that is used for the -space sum. The QM portion of the calculation scales as , where is the number of QM atoms (whereas is the total number of atoms). The MM Ewald parameter is thus selected to minimize the amount of work that is done in real space. The optimal value, which is typically , can be found by solving the equation479
and is the length of the simulation cell. (Only cubic simulation cells are available at present.) In contrast, the parameter should be selected to minimize the total number of vectors in both real and reciprocal space. The optimal value, which is often , is determined by solving the equation479
To perform an MM- or QM/MM-Ewald job, one must set MM_SUBTRACTIVE = TRUE and EWALD_ON = TRUE in the $rem section, but otherwise job control is largely done through the $forceman section. The following variables must be set for every type of Ewald calculation.
The keyword Ewald will turn on Ewald summation.
The keyword alpha should be followed by a value for the MM Ewald parameter and then the QM Ewald parameter. (The latter must be set even for MM-only jobs.)
Box_length specifies the side length of the cubic simulation cell, in Å.
The following parameters are optional for further job control.
Dielectric specifies a dielectric constant for the surrounding medium, which appears in the “dipole term” of Ewald summation ( in Ref. 479). If no value is set, the dielectric constant is set to infinity, corresponding to “tin foil" boundary conditions.
The keyword Ewald_SCF_thresh_on, followed by a real number, causes Q-Chem to wait until the DIIS error falls below the specified value before adding the Ewald correction to the Fock matrix, thus obviating the sometimes-costly Ewald correction in early SCF cycles. (The default value is 1.0, which turns on Ewald summation immediately in most cases)
A short example of a $forceman section using Ewald summation could be as follows:
$forceman ewald alpha 0.35 0.1 box_length 15.00 dielectric 88.0 mm_read_scratch ewald_scf_thresh_on 0.0001 $end
A QM/MM geometry optimization job using L-BFGS algorithm can be requested by using the following option in the $forceman section:
$forceman QMMM-LBFGS $end
The additional job controls for this job are described below. These options are also need to be specified in the $forceman section.
LBFGS_M: Curvature information from the last M steps will be used to construct the Hessian approximation. The default value is 10.
MaxSteps: Maximum number of optimization steps. The default value is 2000.
ConvG: Convergence on the maximun gradient components. The default tolerance value is 0.0003.
ConvD: Convergence on the maximum atomic displacement. The default tolerance value is 0.0012.
ConvE: Convergence on maximum (absolute) energy change. The default tolerance value is 0.000001.
A sample $forceman section for a QM/MM optimization job using all the above options with their default values looks like:
$forceman QMMM-LBFGS LBFGS_M 10 MaxSteps 2000 ConvG 0.0003 ConvD 0.0012 ConvE 0.000001 $end
$molecule 0 1 O 1.3584299158 0.1073418692 -0.2758823010 101 2 3 0 0 H 0.3884464033 -0.0182409613 -0.1252830261 88 1 0 0 0 H 1.7255084907 -0.4596377323 0.4452211001 88 1 0 0 0 O -1.3286731559 -0.2344591932 0.1344130752 101 5 6 0 0 H -1.7784222051 0.6341523014 0.2664866218 88 4 0 0 0 H -1.7690342253 -0.5495694315 -0.6907120483 88 4 0 0 0 $end $rem JOBTYPE opt EXCHANGE hf BASIS sto-3g QM_MM_INTERFACE janus FORCE_FIELD charmm27 USER_CONNECT true NO_REORIENT true SYMMETRY false $end $forceman QMMM-LBFGS LBFGS_M 10 $end $qm_atoms 1 2 3 $end