13.07.2015 Views

Long-range interactions: P3M, MMMxD, ELC, MEMD ... - ESPResSo

Long-range interactions: P3M, MMMxD, ELC, MEMD ... - ESPResSo

Long-range interactions: P3M, MMMxD, ELC, MEMD ... - ESPResSo

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

http://www.icp.uni-stuttgart.de<strong>Long</strong>-<strong>range</strong> <strong>interactions</strong>:P 3 M, <strong>MMMxD</strong>, <strong>ELC</strong>, <strong>MEMD</strong> and ICC ∗Axel ArnoldInstitute for Computational PhysicsUniversität StuttgartOctober 10, 2012


<strong>Long</strong>-<strong>range</strong> <strong>interactions</strong>http://www.icp.uni-stuttgart.de• gravity• Coulomb interaction• dipolar interaction• hydrodynamic interactionA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 2/40


Electrostatics in periodic boundary conditionshttp://www.icp.uni-stuttgart.deAlternatively from potentialU = 1 2• Poisson’s equation:N∑q i φ(r i )i=1N∑∇ 2 φ(r) = 4π δ(r j − r)q j ,j=1imposing periodic boundary conditions• intrinsic solution• difference to spherical sum known• intrinsic U is periodic in coordinates r iA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 4/40


Electrostatics in <strong>ESPResSo</strong>http://www.icp.uni-stuttgart.de• requires myconfig.h-switch ELECTROSTATICS• switching on:inter coulomb • methods and their parameters: next 2 hours• switching off:inter coulomb 0• getting l B , method and parameters:intercoulombreturns e. g.{ coulomb 1.0 p3m 7 .75 8 5 0 .1138 0.0}{ coulomb epsilon 80 .0 n_interpol 32768 mesh_off 0.5 0.5 0.5}A. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 5/40


Assigning chargeshttp://www.icp.uni-stuttgart.de• assigning charges to particlespart 0 pos 0 0 0 q 1part 1 pos 0.5 0 0 q -1.5• adding a charged plateconstraint plate height sigma • plate parallel to xy-plane at z = h, charge density σ• requires 2D periodicity• adding a charged rodconstraint rod center lambda • rod parallel to z-axis at (x, y) = (c x , c y ), line charge density λ• requires 1D periodicityA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 6/40


The Ewald methodhttp://www.icp.uni-stuttgart.deP. P. Ewald, 1888 — 1985Coulomb potential has 2 problems1. singular at each particle position2. very slowly decayingIdea: separate the two problems!• one smooth potential — Fourier space• one short-<strong>range</strong>d potential — real spaceA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 7/40


Ewald: splitting the potentialhttp://www.icp.uni-stuttgart.decharge distributionρ = ∑N ∑n∈LZ 3 i=1q i δ(r − r i − n)= +replace δ by Gaussians of width α −1 :ρ Gauss (r) = ( α/ √ π ) 3 e−α 2 r 2δ(r) = ρ Gauss (r) + [δ(r) − ρ Gauss (r)]A. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 8/40


The Ewald formulahttp://www.icp.uni-stuttgart.dewithU (r) = 1 2∑∑ ′m∈Z 3 i,jU (k) = 12L 3 ∑k≠0U (s) = − α √ π∑U = U (r) + U (k) + U (s)q i q jerfc(α|r ij + mL|)|r ij + mL|4πk 2 e−k 2 /4α 2 |̂ρ(k)| 2iq 2 iforces from differentiationF i = − ∂∂r iUreal space correctionGaussians in k-spaceGaussian self interactionA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 9/40


The dipole termhttp://www.icp.uni-stuttgart.deɛ = ɛ ′ 32 1 2( ɛ = 13 1 0 1 3U (d) 2π ∑=(1 + 2ɛ ′ )L 3 i2 1 2ɛ = ɛ ′3q i r i) 2• Ewald sum derived from Poisson’s formula ⇒ intrinsic potential• spherical summation leads to additional term U (d)• polarizable material of dielectric constant ɛ ′ outside sphere• ɛ ′ = 1 corresponds to mathematical sum• ɛ ′ = ∞ (metallic boundary conditions) ⇔ intrinsic potentialA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 10/40


Mesh-based Ewald methodshttp://www.icp.uni-stuttgart.deR. W. HockneyJ. W. Eastwood• replace k-space Fourier sum by discrete FFT• discrete FT is exact — constant real space cutoff• computational order O(N log N)• most frequently used methods:• P 3 M: optimal method• PME• SPMER. W. Hockney and J. W. Eastwood,Computer Simulation Using Particles, 1988M. Deserno and C. Holm, JCP 109:7678, 1998A. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 12/40


