Implementation of a Semiclassical Initial Value Representation - ICTP

2 downloads 138 Views 435KB Size Report
application, called reserve smp nodes, is a system of 2 separate python scripts: a server script which runs locally and a client one which is ex- ecuted on the Grid ...
Implementation of a Semiclassical Initial Value Representation Code on the Grid to Calculate Rate Coefficients of Atom Diatom Reaction Noelia Faginas Lago∗

Department of Chemistry, University of Perugia, Perugia, Italy

Lecture given at the Joint EU-IndiaGrid/CompChem Grid Tutorial on Chemical and Material Science Applications Trieste, 15-18 September 2008

LNS0924012



[email protected]

Abstract A detailed description of the Grid implementation on the production computing Grid of EGEE of a semiclassical code performing a calculation of atom-diatom reaction rate coefficients is given. To run the job we have used an application written in python that allows the reservation of an entire node of the Grid and the running of the computations on it without conflicting with other user’s jobs. This application, called reserve smp nodes, is a system of 2 separate python scripts: a server script which runs locally and a client one which is executed on the Grid. An application to the SN + N2 reaction for which a massive computational campaign has been performed is reported.

Contents 1 Introduction

207

2 The SC-IVR method

208

3 The Grid implementation

210

4 Acknowledgments

214

Implementation of a Semiclassical Initial Value Representation Code

1

207

Introduction

