Difference for ug/ug_colvars.tex from version 1.26 to 1.27

version 1.26version 1.27
Line 1
Line 1
 \cvnamdugonly{ \cvnamdugonly{
 \section{Collective Variable-based Calculations\footnote{The features described in this section were contributed by Giacomo Fiorin (ICMS, Temple University, Philadelphia, PA, USA) and J\'er\^ome H\'enin (IBPC, CNRS, Paris, France). Please send feedback and suggestions to the NAMD mailing list.}} \section{Collective Variable-based Calculations (Colvars)\footnote{The features described in this section were contributed by Giacomo Fiorin (ICMS, Temple University, Philadelphia, PA, USA) and J\'er\^ome H\'enin (IBPC, CNRS, Paris, France). Please send feedback and suggestions to the NAMD mailing list.}}
  
  \emph{This chapter can also be downloaded as a separate manual (PDF and HTML) at the webpage:\\{\tt http://colvars.github.io}}
 } }
  
 \cvvmdugonly{ \cvvmdugonly{
 \chapter{Collective Variables Interface} \chapter{Collective Variables Interface (Colvars)}
 } }
 \cvrefmanonly{ \cvrefmanonly{
 \section{Introduction} \section{Introduction}
Line 11
Line 14
  
 In today's molecular dynamics simulations, it is often useful to reduce the large number of degrees of freedom of a physical system into few parameters whose statistical distributions can be analyzed individually, or used to define biasing potentials to alter the dynamics of the system in a controlled manner.  In today's molecular dynamics simulations, it is often useful to reduce the large number of degrees of freedom of a physical system into few parameters whose statistical distributions can be analyzed individually, or used to define biasing potentials to alter the dynamics of the system in a controlled manner. 
 These have been called `order parameters', `collective variables', `(surrogate) reaction coordinates', and many other terms. These have been called `order parameters', `collective variables', `(surrogate) reaction coordinates', and many other terms.
  
 Here we use primarily the term `collective variable' (shortened to \textit{colvar}), which indicates any differentiable function of atomic Cartesian coordinates, $\bm{x}_{i}$, with $i$ between $1$ and $N$, the total Here we use primarily the term `collective variable' (shortened to \textit{colvar}), which indicates any differentiable function of atomic Cartesian coordinates, $\bm{x}_{i}$, with $i$ between $1$ and $N$, the total
 number of atoms: number of atoms:
 \begin{equation}  \begin{equation} 
Line 19
Line 23
   \ldots \right)\;, \;\; 1 \leq i,j,k\ldots \leq N   \ldots \right)\;, \;\; 1 \leq i,j,k\ldots \leq N
 \end{equation} \end{equation}
 \cvnamdugonly{ \cvnamdugonly{
 The colvars module in NAMD may be used in both MD simulations and energy minimization runs. The Colvars module in NAMD may be used in both MD simulations and energy minimization runs.
 } }
 \cvvmdugonly{% \cvvmdugonly{%
 The colvars module in VMD may be used to calculate these functions over a molecular structure, and to analyze the results of previous simulations.} The Colvars module in VMD may be used to calculate these functions over a molecular structure, and to analyze the results of previous simulations.}
 \cvrefmanonly{% \cvrefmanonly{%
 This manual documents the collective variables module (colvars), a portable software that interfaces multiple MD simulation programs, with a focus on flexibility, robustness and high performance.} This manual documents the collective variables module (\textbf{Colvars}), a portable software that interfaces multiple MD simulation programs, with a focus on flexibility, robustness and high performance.}
 The module is designed to perform multiple tasks concurrently during or after a simulation, the most common of which are: The module is designed to perform multiple tasks concurrently during or after a simulation, the most common of which are:
 \begin{itemize} \begin{itemize}
  
 \item apply restraints or biasing potentials to multiple colvars, tailored on the system by choosing from a wide set of basis functions, without limitations on their number or on the number of atoms involved; \cvnamdonly{while this can in principle be done through a TclForces script, using the colvars module is both easier and computationally more efficient;} \item apply restraints or biasing potentials to multiple colvars, tailored on the system by choosing from a wide set of basis functions, without limitations on their number or on the number of atoms involved; \cvnamdonly{while this can in principle be done through a TclForces script, using the Colvars module is both easier and computationally more efficient;}
  
 \item calculate potentials of mean force (PMFs) along any set of colvars, using different enhanced sampling methods, such as Adaptive Biasing Force (ABF), metadynamics, steered MD and umbrella sampling; variants of these methods that make use of an ensemble of replicas are supported as well; \item calculate potentials of mean force (PMFs) along any set of colvars, using different enhanced sampling methods, such as Adaptive Biasing Force (ABF), metadynamics, steered MD and umbrella sampling; variants of these methods that make use of an ensemble of replicas are supported as well;
  
Line 38
Line 42
  
 \cvvmdonly{\textbf{Note:} although restraints and PMF algorithms are primarily used during simulations, they are also available in VMD to test a new input for a simulation, or to evaluate the relative free energy of a new structure based on data from a previous calculation.  \emph{Options that only have an effect during a simulation are also included for compatibility purposes.}}  \cvvmdonly{\textbf{Note:} although restraints and PMF algorithms are primarily used during simulations, they are also available in VMD to test a new input for a simulation, or to evaluate the relative free energy of a new structure based on data from a previous calculation.  \emph{Options that only have an effect during a simulation are also included for compatibility purposes.}} 
  
 To briefly illustrate the flexibility of the colvars module, Figure~\ref{fig:colvars_diagram} shows an example of a non-trivial configuration (the corresponding input can be found in \ref{sec:colvars_config}). To briefly illustrate the flexibility of the Colvars module, Figure~\ref{fig:colvars_diagram} shows an example of a non-trivial configuration (the corresponding input can be found in \ref{sec:colvars_config}).
  
 % AK: this figure looks a bit misplaced in the LAMMPS version of the % AK: this figure looks a bit misplaced in the LAMMPS version of the
 % AK: documentation. perhaps it can be moved to be define a bit earlier, % AK: documentation. perhaps it can be moved to be define a bit earlier,
Line 50
Line 54
 \cvnamdugonly{\includegraphics[width=12cm]{figures/colvars_diagram}} \cvnamdugonly{\includegraphics[width=12cm]{figures/colvars_diagram}}
 \cvvmdugonly{\includegraphics[width=12cm]{pictures/colvars_diagram}} \cvvmdugonly{\includegraphics[width=12cm]{pictures/colvars_diagram}}
 \cvrefmanonly{\includegraphics[width=12cm]{colvars_diagram}} \cvrefmanonly{\includegraphics[width=12cm]{colvars_diagram}}
   \caption[Graphical representation of a collective variables configuration.]{Graphical representation of a collective variables configuration\cvlammpsonly{ \textbf{(note:} \emph{currently, the $\alpha$-helical content colvar is unavailable in LAMMPS)}}.   \caption[Graphical representation of a Colvars configuration.]{Graphical representation of a Colvars configuration\cvlammpsonly{ \textbf{(note:} \emph{currently, the $\alpha$-helical content colvar is unavailable in LAMMPS)}}.
     The colvar called ``$d$'' is defined as the difference between two distances: the first distance ($d_{1}$) is taken between the center of mass of atoms 1 and 2 and that of atoms 3 to 5, the second ($d_{2}$) between atom 7 and the center of mass of atoms 8 to 10.     The colvar called ``$d$'' is defined as the difference between two distances: the first distance ($d_{1}$) is taken between the center of mass of atoms 1 and 2 and that of atoms 3 to 5, the second ($d_{2}$) between atom 7 and the center of mass of atoms 8 to 10.
 The difference $d = d_{1} - d_{2}$ is obtained by multiplying the two by a coefficient $C = +1$ or $C = -1$, respectively. The difference $d = d_{1} - d_{2}$ is obtained by multiplying the two by a coefficient $C = +1$ or $C = -1$, respectively.
 The colvar called ``$c$'' is the coordination number calculated between atoms 1 to 10 and atoms 11 to 20.  A harmonic restraint is applied to both $d$ and $c$: to allow using the same force constant $K$, both $d$ and $c$ are scaled by their respective fluctuation widths $w_d$ and $w_c$. The colvar called ``$c$'' is the coordination number calculated between atoms 1 to 10 and atoms 11 to 20.  A harmonic restraint is applied to both $d$ and $c$: to allow using the same force constant $K$, both $d$ and $c$ are scaled by their respective fluctuation widths $w_d$ and $w_c$.
Line 60
Line 64
   \label{fig:colvars_diagram}   \label{fig:colvars_diagram}
 \end{figure} \end{figure}
  
 Detailed explanations of the design of the colvars module are provided in reference~\cite{Fiorin2013}. Please cite this reference whenever publishing work that makes use of this module. Detailed explanations of the design of the Colvars module are provided in reference~\cite{Fiorin2013}. Please cite this reference whenever publishing work that makes use of this module.
  
  
 \cvsec{General parameters and input/output files} \cvsec{General parameters and input/output files}
 \label{sec:colvarmodule} \label{sec:colvarmodule}
  
 Here, we document the syntax of the commands and parameters used to set up and use the collective variables module in \MDENGINE{}. Here, we document the syntax of the commands and parameters used to set up and use the Colvars module in \MDENGINE{}.
 One of these parameters is the configuration file or the configuration text for the module itself, whose syntax is described in \ref{sec:colvars_config} and in the following sections. One of these parameters is the configuration file or the configuration text for the module itself, whose syntax is described in \ref{sec:colvars_config} and in the following sections.
  
 \cvvmdonly{ \cvvmdonly{
 \cvsubsec{Using the \texttt{cv} command} \cvsubsec{Using the \texttt{cv} command}
 \label{sec:colvars_mdengine_params} \label{sec:colvars_mdengine_params}
 \cvvmdugonly{\index{collective variables!\texttt{cv} command}} \cvvmdugonly{\index{Colvars!\texttt{cv} command}}
  
 The colvars module is accessed in VMD through the command \texttt{cv}. The Colvars module is accessed in VMD through the command \texttt{cv}.
 The command must be used the first time as \texttt{cv molid }\emph{$<$molid$>$} to set up the collective variables module for a given molecule. The command must be used the first time as \texttt{cv molid }\emph{$<$molid$>$} to set up the Colvars module for a given molecule.
 In all following uses, the \texttt{cv} command will continue operating on the same molecule, regardless of its ``top'' status. In all following uses, the \texttt{cv} command will continue operating on the same molecule, regardless of its ``top'' status.
 To use the \texttt{cv} command on a different molecule, use \texttt{cv delete} first and then \texttt{cv molid }\emph{$<$molid$>$}. To use the \texttt{cv} command on a different molecule, use \texttt{cv delete} first and then \texttt{cv molid }\emph{$<$molid$>$}.
 Invoking the \texttt{cv} command with no arguments prints a help screen. Invoking the \texttt{cv} command with no arguments prints a help screen.
  
 \input{colvars-cv.tex} \cvvmdugonly{\input{ug_colvars-cv.tex}}
  \cvrefmanonly{\input{colvars-cv.tex}}
  
 } }
  
 \cvnamdonly{ \cvnamdonly{
 \cvsubsec{NAMD parameters} \cvsubsec{NAMD parameters}
 \label{sec:colvars_mdengine_params} \label{sec:colvars_mdengine_params}
  
 To enable a collective variables-based calculation, two parameters must be added to the NAMD configuration file, \texttt{colvars} and \texttt{colvarsConfig}. To enable a Colvars-based calculation, two parameters must be added to the NAMD configuration file, \texttt{colvars} and \texttt{colvarsConfig}.
 An optional third parameter, \texttt{colvarsInput}, can be used to continue a previous simulation. An optional third parameter, \texttt{colvarsInput}, can be used to continue a previous simulation.
  
 \begin{itemize} \begin{itemize}
Line 97
Line 103
   \keydef   \keydef
     {colvars}{%     {colvars}{%
     NAMD configuration file}{%     NAMD configuration file}{%
     Enable the collective variables module}{%     Enable the Colvars module}{%
     boolean}{%     boolean}{%
     \texttt{off}}{%     \texttt{off}}{%
     If this flag is on, the collective variables module within     If this flag is on, the Colvars module within
     NAMD is enabled; the module requires a separate configuration     NAMD is enabled; the module requires a separate configuration
     file, to be provided with \texttt{colvarsConfig}.}     file, to be provided with \texttt{colvarsConfig}.}
  
Line 112
Line 118
     UNIX filename}{%     UNIX filename}{%
     This file contains the definition of all collective variables and     This file contains the definition of all collective variables and
     their biasing or analysis methods.     their biasing or analysis methods.
     Parameters within the configuration file can be controlled from     This file can also be provided by the Tcl command \texttt{cv configfile}; alternatively, the contents of the file itself can be given as an argument to the command \texttt{cv config}.
     a NAMD config file using Tcl variables in the following way:     % Parameters within the configuration file can be controlled from
      % a NAMD config file using Tcl variables in the following way:
     {\ttfamily 
     colvars on\\     % {\ttfamily
     colvarsConfig colvars\_subst.tmp\\     % colvars on\\
     set myParameter someValue\\     % colvarsConfig colvars\_subst.tmp\\
     \# Parse template and create specific config file on the fly\\     % set myParameter someValue\\
     set infile [open colvars\_template.in r] \\     % \# Parse template and create specific config file on the fly\\
     set outfile [open colvars\_subst.tmp w+] \\     % set infile [open colvars\_template.in r] \\
     puts \$outfile [subst [read \$infile]] \\     % set outfile [open colvars\_subst.tmp w+] \\
     close \$infile \\     % puts \$outfile [subst [read \$infile]] \\
     close \$outfile}     % close \$infile \\
      % close \$outfile}
     In this example, the string \texttt{\$myParameter} will be replaced 
     with the value \texttt{someValue} wherever it appears in the file     % In this example, the string \texttt{\$myParameter} will be replaced
     \texttt{colvars\_template.in}. This value will then be read in by     % with the value \texttt{someValue} wherever it appears in the file
     the colvars module when it parses its input.     % \texttt{colvars\_template.in}. This value will then be read in by
      % the Colvars module when it parses its input.
 } }
  
 \item % \item %
Line 139
Line 146
     Input state file for the collective variables}{%     Input state file for the collective variables}{%
     UNIX filename}{%     UNIX filename}{%
     When continuing a previous simulation run, this file contains the current state of all collective variables and of their associated algorithms.     When continuing a previous simulation run, this file contains the current state of all collective variables and of their associated algorithms.
     It is written automatically at the end of any simulation with collective variables.}     It is written automatically at the end of any simulation with collective variables.
      This file can also be provided by the Tcl command \texttt{cv load}.
    }
  
 \end{itemize} \end{itemize}
 } }
Line 148
Line 157
 \subsection{LAMMPS keywords} \subsection{LAMMPS keywords}
 \label{sec:colvars_mdengine_parameters} \label{sec:colvars_mdengine_parameters}
  
 To enable a collective variables-based calculation, the following line must be added to the LAMMPS configuration file:\\ To enable a Colvars-based calculation, the following line must be added to the LAMMPS configuration file:\\
 \\ \\
 \texttt{fix } \emph{ID } \texttt{all }  \texttt{colvars } \emph{configfile } \emph{keyword value pairs ...}\\ \texttt{fix } \emph{ID } \texttt{all }  \texttt{colvars } \emph{configfile } \emph{keyword value pairs ...}\\
 \\ \\
 where \emph{ID} is a string that uniquely identifies this fix command inside a LAMMPS script, \emph{configfile} is the name of the configuration file for the collective variables module, followed by one or more of the following optional keywords with their corresponding arguments: where \emph{ID} is a string that uniquely identifies this fix command inside a LAMMPS script, \emph{configfile} is the name of the configuration file for the Colvars module, followed by one or more of the following optional keywords with their corresponding arguments:
  
 \begin{itemize} \begin{itemize}
  
Line 172
Line 181
     Prefix of the output state file}{%     Prefix of the output state file}{%
     string}{%     string}{%
     ``out''}{%     ``out''}{%
     If a value is provided, it is interpreted as the prefix to all output files that will be written by the collective variables module (see \ref{sec:colvars_output}).}     If a value is provided, it is interpreted as the prefix to all output files that will be written by the Colvars module (see \ref{sec:colvars_output}).}
  
 \item % \item %
   \keydef   \keydef
     {unwrap}{%     {unwrap}{%
     keyword of the \texttt{fix colvars} command}{%     keyword of the \texttt{fix colvars} command}{%
     Whether to unwrap coordinates passed to the colvars module}{%     Whether to unwrap coordinates passed to the Colvars module}{%
     ``yes'' or ``no''}{%     ``yes'' or ``no''}{%
     ``yes''}{%     ``yes''}{%
     This keyword controls whether wrapped or unwrapped coordinates are passed to the colvars module for calculation of the collective variables and of the resulting forces. The default is to use the image flags to reconstruct the absolute atom positions: under this convention, centers of mass and centers of geometry are calculated as a weighted vector sum (see \ref{sec:colvar_atom_groups_wrapping}).     This keyword controls whether wrapped or unwrapped coordinates are passed to the Colvars module for calculation of the collective variables and of the resulting forces. The default is to use the image flags to reconstruct the absolute atom positions: under this convention, centers of mass and centers of geometry are calculated as a weighted vector sum (see \ref{sec:colvar_atom_groups_wrapping}).
 Setting this to \emph{no} will use the current local coordinates that are wrapped back into the simulation cell at each re-neighboring instead.} Setting this to \emph{no} will use the current local coordinates that are wrapped back into the simulation cell at each re-neighboring instead.}
  
 \item % \item %
Line 201
Line 210
     Thermostating fix}{%     Thermostating fix}{%
     string}{%     string}{%
     NULL}{%     NULL}{%
     This keyword provides the \emph{ID} of an applicable thermostating fix command. This will be used to provide the colvars module with the current thermostat target temperature when using a method that needs this information.}     This keyword provides the \emph{ID} of an applicable thermostating fix command. This will be used to provide the Colvars module with the current thermostat target temperature when using a method that needs this information.}
  
 \end{itemize} \end{itemize}
 } }
  
  
 \cvsubsec{Configuration syntax for the collective variables module} \cvsubsec{Configuration syntax for the Colvars module}
 \label{sec:colvars_config} \label{sec:colvars_config}
  
 \cvnamdonly{All the parameters defining the colvars and their biasing or analysis algorithms are read from the file specified by \texttt{colvarsConfig}. \cvnamdonly{All the parameters defining the colvars and their biasing or analysis algorithms are read from the file specified by the configuration option \texttt{colvarsConfig}, or by the Tcl commands \texttt{cv config} and \texttt{cv configfile}.
 Hence, none of the keywords described in this section and the following ones are available as keywords for the Hence, none of the keywords described in this section and the following ones are available as keywords for the
 NAMD configuration file.} NAMD configuration file.}
 \cvvmdonly{The colvars configuration is usually read using the commands \texttt{cv configfile} or \texttt{cv config}.} \cvvmdonly{The Colvars configuration is usually read using the commands \texttt{cv configfile} or \texttt{cv config}.}
 The syntax of the colvars configuration is ``\texttt{keyword value}'', where the keyword and its value are separated by any white space. The syntax of the Colvars configuration is ``\texttt{keyword value}'', where the keyword and its value are separated by any white space.
 The following rules apply: The following rules apply:
  
 \begin{itemize} \begin{itemize}
Line 226
Line 235
 \item many keywords are nested, and are only meaningful within a specific context: for every keyword documented in the following, the ``parent'' keyword that defines such context is also indicated\cvnamdugonly{ in parentheses}; \item many keywords are nested, and are only meaningful within a specific context: for every keyword documented in the following, the ``parent'' keyword that defines such context is also indicated\cvnamdugonly{ in parentheses};
  
 \cvnamdonly{% \cvnamdonly{%
 \item unlike in the NAMD main configuration file, the deprecated `\texttt{=}' sign between a keyword and its value is not allowed; \item the `\texttt{=}' sign between a keyword and its value, deprecated in the NAMD main configuration file, is not allowed;
  
 \item unlike in the NAMD main configuration file,  Tcl commands and variables are not available, but it is possible to use Tcl to generate a new configuration file with different parameters \cvnamdugonly{(see \ref{sec:colvars_mdengine_params})}; \item Tcl syntax is generally not available, but it is possible to use Tcl variables or bracket expansion of commands within a configuration string, when this is passed via the command \texttt{cv config \ldots}; this is particularly useful when combined with parameter introspection\cvnamdugonly{ (see \ref{section:tclscripting})}, e.g.{} \texttt{cv config "colvarsTrajFrequency [DCDFreq]"};
 } }
  
 \cvvmdonly{% \cvvmdonly{%
 \item Tcl commands and variables are not available, but it is possible to include Tcl variables and constructs inside a configuration string: for example, it is possible to load the atom selection \$\emph{sel} into an atom group (see \ref{sec:colvar_atom_groups_sel}) using \texttt{atomNumbers \{ [\$sel get serial] \}} inside a configuration string read by \texttt{cv config}; \item Tcl syntax is generally not available, but it is possible to use Tcl variables or bracket expansion of commands within a configuration string, when this is passed via the command \texttt{cv config \ldots}: for example, it is possible to convert the atom selection \$\emph{sel} into an atom group (see \ref{sec:colvar_atom_groups_sel}) using \texttt{cv config "atomNumbers \{ [\$sel get serial] \}"};}
 } 
  
 \item if a keyword requiring a boolean value (\texttt{yes|on|true} or \texttt{no|off|false}) is provided without an explicit value, it defaults to `\texttt{yes|on|true}'; for example, `\texttt{outputAppliedForce}' may be used as shorthand for `\texttt{outputAppliedForce on}'; \item if a keyword requiring a boolean value (\texttt{yes|on|true} or \texttt{no|off|false}) is provided without an explicit value, it defaults to `\texttt{yes|on|true}'; for example, `\texttt{outputAppliedForce}' may be used as shorthand for `\texttt{outputAppliedForce on}';
  
