RESP
It is often desired to compute atomic charges which reproduce the electrostatic potential (ESP) generated by the molecule on a predefined grid. Such charges are often used to fit empirical force fields (e.g. Amber, and CHARMM). When fitting charges in this way, it is often found that the charge of buried atoms is ill-defined (because they do not contribute significantly to the ESP outside the molecule. Thus, the restrained ESP (RESP) method was introduced,1 which determines a set of atomic charges which reproduce the ESP on a grid, but which also penalize nonzero values of atomic charges (ensuring that buried atoms are assigned small charges).
Quick start
The minimum input to derive RESP charges is the single keyword resp yes
added to any ground-state HF/DFT calculation:
basis 6-31g
method rhf
coordinates mymol.xyz
charge 0
spinmult 1
maxit 100
gpus 1
run energy
resp yes
end
All other RESP parameters take their defaults: a layered Connolly surface with 4 layers at radii \(\{1.2, 1.4, 1.6, 1.8\} \times \mathrm{vdW}\), a surface density of 1.0 grid point/Ų, and the standard restraint \(a \sum_k ((q_k^2 + b^2)^{1/2} - b)\) with \(a = 5\times 10^{-4}\) a.u. and \(b = 0.1\,e^{-}\). The keyword table at the bottom of this page covers the knobs to customize each of these.
Visualizing the RESP grid
The grid points used during fitting are written to scr/esp.xyz in the format
described in Relevant input/output files below.
A quick way to inspect the cavity is to open both the input geometry
(mymol.xyz) and scr/esp.xyz together in VMD: render the molecule as
"CPK" or "Licorice" and render esp.xyz as "Points".
Molecular grid
Most applications of RESP use a molecular grid which corresponds to multiple layers of Connolly surfaces (e.g. for different atomic radii).2 TeraChem computes such a grid internally, and several parameters of the grid can be controlled by the user. Specifically, the user can alter the number of layers used (esp_grid_layers), the density of the surface grid points on each layer (esp_grid_dens), the spacing between the layers (esp_grid_incr), the scale factor for the atomic radii used in construcing the innermost layer (esp_grid_scale), and the radius of the probe sphere used to smooth any kinks in each surface (probe_radius).
You can compute the ESP on the grid without fitting any atomic charges by setting esp_only.
Fitting procedure
The ESP will be computed on a grid. By default this is a layered Connolly surface as described above. There are also options to read in a grid (esp_gridfile) or to use a general cubic grid (esp_cubic_grid). When these other grids are used, it is often because the user wants to visualize the ESP and not to fit atomic charges. We do not recommend fitting atomic charges using grids other than the default layered Connolly surface.
Once the ESP is computed on a grid, TeraChem will fit the charges (\(q_i\) for the ith atom) in order to minimize the following loss function:
where
This fitting is subject to the hard constraint that the sum of the atomic charges agree with the total charge on the molecule.
Relevant input/output files
- scr/esp.xyz - ESP computed at grid points
- Column 1: Element type of atom the grid point originates from (set to first atom for user-defined grids)
- Columns 2-4: XYZ coordinates of grid point (in Angstroms)
- Column 5: ESP at this grid point (atomic units)
- Column 6: Index of the atom this grid point originates from (first atom is 1). Order follows input molecular geometry. Set to the first atom for user-defined grids.
- User-defined grid (esp_gridfile)
- npoints [bohr|angstrom] (line 1, unit specifier is optional - default is Angstroms)
- x1 y1 z1
- ...
- xn yn zn
ESP-only mode (no charge fitting)
Sometimes the goal is just to evaluate the ESP on a grid — for example to
export it for visualization in APBS or
Chimera — without fitting atomic charges.
This is exactly what esp_only yes does: TeraChem still builds the grid and
computes the ESP, but skips the (R)ESP fit.
The grid itself can be controlled in three ways:
- Default layered Connolly surface (the same one used for RESP) — give no
grid-related keywords and just set
esp_only yes. - Cubic grid — useful for export to volumetric viewers. Set
esp_cubic_grid yes; the resolution is controlled byesp_cubic_nppd(points per dimension; default 64). The cubic box is automatically sized to enclose the molecule. - User-defined grid — point
esp_gridfileat a text file containing the grid points. By default coordinates in this file are interpreted as Angstroms; setesp_bohr_grid yesto read them as bohr instead. The file format is documented in Relevant input/output files.
For volumetric export over the cubic grid:
basis 6-31g
method rhf
coordinates mymol.xyz
charge 0
spinmult 1
run energy
resp yes
esp_only yes
esp_cubic_grid yes
esp_cubic_nppd 80
end
Known limitations
- Only spd basis sets are supported
Summary of relevant keywords
| Keyword | Type | Default | Description |
|---|---|---|---|
| resp | bool | no | Calculate ESP/RESP charge? |
| esp_gridfile | string | none | If present, this file contains a user-defined grid to be used for ESP calculations |
| esp_bohr_grid | bool | false | Interpret coordinates in esp_gridfile as bohr rather than Angstrom |
| esp_cubic_grid | bool | false | If set, a cubic grid will be used |
| esp_cubic_nppd | int | 64 | Number of points per dimension in cubic box |
| esp_restraint_a | float | 0.0005 | "a" parameter in restraint term |
| esp_restraint_b | float | 0.1 | "b" parameter in restraint term |
| esp_grid_scale | float | 1.4 | Scale factor for vdw radius for grid |
| esp_grid_incr | float | 0.2 | spacing between layers of grid points |
| esp_grid_layers | int | 4 | number of layers |
| esp_grid_dens | float | 1.0 | Target surface point grid density in Bohr^2 |
| probe_radius | float | 0 | Radius of probe sphere used to create grid |
| esp_only | bool | no | If true, the ESP will be computed on the grid but charges will not be fit |