Skip to content

Commit c2569e5

Browse files
committed
Merge branch 'master' of https://github.com/MobleyLab/basic_simulation_training into mobley
2 parents 0278535 + a6a0782 commit c2569e5

File tree

2 files changed

+60
-45
lines changed

2 files changed

+60
-45
lines changed

paper/basic_training.pdf

-9.64 KB
Binary file not shown.

paper/basic_training.tex

Lines changed: 60 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ \subsubsection{ Ewald Summation}
10661066
As $\rho$ is not smooth, $\phi$ is not smooth either. \\
10671067

10681068

1069-
Ewald method is based on replacing the point charge distributions by smooth charge distributions in order to use the fast solvation techniques of the pde. The most common smooth function used in Ewald method is the gaussian distribution although other distributions have been used as well. Thus,
1069+
Ewald method is based on replacing the point charge distributions by smooth charge distributions in order to use the fast solution techniques of the pde. The most common smooth function used in Ewald method is the gaussian distribution although other distributions have been used as well. Thus,
10701070

10711071
\[ \rho = \rho^{sr} + \rho^{lr} \]
10721072

@@ -1082,12 +1082,12 @@ \subsubsection{ Ewald Summation}
10821082
\label{charges_ewald}
10831083
\end{figure}
10841084

1085-
Direct space or short range charge ($\rho^{sr}$) consists of the original point charge screened by the gaussian-distributed charge of the same magnitude.
1085+
Direct space or short range charge ($\rho^{sr}$) consists of the original point charge screened by the gaussian-distributed charge (G)of the same magnitude.
10861086
\[
10871087
E^{sr} = \frac{1}{2} \sum_{n \in Z^3}^{'} \sum_{i,j}q_i q_j \frac{erfc(\alpha|r_{ij} + nL|}{|r_{ij} + nL|}
10881088
\]
10891089

1090-
Unlike the potential due to the original charge, the potential due to direct space charge decays rapidly as shown in the figure. This is due to erfc function which decays very fast. Infact, it decays even faster than the Van der Waals term $r^{-6}$ and hence the cutoff used for Van der Waals can be used for direct space coulombic potential calculation as well.
1090+
Unlike the potential due to the original charge, the potential due to direct space charge decays rapidly as shown in the figure. This is due to erfc function which decays very fast. In fact, it decays even faster than the Van der Waals term $r^{-6}$ and hence the cutoff used for Van der Waals can be used for direct space coulombic potential calculation as well.
10911091

10921092
\begin{figure}[h]
10931093
\centering
@@ -1099,64 +1099,79 @@ \subsubsection{ Ewald Summation}
10991099

11001100
Potential due to the long range charge however doesn't decay rapidly and if calculated in the direct space would require summation over the infinite images. However, as we discussed earlier, the smoothness of the charge $\rho^{lr}$ (and hence potential ($\phi^{lr}$) allows the use of fast pde solvers. Fourier based solvers use the important result that differentiation operation in direct space corresponds to multiplication by (ik) in reciprocal space!
11011101

1102+
%\[
1103+
%E^{lr} = \frac{1}{2L^3} \sum_{k \neq 0} \frac{4\pi}{k^2} \exp^{-\frac{k^2}{4\alpha^2}} |\rho(k)|^2
1104+
%\]
1105+
11021106
\[
1103-
E^{lr} = \frac{1}{2L^3} \sum_{k \neq 0} \frac{4\pi}{k^2} \exp^{-\frac{k^2}{4\alpha^2}} |\rho(k)|^2
1107+
E^{lr} = (const) \sum_{k \neq 0} \frac{\exp(-k^2)}{k^2} |\rho(k)|^2
11041108
\]
11051109

1106-
The interesting factor here in $E^{lr}$ is the $\exp (-k^2)$ which decays exponentially. If we used only the original point charges, we would not have had this dampening factor.
1110+
The interesting factor here in $E^{lr}$ is the $\exp (-k^2)$ which decays exponentially. This means that we need to calculate this term only for a small values of $|k|$ before the term dies down. If we used only the original point charges and not the gaussian-distributed charges as we are using in reciprocal space, we would not have this dampening factor.
11071111

1108-
Self term is not a physical quantity and comes up due to the way the Ewald summation is set up.
1112+
The final term in Ewald summation is the so-called self term.
11091113

1114+
%\[
1115+
%E^{s} = - \frac{\alpha}{\sqrt{\pi}}\sum_i q_i^2
1116+
%\]
11101117
\[
1111-
E^{s} = - \frac{\alpha}{\sqrt{\pi}}\sum_i q_i^2
1118+
E^{s} = (const)\sum_i q_i^2
11121119
\]
11131120

1121+
It is not a physical quantity and comes up due to the way the reciprocal space Ewald summation is set up.
1122+
It has to be subtracted out from the Ewald summation.
1123+
Interestingly, self term needs to be calculated only once at the beginning of the simulation as it depends only on the charges and does not change with a change in the positions of the charges. For the same reason, it does not contribute to the force either.
1124+
1125+
11141126
\subsubsection{Grid based Ewald summation}
11151127

11161128
Ewald summation, through Fourier transform, as described in the previous section takes $O(n^{3/2})$ time. Discrete Fourier Transform (DFT) provides a faster way of solving the problem and reduces the time complexity to $O(n log(n))$. In order to use DFT, the charge distribution has to be discretized over a grid. Particle-Particle Particle Mesh (P3M), Particle Mesh Ewald (PME) and Smooth Particle Mesh Ewald (SPME) are three different implementations of the grid-based solution and are very similar in spirit though the details are slightly different. The choice of specifics in each one is based on a combination of accuracy, speed and ease of implementation. In this subsection, we give an overview of the grid-based approach.
11171129

11181130
There are five general steps involved in these methods :
11191131
\begin{enumerate}
1120-
\item Charge assignment : In this step, charges are interpolated onto the grid. While the original PME method uses Lagrangian interpolation for charge assignment, the SPME method uses the smoother cardinal B-splines of order n ($M_n$).
1132+
\item Charge assignment : In this step, charges are interpolated onto the grid. While the original PME method uses Lagrangian interpolation for charge assignment, the SPME method uses the smoother cardinal B-splines(hence the name Smooth-PME). These interpolation functions make sure that the charge density is distributed over the neighboring grid points.
11211133

1122-
\[
1123-
Q(k_1,k_2,k_3) = \sum_{i=0}^{N}\sum_{p_a=0}^{K_a-1} q_i \prod_{d=1}^3 M_n(u_i^d - k_d - p_dK_d)
1124-
\]
1134+
%\[
1135+
%Q(k_1,k_2,k_3) = \sum_{i=0}^{N}\sum_{p_a=0}^{K_a-1} q_i \prod_{d=1}^3 %M_n(u_i^d - k_d - p_dK_d)
1136+
%\]
11251137
\item Transformation of the grid to reciprocal space : Fast Fourier Transform (FFT) is used to convert the charges on the grid to their equivalent fourier space structure factors.
1126-
\[
1127-
S(m) = \sum_j q_j \exp(mr_j)
1128-
\]
1129-
\[
1130-
=\prod_{i=1}^{3} b_i(m_i)F(Q)(m_1,m_2,m_3)
1131-
\]
1132-
where
1133-
\[
1134-
b_i(m_i) = \exp(2\pi i (n-1)m_iK_i) X
1135-
\]
1136-
\[ [\sum_{k=0}^{n-2}M_n(m+1)\exp{2\pi im_ik/Ki}]^{-1}
1137-
\]
1138-
\item Energy calculation : Reciprocal space energy is calculated by
1139-
\[
1140-
E^{rec} = \frac{1}{2} \sum_{m_a=1}^{K_a-1} Q(m_1,m_2,m_3)(\theta_{rec}*Q)(m_1,m_2,m_3)
1141-
\]
1142-
where
1143-
\[
1144-
\theta_{rec} = F(BXC)
1145-
\]
1146-
1147-
\[
1148-
B(m_1,m_2,m_3) = \prod_{i=1}^{3} |b_i(m_i)|^2
1149-
\]
1150-
and
1151-
\[
1152-
C(m_1,m_2,m_3) = \frac{1}{\pi V} \frac{ \exp{- \pi^2 m^2 \beta^2}}{m^2}
1153-
\]
1154-
Here * is the convolution operation which is simply a product in the reciprocal space.
1155-
\item Transformation of the grid back to real space : Inverse FFT is used to convert $\theta{rec}*Q$ back to the real space.
1156-
\item Force calculation : Force is given by the gradient of the energy. It can be calculated in the reciprocal space by multiplication by (ik) (as implemented in the original PME) or by analytic differentiation in the real space as in SPME :
1157-
\[
1158-
\frac{\delta E_{rec}}{\delta r_i^a} = \sum_{m_a=0}^{K_a-1} \frac{\delta Q_{rec}}{\delta r_i^a}(m_1,m_2,m_3) (\theta_{rec}*Q)(m_1,m_2,m_3)
1159-
\]
1138+
%\[
1139+
%S(m) = \sum_j q_j \exp(mr_j)
1140+
%\]
1141+
%\[
1142+
%=\prod_{i=1}^{3} b_i(m_i)F(Q)(m_1,m_2,m_3)
1143+
%\]
1144+
%where
1145+
%\[
1146+
%b_i(m_i) = \exp(2\pi i (n-1)m_iK_i) X
1147+
%\]
1148+
%\[ [\sum_{k=0}^{n-2}M_n(m+1)\exp{2\pi im_ik/Ki}]^{-1}
1149+
%\]
1150+
1151+
\item Energy calculation : Reciprocal space potential is calculated by solving the Poisson equation in Fourier space. As noted earlier, solving the Poisson equation in Fourier space is simply a division by $k^2$, where k is the reciprocal space frequency. At the same time, the grid is modified to store the reciprocal space potential.
1152+
1153+
%\[
1154+
%E^{rec} = \frac{1}{2} \sum_{m_a=1}^{K_a-1} Q(m_1,m_2,m_3)(\theta_{rec}%*Q)(m_1,m_2,m_3)
1155+
%\]
1156+
%where
1157+
%\[
1158+
%\theta_{rec} = F(BXC)
1159+
%\]
1160+
%
1161+
%\[
1162+
%B(m_1,m_2,m_3) = \prod_{i=1}^{3} |b_i(m_i)|^2
1163+
%\]
1164+
%and
1165+
%\[
1166+
%C(m_1,m_2,m_3) = \frac{1}{\pi V} \frac{ \exp{- \pi^2 m^2 \beta^2}}{m^2}
1167+
%\]
1168+
%Here * is the convolution operation which is simply a product in the %reciprocal space.
1169+
1170+
\item Transformation of the grid back to real space : Inverse FFT is used to convert the reciprocal space potential back to the real space.
1171+
\item Force calculation : Force is given by the gradient of the energy. PME, SPME and P3M use different methods for calculating it. SPME specifically calculated it by analytic differentiation in the real space.
1172+
%\[
1173+
%\frac{\delta E_{rec}}{\delta r_i^a} = \sum_{m_a=0}^{K_a-1} \frac{\delta Q_{rec}}{\delta r_i^a}(m_1,m_2,m_3) (\theta_{rec}*Q)(m_1,m_2,m_3)
1174+
%\]
11601175
\end{enumerate}
11611176

11621177

0 commit comments

Comments
 (0)