Line 273
Line 281
     Colvar module restart frequency}{%     Colvar module restart frequency}{%
     positive integer}{%     positive integer}{%
     \texttt{restartFreq}}{%     \texttt{restartFreq}}{%
     Allows to choose a different restart frequency for the collective     Allows to choose a different restart frequency for the Colvars module.
     variables module.  Redefining it may be useful to trace the time     Redefining it may be useful to trace the time
     evolution of those few properties which are not written to the     evolution of those few properties which are not written to the
     trajectory file for reasons of disk space.}     trajectory file for reasons of disk space.}
  
Line 288
Line 296
     extension) as produced by the \texttt{make\_ndx} tool of GROMACS.     extension) as produced by the \texttt{make\_ndx} tool of GROMACS.
     This keyword may be repeated to load multiple index files: the same group name cannot appear in multiple index files.     This keyword may be repeated to load multiple index files: the same group name cannot appear in multiple index files.
     \cvlammpsonly{In LAMMPS, the \texttt{group2ndx} command can be used to generate such file from existing groups.     \cvlammpsonly{In LAMMPS, the \texttt{group2ndx} command can be used to generate such file from existing groups.
     Note that the collective variables module reads the indices of atoms from the index file: therefore, the LAMMPS groups do not need to remain active during the simulation, and could be deleted right after issuing \texttt{group2ndx}.     Note that the Colvars module reads the indices of atoms from the index file: therefore, the LAMMPS groups do not need to remain active during the simulation, and could be deleted right after issuing \texttt{group2ndx}.
 } }
     The names of index groups contained in this file can then be used to define     The names of index groups contained in this file can then be used to define
     atom groups with the \texttt{indexGroup} keyword.     atom groups with the \texttt{indexGroup} keyword.
Line 423
Line 431
     string}{%     string}{%
     ``\texttt{colvar}'' + numeric id}{%     ``\texttt{colvar}'' + numeric id}{%
     The name is an unique case-sensitive string which allows the     The name is an unique case-sensitive string which allows the
     colvar module to identify this colvar unambiguously; it is also     Colvars module to identify this colvar unambiguously; it is also
     used in the trajectory file to label to the columns corresponding     used in the trajectory file to label to the columns corresponding
     to this colvar.}     to this colvar.}
  
Line 471
Line 479
     boolean}{%     boolean}{%
     \texttt{off}}{%     \texttt{off}}{%
     This option does not affect simulation results, but enables some internal optimizations.     This option does not affect simulation results, but enables some internal optimizations.
     Depending on its mathematical definition, a colvar may have ``natural'' boundaries: for example, a \texttt{distance} colvar has a ``natural'' lower boundary at 0.  Setting this option instructs the colvars module that the user-defined lower boundary is ``natural''.     Depending on its mathematical definition, a colvar may have ``natural'' boundaries: for example, a \texttt{distance} colvar has a ``natural'' lower boundary at 0.  Setting this option instructs the Colvars module that the user-defined lower boundary is ``natural''.
 See Section~\ref{sec:cvc} for the physical ranges of values of each component.} See Section~\ref{sec:cvc} for the physical ranges of values of each component.}
  
 \item % \item %
Line 498
Line 506
     the grid.  This option cannot be used when     the grid.  This option cannot be used when
       the initial boundaries already span the full period of a periodic       the initial boundaries already span the full period of a periodic
       colvar.}       colvar.}
  
  \item %
    \keydef
      {subtractAppliedForce}{%
      \texttt{colvar}}{%
      Do not include biasing forces in the total force for this colvar}{%
      boolean}{%
      \texttt{off}}{%
      If the colvar supports total force calculation (see \ref{sec:cvc_sys_forces}), all forces applied to this colvar by biases will be removed from the total force.
      This keyword allows to recover some of the ``system force'' calculation available in the Colvars module     before version 2016-08-10.
      Please note that removal of \emph{all} other external forces (including biasing forces applied to a         different colvar) is \emph{no longer supported}, due to changes in the underlying simulation engines (primarily NAMD).
      This option may be useful when continuing a previous simulation where the removal of external/applied forces is essential.
      \emph{For all new simulations, the use of this option is not recommended.}
  }
  
 \end{itemize} \end{itemize}
  
  
Line 505
Line 528
  
 The following options are useful to define restraints (confining potentials) for this colvar. The following options are useful to define restraints (confining potentials) for this colvar.
 To apply moving restraints, or restraints to more than one colvar simultaneously, a more convenient option is to use the \texttt{harmonic} bias (\ref{sec:colvarbias_harmonic}). To apply moving restraints, or restraints to more than one colvar simultaneously, a more convenient option is to use the \texttt{harmonic} bias (\ref{sec:colvarbias_harmonic}).
 When using an extended Lagrangian, the boundary potential is applied to the ``actual'' colvar, in contrast with forces for all types of biases, which are applied to the extended coordinate. 
  
 \begin{itemize} \begin{itemize}
  
Line 591
Line 613
  
 \item % \item %
   \keydef   \keydef
     {outputSystemForce}{%     {outputTotalForce}{%
     \texttt{colvar}}{%     \texttt{colvar}}{%
     Output a system force trajectory for this     Output a total force trajectory for this
     colvar}{%     colvar}{%
     boolean}{%     boolean}{%
     \texttt{off}}{%     \texttt{off}}{%
     If \texttt{colvarsTrajFrequency} is defined, the total system force on this     If \texttt{colvarsTrajFrequency} is defined, the total force on this
     colvar (i.e.~the projection of all interatomic forces     colvar (i.e.~the projection of all atomic total forces
     except constraint forces on this colvar --- see     onto this colvar --- see
     equation~(\ref{eq:gradient_vector}) in     equation~(\ref{eq:gradient_vector}) in
     section~\ref{sec:colvarbias_abf}) are written to the trajectory     section~\ref{sec:colvarbias_abf}) are written to the trajectory
     file under the label ``\texttt{fs\_}$<$\texttt{name}$>$''.     file under the label ``\texttt{fs\_}$<$\texttt{name}$>$''.
     For extended Lagrangian colvars, the "system force" felt by the extended degree of freedom     For extended Lagrangian colvars, the ``total force'' felt by the extended degree of freedom
     is simply the force from the harmonic spring.     is simply the force from the harmonic spring.
     \textbf{Note:} not all components support this option.  The     \textbf{Note:} not all components support this option.  The
     physical unit for this force is \cvnamdonly{kcal/mol}\cvvmdonly{kcal/mol}\cvlammpsonly{the unit of energy specified by \texttt{units}}, divided by the colvar unit U.}     physical unit for this force is \cvnamdonly{kcal/mol}\cvvmdonly{kcal/mol}\cvlammpsonly{the unit of energy specified by \texttt{units}}, divided by the colvar unit U.}
Line 618
Line 640
     \texttt{off}}{%     \texttt{off}}{%
     If \texttt{colvarsTrajFrequency} is defined, the total force     If \texttt{colvarsTrajFrequency} is defined, the total force
     applied on this colvar by biases and confining potentials (walls)     applied on this colvar by biases and confining potentials (walls)
     within the colvar module are     within the Colvars module are
     written to the trajectory under the label     written to the trajectory under the label
     ``\texttt{fa\_}$<$\texttt{name}$>$''.      ``\texttt{fa\_}$<$\texttt{name}$>$''. 
     For extended Lagrangian colvars, this force is actually applied to the     For extended Lagrangian colvars, this force is actually applied to the
     extended degree of freedom rather than the geometric colvar itself.     extended degree of freedom rather than the geometric colvar itself.
     The physical unit for this     The physical unit for this
     force is \cvnamdonly{kcal/mol}\cvvmdonly{kcal/mol}\cvlammpsonly{the unit of energy specified by \texttt{units}} divided by the colvar unit.}     force is \cvnamdonly{kcal/mol}\cvvmdonly{kcal/mol}\cvlammpsonly{the unit of energy specified by \texttt{units}} divided by the colvar unit.}
  
 \end{itemize} \end{itemize}
  
  
Line 636
Line 659
 (fictitious particle) by a harmonic spring. (fictitious particle) by a harmonic spring.
 All biasing and confining forces are then applied to the extended degree All biasing and confining forces are then applied to the extended degree
 of freedom. The ``actual'' geometric colvar (function of Cartesian  of freedom. The ``actual'' geometric colvar (function of Cartesian 
 coordinates) only feels the force from the harmonic spring and its wall coordinates) only feels the force from the harmonic spring.
 potentials, if any. This is particularly useful when combined with an ABF bias (\ref{sec:colvarbias_abf})
  to perform eABF simulations (\ref{sec:eABF}).
  
 \begin{itemize} \begin{itemize}
 \item % \item %
Line 694
Line 718
     positive decimal}{%     positive decimal}{%
     thermostat temperature}{%     thermostat temperature}{%
     Temperature used for calculating the coupling force constant of the     Temperature used for calculating the coupling force constant of the
     extended coordinate (see \texttt{extendedFluctuation}) and, if needed, as a     extended variable (see \texttt{extendedFluctuation}) and, if needed, as a
     target temperature for extended Langevin dynamics (see     target temperature for extended Langevin dynamics (see
     \texttt{extendedLangevinDamping}). This should normally be left at its     \texttt{extendedLangevinDamping}). This should normally be left at its
     default value.}     default value.}
Line 901
Line 925
  
 The resulting selection includes atoms 1 and 3, those between 20 and 50, and those in the index group called ``Water''; the indices of this group are read from the file provided by \texttt{indexFile}, in the global section of the configuration file. The resulting selection includes atoms 1 and 3, those between 20 and 50, and those in the index group called ``Water''; the indices of this group are read from the file provided by \texttt{indexFile}, in the global section of the configuration file.
  
 \cvvmdonly{In the current version, the colvars module does not manipulate VMD atom selections directly: however, these can be converted to atom groups within the colvars configuration string, using selection keywords such as \texttt{atomNumbers}.} \cvvmdonly{In the current version, the Colvars module does not manipulate VMD atom selections directly: however, these can be converted to atom groups within the colvars configuration string, using selection keywords such as \texttt{atomNumbers}.}
 The complete list of selection keywords available in \MDENGINE{} is: The complete list of selection keywords available in \MDENGINE{} is:
  
 \begin{itemize} \begin{itemize}
Line 1019
Line 1043
     Implicitly remove translations for this group}{%     Implicitly remove translations for this group}{%
     boolean}{%     boolean}{%
     \texttt{off}}{%     \texttt{off}}{%
     If this option is \texttt{on}, the center of geometry of the group will be aligned with that of the reference positions provided by \cvnamebasedonly{either} \texttt{refPositions}\cvnamebasedonly{ or \texttt{refPositionsFile}}.     If this option is \texttt{on}, the center of geometry of the group will be aligned with that of the reference positions provided by \cvnamebasedonly{either} \texttt{refPositions} or \texttt{refPositionsFile}.
     Colvar components will only have access to the aligned positions.     Colvar components will only have access to the aligned positions.
 \textbf{Note}: unless otherwise specified, \texttt{rmsd} and \texttt{eigenvector} set this option to \texttt{on} \emph{by default}. \textbf{Note}: unless otherwise specified, \texttt{rmsd} and \texttt{eigenvector} set this option to \texttt{on} \emph{by default}.
 } }
