1% 2% $Id$ 3% 4\label{sec:tropt} 5 6The TROPT module is one of three drivers (see Section \ref{sec:stepper} 7for documentation on STEPPER and Section \ref{sec:driver} for documentation on DRIVER) 8to perform a geometry optimization 9function on the molecule defined by input using the \verb+GEOMETRY+ 10directive (see Section \ref{sec:geom}). Geometry optimization is 11either an energy minimization or a transition state optimization. 12The algorithm programmed in TROPT is a trust region quasi-newton optimization 13and approximate energy Hessian updates. 14 15TROPT is {\bf not} selected by default out of the two available modules to 16perform geometry optimization. In order to force use of TROPT (e.g., 17because a previous optimization used STEPPER or DRIVER) provide a TROPT input 18block (below) --- even an empty block will force use of TROPT. 19 20Optional input for this module is specified within the compound 21directive, 22\begin{verbatim} 23 TROPT 24 (LOOSE || DEFAULT || TIGHT) 25 GMAX <real value> 26 GRMS <real value> 27 XMAX <real value> 28 XRMS <real value> 29 30 OPTTOL <real opttol default 3e-4> 31 32 EPREC <real eprec default 1e-7> 33 34 TRUST <real trust default 0.3> 35 36 CLEAR 37 REDOAUTOZ 38 39 INHESS <integer inhess default 0> 40 41 (MODDIR || VARDIR) <integer dir default 0> 42 (FIRSTNEG || NOFIRSTNEG) 43 44 MAXITER <integer maxiter default 20> 45 46 BSCALE <real BSCALE default 1.0> 47 ASCALE <real ASCALE default 0.25> 48 TSCALE <real TSCALE default 0.1> 49 HSCALE <real HSCALE default 1.0> 50 51 PRINT ... 52 53 XYZ [<string xyz default $file_prefix$>] 54 NOXYZ 55 56 END 57\end{verbatim} 58 59\sloppy 60 61\section{Convergence criteria} 62 63\begin{verbatim} 64 (LOOSE || DEFAULT || TIGHT) 65 GMAX <real value> 66 GRMS <real value> 67 XMAX <real value> 68 XRMS <real value> 69 70 OPTTOL <real value> 71 72\end{verbatim} 73 74The defaults may be used, or the directives \verb+LOOSE+, 75\verb+DEFAULT+, or \verb+TIGHT+ specified to use standard sets of 76values, or the individual criteria adjusted. All criteria are in 77atomic units. 78\verb+GMAX+ and \verb+GRMS+ control the maximum and root mean square 79gradient in the coordinates being used (Z-matrix, redundant internals, 80or Cartesian). \verb+XMAX+ and \verb+XRMS+ control the maximum and 81root mean square of the Cartesian step. 82 83\begin{verbatim} 84 LOOSE DEFAULT TIGHT 85 GMAX 0.0045d0 0.00045 0.000015 86 GRMS 0.0030d0 0.00030 0.00001 87 XMAX 0.0054d0 0.00180 0.00006 88 XRMS 0.0036d0 0.00120 0.00004 89\end{verbatim} 90 91Additionally the user may request a specific value for the tolerance with the keyword \verb+OPTTOL+ which will couple all the convergence criteria in the following way: 92 93\begin{verbatim} 94 GRMS 1.0*OPTTOL 95 GMAX 1.5*OPTTOL 96 XRMS 4.0*OPTTOL 97 XMAX 6.0*OPTTOL 98\end{verbatim} 99 100Note that GMAX and GRMS used for convergence of geometry may significantly vary in 101different coordinate systems such as Z-matrix, redundant internals, or Cartesian. 102The coordinate system is defined in the input file (default is Z-matrix). 103Therefore the choice of coordinate system may slightly affect converged energy. 104Although in most cases XMAX and XRMS are last to converge which are always done 105in Cartesian coordinates, which insures convergence to the same geometry in 106different coordinate systems. 107 108 109The old criterion may be recovered with the input 110\begin{verbatim} 111 gmax 0.0008; grms 1; xrms 1; xmax 1 112\end{verbatim} 113 114\section{Available precision} 115\label{sec:tropt:eprec} 116 117\begin{verbatim} 118 EPREC <real eprec default 1e-7> 119\end{verbatim} 120 121In performing a trust region optimization the precision of the energy is coupled to the convergence criteria. 122As mentioned above in most cases XMAX and XRMS are last to converge, thus, 123an accelerated converge is triggered in TROPT when GMAX and GRMS are already converged and the corresponding energy change with respect to the previous point is below the EPREC threshold, then, the structure is treated as optimized. This is used as an accelerated convergence criteria to avoid long tail in the optimization process. 124This will increase the speed of an optimization in most of the cases but it will 125be somehow cumbersome when dealing with flat energy surfaces, in this case a more tight EPREC value is recommended. 126Note that the default EPREC for DFT calculations is 5e-6 instead of 1e-7. 127 128\section{Controlling the step length} 129 130\begin{verbatim} 131 TRUST <real trust default 0.3> 132\end{verbatim} 133 134A dynamic trust radius (\verb+trust+) is used to control the step during 135optimization processes both minimization and saddle-point searches. 136It defaults to 0.3 for minimizations and 0.1 137for saddle-point searches. 138 139\section{Backstepping in TROPT} 140If a step taken during the optimization is too large or in the wrong direction (e.g., the step causes the energy to go up for a minimization), the TROPT optimizer will automatically ``backstep'' and reduce the current value of the trust radius in order to avoid a permanent ``backsteping''. 141 142\section{Maximum number of steps} 143 144\begin{verbatim} 145 MAXITER <integer maxiter default 20> 146\end{verbatim} 147 148By default at most 20 geometry optimization steps will be taken, 149but this may be modified with this directive. 150 151\section{Discard restart information} 152\begin{verbatim} 153 CLEAR 154\end{verbatim} 155 156By default TROPT reuses Hessian information from a previous 157optimization, and, to facilitate a restart also stores which mode is 158being followed for a saddle-point search. This option deletes all 159restart data. 160 161\section{Regenerate internal coordinates} 162 163\begin{verbatim} 164 REDOAUTOZ 165\end{verbatim} 166 167Deletes Hessian data and regenerates internal coordinates at the 168current geometry. Useful if there has been a large change in the 169geometry that has rendered the current set of coordinates invalid or 170non-optimal. 171 172\section{Initial Hessian} 173\begin{verbatim} 174 INHESS <integer inhess default 0> 175\end{verbatim} 176 177\begin{itemize} 178\item 0 = Default ... use restart data if available, otherwise use diagonal guess. 179\item 1 = Use diagonal initial guess. 180\item 2 = Use restart data if available, otherwise transform 181Cartesian Hessian from previous frequency calculation. 182\end{itemize} 183 184 185In addition, the diagonal elements of the initial Hessian for 186internal coordinates may be scaled using separate factors for 187bonds, angles and torsions with the following 188\begin{verbatim} 189 BSCALE <real bscale default 1.0> 190 ASCALE <real ascale default 0.25> 191 TSCALE <real tscale default 0.1> 192\end{verbatim} 193These values typically give a two-fold speedup over unit values, based 194on about 100 test cases up to 15 atoms using 3-21g and 6-31g* SCF. 195However, if doing many optimizations on physically similar systems it 196may be worth fine tuning these parameters. 197 198Finally, the entire Hessian from any source may be scaled 199by a factor using the directive 200\begin{verbatim} 201 HSCALE <real hscale default 1.0> 202\end{verbatim} 203It might be of utility, for instance, when computing an initial 204Hessian using SCF to start a large MP2 optimization. The SCF 205vibrational modes are expected to be stiffer than the MP2, so scaling 206the initial Hessian by a number less than one might be beneficial. 207 208 209\section{Mode or variable to follow to saddle point} 210 211\begin{verbatim} 212 (MODDIR || VARDIR) <integer dir default 0> 213 (FIRSTNEG || NOFIRSTNEG) 214\end{verbatim} 215 216When searching for a transition state the program, by default, 217will take an initial step uphill and then do mode following 218using a fuzzy maximum overlap (the lowest eigen-mode with an 219overlap with the previous search direction of 0.7 times the 220maximum overlap is selected). Once a negative eigen-value 221is found, that mode is followed regardless of overlap. 222 223The initial uphill step is appropriate if the gradient points roughly 224in the direction of the saddle point, such as might be the case if a 225constrained optimization was performed at the starting geometry. 226Alternatively, the initial search direction may be chosen to be along 227a specific internal variable (using the directive 228\verb+VARDIR+) or along a specific eigen-mode (using \verb+MODDIR+). 229Following a variable might be valuable if the initial gradient is 230either very small or very large. Note that the eigen-modes in the 231optimizer have next-to-nothing to do with the output from a frequency 232calculation. You can examine the eigen-modes used by the optimizer 233with 234 235\begin{verbatim} 236 tropt; print hvecs; end 237\end{verbatim} 238 239The selection of the first negative mode is usually a good choice if 240the search is started in the vicinity of the transition state and the 241initial search direction is satisfactory. However, sometimes the 242first negative mode might not be the one of interest (e.g., transverse 243to the reaction direction). If \verb+NOFIRSTNEG+ is specified, the 244code will not take the first negative direction and will continue doing 245mode-following until that mode goes negative. 246 247\section{Optimization history as XYZ file} 248 249\begin{verbatim} 250 XYZ [<string xyz default $fileprefix>] 251 NOXYZ 252\end{verbatim} 253 254The \verb+XYZ+ directive causes the geometry at each step 255to be output into file in the permanent directory in XYZ format. 256 The optional string will 257prefix the filename. The \verb+NOXYZ+ directive turns this off. 258 259For example, the input 260\begin{verbatim} 261 tropt; xyz ; end 262\end{verbatim} 263will cause a trajectory file filename.xyz to be created 264in the permanent directory. 265 266\section{Print options} 267 268The UNIX command \verb+"egrep '^@' < output"+ will extract a pretty 269table summarizing the optimization. 270 271If you specify the NWChem input 272\begin{verbatim} 273 scf; print none; end 274 tropt; print low; end 275 task scf optimize 276\end{verbatim} 277you'll obtain a pleasantly terse output. 278 279For more control, these options for the standard print directive are 280recognized 281\begin{itemize} 282\item \verb+debug+ - prints a large amount of data. Don't use in parallel. 283\item \verb+high+ - print the search direction in internals 284\item \verb+default+ - prints geometry for each major step (not during 285 the line search), gradient in internals (before 286 and after application of constraints) 287\item \verb+low+ - prints convergence and energy information. At 288 convergence prints final geometry, change in internals 289 from initial geometry 290\end{itemize} 291and these specific print options 292\begin{itemize} 293\item {\tt finish} (low) - print geometry data at end of calculation 294\item {\tt bonds} (default) - print bonds at end of calculation 295\item {\tt angles} (default) - print angles at end of calculation 296\item {\tt hvecs} (never) - print eigen-values/vectors of the Hessian 297\item {\tt searchdir} (high) - print the search direction in internals 298\item `{\tt internal gradient}' (default) - print the gradient in internals 299\item {\tt sadmode} (default) - print the mode being followed to the saddle point 300\end{itemize} 301 302\fussy 303 304 305