next up previous contents
Next: Results for damaged diamond Up: The numerical techniques Previous: Molecular dynamics at constant

The conjugate gradient algorithm

The conjugate gradient is an algorithm to find the local minimum of a function, that can be of many variables. In the present case, the potential energy of the sample has to be minimized, with a number 3N of variables, where N is the number of atoms in the system. The Taylor expansion of a function $f({\bf r})$ about a point ${\bf P}$ of 3Ndimension is given by


\begin{displaymath}f({\bf r}) = a + \sum_{i=1}^{N} \frac{\partial f}{\partial r_...
...sim a - {\bf b}\cdot {\bf r}
+ \frac{1}{2} {\bf r} G {\bf r},
\end{displaymath} (8.20)

where $a=f({\bf P})$, $b_i = - \nabla f({\bf P})$ and $G_{ij} =
\frac{\partial^2 f}{\partial r_i \partial r_j}$. From G one can define a set of {${\bf d}_i$} conjugate directions according to


 \begin{displaymath}{\bf d}_i G {\bf d}_j = 0,
\end{displaymath} (8.21)

for $i \neq j$ and i,j = 1,...,N. A line minimization is then performed along these directions, with an initial direction defined by

\begin{displaymath}{\bf d}_1 = - \nabla f({\bf r}_1),
\end{displaymath} (8.22)

that is, by the forces applied on each atom. The i+1 step is derived from the i step by

\begin{displaymath}{\bf d}_{i+1} = -{\bf g}_{i+1} + \eta_i \bf {d}_i,
\end{displaymath} (8.23)

where

\begin{displaymath}{\bf g}_i = - \nabla f({\bf r}_i)
\end{displaymath} (8.24)

and

\begin{displaymath}\eta_i =\frac{{\bf g}_{i+1} \cdot {\bf g}_{i+1}}{{\bf g}_i \cdot {\bf g}_i}.
\end{displaymath} (8.25)

The vectors ${\bf d}$ and ${\bf g}$ satisfy the orthogonality conditions

\begin{displaymath}{\bf d}_i \cdot {\bf d}_j = 0, \ \ \ {\bf d}_i \cdot {\bf g}_j = 0, \ \ \
i \neq j.
\end{displaymath} (8.26)

It can be shown that the directions ${\bf d}_i$ and ${\bf d}_{i+1}$fulfill the condition in equation 8.21, and that the function is minimized along the conjugate directions. At each step the position of the atoms are calculated according to


\begin{displaymath}{\bf r}_{i+1} = {\bf r}_i + \lambda _i {\bf d}_i,
\end{displaymath} (8.27)

where $\lambda_i$ is determined so that ${\bf r}_{i+1}$ minimizes $f({\bf r_{i+1}})$ in the direction ${\bf d}_i$ from ${\bf r}_i$.


next up previous contents
Next: Results for damaged diamond Up: The numerical techniques Previous: Molecular dynamics at constant
David Saada
2000-06-22