Line 1031
Line 1055
     Implicitly remove rotations for this group}{%     Implicitly remove rotations for this group}{%
     boolean}{%     boolean}{%
     \texttt{off}}{%     \texttt{off}}{%
     If this option is \texttt{on}, the coordinates of this group will be optimally superimposed to the reference positions provided by \cvnamebasedonly{either} \texttt{refPositions}\cvnamebasedonly{ or \texttt{refPositionsFile}}.     If this option is \texttt{on}, the coordinates of this group will be optimally superimposed to the reference positions provided by \cvnamebasedonly{either} \texttt{refPositions} or \texttt{refPositionsFile}.
     The rotation will be performed around the center of geometry if \texttt{centerReference} is \texttt{on}, around the origin otherwise.     The rotation will be performed around the center of geometry if \texttt{centerReference} is \texttt{on}, around the origin otherwise.
     The algorithm used is the same employed by the \texttt{orientation} colvar component~\cite{Coutsias2004}.     The algorithm used is the same employed by the \texttt{orientation} colvar component~\cite{Coutsias2004}.
     Forces applied to the atoms of this group will also be implicitly rotated back to the original frame.     Forces applied to the atoms of this group will also be implicitly rotated back to the original frame.
Line 1044
Line 1068
     atom group}{%     atom group}{%
     Reference positions for fitting (\AA)}{%     Reference positions for fitting (\AA)}{%
     space-separated list of \texttt{(x, y, z)} triplets}{%     space-separated list of \texttt{(x, y, z)} triplets}{%
      \label{key:colvars:atom_group:refPositions}
     This option provides a list of reference coordinates for \texttt{centerReference} or \texttt{rotateReference}.     This option provides a list of reference coordinates for \texttt{centerReference} or \texttt{rotateReference}.
     If only \texttt{centerReference} is \texttt{on}, the list may contain a single (x, y, z) triplet; if also \texttt{rotateReference} is \texttt{on}, the list should be as long as the atom group.     If only \texttt{centerReference} is \texttt{on}, the list may contain a single (x, y, z) triplet; if also \texttt{rotateReference} is \texttt{on}, the list should be as long as the atom group.
 } }
  
 \cvnamebasedonly{ 
 \item % \item %
   \key   \key
     {refPositionsFile}{%     {refPositionsFile}{%
     atom group}{%     atom group}{%
     File containing the reference positions for fitting}{%     File containing the reference positions for fitting}{%
     UNIX filename}{%     UNIX filename}{%
     Supplies the reference positions (mutually exclusive with \texttt{refPositions}).     \label{key:colvars:atom_group:refPositionsFile}
      This keyword provides the reference coordinates for fitting from the given file, and is mutually exclusive with \texttt{refPositions}.
      The acceptable file format is XYZ\cvnamebasedonly{or PDB}.
     Atomic positions are read differently depending on the three following scenarios:     Atomic positions are read differently depending on the three following scenarios:
     \emph{i)} \texttt{refPositionsCol} is specified: the PDB file contains a set of position larger than the size of the group, and positions are read according to the value of the column \texttt{refPositionsCol} (which may be the same as \texttt{atomsCol}).     \emph{i)} the file contains exactly as many records as the atoms in the group: all positions are read in sequence;
     \emph{ii)} \texttt{refPositionsCol} is not specified and the PDB file contains exactly as many \texttt{ATOM} records as the atoms in the group: all positions are read in sequence;     \emph{ii)} the file contains coordinates for the entire system: only the positions corresponding to the numeric indices of the atom group are read\cvnamebasedonly{;
     \emph{iii)} \texttt{refPositionsCol} is not specified and the PDB file contains the entire system: the positions corresponding to the numeric indices of the atom group are read.     \emph{iii)} if the file is a PDB file and \texttt{refPositionsCol} is specified, positions are read according to the value of the column \texttt{refPositionsCol} (which may be the same as \texttt{atomsCol})}.
 } }
  
  \cvnamebasedonly{
 \item % \item %
   \key   \key
     {refPositionsCol}{%     {refPositionsCol}{%
     atom group}{%     atom group}{%
     PDB column containing atom flags}{%     PDB column containing atom flags}{%
     \texttt{O}, \texttt{B}, \texttt{X}, \texttt{Y}, or \texttt{Z}}{%     \texttt{O}, \texttt{B}, \texttt{X}, \texttt{Y}, or \texttt{Z}}{%
     Like \texttt{atomsCol} for \texttt{atomsFile}, indicates which column to use to identify the atoms in \texttt{refPositionsFile}.}     Like \texttt{atomsCol} for \texttt{atomsFile}, indicates which column to use to identify the atoms in \texttt{refPositionsFile} (if this is a PDB file).}
  
 \item % \item %
   \key   \key
Line 1081
Line 1108
  
 \item % \item %
   \keydef   \keydef
     {refPositionsGroup}{%     {fittingGroup}{%
     atom group}{%     atom group}{%
     Use an alternate set of atoms to define the roto-translation}{%     Use an alternate set of atoms to define the roto-translation}{%
     Block \texttt{refPositionsGroup \{ ... \}}}{%     Block \texttt{fittingGroup \{ ... \}}}{%
     This group itself}{%     This group itself}{%
     If either \texttt{centerReference} or \texttt{rotateReference} is defined, this keyword defines an alternate atom group to calculate the optimal roto-translation.     If either \texttt{centerReference} or \texttt{rotateReference} is defined, this keyword defines an alternate atom group to calculate the optimal roto-translation.
     Use this option to define a continuous rotation if the structure of the group involved changes significantly (a typical symptom would be the message ``Warning: discontinuous rotation!'').     Use this option to define a continuous rotation if the structure of the group involved changes significantly (a typical symptom would be the message ``Warning: discontinuous rotation!'').
  
 \cvnamebasedonly{ \cvnamebasedonly{
     The following example illustrates the syntax of \texttt{refPositionsGroup}: a group called ``\texttt{atoms}'' is defined, including 8 C$_{\alpha}$ atoms of a protein of 100 residues.     The following example illustrates the syntax of \texttt{fittingGroup}: a group called ``\texttt{atoms}'' is defined, including 8 C$_{\alpha}$ atoms of a protein of 100 residues.
     An optimal roto-translation is calculated automatically by fitting the C$_{\alpha}$ trace of the rest of the protein onto the coordinates provided by a PDB file.}     An optimal roto-translation is calculated automatically by fitting the C$_{\alpha}$ trace of the rest of the protein onto the coordinates provided by a PDB file.}
  
 {% {%
Line 1104
Line 1131
 \\ \\
 \-~~centerReference yes\\ \-~~centerReference yes\\
 \-~~rotateReference yes\\ \-~~rotateReference yes\\
 \-~~refPositionsGroup \{\\ \-~~fittingGroup \{\\
 \-~~~~\# define the frame by fitting the rest of the protein\\ \-~~~~\# define the frame by fitting the rest of the protein\\
 \-~~~~psfSegID              PROT PROT\\ \-~~~~psfSegID              PROT PROT\\
 \-~~~~atomNameResidueRange  CA  1-40\\ \-~~~~atomNameResidueRange  CA  1-40\\
Line 1158
Line 1185
  In simulations with periodic boundary conditions, NAMD maintains  In simulations with periodic boundary conditions, NAMD maintains
   the coordinates of all the atoms within a molecule contiguous to   the coordinates of all the atoms within a molecule contiguous to
   each other (i.e.~there are no spurious ``jumps'' in the molecular   each other (i.e.~there are no spurious ``jumps'' in the molecular
   bonds).  The colvar module relies on this when calculating a group's   bonds).  The Colvars module relies on this when calculating a group's
   center of geometry, but the condition may fail if the group spans   center of geometry, but the condition may fail if the group spans
   different molecules: in that case, writing the NAMD output files   different molecules: in that case, writing the NAMD output files
   \texttt{wrapAll} or \texttt{wrapWater} could produce wrong results   \texttt{wrapAll} or \texttt{wrapWater} could produce wrong results
Line 1171
Line 1198
 \cvlammpsonly{ \cvlammpsonly{
 In simulations with periodic boundary conditions, many of the implemented colvar components rely on the fact that each position within a group of atoms is at the nearest periodic image from the center of geometry of the group itself. In simulations with periodic boundary conditions, many of the implemented colvar components rely on the fact that each position within a group of atoms is at the nearest periodic image from the center of geometry of the group itself.
 However, due to the internal wrapping of individual atomic positions done by LAMMPS, this assumption is inaccurate if groups lies at one of the unit cell's boundaries. However, due to the internal wrapping of individual atomic positions done by LAMMPS, this assumption is inaccurate if groups lies at one of the unit cell's boundaries.
 For this reason, within the colvars module coordinates are unwrapped by default to avoid discontinuities due to coordinate wrapping (see \texttt{unwrap} keyword in \ref{sec:colvars_lammps}). For this reason, within the Colvars module coordinates are unwrapped by default to avoid discontinuities due to coordinate wrapping (see \texttt{unwrap} keyword in \ref{sec:colvars_mdengine_parameters}).
  
 The user should determine whether maintaining the default value of \texttt{unwrap}, depending on the specifics of each system. The user should determine whether maintaining the default value of \texttt{unwrap}, depending on the specifics of each system.
 In general, internal coordinate wrapping by LAMMPS does not affect the calculation of colvars if each atom group satisfies one or more of the following: In general, internal coordinate wrapping by LAMMPS does not affect the calculation of colvars if each atom group satisfies one or more of the following:
 } }
 \cvvmdonly{ \cvvmdonly{
   When periodic boundary conditions are defined, the colvars module requires that the coordinates of each molecular fragment are contiguous, without ``jumps'' when a fragment is partially wrapped near a periodic boundary.   When periodic boundary conditions are defined, the Colvars module requires that the coordinates of each molecular fragment are contiguous, without ``jumps'' when a fragment is partially wrapped near a periodic boundary.
   The colvars module relies on this assumption when calculating a group's center of geometry, but the condition may fail if the group spans different molecules.   The Colvars module relies on this assumption when calculating a group's center of geometry, but the condition may fail if the group spans different molecules.
   In general, coordinate wrapping does not affect the calculation of colvars if each atom group satisfies one or more of the following:   In general, coordinate wrapping does not affect the calculation of colvars if each atom group satisfies one or more of the following:
 } }
  
Line 1188
Line 1216
   \item[\emph{iv)}] it has all of its atoms within the same molecular fragment%   \item[\emph{iv)}] it has all of its atoms within the same molecular fragment%
 }. }.
 \end{enumerate} \end{enumerate}
 \cvvmdonly{If none of these conditions are met, wrapping may affect the calculation of collective variables: a possible solution is to use \texttt{pbc wrap} or \texttt{pbc unwrap} prior to processing a trajectory with the colvars module.} \cvvmdonly{If none of these conditions are met, wrapping may affect the calculation of collective variables: a possible solution is to use \texttt{pbc wrap} or \texttt{pbc unwrap} prior to processing a trajectory with the Colvars module.}
  
 \cvsubsec{Computational cost of colvars based on group size.} \cvsubsec{Performance a Colvars calculation based on group size.}
 \label{sec:colvar_atom_groups_scaling} \label{sec:colvar_atom_groups_scaling}
  
 In parallel MD simulations, the calculation of most interaction terms are spread over many computational nodes, but the calculation of colvars is not parallelized. In simulations performed with message-passing programs (such as NAMD or LAMMPS), the calculation of energy and forces is distributed (i.e., parallelized) across multiple nodes, as well as over the processor cores of each node.
 Therefore, additional calculations are executed by the node calculating the colvars, and most importantly, additional communication is added between the first node and the other nodes. Atomic coordinates are typically collected on one node, where the calculation of collective variables and of their biases is executed.
 \cvnamdonly{The latency-tolerant design and dynamic load balancing of NAMD alleviate both factors: however, under some circumstances, a noticeable performance impact may be observed.} This means that for simulations over large numbers of nodes, a Colvars calculation may produce a significant overhead, coming from the costs of transmitting atomic coordinates to one node and of processing them.
 To mitigate that, atom groups should be kept relatively small (up to a few thousands, depending on the computational cost to simulate the system by itself).  \cvvmdonly{A test calculation with VMD can provide a crude estimate of the impact of a large colvar on a NAMD simulation.} \cvnamdonly{The latency-tolerant design and dynamic load balancing of NAMD may alleviate both factors, but a noticeable performance impact may be observed.}
  
  Performance can be improved in multiple ways:
  \begin{itemize}
  \item The calculation of variables, components and biases can be distributed over the processor cores of the node where the Colvars module is executed.
    Currently, an equal weight is assigned to each colvar, or to each component of those colvars that include more than one component.
    The performance of simulations that use many colvars or components is improved automatically.
    For simulations that use a single large colvar, it may be advisable to partition it in multiple components, which will be then distributed across the available cores.
    \cvnamdonly{In NAMD, this feature is enabled in all binaries compiled using SMP builds of Charm++ with the CkLoop extension.}
    \cvlammpsonly{In LAMMPS, this feature is supported automatically.}
    If printed, the message ``SMP parallelism is available.'' indicates the availability of the option\cvvmdonly{ (will be supported in a future relase of VMD)}.
  
  \cvnamdonly{
    % Use the following command to identify them:
    % grep -B10 'provide(f_cvc_com_based' * |grep '\:\:'|grep '(std::string const &conf)'
  \item NAMD also offers a parallelized calculation of the centers of mass of groups of atoms.
    This option is on by default for all components that are simple functions of centers of mass, and is controlled by the keyword \refkey{scalable}{sec:cvc_common}.
    When supported, the message ``Will enable scalable calculation for group \ldots'' is printed for each group.
  }
  
  \item As a general rule, the size of atom groups should be kept relatively small (up to a few thousands of atoms, depending on the size of the entire system in comparison).
  To gain an estimate of the computational cost of a large colvar, one can use a test calculation of the same colvar in VMD (hint: use the \texttt{time} Tcl command to measure the cost of running \texttt{cv update}).
  \end{itemize}
  
  
 \cvsec{Collective variable components (basis functions)} \cvsec{Collective variable components (basis functions)}
 \label{sec:cvc} \label{sec:cvc}
Line 1217
Line 1268
 \item \texttt{distanceXY}: projection of a distance vector on a plane; \item \texttt{distanceXY}: projection of a distance vector on a plane;
 \item \texttt{distanceInv}: mean distance between two groups of atoms (e.g.~NOE-based distance); \item \texttt{distanceInv}: mean distance between two groups of atoms (e.g.~NOE-based distance);
 \item \texttt{angle}: angle between three groups; \item \texttt{angle}: angle between three groups;
  \item \texttt{dipoleAngle}: angle between two groups and dipole of a third group;
 \item \texttt{coordNum}: coordination number between two groups; \item \texttt{coordNum}: coordination number between two groups;
 \item \texttt{selfCoordNum}: coordination number of atoms within a \item \texttt{selfCoordNum}: coordination number of atoms within a
   group;   group;
Line 1251
Line 1303
 \item \texttt{orientation}: best-fit rotation, expressed as a unit quaternion. \item \texttt{orientation}: best-fit rotation, expressed as a unit quaternion.
 \end{itemize} \end{itemize}
      
  
 In the following, all the available component types are listed, along In the following, all the available component types are listed, along
 with their physical units and the limiting values, if any.  Such with their physical units and the limiting values, if any.  Such
 limiting values can be used to define \texttt{lowerBoundary} and limiting values can be used to define \texttt{lowerBoundary} and
 \texttt{upperBoundary} in the parent colvar. \texttt{upperBoundary} in the parent colvar.
  
  For each type of component, the available configurations keywords are listed:
  when two components share certain keywords, the second component simply references
  to the documentation of the first regarding that keyword.
  The keywords that are available for all types of components are listed at the end (see \
  
  
 \cvsubsec{List of available colvar components} \cvsubsec{List of available colvar components}
  
  \newenvironment{cvcoptions}%
    {\noindent\textbf{List of keywords} (see also \ref{sec:cvc_superp} for additional options):
    \begin{itemize}}
    {
    \end{itemize}
  }
  
 \cvsubsubsec{\texttt{distance}: center-of-mass distance between two groups.} \cvsubsubsec{\texttt{distance}: center-of-mass distance between two groups.}
 The \texttt{distance \{...\}} block defines a distance component, \label{sec:cvc_distance}
 between two atom groups, \texttt{group1} and \texttt{group2}. The \texttt{distance \{...\}} block defines a distance component between the two atom groups, \texttt{group1} and \texttt{group2}.
 \begin{itemize} 
  \begin{cvcoptions}
 \item % \item %
    \labelkey{colvar|distance|group1}
   \key   \key
     {group1}{%     {group1}{%
     \texttt{distance}}{%     \texttt{distance}}{%
     First group of atoms}{%     First group of atoms}{%
     Block \texttt{group1 \{...\}}}{%     Block \texttt{group1 \{...\}}}{%
     First group of atoms.}     First group of atoms.}
  
 \item % \item %
   \key   \labelkey{colvar|distance|group2}
     {group2}{%   \simkey{group2}{\texttt{distance}}{group1}
     \texttt{distance}}{% 
     Second group of atoms}{% 
     Block \texttt{group2 \{...\}}}{% 
     Second group of atoms.} 
 \item % \item %
    \labelkey{colvar|distance|forceNoPBC}
   \keydef   \keydef
     {forceNoPBC}{%     {forceNoPBC}{%
     \texttt{distance}}{%     \texttt{distance}}{%
Line 1293
Line 1359
     of a single macromolecule, which cannot be split across periodic cell     of a single macromolecule, which cannot be split across periodic cell
     boundaries, and for which the minimum-image distance might give the     boundaries, and for which the minimum-image distance might give the
     wrong result because of a relatively small periodic cell.}     wrong result because of a relatively small periodic cell.}
  
 \item % \item %
    \labelkey{colvar|distance|oneSiteTotalForce}
   \keydef   \keydef
     {oneSiteSystemForce}{%     {oneSiteTotalForce}{%
     \texttt{distance}}{%     \texttt{angle}, \texttt{dipoleAngle}, \texttt{dihedral}}{%
     Measure system force on group 1 only?}{%     Measure total force on group 1 only?}{%
     boolean}{%     boolean}{%
     \texttt{no}}{%     \texttt{no}}{%
     If this is set to \texttt{yes}, the system force is measured along     If this is set to \texttt{yes}, the total force is measured along
     a vector field (see equation~(\ref{eq:gradient_vector}) in     a vector field (see equation~(\ref{eq:gradient_vector}) in
     section~\ref{sec:colvarbias_abf}) that only involves atoms of     section~\ref{sec:colvarbias_abf}) that only involves atoms of
     \texttt{group1}.  This option is only useful for ABF, or custom     \texttt{group1}.  This option is only useful for ABF, or custom
     biases that compute system forces.  See     biases that compute total forces.  See
     section~\ref{sec:colvarbias_abf} for details.}     section~\ref{sec:colvarbias_abf} for details.}
 \end{itemize} 
  \end{cvcoptions}
  
 The value returned is a positive number (in \AA), ranging from $0$ The value returned is a positive number (in \AA), ranging from $0$
 to the largest possible interatomic distance within the chosen to the largest possible interatomic distance within the chosen
Line 1320
Line 1389
 groups projected onto an axis, or the position of a group along such groups projected onto an axis, or the position of a group along such
 an axis.  The axis can be defined using either one reference group and an axis.  The axis can be defined using either one reference group and
 a constant vector, or dynamically based on two reference groups. a constant vector, or dynamically based on two reference groups.
 \begin{itemize} 
  \begin{cvcoptions}
 \item % \item %
    \labelkey{colvar|distanceZ|main}
   \key   \key
     {main}{%     {main}{%
     \texttt{distanceZ, \texttt{distanceXY}}}{%     \texttt{distanceZ}}{%
     Main group of atoms}{%     Main group of atoms}{%
     Block \texttt{main \{...\}}}{%     Block \texttt{main \{...\}}}{%
     Group of atoms whose position $\bm{r}$ is measured.}     Group of atoms whose position $\bm{r}$ is measured.}
  
 \item % \item %
    \labelkey{colvar|distanceZ|ref}
   \key   \key
     {ref}{%     {ref}{%
     \texttt{distanceZ, \texttt{distanceXY}}}{%     \texttt{distanceZ}}{%
     Reference group of     Reference group of
     atoms}{%     atoms}{%
     Block \texttt{ref \{...\}}}{%     Block \texttt{ref \{...\}}}{%
     Reference group of atoms.  The position of its center of mass is     Reference group of atoms.  The position of its center of mass is
     noted $\bm{r}_1$ below.}     noted $\bm{r}_1$ below.}
  
 \item % \item %
    \labelkey{colvar|distanceZ|ref2}
   \keydef   \keydef
     {ref2}{%     {ref2}{%
     \texttt{distanceZ, \texttt{distanceXY}}}{%     \texttt{distanceZ}}{%
     Secondary reference     Secondary reference
     group}{%     group}{%
     Block \texttt{ref2 \{...\}}}{%     Block \texttt{ref2 \{...\}}}{%
Line 1350
Line 1425
     - \bm{r}_1\|)^{-1} \times (\bm{r}_2 - \bm{r}_1)$.  In this case,     - \bm{r}_1\|)^{-1} \times (\bm{r}_2 - \bm{r}_1)$.  In this case,
     the origin is $\bm{r}_m = 1/2 (\bm{r}_1+\bm{r}_2)$, and the value     the origin is $\bm{r}_m = 1/2 (\bm{r}_1+\bm{r}_2)$, and the value
     of the component is $\bm{e} \cdot (\bm{r}-\bm{r}_m)$.}     of the component is $\bm{e} \cdot (\bm{r}-\bm{r}_m)$.}
  
 \item % \item %
    \labelkey{colvar|distanceZ|axis}
   \keydef   \keydef
     {axis}{%     {axis}{%
     \texttt{distanceZ}, \texttt{distanceXY}}{%     \texttt{distanceZ}}{%
     Projection axis (\AA{})}{%     Projection axis (\AA{})}{%
     \texttt{(x, y, z)} triplet}{%     \texttt{(x, y, z)} triplet}{%
     \texttt{(0.0, 0.0, 1.0)}}{%     \texttt{(0.0, 0.0, 1.0)}}{%
     The three components of this vector define (when normalized) a     The three components of this vector define a
     projection axis $\bm{e}$ for the distance vector $\bm{r} -     projection axis $\bm{e}$ for the distance vector $\bm{r} -
     \bm{r}_1$ joining the centers of groups \texttt{ref} and     \bm{r}_1$ joining the centers of groups \texttt{ref} and
     \texttt{main}. The value of the component is then $\bm{e} \cdot     \texttt{main}. The value of the component is then $\bm{e} \cdot
     (\bm{r}-\bm{r}_1)$.  The vector should be written as three     (\bm{r}-\bm{r}_1)$.  The vector should be written as three
     components separated by commas and enclosed in parentheses.}     components separated by commas and enclosed in parentheses.}
  
 \item % \item %
   \keydef   \dupkey{forceNoPBC}{\texttt{distanceZ}}{colvar|distance|forceNoPBC}{\texttt{distance} component}
     {forceNoPBC}{% 
     \texttt{distanceZ, distanceXY}}{% 
     Calculate absolute rather than minimum-image distance?}{% 
     boolean}{% 
     \texttt{no}}{% 
     This parameter has the same meaning as that described above for the \texttt{distance} 
     component.} 
 \item % \item %
   \keydef   \dupkey{oneSiteTotalForce}{\texttt{distanceZ}}{colvar|distance|oneSiteTotalForce}{\texttt{distance} component}
     {oneSiteSystemForce}{% \end{cvcoptions}
     \texttt{distanceZ, distanceXY}}{% 
     Measure system force on group \texttt{main} only?}{% 
     boolean}{% 
     \texttt{no}}{% 
     If this is set to \texttt{yes}, the system force is measured along a 
     vector field (see equation~(\ref{eq:gradient_vector}) in 
     section~\ref{sec:colvarbias_abf}) that only involves atoms of \texttt{main}. 
     This option is only useful for ABF, or custom biases that compute 
     system forces.  See section~\ref{sec:colvarbias_abf} for details.} 
 \end{itemize} 
 This component returns a number (in \AA{}) whose range is determined This component returns a number (in \AA{}) whose range is determined
 by the chosen boundary conditions.  For instance, if the $z$ axis is by the chosen boundary conditions.  For instance, if the $z$ axis is
 used in a simulation with periodic boundaries, the returned value ranges used in a simulation with periodic boundaries, the returned value ranges
Line 1396
Line 1458
 The \texttt{distanceXY~\{...\}} block defines a distance projected on The \texttt{distanceXY~\{...\}} block defines a distance projected on
 a plane, and accepts the same keywords as the component \texttt{distanceZ}, i.e. a plane, and accepts the same keywords as the component \texttt{distanceZ}, i.e.
 \texttt{main}, \texttt{ref}, either \texttt{ref2} or \texttt{axis}, \texttt{main}, \texttt{ref}, either \texttt{ref2} or \texttt{axis},
 and \texttt{oneSiteSystemForce}.  It returns the norm of the and \texttt{oneSiteTotalForce}.  It returns the norm of the
 projection of the distance vector between \texttt{main} and projection of the distance vector between \texttt{main} and
 \texttt{ref} onto the plane orthogonal to the axis.  The axis is \texttt{ref} onto the plane orthogonal to the axis.  The axis is
 defined using the \texttt{axis} parameter or as the vector joining defined using the \texttt{axis} parameter or as the vector joining
 \texttt{ref} and \texttt{ref2} (see \texttt{distanceZ} above). \texttt{ref} and \texttt{ref2} (see \texttt{distanceZ} above).
  
  \begin{cvcoptions}
  \item %
    \dupkey{main}{\texttt{distanceXY}}{colvar|distanceZ|main}{\texttt{distanceZ} component}
  \item %
    \dupkey{ref}{\texttt{distanceXY}}{colvar|distanceZ|ref}{\texttt{distanceZ} component}
  \item %
    \dupkey{ref2}{\texttt{distanceXY}}{colvar|distanceZ|ref2}{\texttt{distanceZ} component}
  \item %
    \dupkey{axis}{\texttt{distanceXY}}{colvar|distanceZ|axis}{\texttt{distanceZ} component}
  \item %
    \dupkey{forceNoPBC}{\texttt{distanceZ}}{colvar|distance|forceNoPBC}{\texttt{distance} component}
  \item %
    \dupkey{oneSiteTotalForce}{\texttt{distanceZ}}{colvar|distance|oneSiteTotalForce}{\texttt{distance} component}
  \end{cvcoptions}
  
  
  
 \cvsubsubsec{\texttt{distanceVec}: distance vector  between two groups.} \cvsubsubsec{\texttt{distanceVec}: distance vector  between two groups.}
 The \texttt{distanceVec~\{...\}} block defines The \texttt{distanceVec~\{...\}} block defines
Line 1410
Line 1488
 \texttt{forceNoPBC}. Its value is the 3-vector joining the centers \texttt{forceNoPBC}. Its value is the 3-vector joining the centers
 of mass of \texttt{group1} and \texttt{group2}. of mass of \texttt{group1} and \texttt{group2}.
  
  \begin{cvcoptions}
  \item %
    \dupkey{group1}{\texttt{distanceVec}}{colvar|distance|group1}{\texttt{distance} component}
  \item %
    \simkey{group2}{\texttt{distanceVec}}{group1}
  \item %
    \dupkey{oneSiteTotalForce}{\texttt{distanceVec}}{colvar|distance|oneSiteTotalForce}{\texttt{distance} component}
  \end{cvcoptions}
  
  
  
 \cvsubsubsec{\texttt{distanceDir}: distance unit vector between two groups.} \cvsubsubsec{\texttt{distanceDir}: distance unit vector between two groups.}
 The \texttt{distanceDir~\{...\}} block defines The \texttt{distanceDir~\{...\}} block defines
Line 1419
Line 1507
 3-dimensional unit vector $\mathbf{d} = (d_{x}, d_{y}, d_{z})$, with 3-dimensional unit vector $\mathbf{d} = (d_{x}, d_{y}, d_{z})$, with
 $|\mathbf{d}| = 1$. $|\mathbf{d}| = 1$.
  
  \begin{cvcoptions}
  \item %
    \dupkey{group1}{\texttt{distanceDir}}{colvar|distance|group1}{\texttt{distance} component}
  \item %
    \simkey{group2}{\texttt{distanceDir}}{group1}
  \item %
    \dupkey{oneSiteTotalForce}{\texttt{distanceDir}}{colvar|distance|oneSiteTotalForce}{\texttt{distance} component}
  \end{cvcoptions}
  
  
 \cvsubsubsec{\texttt{distanceInv}: mean distance between two groups of atoms.} \cvsubsubsec{\texttt{distanceInv}: mean distance between two groups of atoms.}
 The \texttt{distanceInv~\{...\}} block defines a generalized mean distance between two groups of atoms 1 and 2, weighted with exponent $1/n$: The \texttt{distanceInv~\{...\}} block defines a generalized mean distance between two groups of atoms 1 and 2, weighted with exponent $1/n$:
Line 1427
Line 1524
   d_{\mathrm{1,2}}^{[n]} \; = \;   \left(\frac{1}{N_{\mathrm{1}}N_{\mathrm{2}}}\sum_{i,j} \left(\frac{1}{\Vert\mathbf{d}^{ij}\Vert}\right)^{n} \right)^{-1/n}   d_{\mathrm{1,2}}^{[n]} \; = \;   \left(\frac{1}{N_{\mathrm{1}}N_{\mathrm{2}}}\sum_{i,j} \left(\frac{1}{\Vert\mathbf{d}^{ij}\Vert}\right)^{n} \right)^{-1/n}
 \end{equation} \end{equation}
 where $\Vert\mathbf{d}^{ij}\Vert$ is the distance between atoms $i$ and $j$ in groups 1 and 2 respectively, and $n$ is an even integer. where $\Vert\mathbf{d}^{ij}\Vert$ is the distance between atoms $i$ and $j$ in groups 1 and 2 respectively, and $n$ is an even integer.
 This component accepts the same keywords as the component \texttt{distance}: \texttt{group1}, \texttt{group2}, and \texttt{forceNoPBC}.  In addition, the following option may be provided: 
 \begin{itemize} \begin{cvcoptions}
  \item %
    \dupkey{group1}{\texttt{distanceInv}}{colvar|distance|group1}{\texttt{distance} component}
  \item %
    \simkey{group2}{\texttt{distanceInv}}{group1}
  \item %
    \dupkey{oneSiteTotalForce}{\texttt{distanceInv}}{colvar|distance|oneSiteTotalForce}{\texttt{distance} component}
 \item % \item %
   \keydef   \keydef
     {exponent}{%     {exponent}{%
Line 1436
Line 1539
     Exponent $n$ in equation~\ref{eq:distanceInv}}{%     Exponent $n$ in equation~\ref{eq:distanceInv}}{%
     positive even integer}{%     positive even integer}{%
     6}{Defines the exponent to which the individual distances are elevated before averaging.  The default value of 6 is useful for example to applying restraints based on NOE-measured distances.}     6}{Defines the exponent to which the individual distances are elevated before averaging.  The default value of 6 is useful for example to applying restraints based on NOE-measured distances.}
 \end{itemize} \end{cvcoptions}
 This component returns a number in \AA{}, ranging from $0$ to the largest possible distance within the chosen boundary conditions. This component returns a number in \AA{}, ranging from $0$ to the largest possible distance within the chosen boundary conditions.
  
  
  \cvsubsubsec{\texttt{distancePairs}: set of pairwise distances between two groups.}
  The \texttt{distancePairs~\{...\}} block defines a $N_{\mathrm{1}}\times{}N_{\mathrm{2}}$-dimensional variable that includes all mutual distances between the atoms of two groups.
  This can be useful, for example, to develop a new variable defined over two groups, by using the \texttt{scriptedFunction} feature.
  
  \begin{cvcoptions}
  \item %
    \dupkey{group1}{\texttt{distanceInv}}{colvar|distance|group1}{\texttt{distance} component}
  \item %
    \simkey{group2}{\texttt{distanceInv}}{group1}
  \item %
    \dupkey{forceNoPBC}{\texttt{distanceInv}}{colvar|distance|forceNoPBC}{\texttt{distance} component}
  \end{cvcoptions}
  This component returns a $N_{\mathrm{1}}\times{}N_{\mathrm{2}}$-dimensional vector of numbers, each ranging from $0$ to the largest possible distance within the chosen boundary conditions.
  
  
 \cvsubsubsec{\texttt{cartesian}: vector of atomic Cartesian coordinates.} \cvsubsubsec{\texttt{cartesian}: vector of atomic Cartesian coordinates.}
 The \texttt{cartesian~\{...\}} block defines a component returning a flat vector containing The \texttt{cartesian~\{...\}} block defines a component returning a flat vector containing
 the Cartesian coordinates of all participating atoms, in the order the Cartesian coordinates of all participating atoms, in the order
 $(x_1, y_1, z_1, \cdots, x_n, y_n, z_n)$. $(x_1, y_1, z_1, \cdots, x_n, y_n, z_n)$.
 This component accepts the following keyword: 
 \begin{itemize} \begin{cvcoptions}
 \item % \item %
   \key   \key
     {atoms}{%     {atoms}{%
Line 1455
Line 1573
     Defines the atoms whose coordinates make up the value of the component.     Defines the atoms whose coordinates make up the value of the component.
     If \texttt{rotateReference} or \texttt{centerReference} are defined, coordinates     If \texttt{rotateReference} or \texttt{centerReference} are defined, coordinates
     are evaluated within the moving frame of reference.}     are evaluated within the moving frame of reference.}
 \end{itemize} \end{cvcoptions}
  
  
 \cvsubsubsec{\texttt{angle}: angle between three groups.} \cvsubsubsec{\texttt{angle}: angle between three groups.}
Line 1464
Line 1582
 the three groups.  It returns an angle (in degrees) within the the three groups.  It returns an angle (in degrees) within the
 interval $[0:180]$. interval $[0:180]$.
  
  \begin{cvcoptions}
  \item %
    \dupkey{group1}{\texttt{angle}}{colvar|distance|group1}{\texttt{distance} component}
  \item %
    \simkey{group2}{\texttt{angle}}{group1}
  \item %
    \simkey{group3}{\texttt{angle}}{group1}
  \item %
    \dupkey{oneSiteTotalForce}{\texttt{angle}}{colvar|distance|oneSiteTotalForce}{\texttt{distance} component}
  \end{cvcoptions}
  
  
  
  \cvsubsubsec{\texttt{dipoleAngle}: angle between two groups and dipole of a third group.}
  The \texttt{dipoleAngle~\{...\}} block defines an angle, and contains the
  three blocks \texttt{group1}, \texttt{group2} and \texttt{group3}, defining
  the three groups, being \texttt{group1} the group where dipole is calculated. 
  It returns an angle (in degrees) within the interval $[0:180]$.
  
  \begin{cvcoptions}
  \item %
    \dupkey{group1}{\texttt{dipoleAngle}}{colvar|distance|group1}{\texttt{distance} component}
  \item %
    \simkey{group2}{\texttt{dipoleAngle}}{group1}
  \item %
    \simkey{group3}{\texttt{dipoleAngle}}{group1}
  \item %
    \dupkey{oneSiteTotalForce}{\texttt{dipoleAngle}}{colvar|distance|oneSiteTotalForce}{\texttt{distance} component}
  \end{cvcoptions}
  
  
 \cvsubsubsec{\texttt{dihedral}: torsional angle between four groups.} \cvsubsubsec{\texttt{dihedral}: torsional angle between four groups.}
 The \texttt{dihedral~\{...\}} block defines a torsional angle, and The \texttt{dihedral~\{...\}} block defines a torsional angle, and
 contains the blocks \texttt{group1}, \texttt{group2}, \texttt{group3} contains the blocks \texttt{group1}, \texttt{group2}, \texttt{group3}
 and \texttt{group4}, defining the four groups.  It returns an angle and \texttt{group4}, defining the four groups.  It returns an angle
 (in degrees) within the interval $[-180:180]$.  The colvar module (in degrees) within the interval $[-180:180]$.  The Colvars module
 calculates all the distances between two angles taking into account calculates all the distances between two angles taking into account
 periodicity.  For instance, reference values for restraints or range periodicity.  For instance, reference values for restraints or range
 boundaries can be defined by using any real number of choice. boundaries can be defined by using any real number of choice.
 \begin{itemize} 
 \item \keydef \begin{cvcoptions}
     {oneSiteSystemForce}{% \item %
     \texttt{angle}, \texttt{dihedral}}{%   \dupkey{group1}{\texttt{dihedral}}{colvar|distance|group1}{\texttt{distance} component}
     Measure system force on group 1 only?}{% \item %
     boolean}{%   \simkey{group2}{\texttt{dihedral}}{group1}
     \texttt{no}}{% \item %
     If this is set to \texttt{yes}, the system force is measured along   \simkey{group3}{\texttt{dihedral}}{group1}
     a vector field (see equation~(\ref{eq:gradient_vector}) in \item %
     section~\ref{sec:colvarbias_abf}) that only involves atoms of   \simkey{group4}{\texttt{dihedral}}{group1}
     \texttt{group1}.  See section~\ref{sec:colvarbias_abf} for an \item %
     example.}   \dupkey{oneSiteTotalForce}{\texttt{dihedral}}{colvar|distance|oneSiteTotalForce}{\texttt{distance} component}
 \end{itemize} \end{cvcoptions}
  
  
 \cvsubsubsec{\texttt{coordNum}: coordination number between two groups.} \cvsubsubsec{\texttt{coordNum}: coordination number between two groups.}
Line 1504
Line 1652
       1 - (|\mathbf{x}_{i}-\mathbf{x}_{j}|/d_{0})^{m} }       1 - (|\mathbf{x}_{i}-\mathbf{x}_{j}|/d_{0})^{m} }
   }   }
 \end{equation} \end{equation}
 This colvar component accepts the same keywords as the component \texttt{distance}, 
 \texttt{group1} and \texttt{group2}.  In addition to them, it 
 recognizes the following keywords: 
  
 \begin{itemize} \begin{cvcoptions}
  
 \item % \item %
    \labelkey{colvar|coordNum|group1}
    \dupkey{group1}{\texttt{coordNum}}{colvar|distance|group1}{\texttt{distance} component}
  
  \item %
    \labelkey{colvar|coordNum|group2}
    \simkey{group2}{\texttt{coordNum}}{group1}
  
  \item %
    \labelkey{colvar|coordNum|cutoff}
   \keydef   \keydef
     {cutoff}{%     {cutoff}{%
     \texttt{coordNum}}{%     \texttt{coordNum}}{%
Line 1525
Line 1679
     for a proper behavior, $m$ must be larger than $n$.}     for a proper behavior, $m$ must be larger than $n$.}
  
 \item % \item %
    \labelkey{colvar|coordNum|cutoff3}
   \keydef   \keydef
     {cutoff3}{%     {cutoff3}{%
     \texttt{coordNum}}{%     \texttt{coordNum}}{%
Line 1536
Line 1691
     \texttt{cutoff}.}     \texttt{cutoff}.}
  
 \item % \item %
    \labelkey{colvar|coordNum|expNumer}
   \keydef   \keydef
     {expNumer}{%     {expNumer}{%
     \texttt{coordNum}}{%     \texttt{coordNum}}{%
Line 1545
Line 1701
     This number defines the $n$ exponent for the switching function.}     This number defines the $n$ exponent for the switching function.}
  
 \item % \item %
    \labelkey{colvar|coordNum|expDenom}
   \keydef   \keydef
     {expDenom}{%     {expDenom}{%
     \texttt{coordNum}}{%     \texttt{coordNum}}{%
Line 1554
Line 1711
     This number defines the $m$ exponent for the switching function.}     This number defines the $m$ exponent for the switching function.}
  
 \item % \item %
    \labelkey{colvar|coordNum|group2CenterOnly}
   \keydef   \keydef
     {group2CenterOnly}{%     {group2CenterOnly}{%
     \texttt{coordNum}}{%     \texttt{coordNum}}{%
Line 1564
Line 1722
     If this option is \texttt{on}, only contacts between each atoms in \texttt{group1} and the center of mass of     \texttt{group2} are calculated (by default, the sum extends over all pairs of atoms in \texttt{group1} and \texttt{group2}).     If this option is \texttt{on}, only contacts between each atoms in \texttt{group1} and the center of mass of     \texttt{group2} are calculated (by default, the sum extends over all pairs of atoms in \texttt{group1} and \texttt{group2}).
 If \texttt{group2} is a \texttt{dummyAtom}, this option is set to \texttt{yes} by default. If \texttt{group2} is a \texttt{dummyAtom}, this option is set to \texttt{yes} by default.
 } }
  \end{cvcoptions}
 \end{itemize} 
  
 This component returns a dimensionless number, which ranges from This component returns a dimensionless number, which ranges from
 approximately 0 (all interatomic distances are much larger than the approximately 0 (all interatomic distances are much larger than the
Line 1593
Line 1750
 (here defining \emph{all} of the atoms to be considered), (here defining \emph{all} of the atoms to be considered),
 \texttt{cutoff}, \texttt{expNumer}, and \texttt{expDenom}. \texttt{cutoff}, \texttt{expNumer}, and \texttt{expDenom}.
  
  \begin{cvcoptions}
  \item %
    \dupkey{group1}{\texttt{selfCoordNum}}{colvar|coordNum|group1}{\texttt{coordNum} component}
  \item %
    \simkey{group2}{\texttt{selfCoordNum}}{group1}
  \item %
    \dupkey{cutoff}{\texttt{selfCoordNum}}{colvar|coordNum|cutoff}{\texttt{coordNum} component}
  \item %
    \dupkey{cutoff3}{\texttt{selfCoordNum}}{colvar|coordNum|cutoff3}{\texttt{coordNum} component}
  \item %
    \dupkey{expNumer}{\texttt{selfCoordNum}}{colvar|coordNum|expNumer}{\texttt{coordNum} component}
  \item %
    \dupkey{expDenom}{\texttt{selfCoordNum}}{colvar|coordNum|expDenom}{\texttt{coordNum} component}
  \end{cvcoptions}
  
 This component returns a dimensionless number, which ranges from This component returns a dimensionless number, which ranges from
 approximately 0 (all interatomic distances much larger than the approximately 0 (all interatomic distances much larger than the
 cutoff) to $N_{\mathtt{group1}} \times (N_{\mathtt{group1}} - 1) / 2$ (all cutoff) to $N_{\mathtt{group1}} \times (N_{\mathtt{group1}} - 1) / 2$ (all
Line 1614
Line 1786
 with values between 0 (acceptor and donor far outside the cutoff with values between 0 (acceptor and donor far outside the cutoff
 distance) and 1 (acceptor and donor much closer than the cutoff). distance) and 1 (acceptor and donor much closer than the cutoff).
  
  \begin{cvcoptions}
  \item %
    \key
      {acceptor}{%
      \texttt{hBond}}{%
      Number of the acceptor atom}{%
      positive integer}{%
      Number that uses the same convention as \texttt{atomNumbers}.}
  \item %
    \simkey{donor}{\texttt{hBond}}{acceptor}
  \item %
    \dupkey{cutoff}{\texttt{hBond}}{colvar|coordNum|cutoff}{\texttt{coordNum} component}\\
    \textbf{Note:} default value is 3.3~\AA.
  \item %
    \dupkey{expNumer}{\texttt{hBond}}{colvar|coordNum|expNumer}{\texttt{coordNum} component}\\
    \textbf{Note:} default value is 6.
  \item %
    \dupkey{expDenom}{\texttt{hBond}}{colvar|coordNum|expDenom}{\texttt{coordNum} component}\\
    \textbf{Note:} default value is 8.
  \end{cvcoptions}
  
 \cvsubsubsec{\texttt{rmsd}: root mean square displacement  (RMSD) from reference positions.} \cvsubsubsec{\texttt{rmsd}: root mean square displacement  (RMSD) from reference positions.}
 The block \texttt{rmsd~\{...\}} defines the root mean square replacement The block \texttt{rmsd~\{...\}} defines the root mean square replacement
Line 1644
Line 1836
 reference~\cite{Coutsias2004}, which guarantees a continuous reference~\cite{Coutsias2004}, which guarantees a continuous
 dependence of dependence of
 $U^{\{\mathbf{x}_{i}(t)\}\rightarrow\{\mathbf{x}_{i}^{\mathrm{(ref)}}\}}$ $U^{\{\mathbf{x}_{i}(t)\}\rightarrow\{\mathbf{x}_{i}^{\mathrm{(ref)}}\}}$
 with respect to $\{\mathbf{x}_{i}(t)\}$.  The options for \texttt{rmsd} with respect to $\{\mathbf{x}_{i}(t)\}$.
 are: 
 \begin{itemize} \begin{cvcoptions}
  
 \item % \item %
    \labelkey{colvar|rmsd|atoms}
   \key   \key
     {atoms}{%     {atoms}{%
     \texttt{rmsd}}{%     \texttt{rmsd}}{%
Line 1662
Line 1855
     }     }
  
 \item % \item %
    \labelkey{colvar|rmsd|refPositions}
   \key   \key
     {refPositions}{%     {refPositions}{%
     \texttt{rmsd}}{%     \texttt{rmsd}}{%
     Reference coordinates}{%     Reference coordinates}{%
     space-separated list of \texttt{(x, y, z)} triplets}{%     space-separated list of \texttt{(x, y, z)} triplets}{%
     This option\cvnamebasedonly{ (mutually exclusive with \texttt{refPositionsFile})}     This option (mutually exclusive with \texttt{refPositionsFile}) sets the reference coordinates.  If only \texttt{centerReference} is \texttt{on}, the list can be a single (x, y, z) triplet; if also \texttt{rotateReference} is \texttt{on}, the list should be as long as the atom group.  This option 
     sets the reference coordinates.  If only \texttt{centerReference} is \texttt{on}, the list can be a single (x, y, z) triplet; if also \texttt{rotateReference} is \texttt{on}, the list should be as long as the atom group.  This option  
     is independent from that with the same keyword within the     is independent from that with the same keyword within the
     \texttt{atoms~\{...\}} block (see \ref{sec:colvar_atom_groups}).  The latter (and related fitting     \texttt{atoms~\{...\}} block (see \ref{key:colvars:atom_group:refPositions}).  The latter (and related fitting
     options for the atom group) are normally not needed,     options for the atom group) are normally not needed,
     and should be omitted altogether except for advanced usage cases.     and should be omitted altogether except for advanced usage cases.
     }     }
  
 \cvnamebasedonly{ 
 \item % \item %
    \labelkey{colvar|rmsd|refPositionsFile}
   \key   \key
     {refPositionsFile}{%     {refPositionsFile}{%
     \texttt{rmsd}}{%     \texttt{rmsd}}{%
     Reference coordinates file}{%     Reference coordinates file}{%
     UNIX filename}{%     UNIX filename}{%
     This option (mutually exclusive with \texttt{refPositions}) sets     This option (mutually exclusive with \texttt{refPositions}) sets the file name for the reference coordinates to be compared with.  The format is the same as that provided by \texttt{refPositionsFile} within an atom group's definition (see \ref{key:colvars:atom_group:refPositionsFile}).
     the PDB file name for the reference coordinates to be compared 
     with.  The format is the same as that provided by 
     \texttt{refPositionsFile} within an atom group definition. 
     }     }
  
  \cvnamebasedonly{
 \item % \item %
    \labelkey{colvar|rmsd|refPositionsCol}
   \key   \key
     {refPositionsCol}{%     {refPositionsCol}{%
     \texttt{rmsd}}{%     \texttt{rmsd}}{%
     PDB column containing atom flags}{%     PDB column containing atom flags}{%
     \texttt{O}, \texttt{B}, \texttt{X}, \texttt{Y}, or \texttt{Z}}{%     \texttt{O}, \texttt{B}, \texttt{X}, \texttt{Y}, or \texttt{Z}}{%
     If \texttt{refPositionsFile} is defined, and the file contains     If \texttt{refPositionsFile} is a PDB file that contains all the atoms in the topology, this option may be provided to set which PDB field is used to flag the reference coordinates for \texttt{atoms}.
     all the atoms in the topology, this option may be povided to 
     set which PDB field is 
     used to flag the reference coordinates for \texttt{atoms}. 
   }   }
  
 \item % \item %
    \labelkey{colvar|rmsd|refPositionsColValue}
   \key   \key
     {refPositionsColValue}{%     {refPositionsColValue}{%
     \texttt{rmsd}}{%     \texttt{rmsd}}{%
Line 1712
Line 1902
     with a non-zero value are read.     with a non-zero value are read.
   }   }
 } }
  \end{cvcoptions}
 \end{itemize} 
 This component returns a positive real number (in \AA). This component returns a positive real number (in \AA).
  
 \cvsubsubsec{Advanced usage of the \texttt{rmsd} component.}  \cvsubsubsec{Advanced usage of the \texttt{rmsd} component.} 
Line 1740
Line 1929
 \item disabling the application of optimal roto-translations, which \item disabling the application of optimal roto-translations, which
 lets the RMSD component decribe the deviation of atoms lets the RMSD component decribe the deviation of atoms
 from fixed positions in the laboratory frame: this allows for custom from fixed positions in the laboratory frame: this allows for custom
 positional restraints within the colvars module; positional restraints within the Colvars module;
 \item fitting the atomic positions to different reference coordinates \item fitting the atomic positions to different reference coordinates
 than those used in the RMSD calculation itself; than those used in the RMSD calculation itself;
 \item applying the optimal rotation and/or translation from a separate \item applying the optimal rotation and/or translation from a separate
 atom group, defined through \texttt{refPositionsGroup}: the RMSD then atom group, defined through \texttt{fittingGroup}: the RMSD then
 reflects the deviation from reference coordinates in a separate, moving reflects the deviation from reference coordinates in a separate, moving
 reference frame. reference frame.
 \end{enumerate} \end{enumerate}
Line 1773
Line 1962
 Example choices for $(\mathbf{v}_{i})$ are an eigenvector Example choices for $(\mathbf{v}_{i})$ are an eigenvector
 of the covariance matrix (essential mode), or a normal of the covariance matrix (essential mode), or a normal
 mode of the system.  It is assumed that $\sum_{i}\mathbf{v}_{i} = 0$: mode of the system.  It is assumed that $\sum_{i}\mathbf{v}_{i} = 0$:
 otherwise, the colvars module centers the $\mathbf{v}_{i}$ otherwise, the Colvars module centers the $\mathbf{v}_{i}$
 automatically when reading them from the configuration. automatically when reading them from the configuration.
  
 As for the component \texttt{rmsd}, the available options are \texttt{atoms}\cvnamebasedonly{, \texttt{refPositionsFile}, \texttt{refPositionsCol} and \texttt{refPositionsColValue}, } and \texttt{refPositions}. \begin{cvcoptions}
 In addition, the following are recognized: \item %
 \begin{itemize}   \dupkey{atoms}{\texttt{eigenvector}}{colvar|rmsd|atoms}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositions}{\texttt{eigenvector}}{colvar|rmsd|refPositions}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositionsFile}{\texttt{eigenvector}}{colvar|rmsd|refPositionsFile}{\texttt{rmsd} component}
  \cvnamebasedonly{
  \item %
    \dupkey{refPositionsCol}{\texttt{eigenvector}}{colvar|rmsd|refPositionsCol}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositionsColValue}{\texttt{eigenvector}}{colvar|rmsd|refPositionsColValue}{\texttt{rmsd} component}
  }
  
 \item % \item %
   \key   \key
Line 1831
Line 2030
 This allows to conveniently define a colvar $\xi$ as a projection on the linear transformation between two sets of positions, ``A'' and ``B''. This allows to conveniently define a colvar $\xi$ as a projection on the linear transformation between two sets of positions, ``A'' and ``B''.
 For convenience, the vector is also normalized so that $\xi = 0$ when the atoms are at the set of positions ``A'' and $\xi = 1$ at the set of positions ``B''. For convenience, the vector is also normalized so that $\xi = 0$ when the atoms are at the set of positions ``A'' and $\xi = 1$ at the set of positions ``B''.
 } }
  \end{cvcoptions}
 \end{itemize} 
 This component returns a number (in \AA), whose value ranges between This component returns a number (in \AA), whose value ranges between
 the smallest and largest absolute positions in the unit cell during the smallest and largest absolute positions in the unit cell during
 the simulations (see also \texttt{distanceZ}).  Due to the the simulations (see also \texttt{distanceZ}).  Due to the
