1: \documentclass[a4paper,aps,floatfix,twocolumn,prb]{revtex4}
2: %\documentclass[aps,floatfix,preprint,prb]{revtex4}
3: %\documentclass [aps,prb,preprint,endfloats]{revtex4}
4: \usepackage[latin1]{inputenc}
5: \usepackage[OT1]{fontenc}
6: \usepackage{amsmath}
7: \usepackage{amssymb,amsfonts}
8: \usepackage{pifont}
9: \usepackage{graphicx}
10: \usepackage{color}
11:
12: \newcommand{\Eqref}[1]{Eq.~\eqref{#1}}
13:
14: \newcommand{\vect}[1]{\mathbf{#1}}
15: \renewcommand{\u}{\vect{u}}
16: \newcommand{\m}{\vect{m}}
17: \newcommand{\n}{\vect{n}}
18: \newcommand{\p}{\vect{p}}
19: \newcommand{\q}{\vect{q}}
20: \renewcommand{\j}{\vect{j}}
21: \newcommand{\jlo}{\j_\parallel}
22: \newcommand{\jtr}{\j_\perp}
23: \newcommand{\e}{\mathrm{e}}
24: \newcommand{\E}{\vect{E}}
25: \newcommand{\G}{\vect{G}}
26: \newcommand{\bE}{\bar{\E}}
27: \newcommand{\Elo}{\E_\parallel}
28: \newcommand{\Etr}{\E_\perp}
29: \renewcommand{\P}{\vect{P}}
30: \newcommand{\R}{\vect{r}}
31: \newcommand{\eps}{\epsilon_0}
32: \newcommand{\C}{\mathcal{C}}
33: \newcommand{\DD}{\mathcal{D}}
34: \newcommand{\Z}{{Z}}
35: \newcommand{\dV}{\;{d^3r}\;}
36: \newcommand{\Zfl}{\Z_\text{fluct}}
37: \newcommand{\Zcoul}{\Z_\text{Coulomb}}
38:
39: \newcommand{\Pe}{\phi^\text{(ext)}}
40: \newcommand{\lo}{_\parallel}
41: \newcommand{\latt}{{\scriptscriptstyle\boxplus}}
42: \newcommand{\qlatt}{\vect{q}^{\scriptscriptstyle\boxplus}}
43: \newcommand{\qnormlatt}{q^{\scriptscriptstyle\boxplus}}
44: \newcommand{\Qnormlatt}{Q^{\scriptscriptstyle\boxplus}}
45:
46: \def\D{\mathrm{d}}
47: \newcommand{\DR}{\ensuremath{\:\D³r}}
48: \newcommand{\DRj}{\ensuremath{\prod_j\DR_j}}
49: \newcommand{\grad}{\nabla}
50: \renewcommand{\div}{\nabla \cdot}
51: \newcommand{\curl}{\nabla \times}
52:
53: \begin{document}
54:
55: \title{Boundary conditions in local electrostatics algorithms}
56: \author{L. Levrel}
57: \affiliation{Physique des Liquides et Milieux Complexes, Facult\'e
58: des Sciences et Technologie, Universit\'e Paris Est (Cr\'eteil), 61 avenue du
59: G\'en\'eral-de-Gaulle, F-94010 Cr\'eteil Cedex, France}
60: \affiliation{IUFM de l'Acad\'emie de Cr\'eteil, Rue Jean Mac\'e, F-94861 Bonneuil-sur-Marne
61: Cedex, France}
62: \author{A. C. Maggs}
63: \affiliation{Physico-Chimie Th\'eorique, Gulliver-CNRS, ESPCI,
64: 10 rue Vauquelin, Paris 75005, France.}
65: \date{\today}
66: \begin{abstract}
67: We study the simulation of charged systems in the presence of general
68: boundary conditions in a local Monte Carlo algorithm based on a constrained
69: electric field. We firstly show how to implement constant-potential,
70: Dirichlet, boundary conditions by introducing extra Monte Carlo moves to the
71: algorithm. Secondly, we show the interest of the algorithm for studying
72: systems which require anisotropic electrostatic boundary conditions for
73: simulating planar geometries such as membranes.
74: \end{abstract}
75: \maketitle
76: \section{Introduction}
77:
78: In the simulation of condensed matter one very often imposes periodic boundary
79: conditions in order to minimize surface artefacts which give rise to slow
80: convergence of energies to their bulk values. While such boundary conditions
81: are simple to understand for short-ranged potentials they lead to many
82: subtleties when working with charged systems \cite{deleeuw,fraser}. Attempts
83: at simplifying the problem by using truncated potentials lead to violations of
84: basic sum rules on the structure factor \cite{stillinger}, incorrect number
85: fluctuations in finite systems \cite{lebowitz} or even loss of electrical
86: conductivity \cite{marchetti}. The correct treatment of charged media
87: requires a full treatment of the long-ranged Coulomb interaction.
88:
89: Classical methods of treating the Coulomb interaction use careful mathematical
90: analysis to convert the conditionally convergent Coulomb sum into a well
91: defined mathematical object such as the Ewald sum \cite{deleeuw}. Recently we
92: introduced an alternative treatment of the Coulomb problem that allows one to
93: replace the \textsl{global}\/ calculation of the interaction energy by a local
94: dynamic process \cite{PRL88, JCP117, StatPhys}. The main interest in this
95: transformation is that it enables one to perform a local Monte Carlo
96: simulation in the presence of charges and dielectrics, without ever solving
97: the Poisson equation. The algorithm works by evolving the electric field in
98: time (in a manner similar to Maxwell's equations) while eliminating
99: ``uninteresting'' degrees of freedom such as the magnetic field. The
100: algorithm uses the energy
101: \begin{equation}
102: U = \int \frac {\epsilon_0 \E^2}{2} \DR \label{energy}
103: \end{equation}
104: where $\E$ is the electric field while implementing Gauss' law
105: \begin{equation}
106: \epsilon_0 \div \E - \rho=0 \label{constraint}
107: \end{equation}
108: as a dynamic constraint. We showed \cite{JCP120} that the algorithm can be
109: used to generate \textsl{tin-foil}\/ or \textsl{vacuum}\/ boundary conditions if one
110: chooses appropriate dynamics for the $\q=0$ component of the electric field.
111: Until now applications have been to the properties of bulk, three dimensional
112: media \cite{igor,PRL93} in periodic systems.
113:
114: This paper generalizes the method to a broader class of physical systems and
115: boundary conditions. Firstly we consider the case, particularly important in
116: devices and electrodes, of imposition of an external potential on a metallic
117: surface; a case which requires the use of Dirichlet boundary conditions for
118: the potential. Again we find that the locality of the formulation allows the
119: simulation of a broader class of geometries, including those for which the use
120: of fast Fourier techniques is difficult.
121:
122: A second generalization of the method is required to treat \textsl{anisotropic}\/
123: systems, in particular membranes. The simulation of thin, quasi
124: two-dimensional systems in three-dimensional space is surprisingly difficult
125: \cite{berkoslab, holm53, holmslab}.
126: The use of a purely local algorithm requires only small modifications in order
127: to minimize finite size effects; we argue that it will also give rather
128: favorable complexity in the limit of large number of particles, $N$.
129:
130: Our paper contains two, independent, self-contained theoretical
131: sections. Firstly in II we treat the problem of metallic boundary conditions
132: including certain subtleties as to how a true metal behaves. Secondly in III
133: we consider electrostatics in anisotropic $2+1$ dimensional geometries.
134: Implementation of the ideas has been performed by Thompson and Rottler
135: \cite{comp} using off lattice techniques suitable for atomistic simulation.
136: In their paper they compare detailed simulations with available theories.
137:
138: \section{Metallic boundary conditions}
139:
140: We begin by emphasizing the difference between idealized metallic boundaries
141: and true physical systems in which screening occurs over a small but finite
142: Debye length. We then show how to impose Dirichlet conditions on the
143: potential, $\phi$ while still keeping $\E$ as the main dynamic variable.
144:
145: \subsection*{The nature of metallic boundary conditions}
146:
147: There are two different, self-consistent ways of calculating the energy of
148: charges in the presence of a dielectric or conducting interfaces. In the first
149: treatment we calculate the potential energy arising from the solution of the
150: Poisson equation
151: \[
152: \div (\epsilon \grad \phi) = - \rho
153: \]
154: with $\rho$ the density of free charges, with the appropriate boundary
155: conditions for each configuration. The boundary condition at a metallic
156: surface is that the tangential electric field vanishes, while the normal field
157: at the surface satisfies
158: \begin{equation} \vect{D} \cdot \n =\epsilon \E \cdot \n=-\sigma \label{bc}
159: \end{equation}
160: where $\sigma$ is the surface charge density. The field is identically zero
161: within a conductor \cite{landau}. The internal energy is then
162: \begin{equation}
163: U = \frac{1}{2}\int \phi \rho \DR. \label{U0}
164: \end{equation}
165: In this case the longitudinal electric field is static, and is given by $\E =
166: -\grad \phi$. We note that in this treatment thermal fluctuations play no role
167: so that certain fluctuation phenomena such as thermal Casimir interactions are
168: neglected.
169:
170: A physical system at a non-zero temperature always presents polarization or
171: charge fluctuations; superposed on the interaction energy \Eqref{U0}
172: is an effective potential coming from these fluctuations. We now work in the
173: Debye--H{\"u}ckel limit to calculate an approximate correlation function for
174: the electric field in a conducting system at finite temperatures. This
175: illustrative calculation shows that transverse field fluctuations become
176: important as soon as the temperature $T>0$.
177:
178: We consider a one component plasma, with neutralizing background. We
179: approximate the free energy of a conductor as a sum of the electric field
180: energy \Eqref{energy} and the configurational entropy of the charges with
181: the functional \cite{JCP120}
182: \begin{equation}
183: F = \int \left \{
184: \frac{\epsilon_0 \E^2 }{2} + k_BT \; c\ln{c}
185: \right \}\DR
186: \label{debye}
187: \end{equation}
188: where $c(\vect{r})=\rho(\vect{r})/e$ is the number density of mobile ions and
189: $e$ the charge of the particles. In the limit of small fluctuations of density
190: $\delta c(\vect{r})$ we expand to second order and use charge conservation so
191: that $\int \delta c \DR=0 $. Then
192: \[
193: F(\delta c, \E) = \int \left \{ \frac{\epsilon_0 \E^2 }{2} + k_BT \; \frac
194: {( \delta c)^2 }{2 c_0} \right \}\DR
195: \]
196: where $c_0$ is the mean background density of the ions. We now eliminate the
197: charge fluctuation with the help of Gauss' law and find an effective action
198: for the electric field
199: \begin{equation}
200: F_E= \int
201: \epsilon_0 \left \{
202: \frac {\E^2 }{2} + \frac{(\div \E)^2 }{2\kappa^2}
203: \right \} \DR
204: \label{fieldenergy}
205: \end{equation}
206: with $\kappa$ the inverse Debye length. From \Eqref{fieldenergy} we read
207: off the longitudinal and transverse correlations of the electric field,
208: \begin{align*}
209: \epsilon_0 \langle \E(q) \E(q) \rangle_{long}
210: &= \frac {k_B T }{ 1 + q^2/\kappa^2}, \\
211: \epsilon_0 \langle \E(q) \E(q) \rangle_{tran}&=k_B T.
212: \end{align*}
213: On wavelengths large compared with the screening length ($q/\kappa <<1$) all
214: longitudinal and transverse electric modes fluctuate with the same amplitude.
215:
216: It is instructive to compare with similar calculations for an explicit model of
217: dielectric in terms of polarization fluctuations \cite{polardiel}. We find
218: that
219: \begin{align*}
220: \epsilon_0 \langle \E(q) \E(q) \rangle_{long}
221: &= k_B T \; \frac{\epsilon -\epsilon_0 }{ \epsilon }, \\
222: \epsilon_0 \langle \E(q) \E(q) \rangle_{tran}&=k_B T.
223: \end{align*}
224: Again transverse field correlations are unchanged in the presence of
225: a dielectric or classical charged fluid, longitudinal fluctuations depend on
226: the material properties. In the limit $\epsilon \rightarrow \infty$ the
227: fluctuations of a dielectric
228: are the same as those of a metal for $q \ll\kappa$.
229:
230: From these expressions in Fourier space we calculate the correlations of the
231: electric field in real space. For a dielectric (with $\epsilon < \infty$) we
232: find that the field displays dipolar correlations so that
233: \[
234: \langle E_i(\vect{r}) E_j(\vect{r}') \rangle \sim \frac {1}{ |\vect{r}-\vect{r}'|^3 },
235: \] field correlations are long-ranged. This dipolar correlation in the fields
236: leads to long-ranged Casimir/Lifshitz interactions between dielectrics. For a
237: conducting system field correlations decay exponentially with characteristic
238: length the Debye length,
239: \[
240: \langle E_i(\vect{r}) E_j(\vect{r}') \rangle \sim e^{-\kappa |\vect{r}-\vect{r}'|}.
241: \]
242:
243: From these considerations we see that different strategies are needed to
244: simulate the idealized classical metallic boundary condition \Eqref{bc} or a
245: true fluctuating charged fluid. In the first situation one only needs
246: information on the fields in the nonconducting regions. In the second case
247: the surface field is influenced by fluctuations that occur within a few Debye
248: lengths of the surface. The surface must then be simulated explicitly with an
249: expression such as \Eqref{debye} in order to obtain results including
250: Casimir/Lifshitz type interactions. We note that such interactions are very
251: weak on the macroscopic scale. Between two plates of area $A$ separated by a
252: distance $H$ the thermal interactions are given by \cite {kardar}
253: \[
254: {U}=-A k_BT \frac{\zeta(3) }{ 16 \pi H^2}
255: \]
256: with $\zeta(3) \approx 1.20$
257:
258: In this paper we will only consider the case of imposing the first type of
259: metallic boundary conditions in which fluctuation forces are neglected.
260:
261: \subsection*{Fixed-potential boundary conditions}
262:
263: \subsubsection*{Minimization principle}
264:
265: We now apply our local simulation algorithm to fixed-potential boundary
266: conditions of the type \Eqref{bc}. The method of attack is a generalization of
267: the methods of Ref.~\onlinecite{PRL88}. Firstly we seek a variational principle for the
268: electric field for which the energy is a \textsl{true minimum}\/ for the geometry
269: of interest. We then promote the constraints of the minimization principle to
270: $\delta$-functions in a partition function. This partition function is then
271: shown to generate the same relative statistical weights as the original
272: variational energy, but is much more convenient for the purposes of simulation
273: since it allows the local update of fields in a Monte Carlo algorithm.
274:
275: As noted in the introduction electrostatic interaction is calculated by
276: minimizing the electric field energy \Eqref{energy} in the presence of the
277: constraint of Gauss' law, \Eqref{constraint}, using the functional
278: \begin{equation*}
279: A[\E]=\int\left[\frac{\eps \E^2}{2}+\lambda(\eps\div\E-\rho)\right]\DR,
280: \end{equation*}
281: where $\lambda$ is a Lagrange multiplier. We now generalize Ref.~\onlinecite{schwinger}
282: and consider a system with both free charges and conductors, $i$. These
283: conductors are maintained by external sources at fixed potentials $\Pe_i$.
284: This is most conveniently done by performing Legendre transform \cite{landau}
285: in order to eliminate for the unknown surface charge densities $\sigma
286: =\{\sigma_i\}$ on the surfaces $S=\{S_i\}$ in order to replace them by the
287: potentials $\Pe=\{\Pe_i\}$:
288: \begin{equation}\label{foncpotfix}
289: U_2[\E,\sigma]= U[\E]- \oint \sigma\Pe \D S.
290: \end{equation}
291: We now impose the boundary condition \Eqref{bc} with a further Lagrange
292: multiplier $\mu$ living on each surface and consider the functional
293: \begin{equation}
294: A_2 = U_2 + \int \lambda(\eps\div\E-\rho)\DR
295: + \oint \mu(\eps\n\cdot\E+\sigma)\;\D S. \label{a2}
296: \end{equation}
297: In order to find the stationary point of $A_2$ we vary all the fields,
298: %\setlength{\multlinegap}{0pt}
299: %\begin{multline*}
300: % \delta A_2=\int[\eps \;\delta\E\;\cdot\E+\;\delta\lambda\;(\eps\div\E-\rho)
301: % +\lambda\eps\delta(\div\E)]\DR\\
302: % - \oint\,[\delta\sigma\; \Pe
303: % +\;\delta\mu\;(\eps\n\cdot\E+\sigma)+\mu\;\delta(\eps\n\cdot\E+\sigma)]\D S.
304: %\end{multline*}
305: and integrate by parts using $\lambda\div\delta\E=\div(\lambda\delta\E)
306: -(\grad\lambda)\cdot\delta\E$ and find
307: \begin{multline*}
308: \delta A_2=\int[\eps\;\delta\E\cdot(\E-\grad\lambda)
309: +\delta\lambda\;(\eps\div\E-\rho)]\DR\\
310: -
311: \oint[\delta\sigma(\Pe+\mu)
312: +\delta\mu(\eps\n\cdot\E+\sigma)
313: -\eps(\lambda-\mu)\delta\E\cdot\n]\;\D S.
314: \end{multline*}
315: At the stationary point we find
316: \begin{alignat*}{2}
317: \delta\E &:\quad \left\{\begin{aligned}
318: &\E-\grad\lambda=0\\
319: &\lambda-\mu=0 \end{aligned}\right.
320: &\quad&\begin{aligned} & \text{in $V$,}\\
321: &\text{on $S$,} \end{aligned} \\
322: \delta\sigma &:\quad \Pe +\mu =0 &&\text{\,on $S$,} \\
323: \delta\lambda &: \quad \eps\div\E -\rho =0 &&\text{\,in $V$,} \\
324: \delta\mu &: \quad \eps\n\cdot\E +\sigma =0 &&\text{\,on $S$.}
325: \end{alignat*}
326:
327: The first equation implies that $\E$ is the gradient of a potential,
328: $\phi=-\lambda$. The next two imply that $\phi=\Pe$ on $S$ so that we
329: indeed generate Dirichlet conditions. Finally the last two equations impose
330: Gauss' law. At the stationary point thus we have
331: $\E=\E_p=-\grad\phi_p$ and $\sigma=\sigma_p$, where the
332: index $p$ signals the solution to Poisson's equation with Dirichlet boundary
333: conditions.
334:
335: \subsubsection*{Partition function}
336: We now generalize the stationary principle to finite temperatures and replace
337: the Lagrange multipliers of \Eqref{a2} by $\delta$-functions in a
338: functional integral. Let us define a partial partition function,
339: where the bulk charge distribution $\rho$ is given, as
340: \begin{equation}
341: Z_\rho=\int\DD\E\ \DD\sigma\;
342: \delta(\eps\div\E-\rho)\:\delta(\eps\n\cdot\E+\sigma)
343: \:\mathrm{e}^{-\beta U_2[\E,\sigma]}.
344: \label{zrho}
345: \end{equation}
346: We integrate over the electric field, constrained by Gauss' law and also
347: all values of the surface charge $\sigma$ compatible with the flux
348: condition at the surface of the conductors.
349:
350: The full partition function is calculated by integrating over the position of
351: all mobile charges. In order to find the interaction in terms of the minimum
352: of the functional it is convenient to change integration variables so that
353: $\E=\E_p+\vect{e}$ and $\sigma=\sigma_p+s$. After noting that
354: $\sigma_p=-\epsilon_0 \n\cdot\E_p$ we find
355: \begin{align*}
356: Z_\rho
357: &=\int\DD\vect{e}\ \DD s\;\delta(\div\vect{e})\:\delta(\eps\n\cdot\vect{e}+s)\\
358: &\times \qquad \e^{-\beta\left[\int \frac{\eps}{2}(\E_p+\vect{e})^2\DR
359: -\oint (\sigma_p+s)\Pe\: \D S \right]}.
360: \end{align*}
361: With the help of the constraint equations we find
362: \begin{eqnarray*}
363: Z_\rho &=&\e^{-\beta U_2[\E_p,\sigma_p]} \\
364: &\times& \int\DD\vect{e}\ \DD s\;\delta(\div \vect{e})\:\delta(\eps\n\cdot\vect{e}+s)
365: \:\mathrm{e}^{-\beta U_2[\vect{e},s]}
366: \end{eqnarray*}
367: so that
368: \begin{equation}
369: Z_\rho=\mathrm{e}^{-\beta U_2[\E_p,\sigma_p]}\: \Zfl \label{zfl},
370: \end{equation}
371: with $\Zfl$ independent of positions of the mobile charges. This results in a
372: complete factorization of the statistical weights of charge configurations
373: and of field and surface charge fluctuations
374: \begin{equation*}
375: Z=\biggl[\int\Bigl(\DRj\Bigr)\mathrm{e}^{-\beta U_2[\E_p,\sigma_p]}\biggr]\Zfl
376: =\Zcoul \Zfl.
377: \end{equation*}
378: We note, however, that following the discussion of Section II, this
379: fluctuation partition function is not necessarily the true physical
380: fluctuation partition function that one would calculate for a true physical
381: metal. Thus sampling with the partition function \Eqref{zrho} will not
382: necessarily give the correct fluctuation forces acting on electrodes even if,
383: by construction, it generates the correct relative weight for configurations
384: of free charges.
385:
386: \subsubsection*{Algorithm}
387: The result \Eqref{zfl} is the analytical basis for an algorithm that
388: simulates fixed-potential surfaces. Sampling the partition function requires
389: updates generating fluctuations of the variables, $\{\R_j\}$, $\E$ and
390: $\sigma$. We refer the reader to previous work \cite{PRL88,StatPhys,PRE} for
391: particle updates and bulk field updates. We note that the demonstration
392: requires an integral over the surface charge $\sigma$; thus even if charges in
393: the volume are discrete those on surfaces should be sampled continuously.
394:
395: In order to sample the partition function \Eqref{zrho} two new moves need to
396: be introduced. Firstly, fluctuation in the charge density in the surface of a
397: given conductor that \textsl{conserve}\/ its total charge. This move is
398: implemented by a variation of the simplest update for volume charges. A
399: random charge amplitude $\delta$ is generated to make a charge pair of
400: $+\delta$ at one site and $-\delta$ at a second site. Since field lines must
401: lie outside the conductor, Fig.~\ref{surf-local}, we update the field on three
402: links connecting the modified sites. To sample the integral \Eqref{zrho} the
403: charges should be chosen from a continuum distribution. Secondly, each
404: conductor $i$ bears a net charge $\int_{S_i}\sigma_i$ which should also
405: fluctuate. This is achieved by transferring charges between pairs of
406: conductors. Gauss' law then requires modifying the total electric flux
407: between the two surfaces.
408:
409: \begin{figure}
410: \includegraphics[scale=.5]{surf_fluct0}
411: \caption{Local update for integrating surface charge fluctuations. Grey
412: region represents the conductor volume (where $\E=0$); the white region is
413: the dielectric.} \label{surf-local}
414: \end{figure}
415:
416: \begin{figure}%[t]
417: \centering
418: \includegraphics{surf_charge0}
419: \caption{Updating the total charge of conductors implies updating the field
420: along a line connecting them. This update is not local.}
421: \label{surf-global}
422: \end{figure}
423:
424: We now demonstrate that despite the need to transfer charge large distances
425: between conductors this does not dominate the time need to simulate the
426: system. We start by noting that fluctuations on a conductor can be
427: estimated using an argument based on the capacitance of an isolated conductor
428: \cite{jancovici}. In three dimensions the capacitance of an object of size
429: $d$ scales as $C=\eps d$. If we equate the charging energy to the thermal
430: energy scale we find
431: \[
432: k_BT= \frac {Q^2} {2 C} \sim \frac {Q^2}{\eps d}
433: \]
434: so that the amplitude of charge fluctuation of a conductor is $Q^2 \sim k_B T
435: \eps d$. Consider a Monte Carlo trial in which a charge $\delta$ is sent
436: along a path of length $\ell$, Fig.~\ref{surf-global}. Then \cite{PRE} we
437: estimate the energy change as $\ell \delta^2/\epsilon_0 a^2$, with $a$ the
438: mesh spacing. For this trial to be successful we again require that this
439: energy is matched to the thermal fluctuations giving $\delta^2 \sim \epsilon_0 a^2 k_B T
440: / \ell$. Thus the amplitude of the charge transfer over large distances must
441: be small.
442:
443: We now consider $M$ such exchanges. Since charges are transferred in each
444: direction we require that $M \delta^2 = Q^2$, or $M\sim \ell d/a^2$. Each
445: transfer requires a numerical effort that is also $O(\ell/a)$ to update the
446: links so that a total computational effort ${\eta}=\ell^2 d/a^3$ is needed to
447: equilibrate the charge fluctuations between the conductors. In any practical
448: simulation in a box of dimension $L$ we expect that ${\eta}<L^3/a^3$, so
449: that the effort need to equilibrate charges between conductors is less than
450: that required to perform a single sweep of the bulk of the simulation.
451:
452:
453: We thus have the basis for the generalization of a local Monte Carlo algorithm
454: for simulating charges in the presence of Dirichlet boundary conditions.
455: Conventional methods for treating this problem use fast Fourier techniques in
456: simple separable geometries, such as regular simulation cells. The use of a
457: local formulation of the electrostatics allows one to implement such boundary
458: conditions in arbitrary geometries --- including rough surfaces or irregular
459: electrodes where Fourier analysis does not work.
460:
461: \section{Simulating systems with slab geometries}\label{sec-slab}
462:
463: We now pass to consideration of a second important class of boundary
464: conditions that should be imposed in the study of systems with planar
465: geometries. Examples include thin quasi two-dimensional slabs isolated in
466: three-dimensional space, or in the biophysical field simulation of proteins in
467: a lipid membrane with an implicit solvent. In order to generate the correct
468: Coulomb interactions between particles with grid based methods the thin sample
469: must be embedded in a thick three-dimensional simulation box. This box
470: then contains many more degrees of freedom than the original particle
471: system. For reasons of efficiency one wishes to make the repeat distance
472: perpendicular to the thin sample as small as possible, however if this repeat
473: distance is too small multiple copies of the sheet ``see'' each other and
474: introduce artefacts in the simulation.
475:
476: Imposition of tin-foil or vacuum boundary conditions gives rise to simulations
477: that converge very slowly as the system size is increased. The crucial
478: insight into how to accelerate this convergence was provided in
479: Ref.~\onlinecite{berkoslab} and efficient implementations are now available that
480: translate these ideas \cite{holmslab,holmslab2} in molecular dynamics. Our aim
481: here is to reproduce this rapid convergence in a local formulation of
482: electrostatics, and to argue that the asymptotic complexity is at least as
483: good as $N^{3/2}$ and in many systems $N^{1}$.
484:
485: In standard approaches to the electrostatic energy all the complexity comes
486: from the transformation from an ambiguous, conditionally convergent sum (a sum
487: whose answer depends on the order of evaluation) into a rapidly converging,
488: unambiguous expression, such as the Ewald formula \cite{deleeuw}. In local
489: formulations there is \textsl{no equivalent to the conditional convergence}.
490: Instead one is left with different, inequivalent, choices for the treatment of
491: the zero wavevector component of the electric field $\E(q =0)$ \cite{JCP120}. Let
492: us first review the origin of these different choices.
493:
494: \subsection*{Periodic boundary conditions in local algorithms}
495:
496: In periodic boundary conditions an arbitrary vector field can be decomposed
497: into three terms
498: \[
499: \E = - \grad \phi + \curl \G + \bar \E
500: \]
501: where the potential $\phi$ is periodic, as is $\G$. $\bar \E$ is a constant;
502: it is the zero wavevector component of the electric field, $\E(q=0)$. With
503: this decomposition the energy is given by the sum of three independent terms
504: \[
505: U= \frac {\epsilon_0 }{2} \left\{ \int (\grad \phi)^2 \DR + \int (\curl \G)^2
506: \DR + V\: \bar \E^2 \right \}
507: \]
508: with $V$ the volume of the simulation cell. Cross-terms are shown to be zero
509: on integration by parts. The simplest version of the local Monte Carlo
510: algorithm uses two updates \cite{PRL88}.
511: \begin{itemize}
512: \item Motion of charges $q$ along links $l$ together with a slaved update of
513: the electric field on the link according to
514: \begin{math}
515: E_l \rightarrow E_l - q/ \epsilon_0
516: \end{math}. Both the longitudinal and transverse components of the field
517: are modified, as well as the $q=0$ component, $\bar \E$.
518: \item A plaquette update which leaves unchanged both $\bar \E$ and the
519: longitudinal field $-\grad \phi$, modifying only $\G$.
520: \end{itemize}
521: This pair of updates are respectively a discretized analog of the two terms on
522: the right hand side of the Maxwell equation
523: \[
524: \epsilon_0 \frac {\partial \E}{\partial t} = -\vect{J} + \curl \vect{H}.
525: \]
526: Integrating the Maxwell equation over both time and the simulation volume we
527: see that the $q=0$ component of the field and the dipole moment of the
528: system of charges $\vect{d}= \int\!\!\D t \int\!\!\DR \vect{J}$ are linked by
529: $\epsilon_0 V \bar \E + \vect{d}= \mathrm{const}$, a conservation law which remains
530: valid for the discretized equations.
531:
532: Thus the simplest form of the algorithm samples the partition function
533: \begin{equation}
534: Z = \int\DD \E \;\delta (\div \E - \rho) \: \delta(\epsilon_0 V \bar \E + \vect{d})
535: \: e^{-\beta \int \epsilon_0 \E^2/2 \DR }. \label{nowind}
536: \end{equation}
537: If we introduce the solution to the Poisson equation in periodic boundary
538: conditions $\phi_p$ then we see that this partition function samples
539: configurations with the effective energy
540: \begin{equation}
541: U_\mathit{eff} = \int \frac{\epsilon_0 (\grad \phi_p)^2}{2} \DR + \frac{\vect{d}^2}
542: {2 \epsilon_0 V}. \label{ueff}
543: \end{equation}
544: This result is very similar to that found using careful evaluation of the
545: Coulomb sum \cite{deleeuw} which gives
546: \[
547: U_{lps} =\int \frac {\epsilon_0 (\grad \phi_p)^2 }{2} \DR + \frac{\p^2
548: }{2(1+ 2 \epsilon_s) \epsilon_0 V}
549: \]
550: where $\p$ is the cell dipole moment and $\epsilon_s$ the relative
551: dielectric constant of an ``exterior'' reference medium, two common choices
552: being $\epsilon_s=1$ for \textsl{vacuum}\/ boundary conditions and
553: $\epsilon_s=\infty$ for metallic or \textsl{tin-foil}\/ boundary conditions. The
554: expression resulting from the local algorithm is very similar to that found in
555: the summation method if we take $\epsilon_s=0$ and we notice that $\vect{d}$ and
556: $\p$ are \textsl{almost}\/ identical.
557: $\p$ is the dipole moment of the charge images inside the Bravais cell being
558: used in the simulation; when a particle crosses the boundary of the cell it is
559: replaced by that of its periodic images which enters the cell so that $\p$ is
560: discontinuous. $\vect{d}$ is a dipole moment which is continuous on crossing
561: Bravais cell boundaries, thus it keeps track of how many times the particles
562: wind around the simulation box:
563: \[
564: \p = \vect{d} - \sum_i \vect{a}_i q_i
565: \]
566: where $q_i$ is the charge of each particle in the simulation cell and
567: $\vect{a}_i$ is a Bravais lattice vector.
568:
569: The authors of Ref.~\onlinecite{StatPhys} introduced another update scheme for the
570: electric field based on a \textsl{worm}\/ algorithm widely used in the simulation
571: of quantum spins \cite{alet}. The algorithm nucleates a pair of virtual
572: charges $\pm q_v$. One of these charges diffuses until it returns to its
573: companion where the two charges annihilate. If the mobile charge is confined
574: to the periodic cell then during the move only the transverse field $\curl \G$
575: is updated. If the particle is allowed to wind around the cell it breaks the
576: conservation law on $\epsilon_0 V\bar \E + \vect{d}$, removing the second
577: $\delta$-function in \Eqref{nowind}. We then find that the effective energy
578: \Eqref{ueff} is independent of $\vect{d}$; we have effectively periodic, that
579: is tin-foil, boundary conditions. A similar result is found by including $\bar
580: \E$ as a single extra dynamic variable which must be updated with a third,
581: independent Monte Carlo move \cite{PRL88, JCP120b}.
582:
583: \subsection*{Finite size effects in slab geometries}
584:
585: We now give a short argument for the slow convergence of the interaction
586: energy for systems which are simulated in slab geometries. Rigorous
587: calculations which provide the full justification are to be found in the
588: literature \cite{fraser, berkoslab,holmslab}. Consider a thin, quasi
589: two-dimensional system embedded in a simulation box of dimensions $L^2 \times
590: L_z$; usually one is interested in the case $L_z/L >1$ so that successive
591: periodic images do not interact too strongly.
592:
593: The slow convergence of the energy can be understood by considering the
594: electrostatic potential in a mixed real-space/Fourier representation, $\hat
595: \phi(\q_\parallel,z)$ where $\q_\parallel$ denotes the transverse
596: wavevector in the $(x,y)$ plane. Using the fact that polarization of a sample
597: is equivalent to a space charge $\rho=-\div \P$ %ACM
598: the mean %LL since sheets are uniform
599: polarization of the thin
600: sample in the $z$ direction is equivalent to two charge sheets of strength
601: $\sigma= \pm p_z/L^2 h$ where $p_z$ is the $z$ component of the dipole moment
602: and $h$ the sample thickness. The interesting physics occurs in the equation
603: for $q_\parallel=0$. We consider a single cell in the $z$ direction, placing
604: the source $-\sigma$ at $z=0$ and the second $+ \sigma$ at $z=h$. Then
605: \[
606: \epsilon_0 \frac{\partial ^2 \hat \phi(0, z) }{\partial z^2} = \sigma
607: \left [ \delta(z) - \delta(z-h) \right ].
608: \]
609: This has as a solution
610: \begin{align*}
611: \hat \phi(0,z) &=(-e_0+\sigma/\epsilon_0 )z &0&<z<h \\
612: &=(-e_0+\sigma/\epsilon_0 )h -e_0(z-h) &h&<z<L_z
613: \end{align*}
614: where we have used continuity, but not periodicity, of the potential.
615: $e_0$ is
616: a yet to be determined integration constant; it corresponds to the electric
617: field flowing between two copies of the simulation cell, Fig.~\ref{periodpot}.
618: The $z$ component of the electric field is
619: \begin{align*}
620: E_z&= E^{int}=e_0- \sigma/\epsilon_0 \quad &0&<z<h \nonumber \\
621: &=E^{ext}=e_0 \quad &h&<z<L.
622: \end{align*}
623: The energy of this simulation cell is the integral of $\epsilon_0 E_z^2/2$,
624: \[
625: U_\mathit{Coulomb} = \frac {\epsilon_0 L^2 }{2}
626: \left \{
627: (e_0-\sigma/\epsilon_0)^2 h + (L_z-h)e_0^2
628: \right\}.
629: \]
630: The classical tin-foil solution is recovered by setting $e_0= \sigma
631: h/\epsilon_0 L_z$ so that the potential is periodic, $\phi(0)=\phi(L_z)$,
632: Fig.~\ref{periodpot}, and
633: the average field $\bar E_z=\frac{1}{L_z}\int \D z\, E_z(z)=0$. But the energy
634: then depends on $L_z$,
635: \begin{equation}
636: U_\mathit{Coulomb} = U_\infty - \frac {p_z^2 }{2 \epsilon_0 L^2 L_z} \label{Ustack}
637: \end{equation}
638: where $U_\infty$ is the energy in the limit of large $L_z$. If one
639: considers a series of slabs with identical dipole moment and transverse
640: dimensions and vary $L_z$ then the energy converges as
641: only $1/L_z$; very large, and mostly empty boxes must be simulated in order to
642: reduce finite size artefacts.
643:
644:
645: \begin{figure}
646: \centering
647: \includegraphics{potslabper1}
648: \caption{Plot of $\hat \phi(0,z)$ in the presence of a double
649: layer. $E^{int}= e_0-\sigma/\epsilon_0$, $E^{ext} = e_0$, with $e_0=\sigma
650: h/\eps L_z$. Potential
651: plotted over several simulation cells. The non-zero $E^{ext}$ couples
652: successive periodic images.}
653: \label{periodpot}
654: \end{figure}
655:
656:
657: \begin{figure}
658: \centering
659: \includegraphics{potslab1}
660: \caption{Plot of $\hat \phi$ with $e_0=0$. The field between
661: slabs, $E^{ext}$, is zero.
662: There is no dipolar interaction between the slabs.}\label{stack1}
663: \end{figure}
664:
665: There is no such convergence problem when using anisotropic electrostatic
666: boundary conditions in which the exterior field is always zero: $e_0=0$,
667: Fig.~\ref{stack1}. The energy is $U_\mathit{Coulomb} = U_\infty$, independent of
668: $L_z$. The local algorithm automatically gives $e_0=0$, as do Maxwell's
669: equations; in order to still have $\bar E_x=\bar E_y=0$ we require tin-foil
670: boundary conditions in the $(x,y)$ plane. Our method implicitly includes the
671: $+p_z^2/2\eps V$ correction that potential-based algorithms need to add to the
672: tin-foil energy. Since the particles remain confined to a single lattice cell
673: in the $z$ direction there is no distinction between $d_z$ and $p_z$.
674:
675: Let us now consider the effect of density fluctuations with the plane, by
676: studying the Poisson equation for wavevectors $\q_\parallel \ne 0$:
677: \[
678: -q\lo{}^2\hat{\phi}+\frac{\partial^2\hat{\phi}}{\partial z^2}=
679: -\frac{{\hat \rho(\q_\parallel,z)}}{\eps}.
680: \]
681: Outside of the slab where $\hat \rho=0$ we conclude that
682: \[
683: \hat{\phi}(\q_\parallel\ne 0, z>h) \sim \e^{ \pm q_\parallel z}
684: \]
685: where $\q_\parallel=0$ corresponds to the special case treated above. The
686: next longest-ranged component to the interaction must come from modes of the
687: form $( 2 \pi /L,0,0) $ and lead to interactions decaying as $\e^{-2\pi
688: L_z/L}$. Already when $L_z/L=3$ one finds a reduction in the interaction by
689: a factor $7\times 10^{-9}$.
690:
691: \subsection*{Numerical tests}
692: To test these ideas we simulated a lattice gas with a slab geometry using the
693: local algorithm. The lattice spacing $a$ is set to unity. We start a
694: simulation with all positive and negative charges superposed at $z=0$ and
695: $\E=0$ in the whole simulation volume. We then displaced positive charges to
696: $z=1$, creating a dipolar sheet, updating the fields according to the
697: constrained algorithm. We simulated the fields using several different
698: temperatures, $T$ and cell heights, $L_z$. The total energy can be decomposed
699: into a static, electrostatic contribution plus a thermal energy $N_{pl} k_B
700: T/2$ coming from equipartition in the $N_{pl}$ degrees of freedom associated
701: with the transverse excitations. On fitting the total energy to the
702: form $$\langle U\rangle =U_\mathit{Coulomb}(L_z) +\frac{ k_BT N_{pl}}{2}$$ we
703: extracted an estimate of the electrostatic energy as a function of the cell
704: dimensions.
705:
706: \begin{figure}
707: \centering
708: \includegraphics{slabenergy_00wind}
709: \caption{Electrostatic energy of the slab system when all
710: three components of $\bar \E$ are sampled independently, corresponding to
711: tin-foil boundary conditions. Simulation results (+) follow
712: \Eqref{Ustack}. $L=15$, $\eps=1$. Five values of $k_BT$ from $0.1$ to
713: $0.5$ for each $L_z$.}\label{slab00wind}
714: \end{figure}
715:
716: In a first series of simulations we imposed the equivalent of tin-foil
717: boundary conditions by including the three components of $\bar \E$ in the set
718: of dynamic fields. The results are shown in Fig.~\ref{slab00wind}; as a guide
719: to the eye we added the continuous curve which corresponds to a correction in
720: the energy varying as $1/L_z$ (with the analytically determined prefactor). In
721: a second series of simulations updates to $\bar{E}_z$ are
722: dropped. Fig.~\ref{slab00} shows that the electrostatic energy is now
723: independent of $L_z$ to within the precision of the measurements and equal to
724: $U_{\infty}$. The natural coupling between $\vect{d}$ and $\bE$ introduced by
725: our local method removes the dipolar interaction between replicas of the slab.
726:
727: \begin{figure}
728: \centering
729: \includegraphics{slabenergy_00}
730: \caption{Coulomb energy of the slab system when $\bar{E}_z$
731: is not updated independently of charges. Simulation results (+) are
732: independent of $L_z$. $L=15$, $\eps=1$. Five values of $k_BT$ from $0.1$
733: to $0.5$ for each $L_z$.}\label{slab00}
734: \end{figure}
735:
736:
737: \subsection*{Discussion}
738: In a local Monte Carlo simulation the most obvious implementation would use a
739: mixture of local updates of the particles together with the \textsl{worm}\/
740: algorithm \cite{StatPhys, alet} in order to integrate over the transverse
741: degrees of freedom in the empty bulk of the simulation. This worm algorithm
742: re-equilibrates the transverse field with an effort which is $O(1)$ per
743: updated degree of freedom (which corresponds to plaquettes). If one were to use
744: just a single worm update per sweep of the particles then we find a complexity
745: per sweep which varies as $O(N)$ for the particle motion, and $O(N^{3/2})$ for
746: the worm dynamics. In practice launching a worm which simulates the entire
747: simulation box for every particle sweep results in an oversampling of the
748: uninteresting transverse degrees of freedom. If one simulates a set of
749: particles for a time $\tau$ then diffusion motion in the plane will give a
750: typical displacement $\ell_t\sim \sqrt{\tau}$. A worm which updates
751: plaquettes a distance more than $\ell_t$ from the slab is doing unnecessary
752: work.
753:
754: This suggests the following hierarchical scheme: every sweep we launch a worm
755: confined to the simulation slab thickness $h$, then every $4$ sweeps we launch
756: a worm confined to a distance $2h$. Similarly every $2^{2n}$ sweeps we allow
757: the worm to propagate $2^nh$ in the $z$ direction. In such a scheme the
758: longest wavelength modes of the electric field are re-equilibrated on the same
759: timescale as is needed for particles to diffuse across the simulation
760: box. The worm then spends most of its time updating at the scale of the slab
761: so that the total algorithm has a complexity scaling as $N^1$.
762:
763: \section{Conclusion}
764:
765: We have considered the formulation of generalized boundary conditions in a
766: form useful for local electrostatic simulation algorithms. We have shown how
767: to treat metallic boundaries for which one imposes a constant potential at a
768: surface. An additional Monte Carlo move which transfers charge between
769: conductors performs the Legendre transformation from a constant-charge to a
770: constant-potential ensemble.
771:
772: The local algorithm (like Maxwell's equations) naturally generates a dipolar
773: contribution to the solution to the Poisson equation in a periodic simulation
774: cell. By choosing an anisotropic integration over the $q=0$ components of the
775: electric field we reduce the spurious interaction between different copies of
776: a planar system.
777:
778: Molecular dynamics implementations of both problems are potentially possible
779: \cite{joerglong}. For the first problem of constant-potential simulation one
780: could alternate between a symplectic integrator (e.g. velocity Verlet) for the
781: particles and a Monte Carlo step for charge transfer between conductors, or
782: introduce a kinetic degree of freedom for the charges on each conductor. In
783: the second problem of slab geometries one would need to follow the evolution
784: of the electric field at each time step throughout the simulation cell,
785: loosing the possibility of multiscale updates.
786: Implementation of these ideas has been performed in Ref.~\onlinecite{comp}.
787:
788: Work financed in part by Volkswagenstiftung.
789: \bibliography{coulomb}
790: \end{document}
791: