(r) = \u2014p(r) on the grid, with p(r) the charge density and e(r) the dielectric function. Examples of these are particle-mesh Ewald and multigrid methods. For particle-mesh Ewald, the point charges are replaced by discrete charge distributions using interpolation functions. The charge density is Fourier-transformed and the electrostatic potential is solved for in Fourier-space. As with the Ewald sum, since the electrostatic interactions are resolved using Fourier decomposition the algorithm is unable to deal with inhomo-geneous dielectric functions e(r). The particle-mesh Ewald method may achieve scaling of 0(N log N) through the use of Fast-Fourier Transforms (FFTs)[6, 7, 8]. Multigrid approaches represents a gen-eral class of schemes used to solve elliptic partial differential equations on a grid. These methods are highly efficient and may achieve O(N) scaling, with a volume dependent cofactor.. They rely on the observa-tion that when solving elliptic partial differential equations on a grid, using relaxation methods, the residual error in the solution is most readily reduced when the grid spacing is similar to the -wavelength of the error. Thus by adaptively coarsening or refining the grid spacing, the error is efficiently reduced[9, 10]. By solving for the electrostatic potential in real space Multigrid offers greater flexibility than other mesh or summation techniques. constrained auxiliary-field techniques An effective Coulombic interac-tion is mediated between charged particles by the introduction of a constrained electric field. This algorithm is the subject of this thesis; we will discuss the theoretical foundation of this method in chapter 3. 3 Chapter 1.. Importance of electrostatics and computational hurdles 1.1 Periodic boundary conditions for bulk and slab systems Rather than simulating a macroscopic number of charged particles (~ 10 2 3), periodic boundary conditions (PBCs) are applied in biophysics simu-lations. By using PBCs , each charged particle is surrounded by an infinite number of chafges[2]. In this manner, the system's characteristics may be deduced from only hundreds to hundreds of thousands of charges. The ap-plication of periodic boundary conditions may be understood as an infinite replication of the simulation cell as shown in figure 1.1. o o o o o . o o o o o R \" \\ o ^ o o o o v. o O Figure 1.1: Periodic Boundary Condition for a Rectangular Simulation Cell. R, a direct lattice vector of the simulated lattice. When the characteristics of interest occur in the bulk of a material, P B C s are applied to all three dimensions. For behaviour near an interface, P B C s are only applied to two of the three dimensions. Examples of in-terfacial systems include electrolyte solutions between charged glass plates, lipid-bilayers, macro-ion membrane and membrane-membrane interactions in cellular biology, as well as interacting Wigner crystals in condensed mat-ter physics [1, 2, 4. 5, 11, 12]. Many simple quasi-2D models exist, a few of which are shown in figure 1.2. 4 Chapter 1. Importance of electrostatics and computational hurdles . \u2022 - * --~ Figure 1.2: Several simple model systems with 2D symmetry. A crude model of neutral lipid bilayers. point charges confined to a plane with a negative surface charge (top left). Membrane-membrane interactions in-volving counter ions, modeled by monovalent negative point charges con-fined between positively charged plates (top right). Macro-ion membrane interactions, modeled by a diffuse layer of monovalent point charges and a charged plane (bottom left). Polyelectrolytes between glass plates, modeled by charged strings constrained between charged planes (bottom right). For quasi-2D systems, the third dimension is either infinite or finite. When the third dimension is finite the simulation is said to have slab ge-ometry. Many algorithms have been tailored specifically for either bulk or quasi-2D geometries. Examples of 3D periodic methods include the Ewald sum and particle-mesh Ewald. For quasi-2D simulations, many summa-tion techniques have been developed including the Lekner-Sperb, Haut mart-Klein, and the two-dimension Ewald sum [13, 14, 15, 16, 17]. To simulate dielectric or metallic interfaces, boundary matrix or image charge methods must be be used in addition to the quasi-2D schemes. Boundary matrix methods discretize Maxwell's equations at an interface and solve for the in-duced electrostatic charge[18]. The alternative to boundary matrix methods is to ensure Maxwell's equations are satisfied at the interface(s) by introduc-ing image charges[19]. For a single interface this is often sufficient as only a finite number of image charges are required. However, for two or more the number of required image charges, even for a single charged particle. 5 Chapter 1. Importance of electrostatics and computational hurdles becomes infinite as is shown in figure 1.3. For s implic i ty many simulations util ize the method of images but truncate the images at a finite order, lead-ing to reduced accuracy and inferior scaling. Figure 1.3: M e t h o d of images for two planar symmetric dielectric interface 1.2 A n important model: The electric double layer A n important interfacial model is that of the electric double layer ( E D L ) . It consists of a charged wal l coupled to a diffuse region of mixed valency cation and anion species, as is shown in figure 1.4. Often included is a plane of nearest approach to the interface, which is used to model a th in layer of monovalent adsorbed anions. A common variant is interacting electric double layers, also shown in figure 1.4. + i e . mm o + l e mm i \u00b0 \u00bb o o \u00b0 ms 6 8 +2e +2e Figure 1.4: Schematic of the electric double layer (left) and interacting electric double layers (right). The E D L model has been the subject of much interest as it may be used on such varied systems as interfacial colloid emulsions and l ip id bilayers. A n important problem, known as the Gouy-Chapman problem[20], is the Chapter 1. Importance of electrostatics and computational hurdles determination of the ion density profiles. Analytic expressions are known in asymptotic limits, but a general theory remains unresolved. Computer simulation is a reliable means of predicting behaviour in the intermediate regimes as well as testing the validity of expansions and approximations. 1.3 Limitations of existing methods Realistic simulations remain limited by many factors. Most of the algo-rithms which provide suitable scaling cannot be applied directly to systems with slab geometry, or require additional computational complexity to re-solve interfacial boundaries. Methods reliant on Fourier transforms assume homogeneous dielectric functions. For many systems the effect of inhomoge-neous dielectrics is a reality and cannot be neglected as it leads to substantial modifications. For example, in the E D L , theory does not offer quantitative agreement with experiment, even in the known asymptotic limits, without the addition of a Stern layer[18]. The Stern layer is a thin layer of low di-electric coefficient that is believed to be caused by a strong polarization of the solvent near the dielectric interface. Contemporary simulations often incorporate hundreds of thousands of charged particles. To achieve simulations of this size, parallel computing-is necessary. Thus another scaling issue arises. Even though many meth-ods achieve impressive scaling with particle number, their efficiency peaks quickly as more processors are used. This is often due to the use of F F T s , which provide poor parallel performance due to the need to share the charge density across all processors at each time-step. This is indicative of a more severe limitation, non-locality. Most algorithms require a global solution of the potential after each update to the charge density. Thus global communi-cation between all processors is required following each update. An efficient parallel method would minimize this communication and ensure that only neighbouring nodes share information. Thus it is desirable to be able to compute the potential using only local updates. For Monte Carlo the issue of non-locality is even more problematic. For molecular dynamics global optimization remains reasonable, as the forces on all particles may be calculated simultaneously and the time stepped forward to achieve a new configuration in a single optimization. In contrast, in Monte Carlo a new arrangement requires N calculations of the electrostatic 7 Chapter 1. Importance of electrostatics and computational hurdles energy. This suggests that even the best electrostatic algorithms cost 0(N2) for Monte Carlo. 1 . 4 H i s t o r y o f t h e a u x i l i a r y - f i e l d t e c h n i q u e The auxiliary-field technique was proposed in 2002 by A . C . Maggs and collaborators[21]. It is a reformulation of the Coulomb.problem in terms of a constrained vector field, requiring local updates only. When implemented for Monte Carlo, it has a complexity O(N). It has been implemented for bulk and quasi-2D geometry lattice gases[21, 22, 23, 24]. As the formulation is entirely in real space, it is capable of treating inhomogeneous dielectrics. The behaviour of a lattice gas of mobile dielectrics has been studied in [24]. Extensions of the algorithm to simulate particles moving in a contin-uum have been implemented for bulk geometries[23, 25, 26]. In addition, a molecular dynamics method utilizing constrained auxiliary fields has also been developed[27] that also has a scaling O(N). 1 . 5 O u t l i n e o f t h e s i s For this thesis, we have developed an implementation of the auxiliary-field technique for application to the E D L . In chapters 2, 3, and 4 a review is given of the Ewald sum, the foundation of the auxiliary-field method, and the asymptotic limits of the Gouy-Chapman problem. A description of the implementation is given in chapter 5 and numerical accuracy is established in chapter 6. Our applications of the algorithm to the Gouy-Chapman problem and interacting E D L s with inhomogeneous dielectrics is presented in chapters 7 and 8. Throughout this thesis the electrostatic units used follow the SI convention. For conciseness, we present numerical results in Heaviside units with ks = eo = e = 1. 8 Chapter 2 The Ewald summation method In this chapter, we review the Ewald sum for systems with 2D and 3D periodicity as discussed in [6, 7. 8, 12, 13, 14, 16, 28, 29]. 2.1 T h e E w a l d s u m for 3 D p e r i o d i c b o u n d a r y c o n d i t i o n s Consider N charged point particles with charge {qj, q2,qN} at positions {rj, r - 2 , r \/ v } within a homogeneous dielectric medium of volume V and dielectric coefficient e. The electrostatic energy is 47T6 ^ r; - r; v ' i + 0( Scj)2 ) = U\\(p] + j d:irV-(-eV(50)(\/> + 0{ Sep2 ) = U[(p} + j d : 5r Sp 0 + O( 5**{V D - p^j -z2 dSi(nj \u2022 D + a ^ S Thus the extrema of T is defined by (3.27) -e ( r )V^r ) = D(r) r e V (3.28) V-D(r) = p(r) reV (3.29) M r ) - D ( r ) = ^(r) r e dSi (3.30) S(r) = <\/>(r) r \u20ac dS* (3.31) 2(r) = d>(-')(r) r e c\\Sl (3.32) from which we arrive at the electrostatic equations of motion. The Legendre transform has achieved the desired effect of introducing Dirichlet boundary conditions. 20 Chapter 3. Electrostatics and constrained statistical mechanics Now consider the partition function with Dirichlet boundary conditions r(Dir.) _ 1 f fTjd3^ xVB 5( V--D-p)]j(vol 5( ni-D + Oi^ ( 3 . 3 3 ) > ^ - \/ < ^ ? \u00a3 ^ ) Let (fP be the electrostatic solution. We define erf (r) through the relation <7f(r) = -ni(r)-e(r)V<^(r), r e dS, ; ( 3 . 3 4 ) Substituting D = \u2014eVcjP + V x Q and cr, = o\\ + Oi into Zjy we get x ^ P ( V x Q ) <$( V-V.xQ) J J ^ P ^ S( hi \u2022 V x Q + a, )^ ( 3\" 3 5) 2 \/\u2022 ^ ^ ( e z t ) V .\/ 2kBTe ^Js< kBT = ZCDoullmb\\ 1 X ZF\u00b0iuct\\ i r i ) \\ As before, for a dielectric background independent of the particle coordinates (Dir ) we find that ZN is equivalent to the partition functions for an ensemble of particles interacting via Coulomb forces. However, the equivalent potential produced is now subject to Dirichlet boundary conditions along Sj. In the general case of mobile dielectrics, the term Z^^J has yet to be proven to result in interacting thermally agitated dipoles. However, the form of (Dir ) Zpiuct suggests equivalence. For the purpose of this work, proving the latter is unimportant as we are only concerned with systems with dielectric functions e(r) independent of the ion coordinates {ri}. This formulation is quite interesting as it presents an alternative to the use of either matrix boundary or image charges methods for dealing with metal-lic boundaries in the Coulomb problem. In addition, no approximations have been made to arrive at the statistical equivalence of these ensembles. 21 Chapter 4 Analytic theory of the Gouy-Chapman problem This chapter presents a review of field theory methods applied to the monovalent homogeneous EDL as developed by R. Netz and collaborators in [1. 2, 4. 5]. The asymptotic counter-ion density expressions reviewed are used to test our algorithm when applied to the slab geometry in chapter 7. 4 .1 Electric double layer Hamiltonian Consider N charges of charge \u2014e confined to a region defined by the re-stricting function f2(r), interacting only via Coulomb interactions. In addi-tion to the charges we allow a surface charge, **