Line 1856
Line 2054
 define the atom group, and returns a positive number, expressed in define the atom group, and returns a positive number, expressed in
 \AA{}. \AA{}.
  
  \begin{cvcoptions}
  \item %
    \dupkey{atoms}{\texttt{gyration}}{colvar|rmsd|atoms}{\texttt{rmsd} component}
  \end{cvcoptions}
  
 \cvsubsubsec{\texttt{inertia}: total moment of inertia of a group  of atoms.} \cvsubsubsec{\texttt{inertia}: total moment of inertia of a group  of atoms.}
 The block \texttt{inertia~\{...\}} defines the The block \texttt{inertia~\{...\}} defines the
Line 1873
Line 2075
 define the atom group, and returns a positive number, expressed in define the atom group, and returns a positive number, expressed in
 \AA{}$^{2}$. \AA{}$^{2}$.
  
  \begin{cvcoptions}
  \item %
    \dupkey{atoms}{\texttt{inertia}}{colvar|rmsd|atoms}{\texttt{rmsd} component}
  \end{cvcoptions}
  
 \cvsubsubsec{\texttt{inertiaZ}: total moment of inertia of a group of atoms around a chosen axis.} \cvsubsubsec{\texttt{inertiaZ}: total moment of inertia of a group of atoms around a chosen axis.}
 The block \texttt{inertiaZ~\{...\}} defines the The block \texttt{inertiaZ~\{...\}} defines the