The quantum dynamics of a molecular system is fully determined by the ˆ h), onto the given initial action of the time evolution operator, exp(−iHt/¯ wave function or density matrix. Related calculations can now be performed quite accurately for small polyatomic systems (like those involving only three or four atoms) using a basis set method [1, 2]. However, it is still difficult to foresee an application of the method to larger systems due to the exponential growth of the basis set with the system size. A totally different quantum dynamics treatment is the one based on real-time path integrals [3]. Yet, the direct application of this method to multidimensional systems or longer time dynamic processes is still prohibitive. The integrand of a real-time path integral exhibits, in fact, a frame of large oscillations (when the path is far from being the stationary one) that makes a Monte Carlo evaluation of the integral extremely difficult [4]. To alleviate this situation filtering or smoothing techniques [5] (such as the stationary phase Monte Carlo [6] converting the original integrand into a much smoother one via local averaging) can be applied. A more drastic approximation resulting in the semiclassical (SC) approximation was developed by Van Vleck by dropping all the contributions but those associated with paths located around the stationary one [7]. Though the original Van Vleck formulation is based on a numerically awkward to handle root-search, the problem can be circumvented by employing the initial-value representation (IVR) method proposed by W. H. Miller [8]. The computational problem I delivered as a case study to be dealt with at the school is the Grid implementation of the SC-IVR code derived from a previous program developed by X. Gimenez in collaboration with W. H. Miller [9]. The related program is a sequential code that has been already implemented on a CompaqAlphaServer ES40cluster of the CESCA supercomputing center of Barcelona that has been already used in the past to study the reaction N + N2 [10, 11]. At the school the program has been implemented on the Grid and structured to maximize its throughput for extended computational campaigns. Accordingly, the present paper is organized as follows: in section 2 the SC-IVR method is presented and in section 3 its implementation on the Grid is illustrated.

208

2

N. Faginas Lago

The SC-IVR method

A typical application of the semiclassical SC-IVR method is the calculation of the thermalized rate coefficients k(T ) for the benchmark heavy + heavyheavy gas-phase reaction N + N2 → N + N2 for a wide range of temperature (T ) values. Although this might be regarded as a minor computational problem because of the small size of the system and of the scarce efficiency of the reactive process, it is nevertheless of high relevance for several tecnological applications (like spacecraft reentry in the earth atmosphere). In addition to several technical improvements in the SC-IVR methodology over previous applications, the most novel aspect of the treatment presented here is the use of Cartesian coordinates in the full space of six degrees of freedom (once the overall center of mass translation has been removed). This means that the conservation of the total angular momentum J to reduce the dimensionality of the problem (to be solved separately for each value of the total angular momentum quantum number J, as is usually done in standard quantum mechanical treatments) is not invoked here. The main reason for proceeding this way is that the coherent states involved in the semiclassical propagator are most naturally defined and straightforwardly applied in Cartesian coordinates. As already mentioned, the quantity to be calculated is the thermalized rate coefficient k(T ) that is defined as [1, 8, 12, 13, 14] k(T ) =

1 Cf (0) Qtrans (T )Qint (T )

Z ∞ 0

dtRf (t)

(1)

with Rf (t) = Cf (t)/Cf (0). Cf (0) is a “static” factor that can be calculated exactly using imaginary-time path integral techniques. Rf (t) is a “dynamical” factor that can be evaluated approximately through the combined use of semiclassical initial value and path integrals techniques. The “static” factor Cf (0) is formulated as (see ref. [14]) Cf (0) = −

32 

h kB1T ¯

n

ˆ

ˆ

tr[h(ˆ s)e−3H/4kB T h(ˆ s)e−H/4kB T ]

2 ˆ

ˆ

o

tr[h(ˆ s)e−H/2kB T h(ˆ s)e−H/2kB T ]

(2)

where h(ˆ s) is the projection operator onto the reactant and the product sides of a surface chosen to properly divide the corresponding parts of the reaction ˆ is the quantum Hamiltonian operator of the system written channel and H in Cartesian coordinates.

Implementation of a Semiclassical Initial Value Representation Code

209

As already mentioned, the calculation of the “dynamical” factor Rf (t) can be reconducted to the evaluation of the flux correlation function Cf (t) that is defined as −2d

Z

Cf (t) = (2π¯h)

Z

dq0

Z

dp0

dq00

Z

dp00

× M0 Mt Ct (q0 p0 )Ct∗ (q00 p00 ) 0

0

× ei[St (q0 p0 )−St (q0 p0 )]/¯h where M0 = hq0 p0 |Fˆ (2/kB T ) |q00 p00 i and Mt = hq0t p0t |Fˆ (2/kB T ) |qt pt i, d is the number of degrees of freedom of the system, St is the classical action along a given trajectory, (q0 p0 ; q00 p00 ) are the initial (time 0) states (coordinates and momenta) for a pair of classical trajectories while, Ct is the square root of a determinant that involves the various monodromy matrices. Cf (t) was calculated using an approximation (see ref. [11]) requiring a computational effort definitely smaller than that necessary to compute the monodromy matrix. Fˆ (2/kB T ) is the Boltzmannized flux operator chosen to have an intermediate form between the traditional “half split” [15] and the “kubo” [16] one: Fˆ



1 kB T

=

2kB T i h −H/4k ˆ ˆ BT e h(ˆ s)e−3H/4kB T ¯h



e−3−H/4kB T h(ˆ s)e−H/4kB T



ˆ

ˆ

i

(3)

Accordingly, the dynamical factor Rf (t) can be written as: 

Rf (t) ∼

Mt 0 0 Ct (q0 p0 )Ct∗ (q00 p00 )ei[St (q0 p0 )−St (q0 p0 )]/¯h M0



,

(4)

W

if the initial conditions of the trajectories are sampled using the standard Metropolis method [17]. The weight function W that depends on q0 , p0 , q00 and p00 can be formulated as W (q0 p0 ; q00 p00 ) = (2π¯h)−2d |hq0 p0 |Fˆ (1/2kB T )|q00 p00 i|2

(5)

To properly choose the dividing surface separating the reactant from the product region for the A+BC (reactants) and AB+C (products) the reaction coordinate s(x) is defined as follows (the two product channels are treated equivalently) s(x) = max{sr (x), sp (x)}

(6)

210

N. Faginas Lago

where x is the vector of the position coordinates, sr (x) and sp (x) are the reaction coordinates of the individual rearrangement processes defined as: sr (x) = rCB − rBA

(7)

sp (x) = rBC − rCA

with rXY being the interatomic distance between the atoms X and Y . To locate the best (the closest to the reactant asymptotes that makes the fraction of the recrossing back trajectories smaller than a predetermined percentage) dividing surface, a “mobile” dividing surface s(x; λ) characterized by a parameter λ is introduced. s(x; λ) is defined as s(x; λ) ≡ λs1 (x) + (1 − λ)s0 (x)

(0 ≤ λ ≤ 1).

(8)

where s1 (x) = s(x) and s0 (x) = R∞ −|R|, with R∞ being a large (asymptoticlike) constant. Accordingly, s(x; λ) interpolates between the original reaction coordinate s1 (x) and the “asymptotic” reactant reaction coordinate s0 (x) in a continuous manner.

3

The Grid implementation

In order to successfully achieve the goal of implementing the SC-IVR code on the Grid the computational procedure has been articulated in a sequence of blocks of operations as follows: block a) Calculation of the Coherent state matrix (CSM) elements. In this block the CSM elements of the Boltzmannized flux operator are computed. The CSM elements are evaluated as a function of the normal mode coordinates at the geometry of the saddle to reaction and the quality of convergence with respect to the number of time slices P or the number of paths sampled. block b) Generation of the initial states. In this block the initial states of the pairs of real-time trajectories, (q0 p0 ) and (q00 p00 ), are generated by sampling the weight function of Eq. 5 using the standard Metropolis method [17]. The result is written on an external file for later use in the calculation of Rf using Eq. 4. An illustration of the distribution scheme adopted for the evaluation of the initial states considered for the calculation of the path integral part working schedule of this block is given in Fig. 1.