Steps of P 3 Mhttp://www.icp.uni-stuttgart.de1. {r i , q i } → ρ(r): interpolate charges onto a grid(window functions: cardinal B-splines)2. ρ(r) → ̂ρ(k): Fourier transform charge distribution3. ˆφ(k) = Ĝ(k)ˆρ(k): solve Poisson’s equation by multiplicationwith optimal influence function Ĝ(k)(in continuum: product of Green’s function 4π andk 2Fourier transform of Gaussians e −k 2 /4α 2 )4. ik ˆφ(k) → Ê(k): obtain field by Fourier space differentiation4. Ê(k) → E(r): Fourier transform field back5. E(r) → {r i , F i }: interpolate field at position of chargesto obtain forces F i = q i E iA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 13/40


Charge assignmenthttp://www.icp.uni-stuttgart.deq5q1aqq6q 3 q4q 2q7 8• interpolate charges onto h-spaced gridM (P ) (x)10.80.60.40.2001123425637x4567ρ M (r p ) = 1 h 3N ∑i=1q i W (p) (r p − r i )• W (p) (r) cardinal B-splines in P 3 M / SPMEA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 14/40


Optimal influence functionhttp://www.icp.uni-stuttgart.deĜ opt (k) = h 6 ik · ∑m∈Z 3 Ŵ (p)2 (k + 2π h m)̂R(k + 2π h m)|k| 2 [ ∑m∈Z 3 Ŵ (p)2 (k + 2π h m) ] 2• aliasing of continuum forcêR(k) = −ik 4πk 2 e−k 2 /4α 2with differentiation, Green’s function and transform of Gaussian• minimizes the rms force error functionalQ[F] := 1 ∫h 3 d 3 r [ F(r; r 1 ) − R(r) ] 2h 3 d 3 r 1∫VA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 15/40


http://www.icp.uni-stuttgart.deWhy to control errorsrms force error ∆F =√ 〈(F exact − F Ewald ) 2〉 =∆F1010.10.010.0010.0001r max=1, k max=10r max=2, k max=10r max=1, k max=201e-050 1 2 3 4 5α√1NN∑i=1∆F 2i• optimal α brings orders of magnitude of accuracy• at given required accuracy, find fastest cutoffs• compare algorithms at the same accuracyA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 16/40


How to: error estimateshttp://www.icp.uni-stuttgart.deKolafa and Perram:∆F∆F real ≈1010.10.010.001total errorreal space estimatek-space estimate0.00010 1 2 3 4 5α∑ q2√Ni2)√(−αrmax L exp 2 r 23 maxHockney and Eastwood:∆F Fourier ≈√∑ q2√NiQ[Ĝopt(k)]L 3A. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 17/40


P 3 M in <strong>ESPResSo</strong> (H. Limbach, AA)http://www.icp.uni-stuttgart.de• tune P 3 M for rms force error τinter coulomb p3m tune accuracy \[ r_cut ] [ mesh ] [ cao ] [ alpha ]inter coulomb [ epsilon ɛ ∞] [ mesh_off o x o y o z ]• ɛ ∞ is dielectric constant at infinity (defaults to “metallic”)• o x , o y , o z shifts the mesh origin (defaults to (0, 0, 0))• tunable parameters are (can be fixed)α Ewald splitting parameter (don’t fix!)r max real space cutoff (0 to retune)n M = L/h mesh size (0 to retune)p charge assignment spline order p (0 to retune)• manually set parameters (dangerous!)inter coulomb p3m A. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 18/40


Partially periodic systemshttp://www.icp.uni-stuttgart.de• partially p. b. c. for slablike systems (surfaces, thin films)• ... or for cylindrical systems (rods, nanopores)• dielectric contrasts at interfaces• P 3 M cannot be employed straightforwardlyA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 19/40


Alternative approaches: screeninghttp://www.icp.uni-stuttgart.deU(r)1010.10.011/rexp(-r)/rexp(-r/4)/r0.0010.1 1 10screened Coulomb potential, screening length β −1 :rU β = ∑ m∈Z 3N ∑i,j=1q i q je −β|r ij +mL||r ij + mL|• U = lim β→0 U β is periodic ⇒ intrinsic solutionA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 20/40


Taking the limit: MMM2D far formulahttp://www.icp.uni-stuttgart.deφ β (r) = ∑k,l∈LZ(= 2 ∑ ∑Lp∈ 2π L Z l∈LZ= 2πL 2⎛= 2π ⎝L 2e −β√ (x+k) 2 +(y+l) 2 +z 2√(x + k)2 + (y + l) 2 + z 2∑p,q∈ 2π L Z∑p 2 +q 2 >0K 0( √β2+ p 2 √(y + l) 2 + z 2 ) ) e ipxe − √β 2 +p 2 +q 2 |z|√β2 + p 2 + q 2 eipx e iqye fpq|z|f pq⎞e ipx e iqy + |z| ⎠ + π L 2 β−1 + O β→0 (β)• singularity cancels due to charge neutrality• bad or no convergence for z ≈ 0A. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 21/40