Line 1888
Line 2094
 \emph{Note that all atomic masses are set to 1 for simplicity.} \emph{Note that all atomic masses are set to 1 for simplicity.}
 This component must contain one \texttt{atoms~\{...\}} block to This component must contain one \texttt{atoms~\{...\}} block to
 define the atom group, and returns a positive number, expressed in define the atom group, and returns a positive number, expressed in
 \AA{}$^{2}$.  The following option may also be provided: \AA{}$^{2}$.
 \begin{itemize} 
  \begin{cvcoptions}
  \item %
    \dupkey{atoms}{\texttt{inertiaZ}}{colvar|rmsd|atoms}{\texttt{rmsd} component}
 \item % \item %
   \keydef   \keydef
     {axis}{%     {axis}{%
Line 1899
Line 2108
     \texttt{(0.0, 0.0, 1.0)}}{%     \texttt{(0.0, 0.0, 1.0)}}{%
     The three components of this vector define (when normalized) the     The three components of this vector define (when normalized) the
     projection axis $\mathbf{e}$.}     projection axis $\mathbf{e}$.}
 \end{itemize} \end{cvcoptions}
  
  
 \cvsubsubsec{\texttt{orientation}: orientation from reference  coordinates.} \cvsubsubsec{\texttt{orientation}: orientation from reference  coordinates.}
Line 1921
Line 2130
 to and from a $4\times{}4$ rotation matrix in a format suitable for to and from a $4\times{}4$ rotation matrix in a format suitable for
 usage in VMD. usage in VMD.
  
 As for the component \texttt{rmsd}, the available options are \texttt{atoms}\cvnamebasedonly{, \texttt{refPositionsFile}, \texttt{refPositionsCol} and \texttt{refPositionsColValue}, } and \texttt{refPositions}. As for the component \texttt{rmsd}, the available options are \texttt{atoms}, \texttt{refPositionsFile}\cvnamebasedonly{, \texttt{refPositionsCol} and \texttt{refPositionsColValue}, } and \texttt{refPositions}.
  
 \textbf{Note:} \texttt{refPositions}\cvnamebasedonly{ and \texttt{refPositionsFile}} define the set of positions \emph{from which} the optimal rotation is calculated, but this rotation is not applied to the coordinates of the atoms involved: it is used instead to define the variable itself. \textbf{Note:} \texttt{refPositions}and \texttt{refPositionsFile} define the set of positions \emph{from which} the optimal rotation is calculated, but this rotation is not applied to the coordinates of the atoms involved: it is used instead to define the variable itself.
  
 \begin{itemize} \begin{cvcoptions}
  \item %
    \dupkey{atoms}{\texttt{orientation}}{colvar|rmsd|atoms}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositions}{\texttt{orientation}}{colvar|rmsd|refPositions}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositionsFile}{\texttt{orientation}}{colvar|rmsd|refPositionsFile}{\texttt{rmsd} component}
  
  \cvnamebasedonly{
  \item %
    \dupkey{refPositionsCol}{\texttt{orientation}}{colvar|rmsd|refPositionsCol}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositionsColValue}{\texttt{orientation}}{colvar|rmsd|refPositionsColValue}{\texttt{rmsd} component}
  }
  
 \item % \item %
   \keydef   \keydef
Line 1941
Line 2163
     possible rotations.  \textbf{Note:} \emph {this only affects the     possible rotations.  \textbf{Note:} \emph {this only affects the
       output, never the dynamics}.}       output, never the dynamics}.}
  
 \end{itemize} \end{cvcoptions}
  
 \textbf{Hint: stopping the rotation of a protein.}  To stop the \textbf{Tip: stopping the rotation of a protein.}  To stop the
 rotation of an elongated macromolecule in solution (and use an rotation of an elongated macromolecule in solution (and use an
 anisotropic box to save water molecules), it is possible to define a anisotropic box to save water molecules), it is possible to define a
 colvar with an \texttt{orientation} component, and restrain it throuh colvar with an \texttt{orientation} component, and restrain it throuh
Line 1957
Line 2179
  
 \cvsubsubsec{\texttt{orientationAngle}: angle of rotation from reference coordinates.}   \cvsubsubsec{\texttt{orientationAngle}: angle of rotation from reference coordinates.}  
 The block \texttt{orientationAngle~\{...\}} accepts the same base options as The block \texttt{orientationAngle~\{...\}} accepts the same base options as
 the component \texttt{orientation}: \texttt{atoms} and \texttt{refPositions}\cvnamebasedonly{, or \texttt{refPositionsFile}, \texttt{refPositionsCol} and \texttt{refPositionsColValue}}. the component \texttt{orientation}: \texttt{atoms}, \texttt{refPositions}, \texttt{refPositionsFile}\cvnamebasedonly{, \texttt{refPositionsCol} and \texttt{refPositionsColValue}}.
 The returned value is the angle of rotation $\theta$ between the current and the reference positions. The returned value is the angle of rotation $\theta$ between the current and the reference positions.
 This angle is expressed in degrees within the range [0$^{\circ}$:180$^{\circ}$]. This angle is expressed in degrees within the range [0$^{\circ}$:180$^{\circ}$].
  
  \begin{cvcoptions}
  \item %
    \dupkey{atoms}{\texttt{orientationAngle}}{colvar|rmsd|atoms}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositions}{\texttt{orientationAngle}}{colvar|rmsd|refPositions}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositionsFile}{\texttt{orientationAngle}}{colvar|rmsd|refPositionsFile}{\texttt{rmsd} component}
  
  \cvnamebasedonly{
  \item %
    \dupkey{refPositionsCol}{\texttt{orientationAngle}}{colvar|rmsd|refPositionsCol}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositionsColValue}{\texttt{orientationAngle}}{colvar|rmsd|refPositionsColValue}{\texttt{rmsd} component}
  }
  
  \end{cvcoptions}
  
 \cvsubsubsec{\texttt{orientationProj}: cosine of the angle of rotation from reference coordinates.}   \cvsubsubsec{\texttt{orientationProj}: cosine of the angle of rotation from reference coordinates.}  
 The block \texttt{orientationProj~\{...\}} accepts the same base options as The block \texttt{orientationProj~\{...\}} accepts the same base options as
 the component \texttt{orientation}: \texttt{atoms} and \texttt{refPositions}\cvnamebasedonly{, or \texttt{refPositionsFile}, \texttt{refPositionsCol} and \texttt{refPositionsColValue}}. the component \texttt{orientation}: \texttt{atoms}, \texttt{refPositions}, \texttt{refPositionsFile}\cvnamebasedonly{, \texttt{refPositionsCol} and \texttt{refPositionsColValue}}.
 The returned value is the cosine of the angle of rotation $\theta$ between the current and the reference positions. The returned value is the cosine of the angle of rotation $\theta$ between the current and the reference positions.
 The range of values is [-1:1]. The range of values is [-1:1].
  
  \begin{cvcoptions}
  \item %
    \dupkey{atoms}{\texttt{orientationProj}}{colvar|rmsd|atoms}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositions}{\texttt{orientationProj}}{colvar|rmsd|refPositions}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositionsFile}{\texttt{orientationProj}}{colvar|rmsd|refPositionsFile}{\texttt{rmsd} component}
  \cvnamebasedonly{
  \item %
    \dupkey{refPositionsCol}{\texttt{orientationProj}}{colvar|rmsd|refPositionsCol}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositionsColValue}{\texttt{orientationProj}}{colvar|rmsd|refPositionsColValue}{\texttt{rmsd} component}
  }
  \end{cvcoptions}
  
  
 \cvsubsubsec{\texttt{spinAngle}: angle of rotation around a given axis.} \cvsubsubsec{\texttt{spinAngle}: angle of rotation around a given axis.}
 The complete rotation described by \texttt{orientation} can optionally be decomposed into two sub-rotations: one is a ``\emph{spin}'' rotation around \textbf{e}, and the other a ``\emph{tilt}'' rotation around an axis orthogonal to \textbf{e}. The complete rotation described by \texttt{orientation} can optionally be decomposed into two sub-rotations: one is a ``\emph{spin}'' rotation around \textbf{e}, and the other a ``\emph{tilt}'' rotation around an axis orthogonal to \textbf{e}.
 The component \texttt{spinAngle} measures the angle of the ``spin'' sub-rotation around \textbf{e}. The component \texttt{spinAngle} measures the angle of the ``spin'' sub-rotation around \textbf{e}.
 This can be defined using the same options as the component \texttt{orientation}: \texttt{atoms} and \texttt{refPositions}\cvnamebasedonly{, or \texttt{refPositionsFile}, \texttt{refPositionsCol} and \texttt{refPositionsColValue}}. 
 In addition, \texttt{spinAngle} accepts the \texttt{axis} option: \begin{cvcoptions}
 \begin{itemize} \item %
    \dupkey{atoms}{\texttt{spinAngle}}{colvar|rmsd|atoms}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositions}{\texttt{spinAngle}}{colvar|rmsd|refPositions}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositionsFile}{\texttt{spinAngle}}{colvar|rmsd|refPositionsFile}{\texttt{rmsd} component}
  \cvnamebasedonly{
 \item % \item %
    \dupkey{refPositionsCol}{\texttt{spinAngle}}{colvar|rmsd|refPositionsCol}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositionsColValue}{\texttt{spinAngle}}{colvar|rmsd|refPositionsColValue}{\texttt{rmsd} component}
  }
  \item %
    \labelkey{colvar|spinAngle|axis}
   \keydef   \keydef
     {axis}{%     {axis}{%
     \texttt{tilt, spinAngle}}{%     \texttt{tilt}}{%
     Special rotation axis (\AA{})}{%     Special rotation axis (\AA{})}{%
     \texttt{(x, y, z)} triplet}{%     \texttt{(x, y, z)} triplet}{%
     \texttt{(0.0, 0.0, 1.0)}}{%     \texttt{(0.0, 0.0, 1.0)}}{%
     The three components of this vector define (when normalized) the special rotation axis used to calculate the \texttt{tilt} and \texttt{spinAngle} components.}     The three components of this vector define (when normalized) the special rotation axis used to calculate the \texttt{tilt} and \texttt{spinAngle} components.}
 \end{itemize} \end{cvcoptions}
 The component \texttt{spinAngle} returns an angle (in degrees) within the periodic interval $[-180:180]$.   The component \texttt{spinAngle} returns an angle (in degrees) within the periodic interval $[-180:180]$.  
  
 \textbf{Note:} the value of \texttt{spinAngle} is a continuous function almost everywhere, with the exception of configurations with the corresponding ``tilt'' angle equal to 180$^\circ$ (i.e.~the \texttt{tilt} component is equal to $-1$): in those cases, \texttt{spinAngle} is undefined.  If such configurations are expected, consider defining a \texttt{tilt} colvar using the same axis \textbf{e}, and restraining it with a lower wall away from $-1$. \textbf{Note:} the value of \texttt{spinAngle} is a continuous function almost everywhere, with the exception of configurations with the corresponding ``tilt'' angle equal to 180$^\circ$ (i.e.~the \texttt{tilt} component is equal to $-1$): in those cases, \texttt{spinAngle} is undefined.  If such configurations are expected, consider defining a \texttt{tilt} colvar using the same axis \textbf{e}, and restraining it with a lower wall away from $-1$.
