• Tidak ada hasil yang ditemukan

Chapter 3: Generalization and optimization of dimension-free integrators for

4.4 Results

is performed with the same distribution used to generate trial configurations for the path sampling.

In total, each MC step involves a total number ofNpathMD force evaluations. Since Nforce is defined as the number of force evaluations per shifting event, and since Nsampleis the number of MC steps per shifting event, we have

Nforce =Nsample·Npath . (4.9)

As we seek to maximize the wall-clock speedup via parallelization of these inde- pendent force evaluations, we employ one processor per force evaluation, and thus

Nprocs =Npath . (4.10)

Additional parallelization within the force evaluation is of course possible, but is not considered in the current chapter. Thus, we insert Eqs. (4.9) and (4.10) into Eq. (4.8) to arrive at the following expression for the PAMD speedup:

χ= Nshift

Nsample · dt

dtE . (4.11)

See Tbl.4.1for a summary of terms.

Eq. (4.11) under the stated assumptions. The computational cost associated with each speedup can be obtained by multiplying the reported value with the number of parallel processors,Nprocs, employed in each application.

4.4.1 Harmonic oscillator

Here, we consider the example of an overdamped harmonic oscillator, with potential V(x) = 12x2. Two measures of the accuracy of the integrated MD trajectories are considered. The first reports on the degree to which the trajectories sample the correct equilibrium distribution,

Eeq = qr

Rdx|P(x)−Ps(x)|2

Z (4.12)

whereP(x)is the exact Boltzmann distribution,Z is the associated partition func- tion, andPs(x)is the equilibrium distribution of positions sampled by the numerical integration schemes. The second measure of error reports on the accuracy of the MD time evolution. Specifically, we consider the autocovariance function

C(t) =⟨x(t)x(t+t)⟩= lim

T→∞

1 T

wT

0 dtx(t)x(t +t), (4.13) which is a simple exponential function for the overdamped harmonic oscillator [49],

C(t) = x2

exp(−κt), (4.14)

where the angled brackets indicate Boltzmann averaging. The second measure of error is thus

Edyn = |κ−κs|

k (4.15)

whereκ =γ−1 = 1is the exact decay constant andκsis the decay constant obtained by fitting the exponential decay of the autocovariance from the numerically inte- grated MD trajectories. Specifically,κsis obtained by averaging over100indepen- dent trajectories of length105 time units that are divided into103 non-overlapping time series, for which the log-autocovariance is linearly fit in the range t ∈ [0,4]. Simulation parameters for integration of the MD trajectories in this application are chosen to ensure that both measures of error remain below3%.

Table4.2indicates that with a time-step ofdtE= 0.025, the Euler algorithm yields error values ofEeq = 0.3%andEdyn = 1.0%. Also shown in the table are parame- ters for three separate PAMD simulations that obtain speedups ofχ= 16,128, and

1024with respect to the Euler algorithm. For both the equilibrium distribution and the autocovariance function, Fig.4.6shows the comparison of the exact results and those obtained using PAMD with the aforementioned speedups. The accuracy of the PAMD trajectories is clearly preserved in all simulations, as indicated by the plotted results and the reported values ofEeq andEdyn.

B A

Figure 4.6. For the harmonic oscillator, comparison of PAMD results (colored lines) with exact results (black dots) forAthe Boltzmann distributionP(x)andBthe autocovariance functionC(t). The PAMD results correspond to Simulation1(red), Simulation2(green), and Simulation3(blue) in Tbl.4.2, which respectively achieve speedups ofχ = 16,128, and1024relative to the Euler algorithm.

For all PAMD simulations reported in Tbl.4.2, a significant fraction of the speedup comes from the 16-fold larger time-step that can be employed in the path-based scheme (dt = 0.4vs.dtE = 0.025). The larger speedups achieved in Simulation2 (χ = 128) and Simulation3(χ = 1024), in comparison to Simulation1(χ = 16), arise from the larger ratios of Nshift to Nsample that are used in these simulations (Nshift/Nsample = 8for Simulation2andNshift/Nsample = 64for Simulation3) in comparison to Simulation1(for whichNshift/Nsample = 1). The higher frequency of shifting events associated with larger values of the ratioNshift/Nsampleplaces greater demand on the efficiency of the path sampling, and a larger number of time-steps in the sampled path (Npath; hence, a larger number of parallel processors, Nprocs, per Eq. (4.10)) is needed to allow path segments to undergo a sufficient number of MC steps before they are used to generate the marginal distribution for the MD trajectories, as discussed in connection with Figs. 4.3 and 4.4. Accordingly, the value ofNpathin each of the simulations in Tbl.4.2is set as large as needed to ensure accurate MD integration at the corresponding value ofNsample, which is kept small (Nsample = 2in Simulation1, andNsample = 1in Simulation2and Simulation3) to enhance the PAMD speedup.

Table 4.2. Summary of PAMD simulation parameters used for the har- monic oscillator application. ParametersL,lmin, andlmaxare specific to the path sampling algorithm used, described in Sec.4.3.

Euler

dtE 0.025

Eeq 0.3%

Edyn 1.0%

Simulation1 SimulationPAMD 2 Simulation3

dt 0.4 0.4 0.4

Npath 16 256 4096

Nsample 2 1 1

Nshift 2 8 64

L 4 8 12

lmin 3 4 4

lmax 3 5 8

χ 16 128 1024

Eeq 0.3% 0.3% 0.5%

Edyn 0.3% 1.1% 2.9%

4.4.2 Lennard–Jones liquid

Here, we apply PAMD to a model for a molecular liquid. The pairwise interaction between particles is described using the standard energy- and force-shifted Lennard–