http://www.icp.uni-stuttgart.deMMM2D near formulaφ β (r) = 4 ∑ ∑(K 0Ll∈LZ p∈ 2π L N− 2 L− 1 L+∑n≥1∑n≥0)p√(y + l) 2 + z 2[ (zb 2n (2π) 2n) ] 2n + iy2n(2n)! R Lcos(px)( −1) 2 ψ (2n) (2 + x L ) + ψ(2n) (2 − x L )n(2n)!( y 2 + z 21√(x + L)2 + y 2 + z + 1√ 2 (x − L)2 + y 2 + z 2L 2) n− 2 Llog (4π) −2πL 3 β−1 + ′ 1|r| + O β→0(β)• uses most special functions math offers• self energy: special case r = 0A. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 22/40


MMM2D procedurehttp://www.icp.uni-stuttgart.defar formula= +far formula• split system into slices• use near formula for adjacent slices, far for the rest• computation time near formula O(N 2 /B)• far formula O(NR max ) = O(NB 2 )• optimal B ∼ N −1/3 , computation time O(N 5/3 )near formulaA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 23/40


Dielectric contrastshttp://www.icp.uni-stuttgart.dezq∆ t ∆ bε tq∆ txl zqε mq∆ bε bq∆ b ∆ t• thin film of water in air, water at metallic plate• take into dielectric contrast by image charges• image charges take form of geometric series• handle using far formulaA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 24/40


MMM2D and MMM1D in <strong>ESPResSo</strong> (AA)http://www.icp.uni-stuttgart.de• using MMM2D tuned for maximal pairwise error τcellsystem layered inter coulomb mmm2d [] \[ dielectric | dielectric-contrasts ]• allows to fix k max (p, q)-space cutoffɛ t , ɛ m , ɛ b dielectric constants or∆ t , ∆ b dielectric contrasts• requires layered cell system• number of layers per CPU n layers = B/N p is tuning parameter• using MMM1D tuned for maximal pairwise error τcellsystem nsquareinter coulomb mmm1d tune • requires all-with-all cell systemA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 25/40


The method of Yeh+Berkowitzhttp://www.icp.uni-stuttgart.dereplicated slab systemslab systemreplicated slab system• potential of a charge and its periodic images similar to plate• plates cancel due to charge neutrality2πq iN∑j=1hLLzσ j (|z ji + mL z | + |z ji − mL z |) = 4πq i nL zN∑j=1σ j = 0• leave a gap and hope artificial replicas cancel( ) ∑ 2• requires changed dipole term U (d) = 2πL 3 i q iz iA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 26/40


Electrostatic layer correction (<strong>ELC</strong>)http://www.icp.uni-stuttgart.de• error not known a priori — required gap size?• idea: calculate contribution of image layersLayer correction termU lc = π L 2∑k∈ 2π L Z2k 2 >0N∑i,j=1q i q je |k|z ij+ e −|k|z ijf pq (e fpqLz − 1) ei(kx x ij + k y y ij )• cut off k 2 < R max : computational effort O(NR max )• subtract numerically the <strong>ELC</strong> term ⇒ smaller gaps• 2-4x faster than plain Yeh+BerkowitzAA, J. de Joannis, and C. Holm, JCP 117:2496, 2002A. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 27/40


<strong>ELC</strong> in <strong>ESPResSo</strong> (AA)http://www.icp.uni-stuttgart.de• using <strong>ELC</strong> for maximal pairwise error τinter coulomb p3m tune accuracy ...inter coulomb elc [k max >] \[ dielectric | dielectric-contrasts ]• gap size g = L z − h has to be specified• user is responsible to keep a gap (by walls or fixed particles)• gap location unimportant• requires P 3 M to be switched on first• allows to fix k max (p, q)-space cutoff (otherwise tuned)ɛ t , ɛ m , ɛ b dielectric constants or∆ t , ∆ b dielectric contrastsA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 28/40


Maxwell Equation Molecular Dynamicshttp://www.icp.uni-stuttgart.deA. C. MaggsJ. C. Maxwell,I. Pasichnyk1831 — 1879B. Dünweg• Electrostatics is quasi–static limit of electrodynamics• Maxwell equations are intrinsically local• dielectric constant can vary spatially• naturally include boundary conditions• ⇒ linear scaling, easy parallelization• problem: speed of lightA. C. Maggs and V. Rosetto, PRL 88:196402, 2002I. Pasichnyk and B. Dünweg, JPCM 16:3999, 2004A. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 29/40


