12.2 Chemical Solvent Models

12.2.4 Linear-Scaling QM/MM/PCM Calculations

Recall that PCM electrostatics calculations require the solution of the set of linear equations given in Eq. (12.2), to determine the vector 𝐪 of apparent surface charges. The precise forms of the matrices 𝐊 and 𝐑 depend upon the particular PCM (Table 12.3), but in any case they have dimension Ngrid×Ngrid, where Ngrid is the number of Lebedev grid points used to discretize the cavity surface. Construction of the matrix 𝐊-1𝐑 affords a numerically exact solution to Eq. (12.2), whose cost scales as 𝒪(Ngrid3) in CPU time and 𝒪(Ngrid2) in memory. This cost is exacerbated by smooth PCMs, which discard fewer interior grid points so that Ngrid tends to be larger, for a given solute, as compared to traditional discretization schemes. For QM solutes, the cost of inverting 𝐊 is usually negligible relative to the cost of the electronic structure calculation, but for the large values of Ngrid that are encountered in MM/PCM or QM/MM/PCM jobs, the 𝒪(Ngrid3) cost of inverting 𝐊 is often prohibitively expensive.

To avoid this bottleneck, Lange and Herbert373 have developed an iterative conjugate gradient (CG) solver for Eq. (12.2) whose cost scales as 𝒪(Ngrid2) in CPU time and 𝒪(Ngrid) in memory. A number of other cost-saving options are available, including efficient pre-conditioners and matrix factorizations that speed up convergence of the CG iterations, and a fast multipole algorithm for computing the electrostatic interactions.569 Together, these features lend themselves to a solution of Eq. (12.2) whose cost scales as 𝒪(Ngrid) in both memory and CPU time, for sufficiently large systems.373 Currently, these options are available only for C-PCM, not for SS(V)PE/IEF-PCM.

Listed below are job control variables for the CG solver, which should be specified within the $pcm input section. Researchers who use this feature are asked to cite the original SWIG PCM references524, 525 as well as the reference for the CG solver.373

Solver
       Specifies the algorithm used to solve the PCM equations.
INPUT SECTION: $pcm
TYPE:
       STRING
DEFAULT:
       INVERSION
OPTIONS:
       INVERSION Direct matrix inversion CG Iterative conjugate gradient
RECOMMENDATION:
       Matrix inversion is faster for small solutes because it needs to be performed only once in a single-point calculation. However, the CG solver (which must be applied at each SCF iteration) is recommended for large MM/PCM or QM/MM/PCM calculations.

CGThresh
       The threshold for convergence of the conjugate gradient solver.
INPUT SECTION: $pcm
TYPE:
       INTEGER
DEFAULT:
       6
OPTIONS:
       n Conjugate gradient converges when the maximum residual is less than 10-n.
RECOMMENDATION:
       The default typically affords PCM energies on par with the precision of matrix inversion for small systems. For systems that have difficulty with SCF convergence, one should increase n or try the matrix inversion solver. For well-behaved or very large systems, a smaller n might be permissible.

DComp
       Controls decomposition of matrices to reduce the matrix norm for the CG Solver.
INPUT SECTION: $pcm
TYPE:
       INTEGER
DEFAULT:
       1
OPTIONS:
       0 Turns off matrix decomposition 1 Turns on matrix decomposition 3 Option 1 plus only stores upper half of matrix and enhances gradient evaluation
RECOMMENDATION:
       None

PreCond
       Controls the use of the pre-conditioner for the CG solver.
INPUT SECTION: $pcm
TYPE:
       None
DEFAULT:
       Off
OPTIONS:
       No options. Specify the keyword to enable pre-conditioning.
RECOMMENDATION:
       A Jacobi block-diagonal pre-conditioner is applied during the conjugate gradient algorithm to improve the rate of convergence. This reduces the number of CG iterations, at the expense of some overhead. Pre-conditioning is generally recommended for large systems.

NoMatrix
       Specifies whether PCM matrices should be explicitly constructed and stored.
INPUT SECTION: $pcm
TYPE:
       None
DEFAULT:
       Off
OPTIONS:
       No options. Specify the keyword to avoid explicit construction of PCM matrices.
RECOMMENDATION:
       Storing the PCM matrices requires 𝒪(Ngrid2) memory. If this is prohibitive, the NoMatrix option forgoes explicit construction of the PCM matrices, and instead constructs the matrix elements as needed, reducing the memory requirement to 𝒪(Ngrid) at the expense of additional computation.

UseMultipole
       Controls the use of the adaptive fast multipole method in the CG solver.
INPUT SECTION: $pcm
TYPE:
       None
DEFAULT:
       Off
OPTIONS:
       No options. Specify the keyword in order to enable the fast multipole method.
RECOMMENDATION:
       The fast multipole approach formally reduces the CPU time to 𝒪(Ngrid), but is only beneficial for spatially extended systems with several thousand cavity grid points. Requires the use of NoMatrix.

MultipoleOrder
       Specifies the highest multipole order to use in the FMM.
INPUT SECTION: $pcm
TYPE:
       INTEGER
DEFAULT:
       4
OPTIONS:
       n The highest order multipole in the multipole expansion.
RECOMMENDATION:
       Increasing the multipole order improves accuracy but also adds more computational expense. The default yields satisfactory performance in common QM/MM/PCM applications.

Theta
       The multipole acceptance criterion.
INPUT SECTION: $pcm
TYPE:
       FLOAT
DEFAULT:
       0.6
OPTIONS:
       n A number between zero and one.
RECOMMENDATION:
       The default is recommended for general usage. This variable determines when the use of a multipole expansion is valid. For a given grid point and box center in the FMM, a multipole expansion is accepted when r/d Theta, where d is the distance from the grid point to the box center and r is the radius of the box. Setting Theta to one will accept all multipole expansions, whereas setting it to zero will accept none. If not accepted, the grid point’s interaction with each point inside the box is computed explicitly. A low Theta is more accurate but also more expensive than a higher Theta.

NBox
       The FMM boxing threshold.
INPUT SECTION: $pcm
TYPE:
       INTEGER
DEFAULT:
       100
OPTIONS:
       n The maximum number of grid points for a leaf box.
RECOMMENDATION:
       The default is recommended. This option is for advanced users only. The adaptive FMM boxing algorithm divides space into smaller and smaller boxes until each box has less than or equal to NBox grid points. Modification of the threshold can lead to speedup or slowdown depending on the molecular system and other FMM variables.

A sample input file for the linear-scaling QM/MM/PCM methodology can be found in the $QC/samples directory, under the name QMMMPCM_crambin.in. This sample involves a QM/MM description of a protein (crambin) in which a single tyrosine side chain is taken to be the QM region. The entire protein is immersed in a dielectric using C-PCM with SWIG discretization.