Implementation of a Semiclassical Initial Value Representation Code

211

Figure 1: The distribution scheme for the evaluation of the initial states. nblock is the time slices considered for computing the path integral while nequi is the number of steps intercurring between two checks of convergence performed during the evaluation of the path integral.

block c) Evaluation of the Static factor. In this block the static factor is evaluated by computing the partition functions on the mobile dividing surface s(x; λ) and in s(x), the reactant asymptotic region at the reference temperature Tref using the DVR [18] method. Next, the ratio between the partition function computed in the interaction region, at s1 (x) (that corresponds to s(λ = 1; β = βref )) and in the asymptotic reactant region s0 (x) that corresponds to s(λ = 0; β = βref )) is evaluated using the extended ensemble method [19]. Then the dependence of the partition function on both the location of the dividing surface and the temperature is evaluated to determine the optimum value of Cf (0). block d) Trajectory integration. In this block the dynamical factor Rf of Eq. 4 is calculated. The initial states of the Monte Carlo sampling are taken from the output of block (b). All the contributions to the SC integral are explicitly saved in an external file to allow a subsequent analysis. This helps the exam of the effect of different Filinov smoothing procedures, since it avoids repeating the calculation with different values of the Filinov parameters. After that, a certain number of

212

N. Faginas Lago

trajectories are integrated in time. The related procedure can be distributed for concurrent execution as shown in Fig. 2. The dynamical factor Rf (t) is calculated by sampling the path (x0 . . . xP ) variables in Eq. 4 using a normal-mode technique [20, 21]. Finally, information obtained are combined to generate the value of the rate coefficient k(T ).

Figure 2: The distribution scheme of the integrated trajectories. The serial version of the code is written for a Tru64 UNIX machine using Compaq Fortran 90 language. The parallel version of the code used for distribution on the Grid is written using Fortran 90 and MPI. It has been implemented on the multi-thread shared memory multi processor machines on the EGEE Grid segment to the COMPCHEM Virtual organization [22] (most of the Computing Elements (CE) of the Grid have multi processor nodes which, can deal efficiently with fine grain parallelism therefore). To run on those nodes use has been made of an application written in python [23] that allows the reservation of an entire node of the Grid and the running of the computations on it without conflicting with other user’s jobs. This application, called reserve smp nodes, is a system of 2 separate python scripts: a server script which runs locally and a client one which is executed on the Grid. In our case the server submits 10 jobs to a CE in order to increase the chances that more than one of them ends on the same node. When

Implementation of a Semiclassical Initial Value Representation Code

213

this happens, the server sends the scripts (mpi.sh) on the reserved (or partially reserved) nodes, in which the jobs were started and frees the unneeded resources by killing the jobs. As to MPI, use was made of an open-source, portable implementation of the Message Passing Interface Standard (MPICH). It contains a complete implementation of version 1.2 of the MPI Standard and also significant parts of MPI-2 (particularly in the area of parallel I/O). MPICH is both a runtime and a compile-time environment for MPI-compliant codes. Moreover, to provide an abstraction layer for interprocess communication, regardless of the operating environment, the shmem device was used for communication among shared memory SMP machines. In particular, in my work the reserve smp nodes with MPICH and the shmem device were used in the following way:

• In the first step MPI package was compiled and installed by enabling shmem on as many CEs as possible. A script took care of this task (as well as of the installation of other software). • In the second step an MPICH package procedure relocatable on different directories was implemented by a substitution of some variables in the mpirun executable. • In the last step the MPICH environment assembled for EUIndia Grid was installed and the shmem device (to be executed on the COMPCHEM segment of EGEE), and a script called relocate.sh (adapting the package to the current directory) were implemented.

To illustrate the MPI execution of the code on a shared memory machine of the VO in the upper panels of Fig. 3 the python script to be sent to the CE is shown. In the first part (lhs panel) the operating system (OS) is asked for the machines of the Grid while in the second part (rhs panel) the file.jld created on the fly is shown in which the user is asked about the resources needed for running the code. In the third block (bottom panel) details of the file to execute are given. As shown by the panel, the file to be executed sends the input files to the SE, runs the job and finally downloads the output files from the SE.

214

N. Faginas Lago