Car–Parrinello Molecular Dynamicshttp://www.icp.uni-stuttgart.de• Electron dynamics in the nuclear potential isquasi–static limit of coupled electron–nuclei dynamics• problem: speed of electrons• Car–Parrinello: heavy electrons to avoid mismatch of time scales• statistics are still correctA. C. Maggs: electrostatics fromelectrodynamics with reduced speed of lightA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 30/40


Maxwell equationshttp://www.icp.uni-stuttgart.deElectrostaticsis c → ∞ limit of∇ · E = 1 ɛ 0ρ and ∇ × E = 0, F = qe E(F = qe E + 1 )ɛ 0 c 2 v × H∇ · E = 1 ρɛ 0∇ × E = − 1 ∂Hɛ 0 c 2 ∂t∇ · H = 0∂E∇ × H = j + ɛ 0∂ρ∂t + ∇ · j = 0∂tWhat if c ≪ ∞?A. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 31/40


Electrostatics as a constraint problemhttp://www.icp.uni-stuttgart.deElectrostatic Gauss’ law as constraint∇ · E = 1 ɛ 0ρ∇ · ∂∂t E = 1 ɛ 0∂∂t ρ ⇒ ∂ ∂t E + 1 ɛ 0j − ∇ × ˙Θ = 0• solve as constrained dynamics with Lag<strong>range</strong> multiplier• ˙Θ transversal component• equivalent to electrodynamics with ˙Θ ≡ c 2 H• but c freely choosable⇒A. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 32/40


Discretizationhttp://www.icp.uni-stuttgart.deDiscrete curl• discretize on simple cubic latticeof spacing a• charge on lattice sites• j, E on the links• Θ, H on plaquettesyE(2)(∇ × E) z = ∂ x E y − ∂ y E xE(1)E(3)a= 1 a [(E(3) − E(1)) − (E(2) − E(4))] E(4)xA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 33/40


<strong>MEMD</strong> procedurehttp://www.icp.uni-stuttgart.de1. calculate current j from ∫ ∂V j ds = ∫ V2. calculate Ḣ = −∇ × E3. propagate H4. calculate ˙Θ = c 2 H5. calculate Ė = − 1 ɛ 0j + ∇ × ˙Θ˙ρ dV6. propagate E7. backinterpolate E on particles and calculate forceA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 34/40


Self energy correctionhttp://www.icp.uni-stuttgart.de000 111000 111000 111000 11100 1100 1100 1100 11000 111000 111000 111000 111000 111000 111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000 111000 111000 111000 111• a charge “sees” its interpolated charge on the lattice• drives charge to center of mesh cell• solution: calculate lattice Green’s function and subtractA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 35/40


Initial electric fieldhttp://www.icp.uni-stuttgart.de• initial E-field required for updating• either use P 3 M & Co. for this• ... or a (slow) global update scheme• allows for spatial inhomogeneous dielectric constantA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 36/40


<strong>MEMD</strong> in <strong>ESPResSo</strong> (F. Fahrenberger)http://www.icp.uni-stuttgart.de• using <strong>MEMD</strong>cellsystem domain_decomposition -no_verlet_listinter coulomb maggs [ epsilon ɛ ∞]• requires the domain decomposition cellsystem, but with exactsorting (which implies not using Verlet lists)• requires to setf mass = 1/c 2n M = L/hɛ ∞mass of the field’s degree of freedommesh sizedielectric constant at infinity (defaults to “metallic”)• plain <strong>MEMD</strong> has artificial dipole term that keeps the initial dipolemoment constant• <strong>ESPResSo</strong> corrects the dipole term similar to P 3 MA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 37/40


Arbitrary dielectric contrastshttp://www.icp.uni-stuttgart.de• MMM2D/<strong>ELC</strong> only handle planar parallel dielectric interfaces• what about a nanopore? vesicle?• cannot be handled by image chargesA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 38/40


ICC ∗ algorithmhttp://www.icp.uni-stuttgart.de• Maxwell equation in dielectric medium• boundary condition at interfaceε in E in · n = ε out E out · n• can be fulfilled by interface charge densityσ = 12π ε ε in − ε outout Eε in + ε out• solve for σ iteratively, E from standard Coulomb solverA. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 39/40


ICC ∗ in <strong>ESPResSo</strong> (S. Kesselheim)http://www.icp.uni-stuttgart.de• set up the meshed interfacesdielectric sphere center \radius res eps • a is mesh size of the generated mesh• alternatively wall, pore, cylinder• creates Tcl variables with properties of thesurface points:• n induced charges• icc epsilons: list of dielectric constants, can vary per surface point• icc normals: list of normal vectors• icc areas: list of surface areas• sigmas: optional list of additional surface charge densities• surfaces charges are calculated byiccp3m $n_induced_charges epsilons $icc_epsilons \normals $icc_normals areas $icc_areas [ sigmas $icc_sigmas ]A. Arnold <strong>Long</strong>-<strong>range</strong> <strong>interactions</strong> 40/40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!