Line 1995
Line 2260
 The component \texttt{tilt} relies on the same options as \texttt{spinAngle}, including the definition of the axis \textbf{e}. The component \texttt{tilt} relies on the same options as \texttt{spinAngle}, including the definition of the axis \textbf{e}.
 The values of \texttt{tilt} are real numbers in the interval $[-1:1]$: the value $1$ represents an orientation fully parallel to \textbf{e} (tilt angle = 0$^\circ$), and the value $-1$ represents an anti-parallel orientation. The values of \texttt{tilt} are real numbers in the interval $[-1:1]$: the value $1$ represents an orientation fully parallel to \textbf{e} (tilt angle = 0$^\circ$), and the value $-1$ represents an anti-parallel orientation.
  
  \begin{cvcoptions}
  \item %
    \dupkey{atoms}{\texttt{tilt}}{colvar|rmsd|atoms}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositions}{\texttt{tilt}}{colvar|rmsd|refPositions}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositionsFile}{\texttt{tilt}}{colvar|rmsd|refPositionsFile}{\texttt{rmsd} component}
  \cvnamebasedonly{
  \item %
    \dupkey{refPositionsCol}{\texttt{tilt}}{colvar|rmsd|refPositionsCol}{\texttt{rmsd} component}
  \item %
    \dupkey{refPositionsColValue}{\texttt{tilt}}{colvar|rmsd|refPositionsColValue}{\texttt{rmsd} component}
  }
  \item %
    \dupkey{axis}{\texttt{tilt}}{colvar|spinAngle|axis}{\texttt{spinAngle} component}
  \end{cvcoptions}
  
 \cvnamebasedonly{ \cvnamebasedonly{
  
Line 2061
Line 2342
 \end{equation} \end{equation}
 and the score function for the $\mathrm{O}^{(n)} \leftrightarrow and the score function for the $\mathrm{O}^{(n)} \leftrightarrow
 \mathrm{N}^{(n+4)}$ hydrogen bond is defined through a \texttt{hBond} \mathrm{N}^{(n+4)}$ hydrogen bond is defined through a \texttt{hBond}
 colvar component on the same atoms.  The options recognized within the colvar component on the same atoms.
 \texttt{alpha~\{...\}} block are: 
 \begin{itemize} \begin{cvcoptions}
  
 \item % \item %
    \labelkey{colvar|alpha|residueRange}
   \key   \key
     {residueRange}{%     {residueRange}{%
       \texttt{alpha}}{%       \texttt{alpha}}{%
       Potential $\alpha$-helical residues}{%       Potential $\alpha$-helical residues}{%
     ``$<$Initial residue number$>$-$<$Final residue number$>$''}{%     ``$<$Initial residue number$>$-$<$Final residue number$>$''}{%
     This option specifies the range of residues on which this     This option specifies the range of residues on which this
     component should be defined.  The colvar module looks for the     component should be defined.  The Colvars module looks for the
     atoms within these residues named ``\texttt{CA}'', ``\texttt{N}''     atoms within these residues named ``\texttt{CA}'', ``\texttt{N}''
     and ``\texttt{O}'', and raises an error if any of those atoms is     and ``\texttt{O}'', and raises an error if any of those atoms is
     not found.}     not found.}
  
 \item % \item %
    \labelkey{colvar|alpha|psfSegID}
   \key   \key
     {psfSegID}{%     {psfSegID}{%
     \texttt{alpha}}{%     \texttt{alpha}}{%
Line 2089
Line 2372
  
  
 \item % \item %
    \labelkey{colvar|alpha|hBondCoeff}
   \keydef   \keydef
     {hBondCoeff}{%     {hBondCoeff}{%
     \texttt{alpha}}{%     \texttt{alpha}}{%
Line 2100
Line 2384
     disables the angle terms.}     disables the angle terms.}
  
 \item % \item %
    \labelkey{colvar|alpha|angleRef}
   \keydef   \keydef
     {angleRef}{%     {angleRef}{%
     \texttt{alpha}}{%     \texttt{alpha}}{%
Line 2111
Line 2396
     (\ref{eq:colvars_alpha_Calpha}).}     (\ref{eq:colvars_alpha_Calpha}).}
  
 \item % \item %
    \labelkey{colvar|alpha|angleTol}
   \keydef   \keydef
     {angleTol}{%     {angleTol}{%
     \texttt{alpha}}{%     \texttt{alpha}}{%
Line 2122
Line 2408
     (\ref{eq:colvars_alpha_Calpha}).}     (\ref{eq:colvars_alpha_Calpha}).}
  
 \item % \item %
    \labelkey{colvar|alpha|hBondCutoff}
   \keydef   \keydef
     {hBondCutoff}{%     {hBondCutoff}{%
     \texttt{alpha}}{%     \texttt{alpha}}{%
Line 2132
Line 2419
     component.}     component.}
  
 \item % \item %
    \labelkey{colvar|alpha|hBondExpNumer}
   \keydef   \keydef
     {hBondExpNumer}{%     {hBondExpNumer}{%
     \texttt{alpha}}{%     \texttt{alpha}}{%
Line 2142
Line 2430
     component.}     component.}
  
 \item % \item %
    \labelkey{colvar|alpha|hBondExpDenom}
   \keydef   \keydef
     {hBondExpDenom}{%     {hBondExpDenom}{%
     \texttt{alpha}}{%     \texttt{alpha}}{%
Line 2151
Line 2440
     Equivalent to the \texttt{expDenom} option in the \texttt{hBond}     Equivalent to the \texttt{expDenom} option in the \texttt{hBond}
     component.}     component.}
  
 \end{itemize} \end{cvcoptions}
  
 This component returns positive values, always comprised between 0 This component returns positive values, always comprised between 0
 (lowest $\alpha$-helical score) and 1 (highest $\alpha$-helical (lowest $\alpha$-helical score) and 1 (highest $\alpha$-helical
Line 2184
Line 2473
 component for defining the relevant residues (\texttt{residueRange} component for defining the relevant residues (\texttt{residueRange}
 and \texttt{psfSegID}) in addition to the following: and \texttt{psfSegID}) in addition to the following:
  
 \begin{itemize} \begin{cvcoptions}
  
  \item %
    \dupkey{residueRange}{\texttt{dihedralPC}}{colvar|alpha|residueRange}{\texttt{alpha} component}
  
  \item %
    \dupkey{psfSegID}{\texttt{dihedralPC}}{colvar|alpha|psfSegID}{\texttt{alpha} component}
  
  \item %
    \dupkey{hBondCoeff}{\texttt{dihedralPC}}{colvar|alpha|hBondCoeff}{\texttt{alpha} component}
  
  \item %
    \dupkey{angleRef}{\texttt{dihedralPC}}{colvar|alpha|angleRef}{\texttt{alpha} component}
  
  \item %
    \dupkey{angleTol}{\texttt{dihedralPC}}{colvar|alpha|angleTol}{\texttt{alpha} component}
  
  \item %
    \dupkey{hBondCutoff}{\texttt{dihedralPC}}{colvar|alpha|hBondCutoff}{\texttt{alpha} component}
  
  \item %
    \dupkey{hBondExpNumer}{\texttt{dihedralPC}}{colvar|alpha|hBondExpNumer}{\texttt{alpha} component}
  
  \item %
    \dupkey{hBondExpDenom}{\texttt{dihedralPC}}{colvar|alpha|hBondExpDenom}{\texttt{alpha} component}
  
 \item % \item %
   \key   \key
     {vectorFile}{%     {vectorFile}{%
Line 2202
Line 2516
     File containing dihedralPCA eigenvector(s)}{%     File containing dihedralPCA eigenvector(s)}{%
     positive integer}{%     positive integer}{%
     Number of the eigenvector to be used for this component.}     Number of the eigenvector to be used for this component.}
 \end{itemize} \end{cvcoptions}
  
 } % end of \cvnamebasedonly } % end of \cvnamebasedonly
  
  
  \cvsubsec{Configuration keywords shared by all components}
  \label{sec:cvc_common}
  
  The following options can be used for any of the above colvar components in order to obtain a polynomial combination\cvscriptonly{ or any user-supplied function provided by the \refkey{scriptedFunction} command}.
  \begin{itemize}
  \item %
    \keydef
      {name}{%
      any component}{%
      Name of this component}{%
      string}{%
      type of component + numeric id}{%
      The name is an unique case-sensitive string which allows the
      Colvars module to identify this component. This is useful, for example,
      when combining multiple components via a \texttt{scriptedFunction}.}
  
  \item %
    \keydef
      {scalable}{%
      any component}{%
      Attempt to calculate this component in parallel?}{%
      boolean}{%
      \texttt{on}, if available}{%
      If set to \texttt{on} (default), the Colvars module will attempt to calculate this component in parallel to reduce overhead.
      Whether this option is available depends on the type of component: currently supported are \texttt{distance}, \texttt{distanceZ}, \texttt{distanceXY}, \texttt{distanceVec}, \texttt{distanceDir}, \texttt{angle} and \texttt{dihedral}.
      This flag influences computational cost, but does not affect numerical results: therefore, it should only be turned off for debugging or testing purposes.
    }
  \end{itemize}
  
  
 \cvsubsec{Advanced usage and special considerations} \cvsubsec{Advanced usage and special considerations}
  \label{sec:cvc_advanced}
  
 \cvsubsubsec{Periodic components.}  \cvsubsubsec{Periodic components.} 
  \label{sec:cvc_periodic}
 The following components returns The following components returns
 real numbers that lie in a periodic interval: real numbers that lie in a periodic interval:
 \begin{itemize} \begin{itemize}
Line 2265
Line 2611
  
  
 \cvsubsubsec{Non-scalar components.} \cvsubsubsec{Non-scalar components.}
  \label{sec:cvc_non_scalar}
 When one of the following components are used, the defined colvar returns a value that is not a scalar number: When one of the following components are used, the defined colvar returns a value that is not a scalar number:
 \begin{itemize} \begin{itemize}
 \item \texttt{distanceVec}: 3-dimensional vector of the distance \item \texttt{distanceVec}: 3-dimensional vector of the distance
Line 2283
Line 2630
  
 Non-scalar components carry the following restrictions: Non-scalar components carry the following restrictions:
 \begin{itemize} \begin{itemize}
 \item Calculation of system forces (\texttt{outputSystemForce} option) \item Calculation of total forces (\texttt{outputTotalForce} option)
   is currently not implemented.   is currently not implemented.
 \item Each colvar can only contain one non-scalar component. \item Each colvar can only contain one non-scalar component.
 \item Binning on a grid (\texttt{abf}, \texttt{histogram} and \item Binning on a grid (\texttt{abf}, \texttt{histogram} and
Line 2297
Line 2644
   of scalar colvars of arbitrary size.}   of scalar colvars of arbitrary size.}
  
  
 \cvsubsubsec{Calculating system forces.} \cvsubsubsec{Calculating total forces.}
  \label{sec:cvc_sys_forces}
 In addition to the restrictions due to the type of value computed (scalar or non-scalar), In addition to the restrictions due to the type of value computed (scalar or non-scalar),
 a final restriction can arise when calculating system force a final restriction can arise when calculating total force
 (\texttt{outputSystemForce} option or application of a \texttt{abf} (\texttt{outputTotalForce} option or application of a \texttt{abf}
 bias).  System forces are available currently only for the following bias).  total forces are available currently only for the following
 components: \texttt{distance}, \texttt{distanceZ}, components: \texttt{distance}, \texttt{distanceZ},
 \texttt{distanceXY}, \texttt{angle}, \texttt{dihedral}, \texttt{rmsd}, \texttt{distanceXY}, \texttt{angle}, \texttt{dihedral}, \texttt{rmsd},
 \texttt{eigenvector} and \texttt{gyration}. \texttt{eigenvector} and \texttt{gyration}.
Line 2347
Line 2695
     \texttt{1}}{%     \texttt{1}}{%
     Defines the power at which the value of this component is raised     Defines the power at which the value of this component is raised
     before being added to the sum.  When this exponent is     before being added to the sum.  When this exponent is
     different than 1 (non-linear sum), system forces and the Jacobian     different than 1 (non-linear sum), total forces and the Jacobian
     force are not available, making the colvar unsuitable for ABF calculations.}     force are not available, making the colvar unsuitable for ABF calculations.}
 \end{itemize} \end{itemize}
  
Line 2361
Line 2709
 \cvscriptonly{ \cvscriptonly{
 \cvsubsec{Colvars as scripted functions of components} \cvsubsec{Colvars as scripted functions of components}
 \label{sec:colvar_scripted} \label{sec:colvar_scripted}
 In contexts that support scripting, a colvar may be defined as When scripting is supported\cvnamdonly{ (default in NAMD)}\cvvmdonly{ (default in VMD)},
 custom scripted function of the values of its components, a colvar may be defined as a
  custom function of its components,
 rather than a linear or polynomial combination. rather than a linear or polynomial combination.
 When implementing generic functions of Cartesian coordinates rather When implementing generic functions of Cartesian coordinates rather
 than functions of existing components, the \texttt{cartesian} component than functions of existing components, the \texttt{cartesian} component
 may be particularly useful. may be particularly useful.
  
 An example of elaborate scripted colvar is given in example 10, in the An example of elaborate scripted colvar is given in example 10, in the
 form of path-based collective variables as defined by Branduardi et al.\cite{Branduardi2007} form of path-based collective variables as defined by Branduardi et al\cite{Branduardi2007}.
 The required Tcl procedures are provided in the colvartools directory. The required Tcl procedures are provided in the \texttt{colvartools} directory.
  
 \begin{itemize} \begin{itemize}
  \item %  \item %
     \labelkey{colvar|scriptedFunction}
   \key   \key
     {scriptedFunction}{%     {scriptedFunction}{%
     \texttt{colvar}}{%     \texttt{colvar}}{%
Line 2483
Line 2833
 tabulated biasing potentials to one or more colvars. See tabulated biasing potentials to one or more colvars. See
 \texttt{inputPrefix} and \texttt{updateBias} below. \texttt{inputPrefix} and \texttt{updateBias} below.
  
  Combining ABF with the extended Lagrangian feature (\ref{sec:colvar_extended})
  of the variables produces the extended-system ABF variant of the method
  (\ref{sec:eABF}).
  
 ABF is based on the thermodynamic integration (TI) scheme for ABF is based on the thermodynamic integration (TI) scheme for
 computing free energy profiles. The free energy as a function computing free energy profiles. The free energy as a function
 of a set of collective variables $\bm{\xi}=(\xi_{i})_{i\in[1,n]}$ of a set of collective variables $\bm{\xi}=(\xi_{i})_{i\in[1,n]}$
Line 2534
Line 2888
 average corresponds to the geometric entropy contribution that appears average corresponds to the geometric entropy contribution that appears
 as a Jacobian correction in the classic formalism~\cite{Carter1989}. as a Jacobian correction in the classic formalism~\cite{Carter1989}.
 Condition~(\ref{eq:ortho_gradient}) states that the direction along Condition~(\ref{eq:ortho_gradient}) states that the direction along
 which the system force on $\xi_{i}$ is measured is orthogonal to the which the total force on $\xi_{i}$ is measured is orthogonal to the
 gradient of $\xi_{j}$, which means that the force measured on $\xi_{i}$ gradient of $\xi_{j}$, which means that the force measured on $\xi_{i}$
 does not act on $\xi_{j}$. does not act on $\xi_{j}$.
  
Line 2579
Line 2933
 Most commonly, the number of variables is one or two. Most commonly, the number of variables is one or two.
  
  
  
 \cvsubsubsec{ABF requirements on collective variables} \cvsubsubsec{ABF requirements on collective variables}
 \label{sec:colvarbias_abf_req} \label{sec:colvarbias_abf_req}
  
  The following conditions must be met for an ABF simulation to be possible and
  to produce an accurate estimate of the free energy profile.
  Note that these requirements do not apply when using the extended-system
  ABF method (\ref{sec:eABF}).
  
 \begin{enumerate} \begin{enumerate}
  \item \emph{Only linear combinations} of colvar components can be used in ABF calculations.  \item \emph{Only linear combinations} of colvar components can be used in ABF calculations.
  \item \emph{Availability of system forces} is necessary. The following colvar components  \item \emph{Availability of total forces} is necessary. The following colvar components
 can be used in ABF calculations: can be used in ABF calculations:
 \texttt{distance}, \texttt{distance\_xy}, \texttt{distance\_z}, \texttt{angle}, \texttt{distance}, \texttt{distance\_xy}, \texttt{distance\_z}, \texttt{angle},
 \texttt{dihedral}, \texttt{gyration},  \texttt{rmsd} and \texttt{eigenvector}. \texttt{dihedral}, \texttt{gyration},  \texttt{rmsd} and \texttt{eigenvector}.
 Atom groups may not be replaced by dummy atoms, unless they are excluded Atom groups may not be replaced by dummy atoms, unless they are excluded
 from the force measurement by specifying \texttt{oneSiteSystemForce}, if available. from the force measurement by specifying \texttt{oneSiteTotalForce}, if available.
  \item \emph{Mutual orthogonality of colvars}. In a multidimensional ABF calculation,  \item \emph{Mutual orthogonality of colvars}. In a multidimensional ABF calculation,
 equation~(\ref{eq:ortho_gradient}) must be satisfied for any two colvars $\xi_{i}$ and $\xi_{j}$. equation~(\ref{eq:ortho_gradient}) must be satisfied for any two colvars $\xi_{i}$ and $\xi_{j}$.
 Various cases fulfill this orthogonality condition: Various cases fulfill this orthogonality condition:
 \begin{itemize} \begin{itemize}
  \item $\xi_{i}$ and $\xi_{j}$ are based on non-overlapping sets of atoms.  \item $\xi_{i}$ and $\xi_{j}$ are based on non-overlapping sets of atoms.
  \item atoms involved in the force measurement on $\xi_{i}$ do not participate in  \item atoms involved in the force measurement on $\xi_{i}$ do not participate in
 the definition of $\xi_{j}$. This can be obtained using the option \texttt{oneSiteSystemForce} the definition of $\xi_{j}$. This can be obtained using the option \texttt{oneSiteTotalForce}
 of the \texttt{distance}, \texttt{angle}, and \texttt{dihedral} components of the \texttt{distance}, \texttt{angle}, and \texttt{dihedral} components
 (example: Ramachandran angles $\phi$, $\psi$). (example: Ramachandran angles $\phi$, $\psi$).
  \item $\xi_{i}$ and $\xi_{j}$ are orthogonal by construction. Useful cases are the sum and  \item $\xi_{i}$ and $\xi_{j}$ are orthogonal by construction. Useful cases are the sum and
Line 2623
Line 2981
 energy gradients are computed. In the direction of each colvar, the grid ranges from energy gradients are computed. In the direction of each colvar, the grid ranges from
 \texttt{lowerBoundary} to \texttt{upperBoundary}, and the bin width (grid spacing) \texttt{lowerBoundary} to \texttt{upperBoundary}, and the bin width (grid spacing)
 is set by the \texttt{width} parameter (see~\ref{sec:colvar_general}). is set by the \texttt{width} parameter (see~\ref{sec:colvar_general}).
 The following specific parameters can be set in the ABF configuration block The following specific parameters can be set in the ABF configuration block:
 (in addition to generic bias parameters such as \texttt{colvars} 
 -- section~\ref{sec:colvarbias}): 
  
 \begin{itemize} \begin{itemize}
  
  \item \dupkey{name}{\texttt{abf}}{sec:colvarbias}{biasing and analysis methods}
  \item \dupkey{colvars}{\texttt{abf}}{sec:colvarbias}{biasing and analysis methods}
  %\item \dupkey{outputEnergy}{sec:colvarbias}{biasing and analysis methods}
  
 \item \keydef{fullSamples}{\texttt{abf}}{% \item \keydef{fullSamples}{\texttt{abf}}{%
     Number of samples in a bin prior     Number of samples in a bin prior
     to application of the ABF}     to application of the ABF}
Line 2671
Line 3032
 \item \keydef{outputFreq}{\texttt{abf}}{% \item \keydef{outputFreq}{\texttt{abf}}{%
     Frequency (in timesteps) at which ABF data files are refreshed}     Frequency (in timesteps) at which ABF data files are refreshed}
   {positive integer}   {positive integer}
   {Colvar module restart frequency}   {Colvars module restart frequency}
   {The files containing the free energy gradient estimate and sampling histogram   {The files containing the free energy gradient estimate and sampling histogram
     (and the PMF in one-dimensional calculations) are written on disk at the given     (and the PMF in one-dimensional calculations) are written on disk at the given
     time interval.}     time interval.}
Line 2728
Line 3089
  
 \cvnamdonly{ \cvnamdonly{
 \cvsubsubsec{Multiple-replica ABF} \cvsubsubsec{Multiple-replica ABF}
  \label{sec:mw-ABF}
  
 \begin{itemize} \begin{itemize}
 \item \keydef{shared}{\texttt{abf}}{% \item \keydef{shared}{\texttt{abf}}{%
Line 2736
Line 3098
   {\texttt{no}}   {\texttt{no}}
   { This is command requires that NAMD be compiled and executed with multiple-replica   { This is command requires that NAMD be compiled and executed with multiple-replica
     support.     support.
     If \texttt{shared} is set to yes, the system force samples will be synchronized among all replicas     If \texttt{shared} is set to yes, the total force samples will be synchronized among all replicas
     at intervals defined by \texttt{sharedFreq}.     at intervals defined by \texttt{sharedFreq}.
     Thus, it is as if system force samples among all replicas are     This implements the multiple-walker ABF scheme described in \cite{Minoukadeh2010}; this
      implementation is documented in \cite{Comer2014c}.
      Thus, it is as if total force samples among all replicas are
     gathered in a single shared buffer, which why the algorithm is referred to as shared ABF.     gathered in a single shared buffer, which why the algorithm is referred to as shared ABF.
     Shared ABF allows all replicas to benefit from the sampling done by other replicas and can lead to faster convergence of the biasing force.     Shared ABF allows all replicas to benefit from the sampling done by other replicas and can lead to faster convergence of the biasing force.
   }   }
Line 2749
Line 3113
   {\texttt{outputFreq}}   {\texttt{outputFreq}}
   {   {
   In the current implementation of shared ABF, each replica maintains a separate   In the current implementation of shared ABF, each replica maintains a separate
   buffer of system force samples that determine the biasing force.   buffer of total force samples that determine the biasing force.
   Every \texttt{sharedFreq} steps, the replicas communicate the samples that   Every \texttt{sharedFreq} steps, the replicas communicate the samples that
   have been gathered since the last synchronization time, ensuring all replicas   have been gathered since the last synchronization time, ensuring all replicas
   apply a similar biasing force.   apply a similar biasing force.
Line 2759
Line 3123
  
 \cvsubsubsec{Output files} \cvsubsubsec{Output files}
  
 The ABF bias produces the following files, all in multicolumn ASCII format: The ABF bias produces the following files, all in multicolumn text format:
 \begin{itemize} \begin{itemize}
 \item \outputName\texttt{.grad}: current estimate of the free energy gradient (grid), \item \outputName\texttt{.grad}: current estimate of the free energy gradient (grid),
   in multicolumn;   in multicolumn;
 \item \outputName\texttt{.count}: total number of samples collected, on the same grid; \item \outputName\texttt{.count}: histogram of samples collected, on the same grid;
 \item \outputName\texttt{.pmf}: only for one-dimensional calculations, integrated \item \outputName\texttt{.pmf}: only for one-dimensional calculations, integrated
   free energy profile or PMF.   free energy profile or PMF.
 \end{itemize} \end{itemize}
Line 2796
Line 3160
 Upon convergence, this bias counteracts optimally the underlying gradient; Upon convergence, this bias counteracts optimally the underlying gradient;
 it is negated to obtain the estimate of the free energy surface. it is negated to obtain the estimate of the free energy surface.
  
 \texttt{abf\_integrate} is invoked using the command-line: \texttt{abf\_integrate} is invoked using the command-line:\\
 {\small {\small \noindent\ttfamily
 \begin{verbatim} abf\_integrate <gradient\_file> [-n <nsteps>] [-t <temp>] [-m (0|1)] [-h <hill\_height>] [-f <factor>]
 integrate <gradient_file> [-n <nsteps>] [-t <temp>] [-m (0|1)] 
                           [-h <hill_height>] [-f <factor>] 
 \end{verbatim} 
 } }
  
 The gradient file name is provided first, followed by other parameters in any order. The gradient file name is provided first, followed by other parameters in any order.
Line 2842
Line 3203
 sampling and discretization on a grid). sampling and discretization on a grid).
  
  
  
  \cvsubsec{Extended-system Adaptive Biasing Force (eABF)}
  \label{sec:eABF}
  
  Extended-system ABF (eABF) is a variant of ABF (\ref{sec:colvarbias_abf})
  where the bias is not applied
  directly to the collective variable, but to an extended coordinate  (``fictitious variable'')
  $\lambda$ that evolves dynamically according to Newtonian or Langevin dynamics.
  Such an extended coordinate is enabled for a given colvar using the
  \texttt{extendedLagrangian} and associated keywords (\ref{sec:colvar_extended}).
  The theory of eABF and the present implementation are documented in detail
  in reference~\cite{Lesage2016}.
  
  Defining an ABF bias on a colvar wherein the \texttt{extendedLagrangian} option
  is active will perform eABF; there is no dedicated option. 
  
  The extended variable $\lambda$ is coupled to the colvar $z=\xi(q)$ by the harmonic potential
  $(k/2) (z - \lambda)^2$.
  Under eABF dynamics, the adaptive bias on $\lambda$ is
  the running estimate of the average spring force:
  \begin{equation}
  F^\mathrm{bias}(\lambda^*) = \left\langle k(\lambda - z) \right\rangle_{\lambda^*}
  \end{equation}
  where the angle brackets indicate a canonical average conditioned by $\lambda=\lambda^*$.
  At long simulation times, eABF produces a flat histogram of the extended variable $\lambda$,
  and a flattened histogram of $\xi$, whose exact shape depends on the strength of the coupling
  as defined by \texttt{extendedFluctuation} in the colvar.
  Coupling should be somewhat loose for faster exploration and convergence, but strong
  enough that the bias does help overcome barriers along the colvar $\xi$.\cite{Lesage2016}
  Distribution of the colvar may be assessed by plotting its histogram, which
  is written to the \outputName\texttt{.zcount} file in every eABF simulation.
  Note that a \texttt{histogram} bias (\ref{sec:colvarbias_histogram})
  applied to an extended-Lagrangian colvar
  will access the extended degree of freedom $\lambda$, not the original colvar $\xi$;
  however, the joint histogram may be explicitly requested by listing the name of the
  colvar twice in a row within the \texttt{colvars} parameter of the \texttt{histogram} block.
  
  The eABF PMF is that of the coordinate $\lambda$, it is not exactly the free energy profile of $\xi$.
  That quantity can be calculated based on \cvnamdonly{either} the CZAR
  estimator\cvnamdonly{ or the Zheng/Yang estimator}.
  
  \cvsubsubsec{CZAR estimator of the free energy}
  
  The \emph{corrected z-averaged restraint} (CZAR) estimator
  is described in detail in reference~\cite{Lesage2016}.
  It is computed automatically in eABF simulations, 
  regardless of the number of colvars involved.
  Note that ABF may also be applied on a combination of extended and non-extended
  colvars; in that case, CZAR still provides an unbiased estimate of the free energy gradient.
  
  CZAR estimates the free energy gradient as:
  \begin{equation}
  A'(z) = - \frac{1}{\beta} \frac{d\ln  \tilde \rho (z)}{dz}  + k (\langle\lambda\rangle_z - z).
  \label{eq:czar}
  \end{equation}
  where $z=\xi(q)$ is the colvar, $\lambda$ is the extended variable harmonically
  coupled to $z$ with a force constant $k$, and $\tilde\rho (z)$ is the observed
  distribution (histogram) of $z$, affected by the eABF bias.
  
  There is only one optional parameter to the CZAR estimator:
  \begin{itemize}
   \item \keydef{writeCZARwindowFile}{\texttt{abf}}{%
  Write internal data from CZAR to a separate file?}
    {boolean}
    {\texttt{no}}
  {When this option is enabled, eABF simulations will write a file containing the 
  $z$-averaged restraint force under the name \outputName\texttt{.zgrad}.
  The same information is always included in the colvars state file, which is sufficient
  for restarting an eABF simulation.
  These separate file is only useful when joining adjacent windows from a stratified
  eABF simulation, either to continue the simulation in a broader window or to
  compute a CZAR estimate of the PMF over the full range of the coordinate(s).}
  \end{itemize}
  
  Similar to ABF, the CZAR estimator produces two output files in multicolumn text format:
  \begin{itemize}
  \item \outputName\texttt{.czar.grad}: current estimate of the free energy gradient (grid),
    in multicolumn;
  \item \outputName\texttt{.czar.pmf}: only for one-dimensional calculations, integrated
    free energy profile or PMF.
  \end{itemize}
  The sampling histogram associated with the CZAR estimator is the $z$-histogram,
  which is written in the file \outputName\texttt{.zcount}.
  
  \cvnamdonly{
  \cvsubsubsec{Zheng/Yang estimator of the free energy}
  \noindent
  This feature has been contributed to NAMD by the following authors:
  
  \begin{quote}
     Haohao Fu and Christophe Chipot                                                               \\[0.4cm]
     Laboratoire International Associ\'e 
     Centre National de la Recherche Scientifique et University of Illinois at Urbana--Champaign,   \\
     Unit\'e Mixte de Recherche No. 7565, Universit\'e de Lorraine,                                \\
     B.P. 70239, 54506 Vand\oe uvre-lès-Nancy cedex, France
  \end{quote}
  
  \copyright~2016, {\sc Centre National de la Recherche Scientifique}
  \medskip
  
  This implementation is fully documented in \cite{Fu2016}.
  The Zheng and Yang estimator \cite{Zheng2012} is based on Umbrella Integration~\cite{Kastner2005}.
  The free energy gradient is estimated as :
  
  \begin{equation}
  A'(\xi^*) =
  \frac{\displaystyle \sum_{\lambda} N(\xi^*, \lambda) 
  \left[ 
  \frac{(\xi^* - \langle\xi\rangle_{\lambda})}{\beta \sigma_{\lambda}^2} - k (\xi^* - \lambda)
  \right]}
  {\displaystyle \sum_{\lambda} N(\xi^*, \lambda)}
  \label{eq:ZhengYang}
  \end{equation}
  where $\xi$ is the colvar, $\lambda$ is the extended variable harmonically
  coupled to $\xi$ with a force constant $k$,
  $N(\xi, \lambda)$ is the number of samples collected in a
  $(\xi, \lambda)$ bin, which is assumed to be a Gaussian function
  of $\xi$ with mean $\langle\xi\rangle_{\lambda}$ and standard deviation
  $\sigma_{\lambda}$.
  At the present stage, equation \ref{eq:ZhengYang} is implemented 
  through the scripted Colvars interface (\ref{sec:scripting}) for one-- and 
  two--dimensional free-energy calculations. 
  
  To evaluate the Zheng/Yang estimator in an eABF simulation, one needs to set 
  {\tt scriptedColvarForces on} 
  and source the eabf.tcl file found in the lib/eabf directory.
  Here, an example of a configuration file is supplied
  for an eABF simulation:
  
  {\addtolength{\baselineskip}{0.1\baselineskip}\small \noindent \ttfamily
  source~~~~~~~~~~~~~~~~eabf.tcl~~~~~\#~Enables eABF\\
  set~eabf\_inputname~~~~0~~~~~~~~~~~~\#~Prefix for restart files. '0' is used for new run\\
  set~eabf\_outputname~~~output.eabf~~\#~Prefix for output files\\
  set~eabf\_temperature~~300~~~~~~~~~~\#~Temperature used in the calculation\\
  set~eabf\_outputfreq~~~20000~~~~~~~~\#~Frequency at which eABF data files are updated
  }
  
  
  \paragraph*{Usage for multiple--replica eABF.}
  The eABF algorithm can be associated with a multiple--walker strategy \cite{Minoukadeh2010,Comer2014c} (\ref{sec:mw-ABF}).
  To run a multiple--replica eABF simulation, start a multiple-replica 
  NAMD run (option \texttt{+replicas}) and set {\tt shared on} in the Colvars config file to enable 
  the multiple--walker ABF algorithm.
  It should be noted that in contrast with classical MW--ABF simulations, 
  the output files of an MW--eABF simulation only show the free energy estimate of 
  the corresponding replica.
  The output files for the estimator should include the replica number:
  {\small\noindent\ttfamily
  source~eabf.tcl\\
  set~eabf\_inputname~~~~~~0\\
  set~eabf\_outputname~~~~~output.eabf.[myReplica]\\
  set~eabf\_temperature~~~~300\\
  set~eabf\_outputfreq~~~~~20000
  }
  
  One can merge the results, using
  {\ttfamily ./eabf.tcl -mergemwabf [merged\_filename] [eabf\_output1] [eabf\_output2] ...}, 
  e.g.,
  {\ttfamily ./eabf.tcl -mergemwabf merge.eabf eabf.0 eabf.1 eabf.2 eabf.3}.
  
  If one runs an ABF--based calculation, breaking the reaction pathway
  into several non--overlapping windows, one can use
  {\ttfamily ./eabf.tcl -mergesplitwindow [merge\_gradfilename] [output\_gradfile1] [output\_gradfile2] ...}
  to merge the data accrued in these non--overlapping windows. 
  This option can be utilized in both eABF and classical ABF simulations, e.g.,
  {\ttfamily ./eabf.tcl -mergesplitwindow merge.grad window0.grad window1.grad window2.grad}.
  }
  
  
 \cvsubsec{Metadynamics} \cvsubsec{Metadynamics}
 \label{sec:colvarbias_meta} \label{sec:colvarbias_meta}
  
Line 2849
Line 3379
 The metadynamics potential on the colvars $\bm{\xi} = (\xi_{1}, \xi_{2}, \ldots, \xi_{N_{\mathrm{cv}}})$ is defined as: The metadynamics potential on the colvars $\bm{\xi} = (\xi_{1}, \xi_{2}, \ldots, \xi_{N_{\mathrm{cv}}})$ is defined as:
 \begin{equation} \begin{equation}
   \label{eq:colvars_meta_pot}   \label{eq:colvars_meta_pot}
   V_{\mathrm{meta}}(\bm{\xi}) \; = \; {   V_{\mathrm{meta}}(\bm{\xi}(t)) \; = \; {
     \sum_{t' = \delta{}t, \\ 2\delta{}t, \\ \ldots}^{t'<t} W \: {     \sum_{t' = \delta{}t, \\ 2\delta{}t, \\ \ldots}^{t'<t} W \: {
       \prod_{i = 1}^{N_{\mathrm{cv}}}       \prod_{i = 1}^{N_{\mathrm{cv}}}
       \exp\left(-\frac{(\xi_{i}-\xi_{i}(t'))^{2}}{2\delta_{\xi_{i}}^{2}}\right)       \exp\left(-\frac{(\xi_{i}(t)-\xi_{i}(t'))^{2}}{2\sigma_{\xi_{i}}^{2}}\right)
     }     }
   }\mathrm{,}   }\mathrm{,}
 \end{equation} \end{equation}
 where $V_{\mathrm{meta}}$ is the history-dependent potential acting on the \emph{current} values of the colvars $\bm{\xi}$, and depends only parametrically on the \emph{previous} values of the colvars. where $V_{\mathrm{meta}}$ is the history-dependent potential acting on the \emph{current} values of the colvars $\bm{\xi}$, and depends only parametrically on the \emph{previous} values of the colvars.
 $V_{\mathrm{meta}}$ is constructed as a sum of $N_{\mathrm{cv}}$-dimensional repulsive Gaussian ``hills'', whose height is a chosen energy constant $W$, and whose centers are the previously explored configurations $\left(\bm{\xi}(\delta{}t), \bm{\xi}(2\delta{}t), \ldots\right)$. $V_{\mathrm{meta}}$ is constructed as a sum of $N_{\mathrm{cv}}$-dimensional repulsive Gaussian ``hills'', whose height is a chosen energy constant $W$, and whose centers are the previously explored configurations $\left(\bm{\xi}(\delta{}t), \bm{\xi}(2\delta{}t), \ldots\right)$.
 Each Gaussian functions has a width of approximately $2\delta_{\xi_{i}}$ along the direction of the $i$-th colvar. 
  
 During the simulation, the system evolves towards the nearest minimum of the ``effective'' potential of mean force $\tilde{A}(\bm{\xi})$, which is the sum of the ``real'' underlying potential of mean force $A(\bm{\xi})$ and the the metadynamics potential $V_{\mathrm{meta}}(\bm{\xi})$. During the simulation, the system evolves towards the nearest minimum of the ``effective'' potential of mean force $\tilde{A}(\bm{\xi})$, which is the sum of the ``real'' underlying potential of mean force $A(\bm{\xi})$  and the the metadynamics potential, $V_{\mathrm{meta}}(\bm{\xi})$.
 Therefore, at any given time the probability of observing the configuration $\bm{\xi^{*}}$ is proportional to $\exp\left(-\tilde{A}(\bm{\xi^{*}})/\kappa_{\mathrm{B}}T\right)$: this is also the probability that a new Gaussian ``hill'' is added at that configuration. Therefore, at any given time the probability of observing the configuration $\bm{\xi^{*}}$ is proportional to $\exp\left(-\tilde{A}(\bm{\xi^{*}})/\kappa_{\mathrm{B}}T\right)$: this is also the probability that a new Gaussian ``hill'' is added at that configuration.
 If the simulation is run for a sufficiently long time, each local minimum is canceled out by the sum of the Gaussian ``hill'' functions. If the simulation is run for a sufficiently long time, each local minimum is canceled out by the sum of the Gaussian ``hills''.
 At that stage the the ``effective'' potential of mean force $\tilde{A}(\bm{\xi})$ is constant, and $-V_{\mathrm{meta}}(\bm{\xi})$ is an accurate estimator of the ``real'' potential of mean force $A(\bm{\xi})$, save for an additive constant: At that stage the ``effective'' potential of mean force $\tilde{A}(\bm{\xi})$ is constant, and $-V_{\mathrm{meta}}(\bm{\xi})$ is an accurate estimator of the ``real'' potential of mean force $A(\bm{\xi})$,  save for an additive constant:
 \begin{equation} \begin{equation}
   \label{eq:colvars_meta_fes}   \label{eq:colvars_meta_fes}
   A(\bm{\xi}) \; \simeq \; {   A(\bm{\xi}) \; \simeq \; {
Line 2871
Line 3400
   }   }
 \end{equation} \end{equation}
  
 Assuming that the set of collective variables includes all relevant degrees of freedom, the predicted error of the estimate is a simple function of the correlation times of the colvars $\tau_{\xi_{i}}$, and of the user-defined parameters $W$, $\delta_{\xi_{i}}$ and $\delta{}t$ \cite{Bussi2006}.  Assuming that the set of collective variables includes all relevant degrees of freedom, the predicted error of the estimate is a simple function of the correlation times of the colvars $\tau_{\xi_{i}}$, and of the user-defined parameters $W$, $\sigma_{\xi_{i}}$ and $\delta{}t$ \cite{Bussi2006}. 
 In typical applications, a good rule of thumb can be to choose the ratio $W/\delta{}t$ much smaller than $\kappa_{\mathrm{B}}T/\tau_{\bm{\xi}}$, where $\tau_{\bm{\xi}}$ is the longest among $\bm{\xi}$'s correlation times: $\delta_{\xi_{i}}$ then dictates the resolution of the calculated PMF. In typical applications, a good rule of thumb can be to choose the ratio $W/\delta{}t$ much smaller than $\kappa_{\mathrm{B}}T/\tau_{\bm{\xi}}$, where $\tau_{\bm{\xi}}$ is the longest among $\bm{\xi}$'s correlation times: $\sigma_{\xi_{i}}$ then dictates the resolution of the calculated PMF.
  
 %Given $\Delta\xi$ the length of the relevant region of the colvar $\xi$, and $A^{*}$ the highest free energy that needs to be sampled (e.g.~the higher transition state free energy), the upper bound for the required simulation time is of the order of $N_{\mathrm{s}}(\xi) = (A^{*}\Delta\xi)/(W2\delta_{\xi})$ multiples of $\delta{}t$. %Given $\Delta\xi$ the length of the relevant region of the colvar $\xi$, and $A^{*}$ the highest free energy that needs to be sampled (e.g.~the higher transition state free energy), the upper bound for the required simulation time is of the order of $N_{\mathrm{s}}(\xi) = (A^{*}\Delta\xi)/(W2\sigma_{\xi})$ multiples of  $\delta{}t$.
 %In calculations with multiple colvars $\bm{\xi}$, the upper bound is then  %In calculations with multiple colvars $\bm{\xi}$, the upper bound is then 
 %$N_{\mathrm{s}}(\xi_{1}) \times N_{\mathrm{s}}(\xi_{2}) \times \ldots \times %N_{\mathrm{s}}(\xi_{N_{\mathrm{cv}}}) \times \delta{}t$. %$N_{\mathrm{s}}(\xi_{1}) \times N_{\mathrm{s}}(\xi_{2}) \times \ldots \times N_{\mathrm{s}}(\xi_{N_{\mathrm{cv}}}) \times \delta{}t$.
  
 To enable a metadynamics calculation, a \texttt{metadynamics} block must be defined in the colvars configuration file.  To enable a metadynamics calculation, a \texttt{metadynamics} block must be defined in the colvars configuration file. 
 Its only mandatory keyword is the \texttt{colvars} option listing all the variables involved: multidimensional PMFs are obtained by the same \texttt{metadynamics} instance applied to all the colvars. Its mandatory keywords are \texttt{colvars}, which lists all the variables involved, and \texttt{hillWeight}, which specifies the weight parameter $W$.
  The parameters $\delta{}t$ and $\sigma_{\xi}$ specified by the optional keywords \texttt{newHillFrequency} and \texttt{hillWidth}:
 The parameters $W$ and $\delta{}t$ are specified by the keywords \texttt{hillWeight} and \texttt{newHillFrequency}, respectively. 
 The values of these options are optimal for colvars with correlation times $\tau_{\bm{\xi}}$ in the range of a few thousand simulation steps, typical of many biomolecular simulations: 
 \begin{itemize} \begin{itemize}
  
  \item \dupkey{name}{\texttt{metadynamics}}{sec:colvarbias}{biasing and analysis methods}
  \item \dupkey{colvars}{\texttt{metadynamics}}{sec:colvarbias}{biasing and analysis methods}
  \item \dupkey{outputEnergy}{\texttt{metadynamics}}{sec:colvarbias}{biasing and analysis methods}
  
 \item % \item %
   \keydef   \key
     {hillWeight}{%     {hillWeight}{%
     \texttt{metadynamics}}{%     \texttt{metadynamics}}{%
     Height of each hill (\cvnamdonly{kcal/mol}\cvvmdonly{kcal/mol}\cvlammpsonly{unit of energy specified by \texttt{units}})}{%     Height of each hill (\cvnamdonly{kcal/mol}\cvvmdonly{kcal/mol}\cvlammpsonly{unit of energy specified by \texttt{units}})}{%
     positive decimal}{%     positive decimal}{%
     \texttt{0.01}}{%     This option sets the height $W$ of the Gaussian hills that are added during this run.
     This option sets the height $W$ of the hills that are added during     Lower values provide more accurate sampling of the system's degrees of freedom at the price of longer simulation times to complete a PMF calculation based on metadynamics.}
     this run.  Lower values provide more accurate sampling at the price 
     of longer simulation times to complete a PMF calculation.} 
  
 \item % \item %
   \keydef   \keydef
Line 2909
Line 3438
     values provide more accurate sampling at the price of longer     values provide more accurate sampling at the price of longer
     simulation times to complete a PMF calculation.}     simulation times to complete a PMF calculation.}
  
  \item %
    \keydef
      {hillWidth}{%
      \texttt{metadynamics}}{%
      Relative width of a Gaussian hill with respect to the colvar's width}{%
      positive decimal}{%
      $\sqrt{2\pi}/2$}{%
      The Gaussian width along each colvar, $2\sigma_{\xi_{i}}$, is set as the product between this number and the colvar's parameter $w_{i}$ given by \texttt{width} (see \ref{sec:colvar_general}); such product is printed in the standard output of \MDENGINE{}.
      The default value of this number gives a Gaussian hill function whose volume is equal to the product of $\prod_{i}w_{i}$, the volume of one \texttt{histogram} bin (see \ref{sec:colvarbias_histogram}), and $W$.
      \textbf{Tip:} \emph{use this property to estimate the fraction of colvar space covered by the Gaussian bias within a given simulation time.}
      When \texttt{useGrids} is on, the default value also gives acceptable discretization errors~\cite{Fiorin2013}: for smoother visualization, this parameter may be increased and the \texttt{width} $w_{i}$ decreased in the same proportion.
      \textbf{Note:} \emph{values smaller than 1 are not recommended}.}
 \end{itemize} \end{itemize}
  
 It is the user's responsibility to either leave \texttt{hillWeight} and \texttt{newHillFrequency} at their default values, or to change them to match the specifics of each system. 
 The parameter $\delta_{\xi_{i}}$ is instead defined as approximately half the \texttt{width} of the corresponding colvar $\xi_{i}$ (see \ref{sec:colvar_general}). 
  
  
  
 \cvsubsubsec{Output files} \cvsubsubsec{Output files}
 \label{sec:colvarbias_meta_output} \label{sec:colvarbias_meta_output}
Line 2935
Line 3472
  
 \item % \item %
   \keydef   \keydef
     {saveFreeEnergyFile}{%     {keepFreeEnergyFiles}{%
     \texttt{metadynamics}}{%     \texttt{metadynamics}}{%
     Keep all the PMF files}{%     Keep all the PMF files}{%
     boolean}{%     boolean}{%
     \texttt{off}}{%     \texttt{off}}{%
     When \texttt{writeFreeEnergyFile} and this option are \texttt{on},     When \texttt{writeFreeEnergyFile} and this option are \texttt{on}, the step number is included in the file name, thus generating a series of PMF files.
     the step number is included in the file name.  Activating this     Activating this option can be useful to follow more closely the convergence of the simulation, by comparing PMFs separated by short times.}
     option can be useful to follow more closely the convergence of the 
     simulation, by comparing PMFs separated by short times.} 
  
 \end{itemize} \end{itemize}
  
Line 2983
Line 3518
  
 \item % \item %
   \keydef   \keydef
     {hillWidth}{% 
     \texttt{metadynamics}}{% 
     Relative width of the hills}{% 
     positive decimal}{% 
     $\sqrt{2\pi}/2$}{% 
     Along each colvar, the width of each Gaussian hill 
     ($2\delta_{\xi_{i}}$) is given by the product between this number 
     and the colvar's \texttt{width}.  The default value gives hills 
     whose volume is the product of $W$ times the \texttt{width} of all 
     colvars.  For a smoother visualization of the free energy plot, 
     decrease \texttt{width} and increase \texttt{hillWidth} in the same 
     proportion.  \textbf{Note:} \emph{when }\texttt{useGrids}\emph{ is 
     }\texttt{on}\emph{ (default in most cases), values smaller than 1 
       should be avoided to avoid discretization errors}.} 
  
 \item % 
   \keydef 
     {rebinGrids}{%     {rebinGrids}{%
     \texttt{metadynamics}}{%     \texttt{metadynamics}}{%
     Recompute the grids when reading a state     Recompute the grids when reading a state
Line 3042
Line 3560
     When running metadynamics in the long time limit, collective variable space is sampled to a modified     When running metadynamics in the long time limit, collective variable space is sampled to a modified
     temperature $T+\Delta T$.  In conventional metadynamics, the temperature ``boost'' $\Delta T$ would     temperature $T+\Delta T$.  In conventional metadynamics, the temperature ``boost'' $\Delta T$ would
     constantly increases with time.  Instead, in well-tempered metadynamics $\Delta T$ must be defined by the     constantly increases with time.  Instead, in well-tempered metadynamics $\Delta T$ must be defined by the
     user via \texttt{biasTemperature}.  If \texttt{dumpFreeEnergyFile} is enabled, the written PMF includes the     user via \texttt{biasTemperature}.  The written PMF includes the
     scaling factor $(T+\Delta T)/\Delta T$ \cite{Barducci2008}.  A careful choice of $\Delta T$ determines the     scaling factor $(T+\Delta T)/\Delta T$ \cite{Barducci2008}.  A careful choice of $\Delta T$ determines the
     sampling and convergence rate, and is hence crucial to the success of a well-tempered metadynamics     sampling and convergence rate, and is hence crucial to the success of a well-tempered metadynamics
     simulation.}     simulation.}
Line 3139
Line 3657
     PMF from this replica}{%     PMF from this replica}{%
     boolean}{%     boolean}{%
     \texttt{on}}{%     \texttt{on}}{%
     When \texttt{multipleReplicas} is \texttt{on}, tje file     When \texttt{multipleReplicas} is \texttt{on}, the file
     \outputName\texttt{.pmf} contains the combined PMF from all     \outputName\texttt{.pmf} contains the combined PMF from all
     replicas.  Enabling this option produces an additional file     replicas, provided that \texttt{useGrids} is \texttt{on} (default).
      Enabling this option produces an additional file
     \outputName\texttt{.partial.pmf}, which can be useful to     \outputName\texttt{.partial.pmf}, which can be useful to
     quickly monitor the contribution of each replica to the PMF.  The     quickly monitor the contribution of each replica to the PMF.}
     requirements for this option are the same as 
     \texttt{dumpFreeEnergyFile}.} 
  
 \end{itemize} \end{itemize}
  
Line 3219
Line 3736
 The harmonic biasing method may be used to enforce fixed or moving restraints, The harmonic biasing method may be used to enforce fixed or moving restraints,
 including variants of Steered and Targeted MD. Within energy minimization including variants of Steered and Targeted MD. Within energy minimization
 runs, it allows for restrained minimization, e.g. to calculate relaxed potential runs, it allows for restrained minimization, e.g. to calculate relaxed potential
 energy surfaces. In the context of the colvars module,  energy surfaces. In the context of the Colvars module, 
 harmonic potentials are meant according to their textbook definition: harmonic potentials are meant according to their textbook definition:
 $\displaystyle V(\bm{x}) = \frac{1}{2} k (\bm{x} - \bm{x_0})^2$. \begin{equation}
    \label{eq:colvarbias_harmonic}
    V(\xi) = \frac{1}{2} k \left(\frac{\xi - \xi_0}{w_{\xi}}\right)^2
  \end{equation}
 Note that this differs from harmonic bond and angle potentials in common Note that this differs from harmonic bond and angle potentials in common
 force fields, where the factor of one half is typically omitted, force fields, where the factor of one half is typically omitted,
 resulting in a non-standard definition of the force constant. resulting in a non-standard definition of the force constant.
  
  The formula above includes the characteristic length scale $w_{\xi}$ of the colvar $\xi$ (keyword \texttt{width}, see \ref{sec:colvar_general}) to allow the definition of a multi-dimensional restraint with a unified force constant:
  \begin{equation}
    \label{eq:colvarbias_harmonic_multi}
    V(\xi_{1}, \ldots, \xi_{M}) = \frac{1}{2} k \sum_{i=1}^{M} \left(\frac{\xi_{i} - \xi_0}{w_{\xi}}\right)^2
  \end{equation}
  
  If one-dimensional or homogeneous multi-dimensional restraints are defined, and there are no other uses for the parameter $w_{\xi}$, \emph{the parameter} \texttt{width} \emph{can be left at its default value of $1$}.
  
  
 \cvnamdonly{The restraint energy is reported by NAMD under the MISC title.} \cvnamdonly{The restraint energy is reported by NAMD under the MISC title.}
 A harmonic restraint is set up by a \texttt{harmonic~\{...\}} A harmonic restraint is set up by a \texttt{harmonic~\{...\}}
 block, which may contain (in addition to the standard option block, which may contain (in addition to the standard option
 \texttt{colvars}) the following keywords: \texttt{colvars}) the following keywords:
 \begin{itemize} \begin{itemize}
  
  \item \dupkey{name}{\texttt{harmonic}}{sec:colvarbias}{biasing and analysis methods}
  \item \dupkey{colvars}{\texttt{harmonic}}{sec:colvarbias}{biasing and analysis methods}
  \item \dupkey{outputEnergy}{\texttt{harmonic}}{sec:colvarbias}{biasing and analysis methods}
  
 \item % \item %
   \keydef   \keydef
     {forceConstant}{%     {forceConstant}{%
Line 3238
Line 3772
     Scaled force constant (\cvnamdonly{kcal/mol}\cvvmdonly{kcal/mol}\cvlammpsonly{unit of energy specified by \texttt{units}})}{%     Scaled force constant (\cvnamdonly{kcal/mol}\cvvmdonly{kcal/mol}\cvlammpsonly{unit of energy specified by \texttt{units}})}{%
     positive decimal}{%     positive decimal}{%
     \texttt{1.0}}{%     \texttt{1.0}}{%
     This defines a scaled force constant for the harmonic potential.     This defines a scaled force constant $k$ for the harmonic potential (eq.~\ref{eq:colvarbias_harmonic_multi}).
     To ensure consistency for multidimensional restraints, it is     To ensure consistency for multidimensional restraints, it is
     divided internally by the square of the specific \texttt{width}     divided internally by the square of the specific \texttt{width}
     for each colvar involved (which is 1 by default), so that all colvars     for each colvar involved (which is 1 by default), so that all colvars
Line 3255
Line 3789
     \texttt{harmonic}}{%     \texttt{harmonic}}{%
     Initial harmonic restraint centers}{%     Initial harmonic restraint centers}{%
     space-separated list of colvar values}{%     space-separated list of colvar values}{%
     The centers (equilibrium values) of the restraint are entered here.     The centers (equilibrium values) of the restraint, $\xi_{0}$, are entered here.
     The number of values must be the number of requested colvars.     The number of values must be the number of requested colvars.
     Each value is a decimal number if the corresponding colvar returns     Each value is a decimal number if the corresponding colvar returns
     a scalar, a ``\texttt{(x, y, z)}'' triplet if it returns a unit     a scalar, a ``\texttt{(x, y, z)}'' triplet if it returns a unit
     vector or a vector, and a ``\texttt{q0, q1, q2, q3)}'' quadruplet     vector or a vector, and a ``\texttt{(q0, q1, q2, q3)}'' quadruplet
     if it returns a rotational quaternion.  If a colvar has     if it returns a rotational quaternion.  If a colvar has
     periodicities or symmetries, its closest image to the restraint     periodicities or symmetries, its closest image to the restraint
     center is considered when calculating the harmonic potential.}     center is considered when calculating the harmonic potential.}
Line 3407
Line 3941
     the FEP or TI formalisms. For convenience, the code provides an estimate     the FEP or TI formalisms. For convenience, the code provides an estimate
     of the free energy derivative for use in TI. A more complete free energy     of the free energy derivative for use in TI. A more complete free energy
     calculation (particularly with regard to convergence analysis),     calculation (particularly with regard to convergence analysis),
     while not handled by the colvars module, can be performed by post-processing     while not handled by the Colvars module, can be performed by post-processing
     the colvars trajectory, if \texttt{colvarsTrajFrequency} is set to a     the colvars trajectory, if \texttt{colvarsTrajFrequency} is set to a
     suitably small value. It should be noted, however, that restraint     suitably small value. It should be noted, however, that restraint
     free energy calculations may be handled more efficiently by an     free energy calculations may be handled more efficiently by an
Line 3472
Line 4006
  
 \begin{itemize} \begin{itemize}
  
  \item \dupkey{name}{\texttt{linear}}{sec:colvarbias}{biasing and analysis methods}
  \item \dupkey{colvars}{\texttt{linear}}{sec:colvarbias}{biasing and analysis methods}
  %\item \dupkey{outputEnergy}{\texttt{linear}}{sec:colvarbias}{biasing and analysis methods}
  
 \item % \item %
   \keydef   \keydef
     {forceConstant}{%     {forceConstant}{%
Line 3519
Line 4057
 an optimization algorithm until the bias has converged}. an optimization algorithm until the bias has converged}.
  
 \begin{itemize} \begin{itemize}
  
  \item \dupkey{name}{\texttt{alb}}{sec:colvarbias}{biasing and analysis methods}
  \item \dupkey{colvars}{\texttt{alb}}{sec:colvarbias}{biasing and analysis methods}
  %\item \dupkey{outputEnergy}{\texttt{alb}}{sec:colvarbias}{biasing and analysis methods}
  
 \item % \item %
       \key{centers}{\texttt{alb}}{%       \key{centers}{\texttt{alb}}{%
       Collective variable centers}{%       Collective variable centers}{%
Line 3584
Line 4127
 The \texttt{histogram} feature is used to record the distribution of a set of collective The \texttt{histogram} feature is used to record the distribution of a set of collective
 variables in the form of a N-dimensional histogram. variables in the form of a N-dimensional histogram.
 It functions as a ``collective variable bias'', and is invoked by adding a It functions as a ``collective variable bias'', and is invoked by adding a
 \texttt{histogram} block to the \textit{colvars} configuration file. \texttt{histogram} block to the Colvars configuration file.
  
  As with any other biasing and analysis method, when a histogram is applied to
  an extended-system colvar (\ref{sec:colvar_extended}), it accesses the value
  of the fictitious coordinate rather than that of the ``true'' colvar.
  A joint histogram of the ``true'' colvar and the fictitious coordinate
  may be obtained by specifying the colvar name twice in a row
  in the \texttt{colvars} parameter: the first instance will be understood as the
  ``true'' colvar, and the second, as the fictitious coordinate.
  
 In addition to the common parameters \texttt{name} and \texttt{colvars} In addition to the common parameters \texttt{name} and \texttt{colvars}
 described above, a \texttt{histogram} block may define the following parameter: described above, a \texttt{histogram} block may define the following parameter:
  
 \begin{itemize} \begin{itemize}
 \item \keydef{outputFreq}{\texttt{histogram}}{% 
     Frequency (in timesteps) at which the histogram file is refreshed} \item \dupkey{name}{\texttt{histogram}}{sec:colvarbias}{biasing and analysis methods}
   {positive integer} \item \dupkey{colvars}{\texttt{histogram}}{sec:colvarbias}{biasing and analysis methods}
   {Colvar module restart frequency} %\item \dupkey{outputEnergy}{\texttt{histogram}}{sec:colvarbias}{biasing and analysis methods}
   {The file containing histogram data is written on disk at the given time interval.} 
  \item %
    \keydef{%
      outputFreq}{%
      \texttt{histogram}}{%
      Frequency (in timesteps) at which the histogram files are refreshed}{%
      positive integer}{%
      \texttt{colvarsRestartFrequency}}{%
      The histogram data are written to files at the given time interval.
      A value of 0 disables the creation of these files (\textbf{note:} all data to continue a simulation are still included in the state file).}
  
  \item %
    \keydef{%
      outputFile}{%
      \texttt{histogram}}{%
      Write the histogram to a file}{%
      UNIX filename}{%
      \outputName\texttt{.$<$name$>$.dat}}{%
      Name of the file containing histogram data (multicolumn format), which is written every \texttt{outputFreq} steps.
      For the special case of 2 variables, Gnuplot may be used to visualize this file.
    }
  
  \item %
    \keydef{%
      outputFileDX}{%
      \texttt{histogram}}{%
      Write the histogram to a file}{%
      UNIX filename}{%
      \outputName\texttt{.$<$name$>$.dat}}{%
      Name of the file containing histogram data (OpenDX format), which is written every \texttt{outputFreq} steps.
      For the special case of 3 variables, VMD may be used to visualize this file.
  }
  
  
  \item %
    \keydef{%
      gatherVectorColvars}{%
      \texttt{histogram}}{%
      Treat vector variables as multiple observations of a scalar variable?}{%
      UNIX filename}{%
      \texttt{off}}{%
      When this is set to \texttt{on}, the components of a multi-dimensional colvar (e.g.~one based on \texttt{cartesian}, \texttt{distancePairs}, or a vector of scalar numbers given by \texttt{scriptedFunction}) are treated as multiple observations of a scalar variable.
      This results in the histogram being accumulated multiple times for each simulation step\cvvmdonly{ or iteration of \texttt{cv update}}).
      When multiple vector variables are included in \texttt{histogram}, these must have the same length because their components are accumulated together.
      For example, if $\xi$, $\lambda$ and $\tau$ are three variables of dimensions 5, 5 and 1, respectively, for each iteration 5 triplets $(\xi_{i},\lambda_{i},\tau)$ ($i = 1, \ldots 5$) are accumulated into a 3-dimensional histogram.
    }
  
  \item %
    \keydef{%
      weights}{%
      \texttt{histogram}}{%
      Treat vector variables as multiple observations of a scalar variable?}{%
      list of space-separated decimals}{%
      all weights equal to 1}{%
      When \texttt{gatherVectorColvars} is \texttt{on}, the components of each multi-dimensional colvar are accumulated with a different weight.
      For example, if $x$ and $y$ are two distinct \texttt{cartesian} variables defined on the same group of atoms, the corresponding 2D histogram can be weighted on a per-atom basis\cvvmdonly{: to compute an electron density map, it is possible to use \texttt{weights [\${sel} get atomicnumber]}} in the definition of \texttt{histogram}.
    }
  
 \end{itemize} \end{itemize}
  
 Like the ABF and metadynamics biases, \texttt{histogram} uses \cvsubsubsec{Grid definition for multidimensional histograms}
 parameters from the colvars to define its grid.  The grid ranges from \label{sec:colvarbias_histogram_grid}
 \texttt{lowerBoundary} to \texttt{upperBoundary}, and the bin width is 
 set by the \texttt{width} parameter. Like the ABF and metadynamics biases, \texttt{histogram} uses the parameters \texttt{lowerBoundary}, \texttt{upperBoundary}, and \texttt{width} to define its grid.
  These values can be overridden if a configuration block \texttt{histogramGrid \{ \ldots \}} is provided inside the configuration of \texttt{histogram}.
  The options supported inside this configuration block are:
  \begin{itemize}
  \item %
    \key{%
      lowerBoundaries}{%
      \texttt{histogramGrid}}{%
      Lower boundaries of the grid}{%
      list of space-separated decimals}{%
      This option defines the lower boundaries of the grid, overriding any values defined by the \texttt{lowerBoundary} keyword of each colvar.
      Note that when \texttt{gatherVectorColvars} is \texttt{on}, each vector variable is automatically treated as a scalar, and a single value should be provided for it. 
    }
  \item %
    \simkey{upperBoundaries}{\texttt{histogramGrid}}{lowerBoundaries}
  \item %
    \simkey{widths}{\texttt{histogramGrid}}{lowerBoundaries}
  \end{itemize}
  
  
  \cvsubsec{Probability distribution-restraints}
  \label{sec:colvarbias_restraint_histogram}
  
  The \texttt{histogramRestraint} bias implements a continuous potential of many variables (or of a single high-dimensional variable) aimed at reproducing a one-dimensional statistical distribution that is provided by the user.
  The $M$ variables $(\xi_{1}, \ldots, \xi_{M})$ are interpreted as multiple observations of a random variable $\xi$ with unknown probability distribution.
  The potential is minimized when the histogram $h(\xi)$, estimated as a sum of Gaussian functions centered at $(\xi_{1}, \ldots, \xi_{M})$, is equal to the reference histogram $h_{0}(\xi)$:
  \begin{equation}
    \label{eq:colvarbias_restraint_histogram}
    V(\xi_{1}, \ldots, \xi_{M}) = \frac{1}{2} k \int\left(h(\xi)-h_{0}(\xi)\right)^2 \mathrm{d}\xi
  \end{equation}
  \begin{equation}
    \label{eq:colvarbias_restraint_histogram_gaussian}
    h(\xi) = \frac{1}{M\sqrt{2\pi\sigma^2}} \sum_{i=1}^{M} \exp\left(-\frac{(\xi-\xi_{i})^2}{2\sigma^2}\right)
  \end{equation}
  When used in combination with a \texttt{distancePairs} multi-dimensional variable, this bias implements the refinement algorithm against ESR/DEER experiments published by Shen \emph{et al} \cite{Shen2015}.
  
  This bias behaves similarly to the \texttt{histogram} bias with the \texttt{gatherVectorColvars} option, with the important difference that \emph{all} variables are gathered, resulting in a one-dimensional histogram.
  Future versions will include support for multi-dimensional histograms.
  
  The list of options is as follows:
  \begin{itemize}
  
  \item \dupkey{name}{\texttt{histogramRestraint}}{sec:colvarbias}{biasing and analysis methods}
  \item \dupkey{colvars}{\texttt{histogramRestraint}}{sec:colvarbias}{biasing and analysis methods}
  \item \dupkey{outputEnergy}{\texttt{histogramRestraint}}{sec:colvarbias}{biasing and analysis methods}
  
  \item %
    \key %
      {lowerBoundary}{%
      \texttt{histogramRestraint}}{%
      Lower boundary of the colvar grid}{%
      decimal}{%
      Defines the lowest end of the interval where the reference distribution $h_{0}(\xi)$ is defined.
      Exactly one value must be provided, because only one-dimensional histograms are supported by the current version.
    }
  
  \item %
    \simkey{upperBoundary}{\texttt{histogramRestraint}}{lowerBoundary}
  
  \item %
    \key %
    {width}{%
      \texttt{histogramRestraint}}{%
      Width of the colvar grid}{%
      positive decimal}{%
      Defines the spacing of the grid where the reference distribution $h_{0}(\xi)$ is defined.
    }
  
  \item %
    \keydef%
    {gaussianSigma}{%
      \texttt{histogramRestraint}}{%
      Standard deviation of the approximating Gaussian}{%
      positive decimal}{%
      2 $\times$ \texttt{width}}{%
      Defines the parameter $\sigma$ in eq.~\ref{eq:colvarbias_restraint_histogram_gaussian}.
    }
  
  \item %
    \keydef
      {forceConstant}{%
      \texttt{histogramRestraint}}{%
      Force constant (\cvnamdonly{kcal/mol}\cvvmdonly{kcal/mol}\cvlammpsonly{unit of energy specified by \texttt{units}})}{%
      positive decimal}{%
      \texttt{1.0}}{%
      Defines the parameter $k$ in eq.~\ref{eq:colvarbias_restraint_histogram}.
    }
  
  \item %
    \key%
    {refHistogram}{%
      \texttt{histogramRestraint}}{%
      Reference histogram $h_{0}(\xi)$}{%
      space-separated list of $M$ positive decimals}{%
      Provides the values of $h_{0}(\xi)$ consecutively.
      The mid-point convention is used, i.e.~the first point that should be included is for $\xi$ = \texttt{lowerBoundary}+\texttt{width}/2.
      If the integral of $h_{0}(\xi)$ is not normalized to 1, $h_{0}(\xi)$ is rescaled automatically before use.
    }
  
  \item %
    \key%
    {refHistogramFile}{%
      \texttt{histogramRestraint}}{%
      Reference histogram $h_{0}(\xi)$}{%
      UNIX file name}{%
      Provides the values of $h_{0}(\xi)$ as contents of the corresponding file (mutually exclusive with \texttt{refHistogram}).
      The format is that of a text file, with each line containing the space-separated values of $\xi$ and $h_{0}(\xi)$.
      The same numerical conventions as \texttt{refHistogram} are used.
    }
  
  \item %
    \keydef
      {writeHistogram}{%
      \texttt{metadynamics}}{%
      Periodically write the instantaneous histogram $h(\xi)$}{%
      boolean}{%
      \texttt{off}}{%
      If \texttt{on}, the histogram $h(\xi)$ is written every \texttt{colvarsRestartFrequency} steps to a file with the name \outputName\texttt{.$<$name$>$.hist.dat}}{%
      This is useful to diagnose the convergence of $h(\xi)$ against $h_{0}(\xi)$.
    }
  
  \end{itemize}
  
  
 \cvscriptonly{% \cvscriptonly{%
Line 3639
Line 4368
 (e.g. \texttt{calc\_colvar\_forces}) or in the NAMD config file after a \texttt{run} or (e.g. \texttt{calc\_colvar\_forces}) or in the NAMD config file after a \texttt{run} or
 \texttt{minimize} statement. \texttt{minimize} statement.
  
 \input{colvars-cv.tex} \cvnamdugonly{\input{ug_colvars-cv.tex}}
  \cvrefmanonly{\input{colvars-cv.tex}}
  
  The following configuration options can modify the behavior of the scripting interface for optimization purposes:
  \begin{itemize}
  \item %
    \keydef
      {scriptingAfterBiases}{%
      global}{%
      Scripted colvar forces need updated biases}{%
      boolean}{%
      \texttt{on}}{%
      This flag specifies that the \texttt{calc\_colvar\_forces} procedure, when defined,
      is executed only after all biases have been updated.
      For example, this allows using the energy of a restraint bias, or the force applied on a colvar,
      to calculate additional scripted forces, such as boundary constraints.
      When this flag is set to \texttt{off}, it is assumed that only the values of their colvars
      (but not their energy or forces) will be used by \texttt{calc\_colvar\_forces}:
      this can be used to schedule the calculation of scripted forces and biases concurrently
      to increase performance.}
  \end{itemize}
  
 } }
  
 } }


Legend:
Removed in v.1.26 
changed lines
 Added in v.1.27



Made by using version 1.53 of cvs2html