Jones potential [2], U(r) =

( u(r)−u(rc)−(r−rc)u(rc), r≤rc

0, r > rc , (4.16) whereu(r) = 4ϵ{(σ/r)12−(σ/r)6}; throughout, we takeϵ = 1andσ = 1. The system consists of27particles placed in a cubic box at reduced densityρσ3 = 0.50 and at constant reduced inverse temperatureβϵ= 0.74. Simulations are performed with periodic boundary conditions at constant volume, and the cutoff distance rc corresponds to half of the simulation box-length.

As described in Sec.4.3, the reported simulations for the Lennard–Jones liquid em- ploy trial configurations drawn from a distribution of paths for a fluid of hard spheres with diameterσHS. To prevent the path-sampling bias from affecting the accuracy of the integrated trajectories, we employ a hard-sphere schedule that varies as a func- tion of the path-timeτ,σHS(τ); path configurations are then sampled in accordance

with the path-time dependent potential

V(r;σHS(τ)) = U(r) +UHS(r;σHS(τ)), (4.17) whereU(r)is defined in Eq. (4.16), andUHS(r;σHS)is the hard-sphere potential

UHS(r;σHS) =

( +∞, r≤σHS

0, r > σHS . (4.18) The scheduleσHS(τ)is chosen such that configurational volume is excluded at the nose of the path for enhanced sampling efficiency, and no volume is excluded at the tail of the path where the marginal distribution for MD integration is sampled (Fig.4.7); in this way, path segments regenerated from the hard-sphere distribution are subsequently relaxed into the Lennard–Jones distribution as they shift from the nose to the tail of the path. A worthy direction for future work is to systematically optimize the scheduleσHS(τ), which in general will depend on the simulation pa- rameters reported in Tbl.4.1.

nose tail

path regeneration path sampling

scaled path-time

Figure 4.7. Hard-sphere scheduleσHS(τ), versus scaled path-timeτ, employed in the re- ported Lennard–Jones simulations. Insets show slices of the path-time dependent poten- tialV(r;σHS(τ))employed to sample path configurations (Eq. (4.17)) at schedule values corresponding to biased (σHS ≃ 1) and unbiased (σHS = 0) sampling of the equilibrium path distribution, and the hard-sphere potentialU(r;σHS)used to regenerate path segments (Eq. (4.18)).

The accuracy of the integrated MD trajectories is evaluated in terms of the radial distribution functiong(r)and the self-diffusion coefficientD, using the respective error measures

Eeq = qrrc

0 dr|g(r)−gs(r)|2 rrc

0 dr g(r) (4.19)

and

Edyn= |D−Ds|

D , (4.20)

whereg(r)andDare reference quantities obtained using the Euler algorithm with a small time-step (5×10−5 Lennard–Jones time units), andgs(r)and Ds are ob- tained using PAMD and the Euler algorithm with larger time-steps. The diffusion coefficient is given byD= 16limt→∞ d

dt⟨R2(t)⟩, where R2(t)

= lim

T→∞

wT 0 dt 1

N

N

X

i=1

|ri(t+t)−ri(t)|2 (4.21) is the mean-square displacement,rithe position of theith particle, andN the num- ber of particles [1]. ⟨R2(t)⟩is obtained by averaging over100independent trajecto- ries that are divided into100non-overlapping time series of length1, in Lennard–

Jones time units, and a linear fit is performed in the ranget∈[0.2,1]to evaluateDs

for the PAMD and Euler simulations.

Table4.3indicates that at a time-step ofdtE= 2.5×10−4, the Euler algorithm yields error values ofEeq = 1.4%andEdyn = 0.1%; larger time-steps were found to lead to unstable Euler trajectories. Also shown in Tbl.4.3 are two PAMD simulations that lead to16-fold (χ = 16; Simulation1) and128-fold (χ = 128; Simulation2) reductions of the wall-clock time required to generate equivalently accurate MD trajectories for the Lennard–Jones liquid via the Euler algorithm, using simulation parameters that keep error values below5%. The radial distribution functions and mean-square displacements obtained from these two simulations are plotted with the corresponding reference quantities in Figs. 4.8A and B. Excellent agreement between the PAMD and reference quantities is evident in the plots and from the values ofEeq andEdynreported in Tbl.4.3.

As in the harmonic oscillator application, the speedups reported in Tbl.4.3for the Lennard–Jones liquid are partially enabled by the use of a larger time-step in PAMD (dt= 5×10−4) than is possible for stable numerical integration via the Euler method (dtE = 2.5×10−4). The remaining speedup in both simulations comes from using shift lengths that integrateNshift = 8(Simulation1) andNshift = 64(Simulation2) time-steps of MD trajectory at a rate of Nsample = 1MC steps per shifting event.

Accurate integration at these speedups requires efficient sampling of path modes that are commensurate with the shifting timescale (8dtin Simulation1and64dtin Sim- ulation2); accordingly, long paths (Npath = 128in Simulation1andNpath = 4096 in Simulation2) are employed in both simulations so that segments can undergo a

B A

Figure 4.8. For the Lennard–Jones liquid at βϵ = 0.74 and ρσ3 = 0.50, comparison of PAMD results (colored lines) with numerically exact results (black dots) forAthe radial distribution function andBthe mean-square displacement. The PAMD results correspond to Simulation1(red) and Simulation2(green) in Tbl.4.3, which respectively achieve speedups ofχ= 16and128relative to the Euler algorithm.

sufficient number of MC steps before they are used to generate the respective MD trajectories (Fig.4.4).