Estimating Accuracy in Classical Molecular Simulation University of Illinois Urbana-Champaign Department of Computer Science Institute for Mathematics and its Applications July 2007
Acknowledgements Ben Leimkuhler (Edinburgh) Brian Laird (Kansas) Ruslan Davidchack (Leicester) Nana Arizumi (Illinois) S. Bond and B. Leimkuhler Acta Numerica 16, 2007.
Motivation Computation of Averages 1.7 Instantaneous Temperature 1.6 1.5 1.4 1.3 0 2 4 6 8 10 12 14 16 18 20 time
Motivation Computation of Averages # Trials 1.3 1.4 1.5 1.6 1.7 Instantaneous Temperature
Motivation Convergence of Averages 1.504 1.502 1.5 1.498 Temperature 1.496 1.494 1.492 1.49 1.488 1.486 10 2 10 3 10 4 Inverse Stepsize (1/dt)
Motivation Divergence of Trajectories 10 1 10 0 10 1 2 norm deviation 10 2 10 3 10 4 10 5 0 2 4 6 8 10 12 14 16 18 20 time
Goal What is the error in an average from a MD trajectory? Error = A numerical A exact Any estimate must account for two factors: Error Statistical Error + Truncation Error Asymptotic Bound: Error C 1 1 t + C 2 t p Talk will focus on truncation error. Paper on statistical error: E. Cancès, F. Castella, P. Chartier, E. Faou, C. Le Bris, F. Legoll, G. Turinici, 04, 05.
System of Equations Newton s Equations: Force = mass acceleration q = p/m and ṗ = U(q) q = position, m = mass, p = momenta First Order System ż = F (z), where F : R n R n Exact Solution Map z (t) = Φ t (t 0, z 0 )
Ergodic Time Average: 1 t A time = lim A (z (τ)) dτ t t 0 Ensemble Average: A ensemble = Ergodicity Ω A time = A ensemble A (z) ρ (z) dz (a.e.)
Liouville Equation Continuity Equation for the Probability Density: Generalized Liouville Equation: ρ t + (ρ F ) = 0 or Dρ Dt + ρ F = 0 D ln ρ Dt = F
Example: Nosé-Hoover Nosé-Hoover Vector Field Invariant Distribution ρ exp dq dt dp dt dξ dt { 1 k B T = M 1 p = U (q) ξ µ p = p T M 1 p gk B T ( )} 1 2 pt M 1 p + U (q) + ξ2 2µ
Error Analysis First Order System ż = F (z) Forward Error: Is the numerical trajectory close to the exact trajectory? z t (t) z (t) C t p Backward Error: Is the numerical trajectory actually an exact trajectory, but for a different problem? Method of Modified Equations F t (z) F (z) C t p
Error Analysis Ergodicity: Exact trajectories are sensitive (chaotic) to perturbations in the initial conditions Large Forward Error. Statistics: Thermodynamic properties (averages) are not a function of the details of the initial conditions Small Backward Error.
Backward Error Analysis: Modified Equations Given a pth-order numerical method, Ψ, we can always construct a modified vector field, F t, such that the numerical method provides a qth-order approximation to the flow of the modified system. If the numerical method and vector field are time-reversible (symplectic/hamiltonian), the modified vector field will be time-reversible (symplectic/hamiltonian). Unfortunately, even if the vector field is analytic, the modified vector field does not converge as q. Fortunately, it is still useful as a truncated series.
Big Picture Flow Map Vector Field Ensemble Φ t Ψ t F F t ρ ρ t
Example: Verlet Hamiltonian Verlet Splitting H (q, p) = 1 2 pt M 1 p + U (q) p n+1/2 = p n t 2 U (qn ) q n+1 = q n + tm 1 p n+1/2 p n+1 = p n+1/2 t 2 U ( q n+1) H 1 = 1 2 pt M 1 p, H 2 = U (q)
Example: Verlet Strang Splitting exp ( tl) = exp Modified Equations ( exp tl [r] t Solve for L [r] t ( ) ( ) t t 2 L 2 exp ( tl 1 ) exp 2 L 2 + O [ t 3] L 1 = M 1 p q ) = exp L = L 1 + L 2 L 2 = q U (q) p ( ) ( ) t t 2 L 2 exp ( tl 1 ) exp 2 L 2 + O [ t r+1] using Baker-Campbell-Hausdorff formula
Example: Verlet Original Hamiltonian: Modified Hamiltonian: H 2, t (q, p) = H (q, p) + t2 12 H (q, p) = 1 2 pt M 1 p + U (q) Verlet conserves H 2, t to 4th order accuracy! ( p T M 1 U M 1 p 1 ) 2 UT M 1 U
Example: Generalized Leapfrog Generalized Leapfrog p n+1/2 = p n t 2 qh (q n, p n+1/2) q n+1/2 = q n + t 2 ph (q n, p n+1/2) p n+1 = p n+1/2 t 2 qh q n+1 = q n+1/2 + t 2 ph Generalized Leapfrog Modified Hamiltonian: H t = H + t2 24 (q n+1, p n+1/2) (q n+1, p n+1/2) ( 2Hqj q k H pj H pk + 2H qj p k H pj H qk H pj p k H qj H qk )
Liouville Equation for Modified Vector Field Modified Equations dz dt = F t (z) where F t = F + t p G Modified Liouville Equation Weighting factor D Dt ρ t = ρ t F t ω t := ρ t /ρ, assuming ρ, ρ t > 0 implies D Dt ln (ω t) = t p ( G + G ln ρ)
Averages Truncation Error Estimate A Num A Exact A (q, p) ρ t dγ A (q, p) ρ dγ Γ Γ A Num 1/ω t Num A/ω t Num 1/ω t Num Reweighted Averages A Exact = A/ω t Num 1/ω t Num + O [ t r ]
Example: Nosé-Poincaré Hamiltonian: ( 1 H (q, p, s, π s ) = s 2 s 2 pt M 1 p ) + U (q) + π2 s 2µ + g k T ln s E 0 Nosé-Poincaré Modified Hamiltonian: H t = H NP + t2 12 s ( πs µ s pt M 1 U 1 2 UT M 1 U + 1 s 2 pt M 1 U M 1 p 1 ( 1 2 µ s 2 pt M 1 p ) 2 g k T + 2 g k T π2 s µ 2 )
Example: Modified marginal distribution: ρ t (q, p) dp dq = 1 δ [ ] H t (q, s, p, p s ) E 0 d p dq dps ds, C s p s = 1 [ ( )] s H N HN 0 + t 2 G d p dq dp s ds. C s p s δ Change of variables, integrating ρ = 1 e N f η 0 C gk BT + h 2 p s η G(q, 1 eη, p, p s ) dp s. η=η 0 η 0 = 1 ( ) H(q, p) + p2 s g k B T 2 µ + h2 G(q, e η 0, p, p s ) HN 0, More mathematical manipulations { [ ρ = ρ c C exp t2 2p j p k U qj q k ( ) Uq 2 j 1 p 2 2 ]} j gk B T, 24k B T m j m k m j µ m j j j j,k
Example: Weighting Factor: { t 2 ω t exp 24 k B T Reweighted Averages: [ 2p T M 1 U (q) M 1 p U (q) T M 1 U (q) 1 µ A Exact A/ω t Num 1/ω t Num ( ) ]} 2 p T M 1 p g k B T Hybrid Monte Carlo: J. Izaguirre and S. Hampton, J. Comput. Phys. 200, 2004. E. Akhmatskaya and S. Reich, LNCSE 49, 2006. Time correlation functions: R. D. Skeel, Preprint, 2007.
Numerical Experiment: System: 256 Particle Gas Lennard-Jones Potential T = 1.5ɛ/k, ρ = 0.95r 3 0, t = 20r 0 m/ɛ Method: Nosé-Poincaré (Symplectic, Time-Reversible) t = 0.012r 0 m/ɛ to 0.0001r0 m/ɛ Reference: Bond, Laird, and Leimkuhler J. Comput. Phys. 151 1999. S. Bond and B. Leimkuhler Acta Numerica 16, 2007.
Numerical Experiment: Extended Energy Conservation:
Numerical Experiment: Improved Estimator 1.52 Standard Reweighted 1.51 Temperature 1.5 1.49 1.48 10 2 10 3 Inverse Stepsize (1/dt)
Numerical Experiment: Improved Estimator Error 10 1 10 2 Standard 2nd Order Reference Reweighted 4th Order Reference 10 3 Error in Temperature 10 4 10 5 10 6 10 7 10 8 10 2 10 3 Inverse Stepsize (1/dt)
Future Directions: Further testing with more systems and averages Extensions to reduce computational cost Other ensembles and numerical methods
Stabilizing Hard Sphere Algorithms: 10 0 PSA CVA PCVA MCVA Deviation in Energy 10 2 10 4 10 6 0 1000 2000 3000 4000 5000 Time S. Bond and B. Leimkuhler, SIAM J. Sci. Comput, 2007, In press.