1 \chapter{Force evaluation for the three body Tersoff potential}
4 \section{Form of the Tersoff potential and its derivative}
6 The Tersoff potential is of the form
8 E & = & \sum_i E_i = \frac{1}{2} \sum_{i \ne j} V_{ij} \textrm{ ,} \\
9 V_{ij} & = & f_C(r_{ij}) [ f_R(r_{ij}) + b_{ij} f_A(r_{ij}) ] \textrm{ .}
11 The repulsive $f_R$ and attractive $f_A$ part is given by
13 f_R(r_{ij}) & = & A_{ij} \exp (- \lambda_{ij} r_{ij} ) \textrm{ ,} \\
14 f_A(r_{ij}) & = & -B_{ij} \exp (- \mu_{ij} r_{ij} ) \textrm{ .}
16 The bond order function $b_{ij}$ is
18 b_{ij} = \chi_{ij} (1 + \beta_i^{n_i} \zeta^{n_i}_{ij})^{-1/2n_i}
22 \zeta_{ij} & = & \sum_{k \ne i,j} f_C (r_{ik}) \omega_{ik} g(\theta_{ijk}) \textrm{ ,}\\
23 g(\theta_{ijk}) & = & 1 + c_i^2/d_i^2 - c_i^2/[d_i^2 + (h_i - \cos \theta_{ijk})^2] \textrm{ .}
25 The cutoff function $f_C$ is taken to be
29 1, & r_{ij} < R_{ij} \\
30 \frac{1}{2} + \frac{1}{2} \cos \Big[ \pi (r_{ij} - R_{ij})/(S_{ij} - R_{ij}) \Big], &
31 R_{ij} < r_{ij} < S_{ij} \\
35 with $\theta_{ijk}$ being the bond angle between bonds $ij$ and $ik$ as shown in Figure \ref{img:tersoff_angle}.\\
37 For a three body potential, if $V_{ij}$ is not equal to $V_{ji}$, the derivative is of the form
39 \nabla_{{\bf r}_i} E = \frac{1}{2} \big[ \sum_j ( \nabla_{{\bf r}_i} V_{ij} + \nabla_{{\bf r}_i} V_{ji} ) + \sum_k \sum_j \nabla_{{\bf r}_i} V_{jk} \big] \textrm{ .}
41 In the following all the necessary derivatives to calculate $\nabla_{{\bf r}_i} E$ are done.
43 \section{Derivative of $V_{ij}$ with respect to ${\bf r}_i$}
46 \nabla_{{\bf r}_i} V_{ij} & = & \nabla_{{\bf r}_i} f_C(r_{ij}) \big[ f_R(r_{ij}) + b_{ij} f_A(r_{ij}) \big] + \nonumber \\
47 & & + f_C(r_{ij}) \big[ \nabla_{{\bf r}_i} f_R(r_{ij}) + b_{ij} \nabla_{{\bf r}_i} f_A(r_{ij}) + f_A(r_{ij}) \nabla_{{\bf r}_i} b_{ij} \big]
50 \nabla_{{\bf r}_i} f_R(r_{ij}) & = & A_{ij} \lambda_{ij} \frac{{\bf r}_{ij}}{r_{ij}} \exp(-\lambda_{ij} r_{ij}) \\
51 \nabla_{{\bf r}_i} f_A(r_{ij}) & = & - B_{ij} \mu_{ij} \frac{{\bf r}_{ij}}{r_{ij}} \exp(-\mu_{ij} r_{ij})
54 \nabla_{{\bf r}_i} f_C(r_{ij}) = \left\{
56 \frac{1}{2} \sin \Big( \frac{\pi(r_{ij}-R_{ij})}{S_{ij}-R_{ij}} \Big) \frac{\pi}{S_{ij}-R_{ij}} \frac{{\bf r}_{ij}}{r_{ij}}, & R_{ij} < r_{ij} < S_{ij} \\
61 \nabla_{{\bf r}_i} b_{ij} &= & - \frac{\chi_{ij}}{2} (1+\beta^{n_i} \zeta_{ij}^{n_i})^{-\frac{1}{2n_i}-1} \beta^{n_i} \zeta_{ij}^{n_i-1} \nabla_{{\bf r}_i} \zeta_{ij} \\
62 \nabla_{{\bf r}_i} \zeta_{ij} & = & \sum_{k \neq i,j} \big( g(\theta_{ijk}) \nabla_{{\bf r}_i} f_C(r_{ik}) + f_C(r_{ik}) \nabla_{{\bf r}_i} g(\theta_{ijk}) \big) \\
63 \nabla_{{\bf r}_i} g(\theta_{ijk}) & = & - \frac{2(h_i-\cos\theta_{ijk})c_i^2}{\big[d_i^2 + (h_i - \cos\theta_{ijk})^2\big]^2} \nabla_{{\bf r}_i} (\cos\theta_{ijk})
66 \nabla_{{\bf r}_i} \cos \theta_{ijk} & = & \nabla_{{\bf r}_i} \Big( \frac{{\bf r}_{ij} {\bf r}_{ik}}{r_{ij} r_{ik}} \Big) \nonumber \\
67 & = & \Big[ \frac{\cos\theta_{ijk}}{r_{ij}^2} - \frac{1}{r_{ij} r_{ik}} \Big] {\bf r}_{ij} + \Big[ \frac{\cos\theta_{ijk}}{r_{ik}^2} - \frac{1}{r_{ij} r_{ik}} \Big] {\bf r}_{ik}
70 \section{Derivative of $V_{ji}$ with respect to ${\bf r}_i$}
73 \nabla_{{\bf r}_i} V_{ji} & = & \nabla_{{\bf r}_i} f_C(r_{ji}) \big[ f_R(r_{ji}) + b_{ji} f_A(r_{ji}) \big] + \nonumber \\
74 & & + f_C(r_{ji}) \big[ \nabla_{{\bf r}_i} f_R(r_{ji}) + b_{ji} \nabla_{{\bf r}_i} f_A(r_{ji}) + f_A(r_{ji}) \nabla_{{\bf r}_i} b_{ji} \big]
77 \nabla_{{\bf r}_i} f_R(r_{ji}) & = & - A_{ji} \lambda_{ji} \frac{{\bf r}_{ji}}{r_{ji}} \exp(-\lambda_{ji} r_{ji}) = \nabla_{{\bf r}_i} f_R(r_{ij}) \\
78 \nabla_{{\bf r}_i} f_A(r_{ji}) & = & + B_{ji} \mu_{ji} \frac{{\bf r}_{ji}}{r_{ji}} \exp(-\mu_{ji} r_{ji}) = \nabla_{{\bf r}_i} f_A(r_{ij})
81 \nabla_{{\bf r}_i} f_C(r_{ij}) = \nabla_{{\bf r}_i} f_C(r_{ij}) = \left\{
83 - \frac{1}{2} \sin \Big( \frac{\pi(r_{ji}-R_{ji})}{S_{ji}-R_{ji}} \Big) \frac{\pi}{S_{ji}-R_{ji}} \frac{{\bf r}_{ji}}{r_{ji}}, & R_{ji} < r_{ji} < S_{ji} \\
88 \nabla_{{\bf r}_i} b_{ji} &= & - \frac{\chi_{ji}}{2} (1+\beta^{n_j} \zeta_{ji}^{n_j})^{-\frac{1}{2n_j}-1} \beta^{n_j} \zeta_{ji}^{n_j-1} \nabla_{{\bf r}_i} \zeta_{ji} \\
89 \nabla_{{\bf r}_i} \zeta_{ji} & = & \sum_{k \neq j,i} \big( g(\theta_{jik}) \nabla_{{\bf r}_i} f_C(r_{jk}) + f_C(r_{jk}) \nabla_{{\bf r}_i} g(\theta_{jik}) \big) \nonumber \\
90 & = & \sum_{k \neq j,i} f_C(r_{jk}) \nabla_{{\bf r}_i} g(\theta_{jik}) \quad \Big(\textrm{Reason: }\nabla_{{\bf r}_i} f_C(r_{jk}) = 0\Big) \\
91 \nabla_{{\bf r}_i} g(\theta_{jik}) & = & - \frac{2(h_j-\cos\theta_{jik})c_j^2}{\big[d_j^2 + (h_j - \cos\theta_{jik})^2\big]^2} \nabla_{{\bf r}_i} (\cos\theta_{jik})
94 \nabla_{{\bf r}_i} \cos \theta_{jik} & = & \nabla_{{\bf r}_i} \Big( \frac{{\bf r}_{ji} {\bf r}_{jk}}{r_{ji} r_{jk}} \Big) \nonumber \\
95 & = & \frac{1}{r_{ji} r_{jk}} {\bf r}_{jk} - \frac{\cos\theta_{jik}}{r_{ji}^2} {\bf r}_{ji}
98 \section{Derivative of $V_{jk}$ with respect to ${\bf r}_i$}
101 \nabla_{{\bf r}_i} V_{jk} & = & f_C(r_{jk}) f_A(r_{jk}) \nabla_{{\bf r}_i} b_{jk} \\
102 \nabla_{{\bf r}_i} b_{jk} & = & - \frac{\chi_{jk}}{2} (1+\beta^{n_j} \zeta_{jk}^{n_j})^{-\frac{1}{2n_j}-1} \beta^{n_j} \zeta_{jk}^{n_j-1} \nabla_{{\bf r}_i} \zeta_{jk} \\
103 \nabla_{{\bf r}_i} \zeta_{jk} & = & \sum_{l \neq j,k} \big( g(\theta_{jkl}) \nabla_{{\bf r}_i} f_C(r_{jl}) + f_C(r_{jl}) \nabla_{{\bf r}_i} g(\theta_{jkl}) \big) \nonumber \\
104 & = & f_C(r_{ji}) \nabla_{{\bf r}_i} g(\theta_{jki}) + g(\theta_{jki}) \nabla_{{\bf r}_i} f_C(r_{ji}) \\
105 \nabla_{{\bf r}_i} g(\theta_{jki}) & = & - \frac{2(h_j-\cos\theta_{jki})c_j^2}{\big[d_j^2 + (h_j - \cos\theta_{jki})^2\big]^2} \nabla_{{\bf r}_i} (\cos\theta_{jki}) \\
106 \nabla_{{\bf r}_i} \cos \theta_{jki} & = & \nabla_{{\bf r}_i} \Big( \frac{{\bf r}_{jk} {\bf r}_{ji}}{r_{jk} r_{ji}} \Big) \nonumber \\
107 & = & \frac{1}{r_{jk} r_{ji}} {\bf r}_{jk} - \frac{\cos\theta_{jki}}{r_{ji}^2} {\bf r}_{ji}
110 \section{Implementation issues}
112 As seen in the last sections the derivatives of $V_{ij}$, $V_{ji}$ and $V_{jk}$
113 with respect to ${\bf r}_i$ are necessary to compute the forces for atom $i$.
114 According to this, for every triple $(ijk)$ the derivatives of the three
115 potential contributions, denoted by $V_{ijk}$, $V_{jik}$ and $V_{jki}$
117 In simulation, however, it is not practical to evaluate all three potential
118 derivatives for each $(ijk)$ triple.
119 The $V_{jik}$ and $V_{jki}$ potential and its derivatives will be calculated
120 in subsequent loops anyways.
121 To avoid multiple computation of the same potential derivatives
122 the force contributions for atom $j$ and $k$ due to the $V_{ijk}$ contribution
123 have to be considered by calculating the derivatives of $V_{ijk}$
124 with respect to ${\bf r}_j$ and ${\bf r}_k$
125 inside the loop of the $(ijk)$ triple
126 in addition to the derivative with respect to ${\bf r}_i$.
127 This poses a more convenient method to obtain the forces
128 keeping in mind that all the necessary force contributions for atom $i$
129 are calculated and added in subsequent loops.
131 The following symmetry considerations help to obtain the
133 \subsection{Derivative of $V_{ij}$ with respect to ${\bf r}_j$}
136 \nabla_{{\bf r}_j} V_{ij} & = &
137 \nabla_{{\bf r}_j} f_C(r_{ij}) \big[ f_R(r_{ij}) +
138 b_{ij} f_A(r_{ij}) \big] + \nonumber \\
139 & & + f_C(r_{ij}) \big[ \nabla_{{\bf r}_j} f_R(r_{ij}) +
140 b_{ij} \nabla_{{\bf r}_j} f_A(r_{ij}) +
141 f_A(r_{ij}) \nabla_{{\bf r}_j} b_{ij} \big]
143 Using the equality $\nabla_{{\bf r}_i} r_{ij}=-\nabla_{{\bf r}_j} r_{ij}$
144 the following relations are valid:
146 \nabla_{{\bf r}_j} f_R(r_{ij}) &=& - \nabla_{{\bf r}_i} f_R(r_{ij}) \\
147 \nabla_{{\bf r}_j} f_A(r_{ij}) &=& - \nabla_{{\bf r}_i} f_A(r_{ij}) \\
148 \nabla_{{\bf r}_j} f_C(r_{ij}) &=& - \nabla_{{\bf r}_i} f_C(r_{ij})
150 The pair contributions .... easy.
151 Now having a look at $b_{ij}$.
153 \nabla_{{\bf r}_j}\cos\theta_{ijk} &=&
154 \nabla_{{\bf r}_j}\Big(\frac{{\bf r}_{ij}{\bf }r_{ik}}{r_{ij}r_{ik}}\Big)
156 &=& \frac{1}{r_{ij}r_{ik}}{\bf r}_{ik} -
157 \frac{\cos\theta_{ijk}}{r_{ij}^2}{\bf r}_{ij}
160 \subsection{Derivative of $V_{ij}$ with respect to ${\bf r}_k$}
162 The derivative of $V_{ij}$ with respect to ${\bf r}_k$ just consists of the
165 \nabla_{{\bf r}_k} V_{ij} & = &
166 f_C(r_{ij})f_A(r_{ij})\nabla_{{\bf r}_{k}}b_{ij}
168 since the derivatives of the functions only depending on atom $i$ and $j$
171 \nabla_{{\bf r}_k} f_R(r_{ij}) &=& 0 \\
172 \nabla_{{\bf r}_k} f_A(r_{ij}) &=& 0 \\
173 \nabla_{{\bf r}_k} f_C(r_{ij}) &=& 0
175 Now look at $b_{ij}$, not only angle important here!
177 \nabla_{{\bf r}_k}\zeta_{ij} &=&
178 g(\theta_{ijk})\nabla_{{\bf r}_k}f_C(r_{ik}) +
179 f_C(r_{ik})\nabla_{{\bf r}_k}g(\theta_{ijk}) \\
180 \nabla_{{\bf r}_k}f_C(r_{ik}) &=& - \nabla_{{\bf r}_i}f_C(r_{ik}) \\
181 \nabla_{{\bf r}_k}\cos\theta_{ijk} &=&
182 \nabla_{{\bf r}_k}\Big(\frac{{\bf r}_{ij}{\bf }r_{ik}}{r_{ij}r_{ik}}\Big)
184 &=&\frac{1}{r_{ij}r_{ik}}{\bf r}_{ij} -
185 \frac{\cos\theta_{ijk}}{r_{ik}^2}{\bf r}_{ik}
188 \subsection{Code realization}
190 The implementation of the force evaluation shown in the following
191 is applied to the potential designed by Erhard and Albe.
192 There are slight differences comparted to the original potential by Tersoff:
194 \item Difference in sign of the attractive part.
195 \item $c$, $d$ and $h$ values depend on atom $k$ in addition to atom $i$.
196 \item Difference in sign of the $\cos\theta_{ijk}$ term.
197 \item There are no parameters $\beta$ and $\chi$.
198 \item The exponent of the $b$ term is constantly $-\frac{1}{2}$.
200 These differences actually slightly ease code realization.
203 \renewcommand\labelitemi{}
204 \renewcommand\labelitemii{}
205 \renewcommand\labelitemiii{}
208 \item // nop (only used in orig. Tersoff)
211 \item // nop (only used in orig. Tersoff)
217 \item set $S_{ij}$ (cutoff)
218 \item calculate: $r_{ij}$, $r_{ij}^2$
219 \item IF $r_{ij} > S_{ij}$ THEN CONTINUE
223 \item set $ik$-depending values
224 \item calculate: $r_{ik}$, $r_{ik}^2$
225 \item IF $r_{ik} > S_{ik}$ THEN CONTINUE
226 \item calculate: $\theta_{ijk}$, $\cos(\theta_{ijk})$,
227 $dg(\theta_{ijk})$, $g(\theta)$,
228 $f_C(r_{ik})$, $df_C(r_{ik})$
229 \item $\zeta_{ij}=\zeta_{ij}+f_C(r_{ik})g(\theta)$
233 \item calculate: $f_C(r_{ij})$, $df_C(r_{ij})$, $f_A(r_{ij})$,
234 $df_A(r_{ij})$, $f_R(r_{ij})$, $df_R(r_{ij})$,
239 \nabla_{{\bf r}_i} f_C(r_{ij}) \big[ f_R(r_{ij}) - b_{ij} f_A(r_{ij}) \big] +
240 f_C(r_{ij}) \big[ \nabla_{{\bf r}_i} f_R(r_{ij}) -
241 b_{ij} \nabla_{{\bf r}_i} f_A(r_{ij}) \big]\big)
243 \item $F_{Atom\, i} = F_{Atom\, i} + F$
244 \item $F_{Atom\, j} = F_{Atom\, j} - F$
245 \item $E=E+\frac{1}{2}f_C(r_{ij})[f_R(r_{ij})-b_{ij}f_A(r_{ij})]$
246 \item $d\zeta_{ij}=\frac{1}{2}f_A(r_{ij})f_C(r_{ij})db_{ij}$
250 \item calculate: $\nabla_{{\bf r}_i}\cos\theta_{ijk}$,
251 $\nabla_{{\bf r}_j}\cos\theta_{ijk}$,
252 $\nabla_{{\bf r}_k}\cos\theta_{ijk}$
254 F_{Atom\, i}+= d\zeta_{ij}\big(
255 g(\theta_{ijk})\nabla_{{\bf r}_i}f_C(r_{ik}) +
256 f_C(r_{ik})dg(\theta_{ijk})\nabla_{{\bf r}_i}\cos\theta_{ijk}\big)$
258 F_{Atom\, j}+= d\zeta_{ij}
259 f_C(r_{ik})dg(\theta_{ijk})\nabla_{{\bf r}_j}\cos\theta_{ijk}$
261 F_{Atom\, k}+= d\zeta_{ij}\big(
262 g(\theta_{ijk})\nabla_{{\bf r}_k}f_C(r_{ik}) +
263 f_C(r_{ik})dg(\theta_{ijk})\nabla_{{\bf r}_k}\cos\theta_{ijk}\big)$
270 \caption{Implementation of the force evaluation for Tersoff like bond-order
271 potentials using pseudocode.}