%
% $Id: esp.tex 19708 2010-10-29 18:04:21Z d3y133 $
%
\label{sec:esp}

The NWChem Electrostatic Potential (ESP) module derives partial atomic 
charges that fit the quantum mechanical electrostatic potential on selected
grid points.

The ESP module is specified by the NWChem task directive
\begin{verbatim}
task esp
\end{verbatim}

The input for the module is taken from the ESP input block
\begin{verbatim}
ESP
  ...
END
\end{verbatim}

\section{Grid specification}
The grid points for which the quantum mechanical electrostatic potential is 
evaluated and used in the fitting procedure of the partial atomic charges
all lie outside the van der Waals radius of the atoms and within a cutoff
distance from the atomic centers. The following input parameters determine
the selection of grid points.
\begin{itemize}
\item
If a grid file is found, the grid will be read from that file. If no grid
file is found, or the keyword
\begin{verbatim}
  recalculate
\end{verbatim}
is given, the grid and the electrostatic potential is recalculated.
\item
The extent of the grid is determined by
\begin{verbatim}
  range <real rcut>
\end{verbatim}
where \verb+rcut+ is the maximum distance in $nm$ between a grid point and
any of the atomic centers. When omitted, a default value for \verb+rcut+ of
0.3 $nm$ is used.
\item
The grid spacing is specified by
\begin{verbatim}
  spacing <real spac>
\end{verbatim}
where \verb+spac+ is the grid spacing in $nm$ for the regularly spaced
grid points. If not specified, a default spacing of 0.05 $nm$ is used.
\item
The van der Waals radius of an element can be specified by
\begin{verbatim}
  radius <integer iatnum> <real atrad>
\end{verbatim}
where \verb+iatnum+ is the atomic number for which a van der Waals radius
of \verb+atrad+ in $nm$ will be used in the grid point determination.
Default values will be used for atoms not specified.
\item
The probe radius in nm determining the envelope around the molecule is
specified by
\begin{verbatim}
  probe <real probe default 0.07> 
\end{verbatim}
\item
The distance between atomic center and probe center can be multiplied
by a constant factor specified by
\begin{verbatim}
  factor <real factor default 1.0> 
\end{verbatim}
All grid points are discarded that lie within a distance 
\verb-factor*(radius(i)+probe)- from any atom $i$.
\item
Schwarz screening is applied using
\begin{verbatim}
  screen [<real scrtol default 1.0D-5>]
\end{verbatim}
\end{itemize}

\section{Constraints}
Additional constraints to the partial atomic charges can be imposed during
the fitting procedure.  Since point group symmetry is ignored during
the fitting, contrains must be applied to maintain a symmetric charge.
\begin{itemize}
\item
The net charge of a subset of atoms can be constrained using
\begin{verbatim}
  constrain <real charge> {<integer iatom>}
\end{verbatim}
where \verb+charge+ is the net charge of the set of atoms \verb+{iatom}+.
A negative atom number \verb+iatom+ can be used to specify that the
partial charge of that atom is substracted in the sum for the set.
\item
The net charge of a sequence of atoms can be constrained using
\begin{verbatim}
  constrain <real charge> <integer iatom> through <integer jatom>
\end{verbatim}
where \verb+charge+ is the net charge of the set of atoms \verb+{[iatom:jatom]}+.
\item
A group of atoms can be constrained to have the same charge with
\begin{verbatim}
  constrain equal {<integer iatom>}
\end{verbatim}
\item
The individual charge of a group of atoms can be constrained to be equal to
those of a second group of atoms with
\begin{verbatim}
  constrain group <integer iatom> <integer jatom> to <integer katom> <integer latom>
\end{verbatim}
resulting in the same charge for atoms \verb+iatom+ and \verb+katom+, for
atoms \verb.iatom+1. and \verb.katom+1., ... for atoms \verb+jatom+ and \verb+latom+.
\item
A special constraint
\begin{verbatim}
  constrain xhn <integer iatom> {<integer jatom>}
\end{verbatim}
can be used to constrain the set \verb+{iatom,{jatom}}+ to zero charge, and
constrain all atoms in \verb+{jatom}+ to have the same charge. This can be used,
for example, to restrain a methyl group to zero charge, and have all hydrogen
carrying identical charges.
\end{itemize}

\section{Restraints}
Restraints can be applied to each partial charge using the RESP charge
fitting procedure.
\begin{itemize}
\item
The directive for charge restraining is
\begin{verbatim}
  restrain [hfree] (harmonic [<real scale>] | \
   hyperbolic [<real scale> [<real tight>]]  \
    [maxiter <integer maxit>]  [tolerance <real toler>])
\end{verbatim}
where \verb+hfree+ can be specified to exclude hydrogen atoms from the
restaining procecure. Variable \verb+scale+ is the strength of the 
restraint potential, with a default of $0.005 au$ for the harmonic
restraint and a default value of $0.001 au$ for the hyperbolic restraint.
For the hyperbolic restraints the tightness \verb+tight+ can be specified
to change the default value of $0.1 e$. The iteration count that needs to
be carried out for the hyperbolic restraint is determined by the
maximum number of allowed iterations \verb+maxiter+, with a default value
of 25, and the tolerance in the convergence of the partial charges
\verb+toler+, with a default of $0.001 e$.
\end{itemize}