Figure 3: Structure of the python script distributing the various jobs using the reserve smp nodes application.

4

Acknowledgments

The author acknowledges financial support from the European project EGEE III and allocation of computing time by COMPCHEM. Part of this work has been carried out as an activity of the working group QDYN of the COST CMST CHEMGRID Action.

Implementation of a Semiclassical Initial Value Representation Code

215

References [1] R.E. Wyatt and J.Z.H. Zhang, Dynamics of Molecules and Chemical Reactions, Marcel Dekker, New York (1996) [2] J.Z.H. Zhang, Theory and Application of Quantum Molecular Dynamics. World Scientific, Singapore (1999) [3] R.P. Feynman and A.R. Hibbs, Quantum Mechanics and Path Integrals, McGraw-Hill, New York (1965) [4] J.D. Doll, D.L. Freeman and T.L. Beck, (1990). Equilibrium and dynamical Fourier path. integral methods, Adv. Chem. Phys. 78, 61-68 [5] V.S. Filinov, (1986). Calculation of the Feynman integrals by means of the Monte Carlo method, Nucl. Phys. B 271, 717-725 [6] N. Makri and W.H. Miller, (1987). Monte Carlo integration with oscillatory integrands: Implications for Feynman path integration in real time, Chem. Phys. Lett. 139, 10-14 [7] J.H. Van Vleck, (1928). Proc. Natl. Acad. Sci. 14, 178 [8] W.H. Miller, (1970). Classical S matrix: Numerical application to inelastic collisions, J. Chem. Phys. 53, 3578-3587 [9] R. Gelabert, X. Gimenez, M. Thoss, H. Wang and W.H. Miller, (2000). A log-derivative formulation of the prefactor for the semiclassical Herman-Kluk propagator, J. Phys. Chem. A 104, 10321-10327 [10] N. Faginas-Lago, F. Huarte-Larra˜ naga and Antonio Lagan`a, (2008). Full dimensional quantum versus semiclassical reactivity for the bent transition state reaction N + N2 , Chem. Phys. Lett. 464, 249-255 [11] N. Faginas-Lago, A. Lagan`a and A. Riganelli, (2004). Quantum vs. semiclassic initial value representation probabilities for nonreactive systems, Int. J. Quantum Chem. 96, 547-553 [12] E.J. Heller, (1991). Cellular dynamics: A new semiclassical approach to time-dependent quantum mechanics, J. Chem. Phys. 94, 2723 [13] E.J. Heller, (1991). Reply to comment on: Semiclassical time evolution without root searches: Comments and perspective, J. Chem. Phys. 95, 9431

216

N. Faginas Lago

[14] T. Yamamoto and W.H. Miller, (2003). Semiclassical calculation of thermal rate constants in full cartesian space: The benchmark reaction for D + H2? DH + H, J. Chem. Phys. 118, 2135-2152 [15] W.H. Miller, (1974). Quantum mechanical transition state theory and a new semiclassical model for reaction rate constants, J. Chem. Phys. 61, 1823-1834 [16] T. Yamamoto, (1960). Quantum statistical mechanical theory of the rate of exchange chemical reactions in the gas phase, J. Chem. Phys. 33, 281 [17] N. Metropolis, A.W. Rosenbluth, M.N. Rosenbluth, A.H. Teller and E. Teller, (1953). Equation of state calculations by fast computing machines, J. Chem. Phys. 21, 1087 [18] D.O. Harris, G.G. Engerholm and W.D. Gwinn, (1965). Calculation of matrix elements for one-dimensional quantum-mechanical problems and the application to anharmonic oscillators, J. Chem. Phys. 43, 1515 [19] A.P. Lyubartsev, A.A. Martsinovski and S.V. Shevkunov, (1992). New approach to Monte Carlo calculation of the free energy: Method of expanded ensembles, J. Chem. Phys. 96, 1776 [20] D.M. Ceperley, (1995). Path integrals in the theory of condensed helium, Rev. Mod. Phys. 67, 279 - 355 [21] T. Yamamoto, H. Wang and W.H. Miller, (2002). Combining semiclassical time evolution and quantum Boltzmann operator to evaluate reactive flux correlation function for thermal rate constants of complex systems, J. Chem. Phys. 116, 7335-7349 [22] A. Lagan` a, A. Riganelli and O. Gervasi, (2006). On the structuring of the computational chemistry virtual organization COMPCHEM, Lecture Notes Computer Science 3980, 665-674 [23] R.D. Meo, In: https://euindia.ictp.it/grid-tools-and-utilities/reservesmp-nodes- 1/description-of-the-tool/

Suggest Documents