원시데이터 수집 시스템
선정목록으로

Implementation of Girsanov Reweighting in OpenMM and Deeptime

간접 관련 화학·수지 · (21) 에폭시수지 (6) PEM(고분자전해질막)(19) 석유수지(23) 컴파운드

기본 정보

저자
  1. Joana-Lysiane Schäfer — Department of Biology, Chemistry, and Pharmacy, Freie Universität Berlin, Berlin 14195, Germany
  2. Bettina G. Keller — Department of Biology, Chemistry, and Pharmacy, Freie Universität Berlin, Berlin 14195, Germany
DOI
10.1021/acs.jpcb.4c01702
저널
The Journal of Physical Chemistry B
발행년도
2024
발행기관
American Chemical Society
피인용수
1
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
http://dx.doi.org/10.1021/acs.jpcb.4c01702
토픽
Composite Material Mechanics
OpenAlex ID
W4399561540

평가 내용

관련도
간접 관련
사업분야
화학·수지 · (21) 에폭시수지
부 분야
(6) PEM(고분자전해질막), (19) 석유수지, (23) 컴파운드
R&D 측면
분석·모델링
확신도
0.70
근거 용어
Molecular dynamics (MD) simulations, Langevin dynamics, potential energy function, Markov state model, stochastic MD integrator
판단 근거
이 논문은 분자 동역학(MD) 시뮬레이션의 시간 척도 한계를 극복하기 위한 Girsanov reweighting 기법과 소프트웨어 구현을 다룹니다. 이는 고분자(에폭시, 석유수지 등)나 전해질 막의 미시적 거동 및 물성을 예측하는 시뮬레이션 방법론으로서 간접적인 활용 가치가 있습니다.
R&D 활용 포인트
고분자 수지, 연료전지용 이온전도성 막, 또는 컴파운드 소재의 분자 수준에서의 열화, 확산, 상전이 등 복잡한 동역학적 특성을 효율적으로 시뮬레이션하고 분석하는 데 활용 가능합니다.
평가 입력
본문 91,655자 중 30,032자 발췌

초록

Classical molecular dynamics (MD) simulations provide invaluable insights into complex molecular systems but face limitations in capturing phenomena occurring on time scales beyond their reach. To bridge this gap, various enhanced sampling techniques have been developed, which are complemented by reweighting techniques to recover the unbiased dynamics. Girsanov reweighting is a reweighting technique that reweights simulation paths, generated by a stochastic MD integrator, without evoking an effective model of the dynamics. Instead, it calculates the relative path probability density at the time resolution of the MD integrator. Efficient implementation of Girsanov reweighting requires that the reweighting factors are calculated on-the-fly during the simulations and thus needs to be implemented within the MD integrator. Here, we present a comprehensive guide for implementing Girsanov reweighting into MD simulations. We demonstrate the implementation in the MD simulation package OpenMM by extending the library openmmtools. Additionally, we implemented a reweighted Markov state model estimator within the time series analysis package Deeptime.

본문 91,655자

본문 펼치기
This article is licensed under <u>[CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/)</u> pubs.acs.org/JPCB <mark>Article</mark> ## Implementation of Girsanov Reweighting in OpenMM and Deeptime ##### _Published as part of The Journal of Physical Chemistry B virtual special issue “Recent Advances in Simulation_ _Software and Force Fields”._ Joana-Lysiane Schäfer and Bettina G. Keller* Cite This: _J._ _Phys._ _Chem._ _B_ [2024,](https://pubs.acs.org/action/showCitFormats?doi=10.1021/acs.jpcb.4c01702&ref=pdf) 128, 6014−6027 Read [Online](https://pubs.acs.org/doi/10.1021/acs.jpcb.4c01702?ref=pdf) #### ACCESS Metrics & More Article Recommendations * sı Supporting Information ABSTRACT: Classical molecular dynamics (MD) simulations provide invaluable insights into complex molecular systems but face limitations in capturing phenomena occurring on time scales beyond their reach. To bridge this gap, various enhanced sampling techniques have been developed, which are complemented by reweighting techniques to recover the unbiased dynamics. Girsanov reweighting is a reweighting technique that reweights simulation paths, generated by a stochastic MD integrator, without evoking an effective model of the dynamics. Instead, it calculates the relative path probability density at the time resolution of the MD integrator. Efficient implementation of Girsanov reweighting requires that the reweighting factors are calculated on-the-fly during the simulations and thus needs to be implemented within the MD integrator. Here, we present a comprehensive guide for implementing Girsanov reweighting into MD simulations. We demonstrate the implementation in the MD simulation package OpenMM by extending the library openmmtools. Additionally, we implemented a reweighted Markov state model estimator within the time series analysis package Deeptime. techniques <sup>21−25</sup> in that it does not assume an effective # ■ INTRODUCTION model of the molecular dynamics but reweights the dynamics Classical molecular dynamics (MD) simulations yield Classical molecular dynamics (MD) simulations yield trajectories of a molecular system at atomistic resolution and are an excellent tool to study the dynamics of complex molecular systems. A complication emerges from the fact that relevant time scales of the molecular system, from slow conformational changes to complex formation and ultimately chemical reactions, occur on time scales that are orders of magnitude beyond the time scales that can be covered by an unbiased MD simulation. To close this time scale gap a wide variety of enhanced sampling techniques <sup>1</sup> have been proposed, which broadly can be classified into methods which (1) change the temperature of the system, <sup>2,3</sup> (2) change the classical Hamiltonian, in particular the potential energy function, of the system, <sup>4−8</sup> or (3) bias the initial state of the trajectory but otherwise leave the dynamics unchanged. <sup>9,10</sup> A necessary complement of enhanced sampling techniques are reweighting methods, <sup>1,11,12</sup> which recover the unperturbed stationary density and the unperturbed dynamics from biased simulations. Girsanov reweighting <sup>13−20</sup> is a dynamical reweighting technique to recover the unbiased dynamics of a molecular system from simulations that were conducted with a biased potential. It differs from other dynamical reweighting techniques <sup>21−25</sup> in that it does not assume an effective model of the molecular dynamics but reweights the dynamics directly on the level of the stochastic MD integrator. In this sense, Girsanov reweighting is an exact reweighting technique. The method is based on the theory of stochastic path integrals. <sup>26−28</sup> It has been applied to model systems <sup>13−17</sup> and peptide dynamics. <sup>19</sup> Recently, it has been used for the machine learning of optimal collective variables based on enhanced sampling simulations. <sup>29</sup> Girsanov reweighting can also be applied in a prospective manner. From MD trajectories obtained at a reference potential energy function, one can calculate the transition rates at a modified potential energy function and investigate the sensitivity of the transition rates with respect to certain parameters of the potential energy. In fact, while modern empirical potential energy functions often reproduce the structural and thermodynamic properties with high fidelity, <sup>30,31</sup> Received: March 14, 2024 Revised: May 22, 2024 Accepted: May 22, 2024 Published: June 12, 2024 © 2024 The Authors Published by <u>The</u> <u>Journal</u> <u>of</u> <u>Physical</u> <u>Chemistry</u> <u>B</u> <u><mark>pubs.acs.org/JPCB</mark></u> <u><mark>Article</mark></u> the dynamic properties, such as transition times across barriers, may vary considerably across different potential energy models for the same molecule. <sup>32</sup> In ref 33, Girsanov reweighting has been combined with the maximum caliber approach <sup>34</sup> to optimize potential energy functions such that the resulting dynamics reproduce a specific transition rate. Since Girsanov reweighting is based on stochastic path integrals, it requires that the MD simulations are carried out with a stochastic MD integrator. <sup>35</sup> To achieve reweighting accuracy at the level of the MD integrator, the random numbers and bias force at each integration time step are collected and aggregated in path reweighting factors. The path reweighting factor can be calculated for any time interval [ _t_, _t_ + _τ_ ] of the entire MD trajectory and represents the relative probability of the path from _t_ to _t_ + _τ_ at the target potential relative to its probability at the simulation potential. Interpreting the path reweighting factor as the relative path probability gives an intuitive explanation of why stochastic MD integrators are needed for Girsanov reweighting. The probability of a specific deterministic path, by definition, is one at the simulation potential but zero at any other potential. Hence, the relative probability of a deterministic path, i.e., the ratio of the path probability between the target potential and the simulation potential, is always zero. For stochastic integrators, the path reweighting factor can be calculated efficiently by formulating it in terms of the random numbers generated during a stochastic MD simulation and in terms of random number differences that account for the difference between the dynamics at the simulation potential and the dynamics at the target potential to which the simulated dynamics should be reweighted. <sup>18,36</sup> The equation for the random number difference depends on the integrator and can easily be derived for the Euler-Maruyama integrator, <sup>28,35</sup> of overdamped Langevin dynamics. <sup>14−16</sup> However, a much more realistic description of the molecular dynamics is achieved by underdamped Langevin dynamics. Ref 37 (unpublished results) presents a general approach to derive the relative path probability density for stochastic integrators of underdamped Langevin dynamics, and it provides a framework to analyze whether the relative path probability for a given integration algorithm is defined throughout the path space. If the relative path probability density is defined, its value can be calculated, and reweighting underdamped Langevin dynamics is thus possible. While specialized simulation protocols for Girsanov reweighting have been published, there is a lack of ready-touse simulation programs that allow on-the-fly estimation of reweighting factors. Calculating the relative path probability density requires access to the random numbers and forces at the time resolution of the MD integrator. Even though the implementation of the relative path probability density amounts to adding a reporter to the inner loop of the MD integrator, for most simulation packages this requires deep knowledge of the package architecture. The goal of this contribution is to provide a template for efficiently implementing the relative path probability density into an MD program. We use OpenMM <sup>38</sup> which provides an easy and versatile implementation of Langevin integrators via the openmmtools package, <sup>39,40</sup> to demonstrate the implementation. As an example analysis of the simulation data, we reweight Markov state models (MSMs) <sup>41−46</sup> and implement the reweighting factor into the time-series analysis package Deeptime. <sup>47</sup> While Girsanov reweighting can be used to reweight other rate estimators, <sup>33</sup> MSMs have the advantage that they are well suited to model multistate dynamics and that, due to the short Markov lag time, a model of the longtime dynamics can be constructed from short paths. Our additions to the two software packages are open source and provide a blueprint for extending an MD simulation and analysis program to include Girsanov reweighting. # ■ THEORY Molecular Simulations and Path Probabilities. Consider a system of _N_ atoms with Cartesian position vector _q_ 3 _N_ and associated momentum vector _p_ 3 _N_ . Momentum and position vectors can be combined to a phase space vector _x_ = ( _q_, _p_ ) 6 _N_ . The time-evolution of such a system in a thermal bath is modeled by underdamped Langevin dynamics _Mq_ ( _t_ ) = _V_ ( _q_ ( _t_ )) _Mq_ ( _t_ ) + 2 _RT_ _M_ ( _t_ ) (1) The left-hand side of eq 1 represents the total force on the 2 particles, where _q_ ( _t_ ) = _t_ 2 _q_ ( _t_ ) is the acceleration vector at time _t_ . _M_ is the 3 _N_ × 3 _N_ -dimensional mass matrix, which contains the masses of the particles along its diagonal. The force consists of three terms (right-hand side of eq 1): (i) the force due to the gradient of the potential energy function −∇ _V_ ( _q_ ); (ii) the friction force, where _q_ ( _t_ ) = _t_ _q_ ( _t_ ) = _v_ ( _t_ ) is the velocity vector and _ξ_ is the collision rate with unit s <sup>−1</sup> ; and (iii) a random force. According to the dissipation fluctuation theorem, <sup>48</sup> the random force along the _l_ th degree of freedom has the mean 0 and variance 2 _RTξMll_, where _R_ is the ideal gas constant, _T_ is the temperature, and _Mll_ is the _l_ diagonal element in _M_ and represents the mass associated with the _l_ th degree of freedom. We model this random force by an uncorrelated white Gaussian noise with unit variance centered at 0, _η_ ( _t_ ), which is then scaled by 2 _RT_ _Mll_ <sup>in</sup> <sup>order</sup> <sup>to</sup> <sup>fulfill</sup> <sup>the</sup> <sup>fluctuation</sup> dissipation theorem. <sup>48</sup> We report the potential in molar energy units, J mol <sup>−1</sup> ; correspondingly, the thermal energy is reported as molar quantity: _RT_ . If energy units are used for the potential, _R_ should be replaced by the Boltzmann constant _k_ B = _R_ / _N_ A in eq 1 and all of the following equations. _N_ A is the Avogadro constant. Langevin integrators <sup>35</sup> are numerical schemes that provide an approximate solution to eq 1. They yield a time-discrete trajectory or path x = ( _x_ 0, _x_ 1, _x_ 2, ... _xn_ ), where _x_ 0 = ( _q_ 0, _p_ 0) is the initial state at time _t_ = 0, _xk_ = ( _qk_, _pk_ ) is the state at time _t_ = _k_ Δ _t_ with time step Δ _t_ . The path length is _τ_ = _n_ Δ _t_ . To model the random force, typical Langevin integrators draw either one or two random numbers from a standard normal distribution per integration time step and degree of freedom. The simulation thus additionally yields either one sequence of random number vectors, _η_ = [ _η_ 0, _η_ 1... _ηn_ −1], or two sequences of random number vectors, _η_ <sup>(1)</sup> = [ _η_ 0(1), _η_ 1(1)... _η_ (1) _n_ −1 ] sequences of random number vectors, _η_ <sup>(1)</sup> = [ _η_ 0(1), _η_ 1(1)... _η_ (1) _n_ −1 ] and _η_ <sup>(2)</sup> = [ _η_ 0(2), _η_ 1(2)... _η_ (2) _n_ −1 ], where _k_ 3 _N_, _k_ (1) 3 _N_, and _k_ (2) 3 _N_ . The _l_ th element of a random number vector _ηk_ contains the random number that determines the random force on the _l_ th degree of freedom at the time step _k_ . 0(1), _η_ 1 1(1)... _η_ (1) _n_ −1 3 _N_, _k_ (1) 3 _N_, and 0(2), _η_ 1 1(2)... _η_ (2) _n_ −1 (2) _n_ −1 ], where _k_ <u>The</u> <u>Journal</u> <u>of</u> <u>Physical</u> <u>Chemistry</u> <u>B</u> <u><mark>pubs.acs.org/JPCB</mark></u> <u><mark>Article</mark></u> The path probability [ x ] is the probability of observing a specific time-discretized path x. It can be decomposed using the Chapman−Kolmogorov equation <sup>49</sup> as <u>[</u> x <u>]</u> _s_ path, _V_ = x [ x ] _s_ [ x ] = x [ x ] _s_ [ x ] [ x ] (7) _n_ 1 [ x ] = _p_ ( _x_ 0)· [ _x_ 1 ... _xn_ | _x_ 0] = _p_ ( _x_ 0)· _p_ ( _xk_ +1| x ] = _p_ ( _x_ 0)· [ _x_ 1 ... _xn_ | _x_ 0] = _p_ ( _x_ 0)· _p_ ( _xk_ +1| _xk_ ) 0 1 _n_ 0 0 _k_ +1 _k_ _k_ =0 +1 (2) _k_ = where _p_ ( _x_ 0) is the probability density of the initial state. We here assume that the initial states are distributed according to the Boltzmann distribution _p_ ( _x_ 0) = _p_ ( _q_, _p_ ( _x_ 0) = _p_ ( _q_, _p_ ) = _p_ ( _q_ 0, _p_ 0) i _V_ ( _q_ <u>0)</u> y 3 _N_ 1 i 1 _pl_ 2,0 1 exp y zzzzzzz { 0 0 0 _l_ i <u>0</u> (3) where [ x ] is the path probability density at the target potential _V_ ̃( _q_ ), [ x ] is the path probability density at the simulation potential _V_ ( _q_ ). _s_ [x] is a path observable, i.e., a function that assigns a real-valued number to each path x. ⟨...⟩ denotes an expected value, where we added the subscript “path” to emphasize that the expected values is calculated with respect to path probability density [ x ] and not with respect to a phase space probability _p_ ( _x_ ). The path integral x ... integrates over the space of all possible time-discretized paths of length _τ_ = _n_ Δ _t_ . If an analytical expression for the relative path probability [ x ]/ [ x ] can be found, the path expected value in eq 7 can be estimated from a set of paths S = ( _x_ 1,... _xn_ paths <sup>)</sup> <sup>generated</sup> <sup>at</sup> the simulation potential _V_ ( _q_ ) as i _p_ i _V_ ( _q_ <u>0)</u> y 3 _N_ 1 i 1 1 exp - exp _Z_ jjjjj _RT_ zzzzz _l_ =1 2 _RT_ _Mll_ jjjjjjj _RT_ 2 k { _V_ ( _q_ 3 _N_ y y y zzzzz { <u>0</u> = 1 exp _Z_ i jjjjj k _RT_ _l_ 1 2 _RT_ _Mll_ _RT_ = _M_ _ll_ i jjjjjjj k 1 _ll_ _V_ ( _q_ ) ### where Z = d q exp( RT ) _V_ ( _q_ ) ### = d q exp( RT ) is the classical configurational _V_ ( _q_ _RT_ partition function, <sup>50</sup> and _pl_,0 is the _l_ th element of the initial momentum vector _p_ 0. In eq 2, _p_ ( _xk_ +1| _xk_ ) is the one-step transition probability to reach _xk_ +1 within one integration step, given that the current state is _xk_ . Langevin integrators that only take current state _xk_ into account when updating position and momentum implement a Markov process. For these integrators, eq 2 is exact. For Langevin integrators that additionally take the previous state _xk_ −1 into account, eq 2 is an approximation. The mathematical expression for _p_ ( _xk_ +1| _xk_ ) depends on the Langevin integrator. One can however argue <sup>36</sup> that the singlestep transition probability is equal to the probability of drawing the random number vector _ηk_ that gives rise to this specific transition _s_ path, _V_ = lim _n_ paths [[ xx _<u>i</u>_ <u>]]</u> _s_ <sup>[</sup> x _i_ = lim _n_ paths x _S_ [[ xx _<u>ii</u>_ <u>]]</u> _s_ <sup>[</sup> x _i_ <sup>]</sup> (8) path, _V_ _n_ paths x _i_ _S_ [ x _i_ ] <sup>[</sup> _i_ _<u>i</u>_ _i_ _i_ _S_ 3 _N_ 2 1 i _l_, _k_ +1| _xk_ ) = _p_ ( _k_ ) = exp jjjjjjj 3 _N_ 2 1 i _l_, _k_ y _p_ ( _xk_ +1| _xk_ ) = _p_ ( _k_ ) = 2 exp 2 _l_ =1 jjjjjjjk zzzzzzz{ 3 _N_ i i jjjjjjj k 1 _l_, _k_ 1| _xk_ ) = _p_ ( _k_ ) = 2 exp 2 _l_ =1 jjjjjjjk y { =1 k { (4) _l_ where we used the random numbers _ηl_, _k_ that are drawn from a standard normal distribution. Equation 4 holds for the Langevin integrator, which draws a single random number per integration step and degree of freedom _l_ . The path probability density (eq 2) can then be written as _n_ 1 _n_ 1 3 _N_ 2 1 i _l_, _k_ [ x ] = _p_ ( _x_ 0)· _p_ ( _k_ ) = _p_ ( _x_ 0)· exp jjjjjjj _n_ 1 _n_ 1 3 _N_ 2 1 i _l_, _k_ y x ] = _p_ ( _x_ 0)· _p_ ( _k_ ) = _p_ ( _x_ 0)· 2 exp 2 _k_ =0 _k_ =0 _l_ =1 jjjjjjjk zzzzzzz{ (5) y { _n_ 1 _n_ 1 _N_ i 1 _l_, _k_ 0)· _p_ ( _k_ ) = _p_ ( _x_ 0)· 2 exp 2 _k_ =0 _k_ =0 _l_ =1 jjjjjjjk _l_ _k_ 0 _k_ =0 A critical question is under which conditions the relative path probability [ x ]/ [ x ] exists. For time-continuous paths, these conditions have been discussed by Girsanov <sup>27</sup> and Onsager and Machlup. <sup>26</sup> It depends on the integrator in the case of time-discretized paths; ref 37 (unpublished reference) discusses path probability ratios for Langevin splitting operators. The potential energy _V_ ( _q_ ), at which the simulation is carried out, and the target potential energy _V_ (̃ _q_ ), to which the path expected value is reweighted, are related by a potential _U_ ( _q_ ) _V_ ( _q_ ) = _V_ ( _q_ ) + _U_ ( _q_ ) (9) Equation 9 takes the viewpoint of a perturbation, <sup>18,20,33,36</sup> (ref 37 unpublished results), where the target potential differs from the reference (simulation) potential by a perturbation _U_ ( _q_ ). Alternatively, one can take the viewpoint of enhanced sampling simulations, where a bias potential _U_ bias( _q_ ) needs to be subtracted from the simulation potential _V_ ( _q_ ) to obtain the molecular (target) potential, thus _V_ ( _q_ ) = _V_ ( _q_ ) _U_ bias( _q_ ). By setting _U_ ( _q_ ) = - _U_ bias( _q_ ), one can reconcile <sup>19</sup> the enhanced sampling viewpoint with eq 9. It is important to be aware of the sign-convention since it enters the equations for the reweighting factor. Using eq 5, the path probability density ratio can be expressed as <sup>36</sup> =0 _k_ =0 _l_ = _k_ 1 i jjjjjjj k Analogously, the path probability density (eq 2) for Langevin integrators that draw two random numbers per integration step and degree of freedom is <u>[</u> x <u>]</u> _p_ ( _x_ <u>0)</u> 2 [ x ] <sup>=</sup> _p_ ( _x_ 0) - _k_ 0 _l_ 1 <u>ki</u> _l_ 2, _k_ x x <u>0</u> y zzz 2 _l_, _k_ _l_, _k_ 2 i jjj 1 3 _N_ exp 2 3 _N_ exp _n_ _k_ =0 _l_ =1 _p_ ( _x_ _p_ ( _x_ ( _x_ <u>0)</u> ( _x_ 0) 0 _k_ =0 _n_ 1 (1) (2) _l_ y zzz <u>{</u> y zzz y zzz { i jjj <u>k</u> i jjj i jjj k i jjj k 1 exp [ x ] = _p_ ( _x_ 0)· x ] = _p_ ( _x_ 0)· _p_ ( (1)) _p_ ( (2)) _p_ ( _x_ 0)· _p_ ( (1)) _p_ _k_ _k_ 0 _k_ =0 _k_ _n_ _k_ = 1 3 _N_ _N_ _l_, _k_ _l_, _k_ = <u>0</u> - exp _l_, _k_ _l_, _k_ _l_, _k_ _l_, _k_ _n_ _k_ y y zzzzzzzzz { y y zzzzzzzzz { i i jjjjjjjjj k (2) <sup>2</sup> , _k_ _p_ ( _x_ _p_ ( _x_ (( _xx_ 00)) - expijjjk _l_, _k_ - _l_, _k_ 12 _l_ 2, _k_ yzzz{, 1 3 _N_ i (1) <sup>2</sup> 1 _l_, _k_ _N_ i _l_, _k_ - _l_, _k_ 1 _l_ 2, _k_ y, zzz { 1 _l_, _k_ _l_, _k_ ( _x_ 0)· exp 2 <sup>exp</sup> 2 2 jjjjjjjjj zzzzzzzzz jjjjjjjjj <u>0</u> = _p_ ( _x_ 0)· _p_ ( _x_ 0 _k_ =0 _l_ 0 _k_ =0 =0 _l_ = 1 _k_ =0 _l_ =1 k { k { (6) _l_ 1 i jjjjjjjjj k (10) where _k_ <sup>is the random number vector that yields an update</sup> <sup>_xk_</sup> → _xk_ +1 at the target potential _V_ (̃ _q_ ), and _ηk_ is the random number vector that yields the same update at the simulation potential _V_ ( _q_ ). The intuition is that one calculates _k_ <sup>and</sup> compares it to the random number vector _ηk_, which was used Girsanov Reweighting. Girsanov reweighting is an importance sampling technique <sup>1</sup> for path probability densities at different potential energy functions. Following the principles of importance sampling, a path expected value at target potential _V_ ̃ can be reweighted as <u>The</u> <u>Journal</u> <u>of</u> <u>Physical</u> <u>Chemistry</u> <u>B</u> <u><mark>pubs.acs.org/JPCB</mark></u> <u><mark>Article</mark></u> in the simulation at _V_ ( _q_ ). However, in our implementation, _k_ is never calculated directly. Instead, the two random number vectors are related by a random number difference vector Δ _ηk_ with _l_, _k_ = _l_, _k_ + _l_, _k_ (11) The random numbers _ηl_, _k_ can be recorded during the simulation at simulation potential _V_ ( _q_ ), but Δ _ηk_, _l_ needs to be calculated at each integration time step. The equation for Δ _ηk_, _l_ depends on the integrator, and the equations for various Langevin integrators are reported later in the text. Analogously, using eq 6, the path probability density ratio can be expressed as <sup>36</sup> _a_ = _t_ _M_ = 1 _ll_ _b_ ( _q_ ) = _t_ _q_ _V_ ( _q_ ) _b_ ( _q_ ) = ( ) = _l_ _d_ = exp( _t_ = exp( _t_ ) _f_ = + _k_ B _TMll_ (1 exp( 2 _t_ = + _k_ B _TMll_ (1 exp( 2 _t_ ) . (17) (1 exp( 2 _t_ ) . B _ll_ 1 3 _N_ _N_ <u>[</u> x <u>]</u> _p_ ( _x_ <u>0</u> [ x ] <sup>=</sup> _p_ ( _x_ 0 (( _xx_ 00)) - expijjjk _l_ (1), _k_ - _l_ (1), _k_ 12 _n_ _k_ _k_ =0 _l_ =1 <u>[[</u> xx <u>]]</u> <sup>=</sup> _pp_ (( _xx_ 00)) - _k_ =0 _l_ =1 expijjjk _l_ (1), _k_ y zzz { <u>0</u> (1) _l_, _k_ (1) , _k_ (1) <sup>2</sup> , _k_ _l_, _k_ _l_, _k_ _l_, _k_ 0 _k_ =0 _l_ 1 i jjj k i jjj k expijjjk _l_ (2), _k_ - _l_ (2), _k_ 12 y zzz { (12) _l_ (2), _k_ (2) <sup>2</sup> , _k_ (2) _l_, _k_ _l_, _k_ _l_, _k_ _l_, _k_ We have formulated the three update operators here as operators that act on a single degree of freedom _l_ . In the simulation of a multidimensional system, these update operators are applied to each degree of freedom. A full update of _xk_ → _xk_ +1 is obtained by sequentially applying all three update operators. Different Langevin integrators can be derived by varying the sequence in which the update operators are applied. Symmetric splitting integrators use a symmetric sequence. An example is the ABOBA algorithm, which applies the sequence ( _qk_, _pk_ ) _T_, where update operators that appear twice in the sequence are applied with half a time step and are denoted with a prime. The corresponding parameters _a_ ′, _b_ ′( _q_ ), _d_ ′, and _f_ ′ are obtained by replacing Δ _t_ with 2 _t_ <sup>in</sup> <sup>eq</sup> <sup>18</sup> with random number differences (1) _l_, _k_ = _l_ (1), _k_ + (1) , _k_ (2). , _k_ _l_, _k_ _l_, _k_ _l_, _k_ (2) _l_, _k_ = _l_ (2), _k_ + _l_ (2), _k_ . (13) (1) , _k_ (2) , _k_ . _t_ _a_ = = _l_, _k_ _l_, _k_ _l_, _k_ _Mll_ _t_ 1 2 _M_ The formulas for Δ _ηl_, _k_, Δ _ηl_ (1), _k_, and Δ _η_ (2) _l_, _k_ depend on the Langevin integrator <sup>37</sup> (unpublished reference). _l_ (1), _k_, and Δ _η_ (2) _l_, _k_ The formulas for Δ _ηl_, _k_, Δ _ηl_ (1), _k_ _ll_ _q_ <sup>_V_</sup> ( <sup>_q_</sup> The path probability ratio can be decomposed into the probability ratio of the initial state _p_ ( _x_ 0)/ _p_ ( _x_ 0) <sup>and the ratio of</sup> the path probabilities conditioned on the initial state _t_ _b_ ( _q_ ) = _d_ = expi _t_ jjj ( _q_ ) = ( ) 2 _q_ <sup>_V_</sup> <sup>_q_</sup> = _l_ exp jjjk 2 i jjj i jjj k y zzz { <u>[</u> x <u>]</u> _p_ ( _x_ <u>0)</u> - _M_ [ x | _x_ 0 [ x ] <sup>=</sup> _p_ ( _x_ 0) <u>[</u> x <u>]</u> _p_ ( _x_ <u>0)</u> - _M_ [ x | _x_ 0] [ x ] <sup>=</sup> _p_ ( _x_ 0) (14) = <u>0</u> _f_ = + _k_ B _TMll_ (1 exp( _t_ = + _k_ B _TMll_ (1 exp( _t_ ) . (18) B _ll_ (1 exp( _t_ ) . where the conditional path probability ratio _M_ [x| _x_ 0] is given by the product over time steps _k_ in eqs 10 or 12. If the initial state _x_ 0 is drawn from the Boltzmann distribution eq 3, the probability ratio of the initial state in eqs 10 and 12 is given as In eq 16, we formulated the updates for position and momenta, which leads to the ABO notation of the update operators. <sup>51,53</sup> The update can analogously be formulated for position and velocities, <sup>39,52</sup> _x_ <u>0)</u> _Z_ i _U_ ( _q_ <u>0)</u> i _l_, _k_ _l_, _k_ _p_ ( _x_ <u>0)</u> = _Z_ expi _U_ ( _q_ <u>0)</u> y _p_ ( _x_ 0) _Z_ jjjjj _RT_ zzzzz _U_ ( _q_ (15) ( _x_ <u>0)</u> = _Z_ expi _U_ ( _q_ <u>0</u> ( _x_ 0) _Z_ jjjjj _RT_ i i jjjjj k = + = jjjjjjj _vl_, _k_ + _q_ + _~~a~~_ _v_ = _Z_ exp <u>0</u> y zzzzz { y zzzzzz { y i i jjjjjj k i _v_ _l_, _k_ _l_, _k_ _l_, _k_ _l_, i _q_ jjjjj _v_ k i _q_ _l_ _vl_ _l_, _k_ _l_, _k_ 0 _Z_ _Z_ _l_, _k_ _l_, Girsanov Reweighting for Langevin Integrators. Commonly used Langevin integrators are based on the splitting method. <sup>51,52</sup> Equation 1 is formulated as a vector field and separated in three terms, each of which is integrated separately, yielding three update operators, <sup>35,51</sup> (ref 37 unpublished results) for the position _ql_, _k_ and the momentum _pl_, _k_ = _Mllql_, _k_ i jjjjj k _q_ _l_ _vl_ i jjjjj _v_ k i _q_ _q_ y _l_, _k_ _vl_, _k_ _l_, y zzzzz { y _l_, _k_ _l_, _k_ _l_, _k_ _l_, _l_, _k_ _l_, _l_, _k_ y zzzzz { y _vl_, _k_ + _b_ ( _q_ ( _q_ ) y zzzzzzz { y _q_ _l_ _vl_ =, jjjjjjj _dvl_, _k_ + _f_ _l_, _k_ zzzzzzz k { (19) i jjjjjjj k i i jjjjjjj k _q_ _l_, _k_ _vl_, _k_ _l_, _l_, _k_ _l_, _l_, _k_ _l_, _k_ _l_, _k_ _l_, , _l_, _k_ y zzzzz { _dvl_, _k_ + _f_ y , zzzzzzz { i = _q_ _l_, _p_ _q_ + _ap_ + i jjjjjj k = jjjjjjj _pl_, _k_ + _l_, _k_ _l_, _k_ y y y zzzzzz { i i jjjjjj k i _p_ _l_, _k_ _l_, _k_ _l_, _k_ _l_, _k_ _l_, _k_ _l_, _k_ _l_, y zzzzzz { y i _q_ _q_ i jjjjjj k i = jjjjjjj _dpl_, _k_ + _f_ _l_, _k_ zzzzzzz k { (16) _l_, _k_ _l_, _k_ _l_, _k_ _l_, _p_ y zzzzzzz { _l_, _k_ _p_ + _b_ ( _q_ _l_, _k_ _l_, _k_ _l_, _k_ _l_, _k_ _b_ ( _q_ ) _q_ _q_ i jjjjjj k i jjjjjjj k i i jjjjjjj k y _l_, _k_ _l_, _k_ y zzzzzz { y y zzzzzz { _l_, _k_ _l_, where an -step is the analogue of an -step, a V-step is the analogue of a -step, and _~~a~~_ = _a_ / _Mll_, ( _ql_, _k_ ) = _b_ ( _ql_, _k_ )/ _Mll_, _d_ ̅ = _d_, _f_ = _f_ / _Mll_ . Equation 19 leads to the RVO notation of Langevin splitting operators. <sup>39,52</sup> A systematic approach to derive the random number difference between an update _xk_ → _xk_ +1 at the simulation potential _V_ ( _q_ ) and the same update at the target potential _V_ ̃( _q_ ) is given in ref 37 (unpublished results). The reference also discusses why the relative path probability density [ x ]/ [ x ] may not be defined for some Langevin splitting integrators. In these cases, path reweighting is not possible. For _p_ _l_, _k_ _dp_ + _f_ _l_, _k_ _l_, _k_ _l_, _k_ _l_, _k_ y zzzzzzz { where <u>The</u> <u>Journal</u> <u>of</u> <u>Physical</u> <u>Chemistry</u> <u>B</u> <u><mark>pubs.acs.org/JPCB</mark></u> <u><mark>Article</mark></u> Table 1. Random Number Differences as Function of Perturbation Force _U_ or Bias Force −∇ _U_ bias, Integration Step Δ _t_, _ql_ Dissipation _d_, and Fluctuation _f_ Terms for Underdamped Langevin Integrators <sup>_a_</sup> integrator random number difference integrator (ABO) Perturbation bias (RVO) _<u>d</u>_ _k_ = _f_ _t_ _q_ _U_ bias( _ql_, _k_ +1) = _f_ _t_ _q_ _U_ bias( _ql_, _k_ +1) RVO _<u>d</u>_ _l_ ABO ABOBA AOBOA BOAOB _k_ = _f_ _t_ _q_ _U_ ( _ql_, _k_ +1) _k_ (1) = _<u>df</u>_ 2 _<u>t</u>_ _q_ <sup>_U_</sup> ( <sup>_q_</sup> _l_, _k_ ) = _f_ _t_ _q_ _U_ ( _ql_, _k_ +1) _<u>d</u>_ _f_ _l_ ( _d_ <u>+</u> 1) _<u>t</u>_ _k_ = _f_ 2 _q_ <sup>_U_</sup> (, <sup>_l_</sup> <sup>_q_</sup> _k_ +1/2) ( _d_ <u>+</u> 1) _<u>t</u>_ = _f_ 2 _q_ <sup>_U_</sup> (, <sup>_l_</sup> <sup>_q_</sup> _k_ +1/2 ( _d_ _<u>t</u>_ ( _d_ <u>+</u> 1) _<u>t</u>_ _k_ = _f_ 2 _q_ <sup>_U_</sup> bias( _ql_, _k_ +1/2) ( _d_ <u>+</u> 1) _<u>t</u>_ = _f_ 2 _q_ <sup>_U_</sup> bias( _ql_, _k_ +1/2 _d_ _f_ _<u>d</u>_ _<u>t</u>_ _l_ _f_ _<u>d</u>_ + ) +1/2 RVOVR _l_ _k_ comb = _<u>df</u>_ _t_ _q_ _U_ ( _ql_, _k_ _k_ comb = _f_ _t_ _q_ _U_ ( _ql_, _k_ +1/2) = _f_ _t_ _q_ _U_ ( _ql_, _k_ +1/2 _k_ comb = _<u>df</u>_ _t_ _q_ _U_ bias( _ql_, _k_ + _k_ comb = _f_ _t_ _q_ _U_ bias( _ql_, _k_ +1/2) = _f_ _t_ _q_ _U_ bias( _ql_, _k_ +1/2) ROVOR _l_ _l_ _k_ comb = _d_ ′ _ηk_ (2) _k_ _ηk_ _ηk_ comb = _d_ ′ _ηk_ (1) _ηk_ (1) + _ηk_ (2) _ηk_ _k_ (1) + _η_ (2) _k_ _<u>t</u>_ _l_ _k_ (1) = _<u>df</u>_ 2 _<u>t</u>_ _q_ <sup>_U_</sup> bias( _ql_, _k_ ) = _f_ 2 _q_ <sup>_U_</sup> bias( _ql_, _k_ ) VOROV = _<u>d</u>_ 2 _<u>t</u>_ _q_ <sup>_U_</sup> ( <sup>_q_</sup> _l_, _k_ ) _k_ (1) = _<u>d</u>_ _<u>t</u>_ _k_ (1) = _f_ 2 _q_ <sup>_U_</sup> bias( _ql_, _k_ ) _f_ _l_ _k_ (2) = 1 _f_ 2 _<u>t</u>_ _q_ <sup>_U_</sup> ( <sup>_q_</sup> _l_, _k_ +1) _<u>t</u>_ _k_ (2) = 1 _f_ 2 _<u>t</u>_ _q_ <sup>_U_</sup> bias( _ql_, _k_ +1) _k_ (2) = 1 _f_ 2 _<u>t</u>_ _q_ <sup>_U_</sup> ( <sup>_q_</sup> _l_, _k_ _k_ (2) = 1 _f_ 2 _<u>t</u>_ _q_ <sup>_U_</sup> bias( _ql_, _k_ = _f_ 2 _q_ <sup>_U_</sup> bias( _ql_, _k_ +1 = _f_ 2 _q_ <sup>_U_</sup> ( <sup>_q_</sup> _l_, _k_ +1) _k_ (2) = _f_ _<u>t</u>_ _l_ _f_ _l_ _k_ (1) = 1 _f_ 2 _<u>t</u>_ _q_ <sup>_U_</sup> ( <sup>_q_</sup> _l_, _k_ ) _<u>t</u>_ _k_ (1) = 1 _f_ 2 _<u>t</u>_ _q_ <sup>_U_</sup> bias( _ql_, _k_ ) _k_ (1) = 1 _f_ 2 _<u>t</u>_ _q_ <sup>_U_</sup> ( <sup>_q_</sup> _l_, _k_ _k_ (1) = 1 _f_ 2 _<u>t</u>_ _q_ <sup>_U_</sup> bias( _ql_, _k_ = _f_ 2 _q_ <sup>_U_</sup> bias( _ql_, _k_ ) OVRVO = _f_ 2 _q_ <sup>_U_</sup> ( <sup>_q_</sup> _l_, _k_ ) _k_ (1) = _f_ _<u>t</u>_ _l_ OBABO/BP _k_ = _f_ _l_ _<u>d</u>_ _f_ _<u>t</u>_ _l_ _<u>t</u>_ _k_ (2) = _<u>df</u>_ 2 _<u>t</u>_ _q_ <sup>_U_</sup> ( <sup>_q_</sup> _l_, _k_ + _k_ (2) = _f_ 2 _q_ <sup>_U_</sup> ( <sup>_q_</sup> _l_, _k_ +1) = _f_ 2 _q_ <sup>_U_</sup> ( <sup>_q_</sup> _l_, _k_ +1) _k_ (2) = _<u>df</u>_ 2 _<u>t</u>_ _q_ <sup>_U_</sup> bias( _ql_, _k_ + _k_ (2) = _f_ 2 _q_ <sup>_U_</sup> bias( _ql_, _k_ +1) = _f_ 2 _q_ <sup>_U_</sup> bias( _ql_, _k_ +1) _<u>d</u>_ _f_ _l_ _<u>a</u>_ _ql_ _U_ ( _ql_, _k_ ): perturbation force is evaluated before position update; _ql_ _U_ ( _ql_, _k_ +1) <sup>:</sup> <sup>perturbation</sup> <sup>force</sup> <sup>is</sup> <sup>evaluated</sup> <sup>after</sup> <sup>position</sup> <sup>update;</sup> _ql_ _U_ ( _ql_, _k_ +1/2): perturbation force is evaluated at an intermediate position during update sequence of the Langevin integrator. Langevin splitting integrators, which have a finite relative path probability density, the expressions for the random number differences are summarized in Table 1. The same equations for the random number difference are obtained when deriving them from the RVO update operators in eq 19. As an example, consider the RVO algorithm, whose random number difference 1 is _l_, _k_ = ( _d_ / _f_ ) _t_ _Mll_ _ql_ _U_ ( _ql_, _k_ +1) <sup>.</sup> <sup>But</sup> <sup>since</sup> <sup>_d_</sup> <sup>̅</sup> <sup>=</sup> <sup>_d_</sup> <sup>and</sup> _f_ = _f_ / _Mll_, we obtain _l_, _k_ = ( _d_ / _f_ ) _t_ _ql_ _U_ ( _ql_, _k_ +1) <sup>,</sup> <sup>which</sup> <sup>is</sup> the equation given in Table 1. Reweighting a Markov State Model. In a Markov state model (MSM), <sup>41−46</sup> the 3 _N_ -dimensional position space Ω is discretized into _n_ state nonoverlapping states Ω _i_, i.e., _in_ =states1 _i_ = 3 _N_ . The probability vector p( _t_ ) contains the time-dependent probabilities _pi_ ( _t_ ) of finding the system in Ω _i_ at time _t_ . The time-evolution of this discrete probability vector is then modeled as a Markov process The absolute transition probability can be formulated as a path integral. <sup>17,18</sup> _Cij_ ( ) = x _hi_ ( _q_ 0) [ x ] _hj_ ( _qn_ ) (22) where _hi_ ( _q_ ) is the indicator function of state Ω _i_ paths x _m_ l m <sup>oo</sup> oo l1, _q_ _i_ ( _q_ ) = m <sup>oo</sup> 1, _i_ = m <sup>oo</sup> _hi_ ( _q_ ) = m <sup>oo</sup> oo n _i_ oo0, otherwise (23) _n_ _i_ _i_ Analogously, _hj_ ( _q_ ) is the indicator function of state Ω _j_ . The path observable _s_ [x] = _hi_ ( _q_ 0) _hj_ ( _qn_ ) thus evaluates to one if the path x starts in Ω _i_ and ends in Ω _j_ and to zero otherwise. _Cij_ ( _τ_ ) can be reweighted according to eq 8, and the reweighted estimator is _Cij_ ( ) = lim _n_ paths _n_ paths1 <u>[[</u> xx _<u>mm</u>_ <u>]]</u> _hi_ ( _q_ 0( _m_ )) _hj_ ( _qn_ ( _m_ )) = lim _n_ paths _n_ paths1 x _S_ <u>[[</u> xx _<u>mm</u>_ <u>]]</u> _m_ _m_ ) _i_ 0( _m_ )) _hj_ ( _qn_ ( _m_ ) _j_ _n_ _<u>m</u>_ _m_ _S_ p _T_ ( _t_ + ) = p _T_ ( _t_ ) P ( ) (20) where P( _τ_ ) is the MSM transition matrix with dimension _n_ states × _n_ states. _τ_ is the MSM lag time. Its elements _Pij_ ( ) = ( _q_ ( _t_ + ) _j_ | _q_ ( _t_ ) _i_ ) contain the conditional probability of finding the system in state Ω _j_ at time _t_ + _τ_, given row-normalized,that it has been in statesuch that Ω _i_ at time _nj_ =states1 _P tij_ . By definition, the matrix is( ) = 1. The conditional transition probability _Pij_ ( _τ_ ) can be calculated from the absolute transition probability _Cij_ ( _τ_ ) between states Ω _i_ and Ω _j_ as I _T_ P ( ) = _i_ ( ) I _T_ _i_ = 0, 1 ...( _n_ states 1) _T_ (24) where _S_ = ( _x_ 1,... _xn_ paths <sup>)</sup> <sup>is</sup> <sup>a</sup> <sup>set</sup> <sup>of</sup> <sup>paths</sup> <sup>of</sup> <sup>length</sup> <sup>_τ_</sup> <sup>=</sup> <sup>_n_</sup> <sup>Δ</sup> <sup>_t_</sup> generated at the simulation potential _V_ ( _q_ ), _q_ (0 _m_ ) is the initial generated at the simulation potential _V_ ( _q_ ), _q_ (0 _m_ ) is the initial position of the _m_ th path and _q_ ( _nm_ ) is its last position. _Cij_ ( ) is position of the _m_ th path and _q_ ( _nm_ ) is its last position. _Cij_ ( ) is the absolute transition probability at a target potential _V_ ̃( _q_ ). Note that due to the normalization of the transition probability in eq 21, the constant ratio of the partition functions _Z_ / _Z_ appearing in eq 15 cancels. <sup>18</sup> Once the reweighted MSM transition matrix P(̃ _τ_ ) has been calculated, the MSM is analyzed via the eigenvalue and eigenvectors of P(̃ _τ_ ) _C_ ( ) = _i_ ( ) I _T_ _i_ = 0, 1 ...( _n_ states 1) (25) _i_ _P_ ( ) = _<u>n</u>_ states _C_ = _<u>nj</u>_ =states1 _Cij_ _<u>n</u>_ _j_ _ij_ _ij_ = _<u>n</u>_ states _Cij_ ( ) =1 _ij_ (21) where l _i_ is the _i_ th left eigenvector and _λi_ ( _τ_ ) is the associated eigenvalue. Due to the row-normalization of P(̃ _τ_ ), the leading <u>The</u> <u>Journal</u> <u>of</u> <u>Physical</u> <u>Chemistry</u> <u>B</u> <u><mark>pubs.acs.org/JPCB</mark></u> <u><mark>Article</mark></u> eigenvalue is always _λ_ 0 = 1 and its associated eigenvector l0 is the stationary density of the MSM. For a molecular system evolving according to eq 1, it should be equal to the (discretized) configurational Boltzmann density. The slow dynamic processes are represented by eigenvectors with eigenvalues close to 1. In Markovian dynamics, the eigenvalues of the MSM transition matrix decay exponentially with the lag time _τ_ : _i_ ( ) = exp( / _ti_ ITS). Thus, if the time-evolution of p( _t_ ) can indeed be modeled by a Markov process, the implied time scale should be independent of _τ_ path length of _τ_ = 40Δ _t_ . We denote the iteration of the MD integrator with index _k_ and the index of the recorded coordinates by _k_ ′. The indices are related via _k_ = _k_ ′ _n_ out. path probability density is calculated and written to a file at the same interval as the coordinates. To do this efficiently, the relative path probability for a path starting at _k_ = _k_ ′ = 0 is decomposed into a product of two factors as shown in eq 14. Inserting eq 15 and omitting the factor _Z_ / _Z_ ̃ yields i <u>0</u> - _M_ [ x | _x_ 0 _RT_ zzzzz <u>0</u> - _M_ [ x | _x_ 0] _U_ ( _q_ bias <u>0</u> - _M_ [ x | _x_ 0 zzzzz <u>0</u> - _M_ [ x | _x_ 0 _RT_ zzzzz ( _q_ ) y y zzzzz { - _M_ [ x | _x_ 0]. <u>[</u> x <u>]</u> expi _U_ ( _q_ <u>0)</u> y· _M_ [ x | _x_ 0]. [ x ] jjjjjk _RT_ zzzzz{ x <u>]</u> expi _U_ ( _q_ <u>0)</u> y· _M_ [ x | x ] jjjjj _RT_ zzzzz exp ]. ITS = [ x _ti_ ITS = ln( _i_ ( )) (26) _U_ bias( _q_ ( _q_ ) y y zzzzz { ]. (27) exp i jjjjj k i i jjjjj k _i_ The implied time scale test <sup>43</sup> uses eq 26 to check the approximation quality of an MSM by calculating MSM transition matrices at various lag times and checking whether the right-hand side of eq 26 is indeed independent of _τ_ . # ■ METHODS General Approach. Performing Girsanov path reweighting for MSMs requires two main steps: (i) computing the relative path probability (eqs 10 and 15) and (ii) estimating the reweighted MSM transition matrix (eq 24). The first step is handled by the MD simulation program on-the-fly during the simulation. The second step is handled by an MD analysis program. The data that is exchanged between the simulation and the analysis program are the position trajectory and an associated trajectory of path reweighting factors. Figure 1 illustrates the data flow. Figure 1. Overview of path reweighting. In path reweighting, and in Girsanov reweighting in particular, the role of MD simulation is to generate a set of paths _S_ = ( _x_ 1,... _xn_ paths <sup>) at the simulation potential</sup> <sup>_V_</sup> <sup>(</sup> <sup>_q_</sup> <sup>). While it</sup> is possible to run a separate MD simulation for each path x _i_, in the context of MSMs the paths are usually extracted from a long trajectory via a sliding window. The path length is then _τ_ = _n_ Δ _t_ = _n_ out· _n_ intervalΔ _t_, where _n_ out represents the interval (in number of MD time steps Δ _t_ ) between writing coordinates to the output trajectory file, and _n_ interval is the number of intervals _n_ outΔ _t_ that fit into the path length _τ_ . To illustrate, in Figure 1 coordinates are written to file every _n_ out = 10 time steps, and _n_ interval = 4 of these recording intervals fit into a path, yielding a We omitted the factor _Z_ / _Z_ ̃ because it cancels in the equation for the MSM transition probability (eq 21). The factor also cancels in other rate estimators. <sup>33</sup> Using a sliding window, path x _i_ may start at any time-point _k_ = _k_ ′ _nout_ at which coordinates are written to file. The indices in eq 27 then shift accordingly, i.e., _q_ 0 → _qk_ ′ and [ _x_ 0, _x_ 1... _xn_ ] → [ _xk_ ′, _xk_ ′+1... _xk_ ′+ _n_ ]. To be able to calculate the relative probability of the initial state of a sliding window path, the perturbation energy _U_ ( _qk_ ′) (or equivalently the bias energy _U_ bias( _qk_ ′)) is written to the reweighting file, whenever coordinates _qk_ = _qk n_ out are written to file. For a Langevin integrator which draws a single random number per degree of freedom and simulation time step, _M_ [x| _x_ 0] is given by the double product in eq 10. To account for the recording interval, we reformulate the factor as _n_ 1 _n_ 3 _N_ interval out 1 _M_ [ x | _x_ [ x | _x_ 0] = exp _l_, _k n_ + _k_ x | _x_ 0] = exp _l_, _k n_ interval+ _k_ _l_, 0 _k_ =0 _k_ interval + _k_ =0 _k_ =0 _l_ = 0 _l_ 1 1 2 i jjj k 1 2 _l_, _k n_ interval+ _k_ _l_, _l_, _k n_ interval+ _k_ _l_, _k n_ interval+ _k_ + _k_ 2 _l_, _k n_ interval+ y zzz { interval+ interval _n_ (28) interval 1 = interval i 1 y exp _Sk_, jjjjjj zzzzzz i i jjjjjj k _k_ y y , zzzzzz { _k_ =0 _S_ _D_ where we split the product over the integration time steps _k_ into an outer product over the recording intervals _k_ ′ and an inner product over the simulation time steps _k_ ″ within a given recording interval. The indices in eqs 10 and 29 are related by _k_ = _k_ ′ _n_ interval + _k_ ″. Furthermore, we have 1 3 _N_ 1 _S_ _D_ _n_ out _k_ + _k_ = _l_, _k n_ + _k_ _l_, _k n_ interval+ _k_ _l_, _k n_ interval+ _k_ _l_, _k n_ interval+ _k_ _l_, interval+ interval + _k_ _l_, _k n_ interval+ =0 _l_ = 0 1 2 _l_ _l_, _k n_ interval+ _k_ 1 2 _l_, interval + _k_ (29) 1 _D_ _Sk_ is calculated in the inner loop of the MD simulation program. At each integration time step _k_ and for each degree of freedom, the random number _l_, _k_ = _l_, _k n_ interval+ _k_ is recorded, and the random number difference _l_, _k_ = _l_, _k n_ interval+ _k_ according to the appropriate equation in Table 1. The terms _l_, _k_ _l_, _k_ + 12 _l_ 2, _k_ are then summed over all degrees of 1 freedom _l_, and the result is added to a buffer variable _D_ _Sk_ . The buffer variable is accumulated throughout the recording <u>The</u> <u>Journal</u> <u>of</u> <u>Physical</u> <u>Chemistry</u> <u>B</u> <u><mark>pubs.acs.org/JPCB</mark></u> <u><mark>Article</mark></u> Figure 2. Implementation of the Girsanov reweighting in OpenMM via openmmtools. (a) Inheritance structure for the class LangevinSplittingGirsanov; (b) sketch of an OpenMM simulation script. LangevinSplittingGirsanov is called analogously to LangevinInegrator. interval, i.e., for _n_ out steps. When the recording interval has elapsed and coordinates are written to the position trajectory, 1 the value of the buffer variable _D_ _Sk_ is written to the reweighting factor trajectory, and the buffer variable is reset to zero. To calculate Δ _ηk_, one needs the bias force −∇ _U_ bias or the perturbation force −∇ _U_ . When Girsanov reweighting is used to unbias a biased simulation, the bias force is already available within the inner loop of the simulation. When Girsanov reweighting is used in a prospective manner to predict the influence of a perturbation _U_ ( _q_ ) on a reference potential _V_ ( _q_ ), perturbation forces −∇ _U_ ( _q_ ) need to be calculated in addition to the forces −∇ _V_ ( _q_ ) that are used to propagate the system. For Langevin integrators that draw two random numbers per 1 integration time step, _D_ _Sk_ is given as 1 3 _N_ 1 _Sk_ _D_ _n_ out _k_ =0 _l_ = (1) _l_, _k_ _n_ interval+ interval + _k_ _l_, _k_ _n_ interval+ = _l_ (1), _k_ _n_ + _k_ (1) , _k_ _n_ _l_, _k_ _n_ interval+ _k_ _l_, _k_ _n_ interval+ _k_ 0 _l_ 1 + 1 (1) ) 2 <sup>(</sup> _l_, _k_ _n_ interval+ _k_ (1) )2 _l_, _k_ _n_ interval+ _k_ _l_, _k_ _n_ interval+ _k_ interval + _n_ 3 _N_ 3 _N_ out 1 (2) _l_, _k_ _n_ + _k_ _l_, _k_ _n_ interval+ + _l_ (2), _k_ _n_ + _k_ (2) , _k_ _l_, _k_ _n_ interval+ _k_ _l_, _k_ _n_ interval+ _k_ interval interval _k_ =0 _l_ =1 0 _l_ 1 + 1 (2) )2. 2 <sup>(</sup> _l_, _k_ _n_ interval+ _k_ (2) )2 _l_, _k_ _n_ interval+ _k_ _l_, _k_ _n_ interval+ _k_ interval + _k_ (30) protocols. For our purpose, the most important openmmtools class is LangevinIntegrator. This class ultimately extends the OpenMM CustomIntegrator class (Figure 2) and provides access to Langevin Splitting integrators. <sup>35,52,53</sup> Openmmtools used the RVO notation. The precise integrator can be conveniently specified by passing the sequence of update operators (eq 16) as a string. LangevinIntegrator implements the update operators as member functions _add_R_step(), _add_V_step(), and _add_O_step(). The sequence of update operations is realized by the function _add_integrator_steps(), which reads a string input, e.g., ‘R V O V R’ and outputs the corresponding update sequence. To implement the reweighting factor trajectory, we created the new class LangevinSplittingGirsanov within openmmtools. With this new class, Girsanov reweighting simulations can be set up simply by specifying the Langevin integrator as a string, as one would normally do for a Langevin simulation with openmmtools. Figure 2b shows a sample OpenMM script for a Girsanov reweighting simulation. LangevinSplittingGirsanov extends LangevinIntegrator and thus inherits all methods from LangevinIntegrator and its parent classes (Figure 2). In this way, variables for _Mll_, _T_, _ξ_, Δ _t_, etc. are automatically set. The random number differences Δ _ηl_, _k_ are implemented as a dispatch table, which can be accessed via the class function _delta_eta_table(self). When initializing the LangevinSplittingGirsanov with a string of update operators, the __init__-function checks whether Girsanov reweighting is possible for this particular Langevin integrator and whether the random number difference has been 1 implemented. The variable _D_ _Sk_ is provided by the function _get_logM(), which performs the summation over the 3 _N_ degrees of freedom, the recording interval _n_ out, and, if necessary, the number of random numbers drawn per integration step. An additional factor sets the buffer variable 1 for _D_ _Sk_ to zero before the next recording step is performed. An OpenMM simulation requires the input of an external force field file, which is processed to the OpenMM System object and can be called within the inner loop of the simulation; for more details cf. [Figure](https://pubs.acs.org/doi/suppl/10.1021/acs.jpcb.4c01702/suppl_file/jp4c01702_si_001.pdf) S1. Additional bias forces can be provided by an interface like openmm-plumed <sup>55</sup> and are stored in a separate force group of the OpenMM Force object. To ensure the bias force update at the 1 The variable name _D_ _Sk_ is a nod to the path action, where _D_ is the diffusion constant. When formulating the path probability in terms of the path action, <sup>15,26,54</sup> _S_ [x], eqs 29 and 30 can be interpreted as the action difference between the simulation and the target potential, scaled by the diffusion constant. Given the position trajectory at the simulation potential _V_ ( _q_ ) and the trajectory of path reweighting factors, an MSM at the target potential _V_ ̃( _q_ ) can be obtained via eq 24. The relative path probability density is calculated from the path 1 reweighting factors by summing up _D_ _Sk_ for all _n_ intervals recording intervals that make up the path x (eq 28) and multiplying the resulting conditional path reweighting factor _M_ [x| _x_ 0] with the relative probability density of the initial state of the path (eq 27). Implementation in OpenMM via Openmmtools. Openmmtools is a Python library layer that provides tools that allow for a user-friendly setup of complex simulation <u>The</u> <u>Journal</u> <u>of</u> <u>Physical</u> <u>Chemistry</u> <u>B</u> <u><mark>pubs.acs.org/JPCB</mark></u> <u><mark>Article</mark></u> Figure 3. Comparison of the reference implementation (dotted) and the OpenMM CustomIntegrator class (solid) (a) Müller−Brown potential; (b) Müller−Brown potential and linear bias; (c) Müller−Brown potential and polynomial bias; Trajectories for 100 time steps of simulation: (d) _x_ component of the position, (e) _x_ -component of the momentum, and (f) potential energy due to the bias. Difference between reference implementation and the OpenMM CustomIntegrator class (solid) for 100 time steps of simulation: (g) difference in _x_ -component of ththe momentume momentum, (h) difference in the bias force _F_ bias( _qk_ ) = _x_ _U_ bias( _qk_ ), and (i) difference in the random number difference Δ _ηk_ . integration step corresponding to the Langevin splitting s c h e m e c f . T a b l e 1, w e h a v e a d a p t e d _add_integrator_steps() to call the bias force group accordingly. Furthermore, we provide reporter class ReweightingReporter to record the path reweighting factors. Implementation in Deeptime. Deeptime <sup>47</sup> is a Python library for the analysis of time series data and offers a wide range of tools to construct and analyze Markov models via the module markov. It implements estimation of a count matrix from a discretized trajectory via the function count_matrix_coo2_mult(···), which is provided by the module deeptime.markov.tools.estimation. The function currently implements the direct maximumlikelihood estimator for the matrix elements _Cij_ ( _τ_ ), which is obtained by setting the path probability ratio in eq 8 to one. We modified this function to implement the reweighted estimator in eq 24. The modified function accepts a trajectory of reweighting factors as an argument in addition to the discretized trajectory. If a trajectory of reweighting factors is passed to the function, the reweighted estimator is calculated; otherwise, it calculates the direct estimator. For each lag time _τ_, the reweighting factors are aggregated according to eqs 28 and 27 and used to calculate the reweighted count estimate according to eq 24. The extended function is called by the class GirsanovReweightingEstimator, which is a child class of the class TransitionCountEstimator. The MaximumLikelihoodMSM class is available as a higher-level estimator of the MSM transition probabilities, which inputs the GirsanovReweightingEstimator, like the TransitionCountEstimator, and transforms the Muller̈ - Brown Potential. We use the Muller̈ −Brown potential _V_ MB( _x_, _y_ )56 (Figure 3a, parametrized according to eq 31 and Table 2) to compare our reference implementation to the implementation using the OpenMM CustomIntegrator class. The potential is characterized by a global minimum around (−0.5, 1.5) and two local minima around (0.0,0.5) and (0.5,0.0). The system was propagated on two biased potentials _V_ ( _x_, _y_ ) = _V_ MB( _x_, _y_ ) + _U_ bias( _x_ ), where the first potential had a reweighted count matrix (21) into a transition matrix (eq 21). From there, all functionalities available in Deeptime, including the evaluation of the dominant eigenvalues (eq 25) and implied time scales (eq 26) for a series of lag times, can be achieved by feeding this transition matrix into the MarkovStateModel class. # ■ RESULTS In this section, the performance of the LangevinSplittingGirsanov class is investigated. Being part of the openmmtools package, the LangevinSplittingGirsanov class receives its forces from an OpenMM simulation object, which requires a molecular force field as the input (Figure 2). The LangevinSplittingGirsanov class thus cannot be directly compared to a reference implementation of a Langevin dynamics on an arbitrary low-dimensional potential. The OpenMM CustomIntegrator class can handle arbitrary lowdimensional potential as well as molecular force fields. To ensure consistency, we first compare the reference implementation to the OpenMM CustomIntegrator class using the Müller−Brown potential. <sup>56</sup> Then we compare the OpenMM CustomIntegrator class to our LangevinSplittingGirsanov class by using a dissociation process in water. <u>The</u> <u>Journal</u> <u>of</u> <u>Physical</u> <u>Chemistry</u> <u>B</u> <u><mark>pubs.acs.org/JPCB</mark></u> <u><mark>Article</mark></u> Table 2. Parameters for Mu ̈ ller−Brown Potential _n_ = 1 _n_ = 2 _n_ = 3 _n_ = 4 units _An_ −20.0 −10.0 −17.0 1.5 kJ/mol _an_ −1.0 −1.0 −6.5 0.7 nm <sup>−2</sup> _bn_ 0.0 0.0 11.0 0.6 nm <sup>−2</sup> _cn_ −10.0 −10.0 −6.5 0.7 nm <sup>−2</sup> _xn_ 1.0 0.0 −0.5 −1.0 nm _yn_ 0.0 0.5 1.5 1.0 nm linear bias along _x_ (Figure 3b), and the second potential had a strong polynomial bias along _x_ (Figure 3c), cf. eq 32. The second form is motivated by a plumed-like bias, which is applied along a reaction coordinate and thus approximates a polynomial of the potential function. The linear bias was chosen to avoid position dependence in the force calculation. A consequence of applying the bias along _x_ is that the path probabilities for the _y_ -component of the path are the same in the simulation and the target potential. The reference implementation uses the analytical forces from this potential and the Langevin splitting integrator ABOBA <sup>35</sup> to propagate the system. The OpenMM CustomIntegrator class uses numerical forces provided by OpenMM and also the Langevin splitting integrator ABOBA <sup>35</sup> to propagate the system. Similarly, analytical bias forces are 1 used to calculate the path reweighting factors _D_ _Sk_ (eq 29) in the reference implementation, whereas numerical forces are used for this purpose in the OpenMM CustomIntegrator class. Figure 3d−f shows the _x_ -component of the position and momentum trajectory, as well as the trajectory of the bias energy for 100 simulation steps. We used the same random number sequence in both implementations. The simulations with the OpenMM CustomIntegrator class are shown as colored solid lines: orange for the linear bias and blue for the polynomial bias. The trajectories from the reference implementation are shown as black dotted lines. Visually the trajectories from the two implementations coincide. In fact, the difference between the two implementations is in the range of floating point precision. Figure 3g shows the difference of the momentum trajectories between the two implementations, which is on the order of 10 <sup>−14</sup> nm amu over 100 time steps, as an example. The difference of the position trajectory and the [difference of the bias energy are shown in Figure S2. However,](https://pubs.acs.org/doi/suppl/10.1021/acs.jpcb.4c01702/suppl_file/jp4c01702_si_001.pdf) we do find that the bias force can differ in the two implementations (Figure 3h). While for the linear bias, analytical and numerical bias forces are identical (orange line in Figure 3h), the numerical force deviates from the analytical force for a nonlinear bias potential (blue line in Figure 3h). Since the bias force is used to calculate the random number difference, Δ _ηk_ differs between the two implementations for the nonlinear bias (Figure 3i). In summary, apart from the difference between analytical and numerical forces, the OpenMM CustomIntegrator implementation reproduces the trajectories and path reweighting factor trajectories from our reference implementation. Next, we confirmed that we can reweight an MSM using the OpenMM CustomIntegrator class. Figure 4b shows the left dominant MSM eigenvectors _l_ 0 and _l_ 1 of the unbiased Muller̈ Brown potential, which is our target potential. _l_ 0 represents the stationary density of the Müller−Brown potential. _l_ 1 changes sign at the largest barrier of the potential and represents equilibration across this barrier. The MSM was obtained by a simulation at the unbiased Muller̈ −Brown potential _V_ MB( _x_, _y_ ). Figure 4c shows the same eigenvectors obtained by simulating at a linearly biased potential _V_ ( _x_, _y_ ) = _V_ MB( _x_, _y_ ) + _U_ bias( _x_ ) and then reweighting the MSM estimator (eq 24). The reweighted eigenvectors are in excellent agreement with the eigenvectors obtained from the unbiased simulation. Figure 4a shows the implied time scales of the MSM from the unbiased simulations (gray dashed line) and the MSM of the biased simulation without reweighting (dotted orange line) and with reweighting (solid orange line). Also for the implied time scales, the reweighted results agree very well with the results obtained from unbiased simulations. I <sup>−</sup> - Ca <sup>2+</sup> - I <sup>−</sup> Dissociation Process in Water. We use simulations of CaI2 in TIP3P water (Figure 5a) to compare the implementation using the OpenMM CustomIntegrator class to our new LangevinSplittingGirsanov class (Figure 5b−g). The I <sup>−</sup> anions were position restrained such that they maintained a Figure 4. MSMs of the dynamics on the Müller−Brown potential. (a) Implied time scale _t_ 1ITS associated with the slowest process. (b) MSM eigenvectors _l_ 0 and _l_ 1 from an unbiased simulation on the Müller−Brown potential. (c) Reweighted MSM eigenvectors _l_ 0 and _l_ 1 from a simulation on the linearly biased Müller−Brown potential. <u>The</u> <u>Journal</u> <u>of</u> <u>Physical</u> <u>Chemistry</u> <u>B</u> <u><mark>pubs.acs.org/JPCB</mark></u> <u><mark>Article</mark></u> Figure 5. Molecular system of Ca <sup>2+</sup> I2− ion pair in TIP3P water is shown in (a). Comparison between OpenMM CustomIntegrator (black dashed) and LangevinSplittingGirsanov class (orange solid) for 100 time steps of simulation: (b) position _qz_, _k_, (c) momentum _pz_, _k_, (d) bias potential _U_ bias( _qz_, _k_ ), (e) bias force _F_ bias( _qz_, _k_ ), (f) reweighting factors _D_ 1 _Sk_, and (g) random number _ηz_, _k_ . Implied time scales from I <sup>−</sup> −Ca <sup>2+</sup> −I <sup>−</sup> reference simulation at a unbiased potential (gray solid), as well as from a reweighted MSM (solid) and a standard MSM (dotted) from linearly biased simulations with _kz_ = 5 kJ/mol/nm in blue (h). First (i) and second (j) left dominant MSM eigenvectors are shown, with the same color code used in (h). distance of 0.9 nm along the _z_ -coordinate. The Ca <sup>2+</sup> cation was allowed to diffuse between these two anions, by applying medium strong harmonic restraints along the _y_ and _x_ coordinates of the Ca <sup>2+</sup> cation. The resulting dynamics resembles a double-well dynamics along _z_, where the Ca <sup>2+</sup> cation alternates between being bound to the I <sup>−</sup> anion and being bound to the other I <sup>−</sup> anion. In between the two bound states, there is a considerable free-energy barrier. The target potential _V_ (̃ _q_ ) consists of the molecular potential for this system including the above-mentioned restraints. In the potential _V_ ( _q_ ) = _V_ ( _q_ ) + _U_ bias( _q_ ), a linear bias potential along _z_ is added, where _q_ is the position vector of all atoms in the system. Similar to the Müller−Brown potential (Figure 3), we compared the two implementations for a trajectory of 100 time steps, which was generated at the biased potential _V_ ( _q_ ). The two simulations use the same random number sequence for each degree of freedom. We observe a slight difference in the position and momentum trajectories between the OpenMM CustomIntegrator and the LangevinSplittingGirsanov. We suspect this can be attributed to slight algorithmic differences between our OpenMM CustomIntegrator implementation of the ABOBA algorithm and the implementation of the ABOBA algorithm via the parent class of LangevinSplittingGirsanov, the class LangevinIntegrator. Apart from this slight drift, the trajectory from our LangevinSplittingGirsanov class follows the trajectory from the OpenMM CustomIntegrator class very closely (Figure 5b−d). Figure 5e−g shows trajectories of the bias force _F_ bias( _qz_, _k_ ), of 1 _D_ _Sk_, and of the random number _ηz_, _k_ . The trajectories from the two implementations are identical for the linear bias (Figure S3a,b). Thus, the LangevinSplittingGirsanov imple <u>The</u> <u>Journal</u> <u>of</u> <u>Physical</u> <u>Chemistry</u> <u>B</u> <u><mark>pubs.acs.org/JPCB</mark></u> <u><mark>Article</mark></u> mentation reproduces the trajectories and path reweighting factors from the OpenMM CustomIntegrator implementation. Figure 5h−j tests whether we can reweight an MSM of the CaI2 dynamics using the LangevinSplittingGirsanov class. The MSM has been constructed by discretizing the _z_ -coordinate, thereby neglecting the solvent degrees of freedom. Figure 5i shows the eigenvector _l_ 0 (gray solid line), which represents the stationary density at the target potential _V_ ̃( _q_ ), and the eigenvector _l_ 1 (blue dotted line), which represents the stationary density at the biased potential. Due to the bias potential, the two stationary densities differ. Reweighting the simulation data from the biased simulation recovers the stationary density _l_ 0 at the target potential _V_ ̃( _q_ ) with high accuracy. Figure 5j shows the eigenvectors _l_ 1 and _l_ 1, which represent the equilibration between the two bound states. Interestingly, the process seems to be insensitive to the bias, and thus the results from all three MSMs coincide. Figure 5h shows the associated implied time scales from simulations at the target potential _V_ ̃( _q_ ), simulations at the biased potential _V_ ( _q_ ), and simulations at the biased potential _V_ ( _q_ ) reweighted to the target potential _V_ ̃( _q_ ). While the MSM eigenvectors can be reweighted with high accuracy, the reweighted implied time scale exhibits a large statistical uncertainty. We will discuss possible reasons for this in Conclusions. # ■ COMPUTATIONAL DETAILS Muller̈ - Brown Potential. The Muller̈ −Brown potential <sup>56</sup> is 4 2 _V_ MB( _x_, _y_ ) = _An_ exp( _an_ ( _x_ _xn_ )2 + _bn_ ( _x_ _xn_ )( _y_ _y_ ( _x_, _y_ ) = _An_ exp( _an_ ( _x_ _xn_ )2 + _bn_ ( _x_ _xn_ )( _y_ _y_ ) MB = _An_ exp( _an_ ( _x_ _xn_ )2 + _n_ _n_ _n_ _n_ _n_ _n_ _n_ = + 1 _n_ _n_ _cn_ ( _y_ _y_ ( _y_ _y_ )2) 2 (31) In the simulations using the OpenMM CustomIntegrator class, the initial positions were drawn randomly from a uniform distribution, and the initial velocities were chosen according to the Boltzmann distribution at 300 K. We then generated 5 trajectories with 10 <sup>8</sup> time steps each for _V_ MB( _x_, _y_ ), 5 trajectories with 10 <sup>8</sup> time steps each for _V_ MB( _x_, _y_ ) + _U_ bias,linear( _x_ ). From the trajectories, we constructed two-dimensional MSMs on a grid with 36 states, where the _x_ -dimension was discretized in the range −3.5 ≤ _x_ ≤ 1.5, and the _y_ -dimension was discretized in the range −1.5 ≤ _y_ ≤ 3.5. The lag time was varied between 0.5 and 24.5 ps in steps of 1 ps. We calculated un-reweighted MSMs for the trajectories at _V_ MB( _x_, _y_ ) and _V_ MB( _x_, _y_ ) + _U_ bias,linear( _x_ ) using the estimators provided by Deeptime. <sup>47</sup> We calculated reweighted MSMs for the trajectories at _V_ MB( _x_, _y_ ) + _U_ bias,linear( _x_ ) using our implementation of the reweighted estimators which extends Deeptime. <sup>57</sup> I <sup>−</sup> - Ca <sup>2+</sup> - I <sup>−</sup> . The model system is a Ca <sup>2+</sup> I2− ion pair ( _m_ Ca = 40.08 amu, _m_ I = 126.90 amu) in an explicit TIP3P water box, containing 49 hydrogen bonds restrained water molecules. The nonbonded interaction parameters are chosen according to the AMBER99 force field, <sup>59</sup> _σ_ Ca = 3.05 × 10 <sup>−1</sup>, _ε_ Ca = 1.92, _σ_ I = 4.19 × 10 <sup>−1</sup>, and _ε_ I = 1.67. ABOBA simulations were performed either with openmmtools LangevinIntegrator <sup>40</sup> or for biased runs with LangevinSplittingIntegrator. <sup>58</sup> The initial positions were drawn randomly from a uniform distribution, and the initial velocities were chosen according to the Boltzmann distribution at 300 K. The step size of the integrator was 1 fs, with the friction coefficient of 2 ps <sup>−1</sup> . The particle mesh Ewald summation was used to calculate the interaction of all particle pairs within a cutoff of 0.49 nm. Five trajectories with 2.5 × 10 <sup>8</sup> time steps each were created for the reference simulations at the unbiased potential. A total of 5 trajectories with 2 × 10 <sup>8</sup> time steps each were created at the biased potential. To apply the bias linearly along one Cartesian coordinate of the Ca <sup>2+</sup> ion _U_ bias,linear( _z_ ) = _k_ linear· _z_ (33) with _k_ linear = 5 kJ/mol/nm, the degrees of freedom of the three atoms are restricted in the other two dimensions by a harmonic potential of the strength _kx_ = _ky_ = 200 × 10 <sup>3</sup> kJ/mol/nm. The displacement of the two iodide atoms is restricted in all directions, _kz_ = 500 × 10 <sup>3</sup> kJ/mol/nm. Restraining the degrees of freedom of the three atoms and the reduction to the collective variable of the iodide-calcium distance _d_ I−Ca means that the slowest process takes place on a double-well potential. The trajectories were used to construct one-dimensional MSMs on a grid with 50 states of the iodide-calcium distance _d_ I−Ca in the range 0.3 ≤ _d_ I−Ca ≤ 0.6. The lag time was varied between 5 and 100 ps in steps of 5 ps. The unreweighted MSMs for both the reference and biased trajectories are calculated using the estimators provided by Deeptime, <sup>47</sup> cf. [Figure](https://pubs.acs.org/doi/suppl/10.1021/acs.jpcb.4c01702/suppl_file/jp4c01702_si_001.pdf) S4. The reweighted MSMs based on trajectories at a biased potential are performed with our implementation of the reweighted estimator. <sup>57</sup> # ■ CONCLUSIONS This paper presents a guide for implementing Girsanov reweighting in MD simulation and analysis programs using the OpenMM with openmmtools and Deeptime as examples. its parameters are reported in Table 2. We used two different bias potentials along the _x_ -coordinate _U_ bias,linear( _x_ ) = _k_ linear· _x_ ( _x_ ) = _k_ linear· bias,linear linear _m_ _U_ bias,polynom( _x_ ) = _k_ polynom· _anx_ ( _x_ ) = _k_ polynom· _n_ _n_ _n_ bias,polynom = polynom· _n_ =1 (32) with _k_ linear = 1 kJ/mol/nm and _k_ polynom = 50 kJ/mol/nm, _m_ = 13, _a_ 1 = 2.06 _e_ - 02 nm <sup>−1</sup>, _a_ 2 = −2.32 _e_ - 02 nm <sup>−2</sup>, _a_ 3 = 3.83 _e_ 03 nm <sup>−3</sup>, _a_ 4 = 3.92 _e_ - 02 nm <sup>−3</sup>, _a_ 5 = −1.39 _e_ - 02 nm <sup>−3</sup>, _a_ 6 = −3.39 _e_ - 02 nm <sup>−3</sup>, _a_ 7 = 3.82 _e_ - 04 nm <sup>−3</sup>, _a_ 8 = 1.24 _e_ - 02 nm <sup>−3</sup>, _a_ 9 = 3.37 _e_ - 03 nm <sup>−3</sup>, _a_ 10 = −1.18 _e_ - 03 nm <sup>−3</sup>, _a_ 11 = −7.50 _e_ - 04 nm <sup>−3</sup>, _a_ 12 = −1.38 _e_ - 04 nm <sup>−3</sup>, _a_ 13 = −8.81 _e_ - 06 nm <sup>−3</sup> . The particle mass was set to _mp_ = 1 amu. The ideal gas constant was set to _R_ = 8.314 J/(K mol). The system was simulated using the Langevin splitting algorithm ABOBA <sup>35</sup> with time step Δ _t_ = 0.5 fs, friction coefficient _ξ_ = 5 ps <sup>−1</sup>, and temperature _T_ = 300 K. We used two different implementations of ABOBA: (i) a reference stand-alone implementation in Python and (ii) an abstraction using the OpenMM CustomIntegrator class. Both implementations are available via GitHub. <sup>57,58</sup> In the simulations using the reference implementation, the initial positions were drawn randomly from a uniform distribution and the initial velocities were set to _v_ 0 = (0.0, 0.0). We then generated 5 trajectories with 2.5 × 10 <sup>8</sup> time steps each for _V_ MB( _x_, _y_ ) and 5 trajectories with 2.5 × 10 <sup>8</sup> time steps each for _V_ MB( _x_, _y_ ) + _U_ bias,linear( _x_ ). <u>The</u> <u>Journal</u> <u>of</u> <u>Physical</u> <u>Chemistry</u> <u>B</u> <u><mark>pubs.acs.org/JPCB</mark></u> <u><mark>Article</mark></u> In openmmtools, we extended an existing Langevin integrator class such that the reweighting factors are calculated on-the-fly and, at regular intervals, are written to a reweighting factor trajectory file. In Deeptime, we extended the MSM estimator class such that the transition counts are reweighted according to the reweighting factor trajectory. We demonstrated the correct functioning and error-free applicability of the newly implemented functions and classes using both a low-dimensional test system and a molecular system. The implementation can be readily used for larger systems. The extended software as well as instructions on how to use it are freely available. <sup>57,58,60,61</sup> The computational cost of the Girsanov reweighting is usually small. During the simulation, it consists of recording the bias forces and energies and the random numbers for the degrees of freedom that are affected by the bias. During the analysis, it consists of evaluating eqs 29 or 30. Since the bias is typically low-dimensional, i.e., it affects only a few atoms in the simulation box, _l_, _k n_ interval <sup>+</sup> _k_ is zero for most dimensions _l_, and the evaluation of the sums in eqs 29 and 30 incurs no relevant computational cost. In our example of calcium−iodine ion dissociation in water, the bias was applied along the _z_ dimension of the Ca <sup>2+</sup> cation. Thus, the bias force was onedimensional and the sum over the dimensions in eq 29 contained a single term. This is negligible compared to the cost of evaluating a single MD simulation step with a 450dimensional force vector (49 water molecules and 3 ions in the simulation box). A more critical question is under which circumstances Girsanov reweighting is efficient. One condition for efficiency is that the length of the reweighted paths has to be considerably shorter than the slow processes in the system. MSMs are one way to construct Girsanov-reweighted kinetic models from short paths because in these models the path length is equal to the MSM lag time. <sup>18,19,36,62</sup> This is the approach we used here. Alternatively, one can reweight transition rates within the framework of transition path sampling or transition interface sampling, in which case only the typically short transition paths are reweighted. <sup>33</sup> The second factor that influences the efficiency of Girsanov reweighting is the bias. Finding an optimal bias is closely connected to optimal control theory and to finding an optimal reaction coordinate along which the bias is applied. <sup>29,63</sup> When reweighting MSMs, the reweighted dominant eigenvectors tend to be more accurate than the reweighted implied time scales. <sup>18,36</sup> This might be due to several reasons. First, the relative path probability decreases exponentially with an increasing path length, falling below the numerical floating point accuracy. One simple remedy is to use a library which allows for a higher precision in the floating point numbers when analyzing the reweighting factor trajectories (for generating the path reweighting trajectory, the usual double precision should be sufficient). Second, in high-dimensional systems, the bias might shift the transition path ensemble for transitions across the barriers. A shifted transition path ensemble at the biased potential is then not representative of paths at the unbiased potential, which causes the relative path probability to be analytically close to zero. To avoid a shift in the transition paths, the bias can be deposited exclusively in the minima of the potential energy function. <sup>22</sup> Finally, drifting implied time scales with large statistical uncertainties also occur in discrete Markov models which are estimated from unbiased simulations. This effect might be magnified by reweighting. More accurate Markov models are obtained by using an arbitrary ansatz function instead of a crisp discretization, such as tICA-Markov models, <sup>64,65</sup> variational Markov models, <sup>66</sup> or core-set Markov models. <sup>45,62,67</sup> Since it is straightforward to reweight the estimators for these Markov models by the Girsanov relative path probability density, using suitable ansatz functions instead of crisp states will likely improve the accuracy of the reweighted implied time scales. OpenMM provides very clean and clear access to the inner loop of the MD simulation via the CustomIntegrator class, and in previous studies, we have taken advantage of this class to implement Girsanov reweighing. <sup>18,19,36</sup> However, this approach requires a detailed understanding of both the numerical schemes used to implement Langevin splitting integrators and the equations for the relative path probability. With the LangevinSplittingIntegrator class presented here, the running of a Girsanov reweighting simulation is simplified to one line of code in the OpenMM simulation script. A simple and errorresistant way to set up a Girsanov reweighting simulation is the starting point for more reweighting studies on large molecular systems. # ■ Data ASSOCIATED Availability Statement CONTENT We provide the software for MD simulation with Girsanov reweighting as a pull request to the original openmmtools and openmm repository. added class LangevinSplittingGirsanov: [https://github.com/choderalab/openmmtools/](https://github.com/choderalab/openmmtools/pull/729) [pull/729,](https://github.com/choderalab/openmmtools/pull/729) added class ReweightingReporter: [https://](https://github.com/openmm/openmm/pull/4533) [github.com/openmm/openmm/pull/4533.](https://github.com/openmm/openmm/pull/4533) The extensions of the deeptime <sup>47</sup> package for Girsanov reweighted Markov state models are also available as a pull request. modified class count_matrix_coo2_mult and added GirsanovReweightingEstimator: [https://github.com/](https://github.com/deeptime-ml/deeptime/pull/290) [deeptime-ml/deeptime/pull/290.](https://github.com/deeptime-ml/deeptime/pull/290) All simulation scripts and input files can be viewed in our reweightingtools repository. [https://github.com/bkellerlab/reweightingtools.](https://github.com/bkellerlab/reweightingtools) - sı Supporting Information The Supporting Information is available free of charge at [https://pubs.acs.org/doi/10.1021/acs.jpcb.4c01702.](https://pubs.acs.org/doi/10.1021/acs.jpcb.4c01702?goto=supporting-info) Illustration of simulation software setup with tools for Girsanov path reweighting; representation of difference in x-dimension of 100-steps long trajectories; difference between the OpenMM CustomIntegrator class and LangevinSplittingGirsanov for 100 time steps of simulation; and dynamical properties of the I <sup>−</sup> -Ca <sup>2+</sup> -I <sup>−</sup> system [(PDF)](https://pubs.acs.org/doi/suppl/10.1021/acs.jpcb.4c01702/suppl_file/jp4c01702_si_001.pdf) # ■ Corresponding AUTHOR INFORMATION Author Bettina G. Keller - _Department_ _of_ _Biology,_ _Chemistry,_ _and_ _Pharmacy, Freie Universität Berlin, Berlin 14195, Germany;_ [orcid.org/0000-0002-7051-0888; Email: bettina.keller@](https://orcid.org/0000-0002-7051-0888) [fu-berlin.de](mailto:bettina.keller@fu-berlin.de) Author Joana-Lysiane Schäfer - _Department_ _of_ _Biology,_ _Chemistry,_ _and_ _Pharmacy,_ _Freie_ _Universität_ _Berlin,_ _Berlin_ _14195,_ _Germany_ Complete contact information is available at: [https://pubs.acs.org/10.1021/acs.jpcb.4c01702](https://pubs.acs.org/doi/10.1021/acs.jpcb.4c01702?ref=pdf) <u>The</u> <u>Journal</u> <u>of</u> <u>Physical</u> <u>Chemistry</u> <u>B</u> <u><mark>pubs.acs.org/JPCB</mark></u> <u><mark>Article</mark></u> Notes The authors declare no competing financial interest. # ■ ACKNOWLEDGMENTS The authors thank Sascha Jähnigen for helpful comments on the manuscript. The work was funded by the German Research Foundation (DFG, GRK2473 “Bioactive Peptides”�project number 392923329 and GRK2662 “Charging into the future”�project number 434130070). # ■(1) REFERENCES Hénin, J.; Lelievre,̀ T.; Shirts, M. R.; Valsson, O.; Delemotte, L. Enhanced sampling methods for molecular dynamics simulations. _Living_ _J._ _Comp._ _Mol._ _Sci._ 2022, _4_ (1), 1583. (2) Swendsen, R. H.; Wang, J.-S. Replica monte [carlo](https://doi.org/10.1103/PhysRevLett.57.2607) simulation of [spin-glasses.](https://doi.org/10.1103/PhysRevLett.57.2607) _Phys._ _Rev._ _Lett._ 1986, _57_ (21), 2607−2609. (3) Sugita, Y.; Okamoto, Y. Replica-exchange [molecular](https://doi.org/10.1016/S0009-2614%0x2899%0x2901123-9) dynamics [method for protein folding.](https://doi.org/10.1016/S0009-2614%0x2899%0x2901123-9) _Chem. Phys. Lett._ 1999, _314_ (1−2), 141− 151. (4) Torrie, G. M.; Valleau, J. P. Nonphysical [sampling](https://doi.org/10.1016/0021-9991%0x2877%0x2990121-8) distributions [in monte carlo free-energy estimation: Umbrella sampling.](https://doi.org/10.1016/0021-9991%0x2877%0x2990121-8) _J. Comput._ _Phys._ 1977, _23_ (2), 187−199. [(5) Wang, L.; Friesner, R. A.; Berne, B. Replica exchange with solute](https://doi.org/10.1021/jp204407d?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) scaling: A more efficient version of replica exchange with solute [tempering](https://doi.org/10.1021/jp204407d?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) (rest2). _J._ _Phys._ _Chem._ _B_ 2011, _115_ (30), 9431−9438. [(6) Huber, T.; Torda, A. E.; Van Gunsteren, W. F. Local elevation: A](https://doi.org/10.1007/BF00124016) [method for improving the searching properties of molecular dynamics](https://doi.org/10.1007/BF00124016) [simulation.](https://doi.org/10.1007/BF00124016) _J._ _Comput._ _Aided_ _Mol._ _Des._ 1994, _8_, 695−708. (7) Grubmüller, H. Predicting slow [structural](https://doi.org/10.1103/PhysRevE.52.2893) transitions in macromolecular systems: Conformational flooding. _Phys._ _Rev._ _E_ 1995, _52_ (3), 2893−2906. [(8) Laio, A.; Parrinello, M. Escaping free-energy minima.](https://doi.org/10.1073/pnas.202427399) _Proc. Natl._ _Acad._ _Sci._ _U.S.A._ 2002, _99_ (20), 12562−12566. (9) Dellago, C.; Bolhuis, P. G. Transition path [sampling](https://doi.org/10.1007/978-3-540-87706-6_3) and other advanced simulation [techniques](https://doi.org/10.1007/978-3-540-87706-6_3) for rare events. _Advanced_ _computer_ _simulation_ _approaches_ _for_ _soft_ _matter_ _sciences_ ; Springer 2009, pp 167− 233.. (10) Zuckerman, D. M.; Chong, L. T. [Weighted](https://doi.org/10.1146/annurev-biophys-070816-033834) ensemble simulation: Review of [methodology,](https://doi.org/10.1146/annurev-biophys-070816-033834) applications, and software. _Annu._ _Rev._ _Biophys._ 2017, _46_, 43−57. (11) Kamenik, A. S.; Linker, S. M.; Riniker, S. [Enhanced](https://doi.org/10.1039/D1CP04809K) sampling without borders: On global [biasing](https://doi.org/10.1039/D1CP04809K) functions and how to reweight [them.](https://doi.org/10.1039/D1CP04809K) _Phys._ _Chem._ _Chem._ _Phys._ 2022, _24_ (3), 1225−1236. (12) Kieninger, S.; Donati, L.; Keller, B. G. Dynamical reweighting methods for [markov](https://doi.org/10.1016/j.sbi.2019.12.018) models. _Curr._ _Opin._ _Struct._ _Biol._ 2020, _61_, 124− 131. (13) Zuckerman, D. M.; Woolf, T. B. Efficient [dynamic](https://doi.org/10.1103/physreve.63.016702) importance sampling of rare [events](https://doi.org/10.1103/physreve.63.016702) in one dimension. _Phys._ _Rev._ _E_ 2000, _63_ (1), 016702. (14) Athenes, M. A path-sampling [scheme](https://doi.org/10.1140/epjb/e2004-00159-0) for computing thermodynamic properties of a [many-body](https://doi.org/10.1140/epjb/e2004-00159-0) system in a generalized [ensemble.](https://doi.org/10.1140/epjb/e2004-00159-0) _Eur._ _Phys._ _J._ _B_ 2004, _38_, 651−663. (15) Adib, A. B. Stochastic actions [for](https://doi.org/10.1021/jp0751458?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) diffusive dynamics: Reweighting, [sampling,](https://doi.org/10.1021/jp0751458?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) and minimization. _J._ _Phys._ _Chem._ _B_ 2008, _112_ (19), 5910−5916. (16) Xing, C.; Andricioaei, I. On the calculation of time correlation functions by [potential](https://doi.org/10.1063/1.2159476) scaling. _J._ _Chem._ _Phys._ 2006, _124_ (3), 034110. (17) Schütte, C.; Nielsen, A.; Weber, M. Markov [state](https://doi.org/10.1080/00268976.2014.944597) models and [molecular](https://doi.org/10.1080/00268976.2014.944597) alchemy. _Mol._ _Phys._ 2015, _113_ (1), 69−78. (18) Donati, L.; Hartmann, C.; Keller, B. G. Girsanov [reweighting](https://doi.org/10.1063/1.4989474) [for path ensembles and markov state models.](https://doi.org/10.1063/1.4989474) _J. Chem. Phys._ 2017, _146_ (24), 244112. (19) Donati, L.; Keller, B. G. Girsanov [reweighting](https://doi.org/10.1063/1.5027728) for [metadynamics](https://doi.org/10.1063/1.5027728) simulations. _J._ _Chem._ _Phys._ 2018, _149_ (7), 072335. (20) Donati, L.; Weber, M.; Keller, B. G. A review of girsanov reweighting and of square root [approximation](https://doi.org/10.1063/5.0127227) for building molecular markov [state](https://doi.org/10.1063/5.0127227) models. _J._ _Math._ _Phys._ 2022, _63_ (12), 123306. [(21) Wolf, S.; Stock, G. Targeted molecular dynamics calculations of](https://doi.org/10.1021/acs.jctc.8b00835?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) free energy profiles using a [nonequilibrium](https://doi.org/10.1021/acs.jctc.8b00835?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) friction correction. _J._ _Chem._ _Theory_ _Comput._ 2018, _14_ (12), 6175−6182. (22) Tiwary, P.; Parrinello, M. From [metadynamics](https://doi.org/10.1103/physrevlett.111.230602) to dynamics. _Phys._ _Rev._ _Lett._ 2013, _111_ (23), 230602. (23) Badaoui, M.; Kells, A.; Molteni, C.; Dickson, C. J.; Hornak, V.; Rosta, E. Calculating kinetic rates and membrane permeability from biased [simulations.](https://doi.org/10.1021/acs.jpcb.8b07442?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) _J._ _Phys._ _Chem._ _B_ 2018, _122_ (49), 11571−11578. (24) Stelzl, L. S.; Kells, A.; Rosta, E.; Hummer, G. [Dynamic](https://doi.org/10.1021/acs.jctc.7b00373?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) histogram analysis to determine [free](https://doi.org/10.1021/acs.jctc.7b00373?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) energies and rates from biased [simulations.](https://doi.org/10.1021/acs.jctc.7b00373?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) _J._ _Chem._ _Theory_ _Comput._ 2017, _13_ (12), 6328−6342. (25) Galama, M. M.; Wu, H.; Kramer, A.; Sadeghi, M.; Noé, F. Stochastic approximation to [mbar](https://doi.org/10.1021/acs.jctc.2c00976?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) and tram: Batchwise free energy [estimation.](https://doi.org/10.1021/acs.jctc.2c00976?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) _J._ _Chem._ _Theory_ _Comput._ 2023, _19_ (3), 758−766. (26) Machlup, S.; Onsager, L. Fluctuations and [irreversible](https://doi.org/10.1103/PhysRev.91.1512) process. ii. systems [with](https://doi.org/10.1103/PhysRev.91.1512) kinetic energy. _Phys._ _Rev._ 1953, _91_ (6), 1512−1515. (27) Girsanov, I. V. On transforming a [certain](https://doi.org/10.1137/1105027) class of stochastic processes by absolutely [continuous](https://doi.org/10.1137/1105027) substitution of measures. _Theory_ _Probab._ _Its_ _Appl._ 1960, _5_ (3), 285−301. (28) Øksendal, B.; Øksendal, B. _Stochastic_ _differential_ _equations_ ; Springer, 2003. [(29) Shmilovich, K.; Ferguson, A. L. Girsanov reweighting enhanced](https://doi.org/10.1021/acs.jpca.3c00505?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) sampling technique (grest): [On-the-fly](https://doi.org/10.1021/acs.jpca.3c00505?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) data-driven discovery of and [enhanced sampling in slow collective variables.](https://doi.org/10.1021/acs.jpca.3c00505?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) _J. Phys. Chem. A_ 2023, _127_ (15), 3497−3517. (30) Wang, Y.; Fass, J.; Kaminow, B.; Herr, J. E.; Rufa, D.; Zhang, I.; [Pulido, I.; Henry, M.; Bruce Macdonald, H. E.; Takaba, K.; et al. End-](https://doi.org/10.1039/d2sc02739a) [to-end differentiable construction of molecular mechanics force fields.](https://doi.org/10.1039/d2sc02739a) _Chem._ _Sci._ 2022, _13_ (41), 12016−12033. (31) Lu, C.; Wu, C.; Ghoreishi, D.; Chen, W.; Wang, L.; Damm, W.; Ross, G. A.; Dahlgren, M. K.; Russell, E.; Von Bargen, C. D.; et al. Opls4: Improving force field [accuracy](https://doi.org/10.1021/acs.jctc.1c00302?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) on challenging regimes of [chemical](https://doi.org/10.1021/acs.jctc.1c00302?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) space. _J._ _Chem._ _Theory_ _Comput._ 2021, _17_ (7), 4291−4300. (32) Vitalini, F.; Mey, A. S.; Noé, F.; Keller, B. G. [Dynamic](https://doi.org/10.1063/1.4909549) properties [of](https://doi.org/10.1063/1.4909549) force fields. _J._ _Chem._ _Phys._ 2015, _142_ (8), 084101. (33) Bolhuis, P. G.; Brotzakis, Z. F.; Keller, B. G. [Optimizing](https://doi.org/10.1063/5.0151166) [molecular potential models by imposing kinetic constraints with path](https://doi.org/10.1063/5.0151166) [reweighting.](https://doi.org/10.1063/5.0151166) _J._ _Chem._ _Phys._ 2023, _159_ (7), 074102. (34) Hazoglou, M. J.; Walther, V.; Dixit, P. D.; Dill, K. A. Communication: Maximum [caliber](https://doi.org/10.1063/1.4928193) is a general variational principle [for nonequilibrium statistical mechanics.](https://doi.org/10.1063/1.4928193) _J. Chem. Phys._ 2015, _143_ (5), 051104. (35) Leimkuhler, B.; Matthews, C. [Molecular](https://doi.org/10.1007/978-3-319-16375-8) dynamics. _Interdiscip._ _Appl._ _Math_ 2015, _39_, 443. (36) Kieninger, S.; Keller, B. G. Path probability [ratios](https://doi.org/10.1063/5.0038408) for langevin dynamics�exact and approximate. _J._ _Chem._ _Phys._ 2021, _154_ (9), 094102. (37) Kieninger, S.; Ghysbrecht, S.; Keller, B. G. [Girsanov](https://doi.org/10.48550/arXiv.2303.14696) reweighting for simulations of [underdamped](https://doi.org/10.48550/arXiv.2303.14696) langevin dynamics. [theory.](https://doi.org/10.48550/arXiv.2303.14696) _arXiv_ 2023, arXiv:2303.14696. (38) Eastman, P.; Pande, V. Openmm: A [hardware-independent](https://doi.org/10.1109/MCSE.2010.27) [framework for molecular](https://doi.org/10.1109/MCSE.2010.27) simulations. _Comput. Sci. Eng._ 2010, _12_ (4), 34−39. (39) Fass, J.; Sivak, D. A.; Crooks, G. E.; Beauchamp, K. A.; Leimkuhler, B.; Chodera, J. D. Quantifying [configuration-sampling](https://doi.org/10.3390/e20050318) error in langevin simulations [of](https://doi.org/10.3390/e20050318) complex molecular systems. _Entropy_ 2018, _20_ (5), 318. (40) Choderalab/openmmtools: A batteries-included toolkit for the gpu-accelerated openmm molecular simulation engine. [https://](https://github.com/choderalab/openmmtools) [github.com/choderalab/openmmtools,](https://github.com/choderalab/openmmtools) 2014. (41) Prinz, J.-H.; Wu, H.; Sarich, M.; Keller, B.; Senne, M.; Held, [M.; Chodera, J. D.; Schütte, C.; Noé, F. Markov models of molecular](https://doi.org/10.1063/1.3565032) kinetics: [Generation](https://doi.org/10.1063/1.3565032) and validation. _J._ _Chem._ _Phys._ 2011, _134_ (17), 174105. (42) Schutte,̈ C.; Fischer, A.; Huisinga, W.; Deuflhard, P. A [direct](https://doi.org/10.1006/jcph.1999.6231) [approach to conformational dynamics based on hybrid monte carlo.](https://doi.org/10.1006/jcph.1999.6231) _J._ _Comput._ _Phys._ 1999, _151_ (1), 146−168. <u>The</u> <u>Journal</u> <u>of</u> <u>Physical</u> <u>Chemistry</u> <u>B</u> <u><mark>pubs.acs.org/JPCB</mark></u> <u><mark>Article</mark></u> [(43) Swope, W. C.; Pitera, J. W.; Suits, F. Describing protein folding](https://doi.org/10.1021/jp037421y?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) [kinetics by molecular dynamics simulations. 1. theory.](https://doi.org/10.1021/jp037421y?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) _J. Phys. Chem. B_ 2004, _108_ (21), 6571−6581. (44) Chodera, J. D.; Singhal, N.; Pande, V. S.; Dill, K. A.; Swope, W. C. Automatic discovery of [metastable](https://doi.org/10.1063/1.2714538) states for the construction of [markov models of macromolecular conformational dynamics.](https://doi.org/10.1063/1.2714538) _J. Chem._ _Phys._ 2007, _126_ (15), 155101. (45) Buchete, N.-V.; Hummer, G. Coarse [master](https://doi.org/10.1021/jp0761665?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) equations for peptide [folding](https://doi.org/10.1021/jp0761665?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) dynamics. _J._ _Phys._ _Chem._ _B_ 2008, _112_ (19), 6057− 6069. (46) Bowman, G. R.; Pande, V. S.; Noé, F. _An introduction to Markov_ _state models and their application to long timescale molecular simulation_ ; Springer Science & Business Media, 2013; Vol. _797_ . (47) Hoffmann, M.; Scherer, M.; Hempel, T.; Mardt, A.; de Silva, B.; Husic, B. E.; Klus, S.; Wu, H.; Kutz, N.; Brunton, S. L.; et al. Deeptime: A python library for [machine](https://doi.org/10.1088/2632-2153/ac3de0) learning dynamical models [from time series data.](https://doi.org/10.1088/2632-2153/ac3de0) _Mach. Learn.: Sci. Technol._ 2021, _3_ (1), 015 009. (48) Zwanzig, R. _Nonequilibrium_ _statistical_ _mechanics_ ; Oxford University Press, 2001; . (49) Gardiner, C. W.; et al. _Handbook of stochastic methods_ ; Springer: Berlin, 1985; Vol. _3_ . [(50) Zwanzig, R. W. Transition from quantum to” classical” partition](https://doi.org/10.1103/PhysRev.106.13) [function.](https://doi.org/10.1103/PhysRev.106.13) _Phys._ _Rev._ 1957, _106_ (1), 13−15. (51) Leimkuhler, B.; Matthews, C. Rational [construction](https://doi.org/10.1093/amrx/abs010) of stochastic numerical [methods](https://doi.org/10.1093/amrx/abs010) for molecular sampling. _Appl._ _Math._ _Res._ _Express_ 2013, _2013_ (1), 34−56. (52) Sivak, D. A.; Chodera, J. D.; Crooks, G. E. [Using](https://doi.org/10.1103/physrevx.3.011007) [nonequilibrium fluctuation theorems to understand and correct errors](https://doi.org/10.1103/physrevx.3.011007) in equilibrium and [nonequilibrium](https://doi.org/10.1103/physrevx.3.011007) simulations of discrete langevin [dynamics.](https://doi.org/10.1103/physrevx.3.011007) _Phys._ _Rev._ _X_ 2013, _3_ (1), 011007. (53) Leimkuhler, B.; Matthews, C. Robust and [efficient](https://doi.org/10.1063/1.4802990) configura[tional molecular sampling via langevin dynamics.](https://doi.org/10.1063/1.4802990) _J. Chem. Phys._ 2013, _138_ (17), 174102. (54) Wio, H. S. _Path integrals for stochastic processes: An introduction_ ; World Scientific, 2013. (55) Galvelis, R.; Eastman, P. a., Openmm/openmm-plumed: Openmm plugin to interface with plumed, [https://github.com/](https://github.com/openmm/openmm-plumed) [openmm/openmm-plumed,](https://github.com/openmm/openmm-plumed) 2016. (56) Muller,̈ K.; Brown, L. D. Location of [saddle](https://doi.org/10.1007/BF00547608) points and minimum energy paths by a [constrained](https://doi.org/10.1007/BF00547608) simplex optimization [procedure.](https://doi.org/10.1007/BF00547608) _Theor._ _Chem._ _Acc._ 1979, _53_, 75−93. [(57) Deeptime with girsanov path reweighting, https://github.com/](https://github.com/deeptime-ml/deeptime/pull/290) [deeptime-ml/deeptime/pull/290,](https://github.com/deeptime-ml/deeptime/pull/290) accessed March 13, 2024. (58) Openmmtools with girsanov path reweighting, [https://github.](https://github.com/choderalab/openmmtools/pull/729) [com/choderalab/openmmtools/pull/729,](https://github.com/choderalab/openmmtools/pull/729) accessed May 6, 2024. (59) Ponder, J. W.; Case, D. A. Force fields for [protein simulations.](https://doi.org/10.1016/S0065-3233%0x2803%0x2966002-X) _Adv._ _Protein_ _Chem._ 2003, _66_, 27−85. (60) Openmm [with girsanov path reweighting, https://github.com/](https://github.com/openmm/openmm/pull/4533) [openmm/openmm/pull/4533,](https://github.com/openmm/openmm/pull/4533) accessed May 6, 2024. (61) Reweightingtools, [https://github.com/bkellerlab/](https://github.com/bkellerlab/reweightingtools) [reweightingtools,](https://github.com/bkellerlab/reweightingtools) accessed May 6, 2024. (62) Schütte, C.; Noé, F.; Lu, J.; Sarich, M.; Vanden-Eijnden, E. Markov state models [based](https://doi.org/10.1063/1.3590108) on milestoning. _J._ _Chem._ _Phys._ 2011, _134_ (20), 204105. (63) Das, A.; Rose, D. C.; Garrahan, J. P.; Limmer, D. T. Reinforcement learning [of](https://doi.org/10.1063/5.0057323) rare diffusive dynamics. _J._ _Chem._ _Phys._ 2021, _155_ (13), 134105. (64) Schwantes, C. R.; Pande, V. S. Improvements in markov state [model construction reveal many non-native interactions in the folding](https://doi.org/10.1021/ct300878a?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) of [ntl9.](https://doi.org/10.1021/ct300878a?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) _J._ _Chem._ _Theory_ _Comput._ 2013, _9_ (4), 2000−2009. (65) Pérez-Hernández, G.; Paul, F.; Giorgino, T.; De Fabritiis, G.; [Noé, F. Identification of slow molecular order parameters for markov](https://doi.org/10.1063/1.4811489) model [construction.](https://doi.org/10.1063/1.4811489) _J._ _Chem._ _Phys._ 2013, _139_ (1), 015102. (66) Nuske, F.; Keller, B. G.; Pérez-Hernández, G.; Mey, A. S.; Noé, [F. Variational approach to molecular kinetics.](https://doi.org/10.1021/ct4009156?urlappend=%3Fref%3DPDF&jav=VoR&rel=cite-as) _J. Chem. Theory Comput._ 2014, _10_ (4), 1739−1752. (67) Lemke, O.; Keller, B. G. Density-based [cluster](https://doi.org/10.1063/1.4965440) algorithms for [the identification of core sets.](https://doi.org/10.1063/1.4965440) _J. Chem. Phys._ 2016, _145_ (16), 164104.

섹션 본문 121문단 · 51,444자

(제목 없음)

1Classical molecular dynamics (MD) simulations provide invaluable insights into complex molecular systems but face limitations in capturing phenomena occurring on time scales beyond their reach.To bridge this gap, various enhanced sampling techniques have been developed, which are complemented by reweighting techniques to recover the unbiased dynamics.Girsanov reweighting is a reweighting technique that reweights simulation paths, generated by a stochastic MD integrator, without evoking an effective model of the dynamics.Instead, it calculates the relative path probability density at the time resolution of the MD integrator.Efficient implementation of Girsanov reweighting requires that the reweighting factors are calculated on-the-fly during the simulations and thus needs to be implemented within the MD integrator.Here, we present a comprehensive guide for implementing Girsanov reweighting into MD simulations.We demonstrate the implementation in the MD simulation package OpenMM by extending the library openmmtools.Additionally, we implemented a reweighted Markov state model estimator within the time series analysis package Deeptime.

■ INTRODUCTION

2Classical molecular dynamics (MD) simulations yield trajectories of a molecular system at atomistic resolution and are an excellent tool to study the dynamics of complex molecular systems.A complication emerges from the fact that relevant time scales of the molecular system, from slow conformational changes to complex formation and ultimately chemical reactions, occur on time scales that are orders of magnitude beyond the time scales that can be covered by an unbiased MD simulation.To close this time scale gap a wide variety of enhanced sampling techniques 1 have been proposed, which broadly can be classified into methods which (1) change the temperature of the system, 2,3 (2) change the classical Hamiltonian, in particular the potential energy function, of the system, 4−8 or (3) bias the initial state of the trajectory but otherwise leave the dynamics unchanged. 9,10A necessary complement of enhanced sampling techniques are reweighting methods, 1,11,12 which recover the unperturbed stationary density and the unperturbed dynamics from biased simulations.

3Girsanov reweighting 13−20 is a dynamical reweighting technique to recover the unbiased dynamics of a molecular system from simulations that were conducted with a biased potential.It differs from other dynamical reweighting techniques 21−25 in that it does not assume an effective model of the molecular dynamics but reweights the dynamics directly on the level of the stochastic MD integrator.In this sense, Girsanov reweighting is an exact reweighting technique.−28 It has been applied to model systems 13−17 and peptide dynamics. 19Recently, it has been used for the machine learning of optimal collective variables based on enhanced sampling simulations. 29irsanov reweighting can also be applied in a prospective manner.From MD trajectories obtained at a reference potential energy function, one can calculate the transition rates at a modified potential energy function and investigate the sensitivity of the transition rates with respect to certain parameters of the potential energy.In fact, while modern empirical potential energy functions often reproduce the structural and thermodynamic properties with high fidelity, 30,31 the dynamic properties, such as transition times across barriers, may vary considerably across different potential energy models for the same molecule. 32In ref 33, Girsanov reweighting has been combined with the maximum caliber approach 34 to optimize potential energy functions such that the resulting dynamics reproduce a specific transition rate.

4Since Girsanov reweighting is based on stochastic path integrals, it requires that the MD simulations are carried out with a stochastic MD integrator. 35To achieve reweighting accuracy at the level of the MD integrator, the random numbers and bias force at each integration time step are collected and aggregated in path reweighting factors.The path reweighting factor can be calculated for any time interval [t, t + τ] of the entire MD trajectory and represents the relative probability of the path from t to t + τ at the target potential relative to its probability at the simulation potential.

5Interpreting the path reweighting factor as the relative path probability gives an intuitive explanation of why stochastic MD integrators are needed for Girsanov reweighting.The probability of a specific deterministic path, by definition, is one at the simulation potential but zero at any other potential.Hence, the relative probability of a deterministic path, i.e., the ratio of the path probability between the target potential and the simulation potential, is always zero.

6For stochastic integrators, the path reweighting factor can be calculated efficiently by formulating it in terms of the random numbers generated during a stochastic MD simulation and in terms of random number differences that account for the difference between the dynamics at the simulation potential and the dynamics at the target potential to which the simulated dynamics should be reweighted. 18,36−16 However, a much more realistic description of the molecular dynamics is achieved by underdamped Langevin dynamics.Ref 37 (unpublished results) presents a general approach to derive the relative path probability density for stochastic integrators of underdamped Langevin dynamics, and it provides a framework to analyze whether the relative path probability for a given integration algorithm is defined throughout the path space.If the relative path probability density is defined, its value can be calculated, and reweighting underdamped Langevin dynamics is thus possible.

7While specialized simulation protocols for Girsanov reweighting have been published, there is a lack of ready-touse simulation programs that allow on-the-fly estimation of reweighting factors.Calculating the relative path probability density requires access to the random numbers and forces at the time resolution of the MD integrator.Even though the implementation of the relative path probability density amounts to adding a reporter to the inner loop of the MD integrator, for most simulation packages this requires deep knowledge of the package architecture.The goal of this contribution is to provide a template for efficiently implementing the relative path probability density into an MD program.We use OpenMM 38 which provides an easy and versatile implementation of Langevin integrators via the openmmtools package, 39,40 to demonstrate the implementation.

8As an example analysis of the simulation data, we reweight Markov state models (MSMs) 41−46 and implement the reweighting factor into the time-series analysis package Deeptime. 47While Girsanov reweighting can be used to reweight other rate estimators, 33 MSMs have the advantage that they are well suited to model multistate dynamics and that, due to the short Markov lag time, a model of the longtime dynamics can be constructed from short paths.Our additions to the two software packages are open source and provide a blueprint for extending an MD simulation and analysis program to include Girsanov reweighting.

9■ THEORY Molecular Simulations and Path Probabilities.Consider a system of N atoms with Cartesian position vector q N 3 and associated momentum vector p N 3 .Momentum and position vectors can be combined to a phase space vector x q p ( , )

10The time-evolution of such a system in a thermal bath is modeled by underdamped Langevin dynamics

11The left-hand side of eq 1 represents the total force on the particles, where q t q t ( ) ( )

12is the acceleration vector at time t.M is the 3N × 3N-dimensional mass matrix, which contains the masses of the particles along its diagonal.

13The force consists of three terms (right-hand side of eq 1): (i) the force due to the gradient of the potential energy function −∇V(q); (ii) the friction force, where

14is the velocity vector and ξ is the collision rate with unit s −1 ; and (iii) a random force.According to the dissipation fluctuation theorem, 48 the random force along the lth degree of freedom has the mean 0 and variance 2RTξM ll , where R is the ideal gas constant, T is the temperature, and M ll is the l diagonal element in M and represents the mass associated with the lth degree of freedom.We model this random force by an uncorrelated white Gaussian noise with unit variance centered at 0, η(t), which is then scaled by RT M 2 ll in order to fulfill the fluctuation dissipation theorem. 48e report the potential in molar energy units, J mol −1 ; correspondingly, the thermal energy is reported as molar quantity: RT.If energy units are used for the potential, R should be replaced by the Boltzmann constant k B = R/N A in eq 1 and all of the following equations.N A is the Avogadro constant.

15Langevin integrators 35 are numerical schemes that provide an approximate solution to eq 1.They yield a time-discrete trajectory or path x = (x 0 , x 1 , x 2 , ...x n ), where x 0 = (q 0 , p 0 ) is the initial state at time t = 0, x k = (q k , p k ) is the state at time t = kΔt with time step Δt.The path length is τ = nΔt.

16To model the random force, typical Langevin integrators draw either one or two random numbers from a standard normal distribution per integration time step and degree of freedom.The simulation thus additionally yields either one sequence of random number vectors, η = [η 0 , η 1 ...η n−1 ], or two sequences of random number vectors, η (1) = [η 0 (1) ,η 1 (1) ...η n−1 (1) ] and η (2) = [η 0 (2) ,η 1 (2) ...η n−1 (2) ], where

173 , and k N (2) 3 .The lth element of a random number vector η k contains the random number that determines the random force on the lth degree of freedom at the time step k.

The path probability x

18[ ] is the probability of observing a specific time-discretized path x.It can be decomposed using the Chapman−Kolmogorov equation 49 as

19where p(x 0 ) is the probability density of the initial state.We here assume that the initial states are distributed according to the Boltzmann distribution i k j j j j j y { z z z z z i k j j j j j j j y { z z z z z z z

20where ( )

21is the classical configurational partition function, 50 and p l,0 is the lth element of the initial momentum vector p 0 .In eq 2, p(x k+1 |x k ) is the one-step transition probability to reach x k+1 within one integration step, given that the current state is x k .Langevin integrators that only take current state x k into account when updating position and momentum implement a Markov process.For these integrators, eq 2 is exact.For Langevin integrators that additionally take the previous state x k−1 into account, eq 2 is an approximation.

22The mathematical expression for p(x k+1 |x k ) depends on the Langevin integrator.One can however argue 36 that the singlestep transition probability is equal to the probability of drawing the random number vector η k that gives rise to this specific transition i k j j j j j j j y

23where we used the random numbers η l,k that are drawn from a standard normal distribution.Equation 4 holds for the Langevin integrator, which draws a single random number per integration step and degree of freedom l.The path probability density (eq 2) can then be written as i k j j j j j j j y

24Analogously, the path probability density (eq 2) for Langevin integrators that draw two random numbers per integration step and degree of freedom is i k j j j j j j j j j y { z z z z z z z z z i k j j j j j j j j j y { z z z z z z z z z

25(2) 2

26Girsanov Reweighting.Girsanov reweighting is an importance sampling technique 1 for path probability densities at different potential energy functions.Following the principles of importance sampling, a path expected value at target potential V ̃can be reweighted as

27where

28x [ ] is the path probability density at the target potential V ̃(q),

29x [ ] is the path probability density at the simulation potential V(q).s[x] is a path observable, i.e., a function that assigns a real-valued number to each path x. ⟨...⟩ denotes an expected value, where we added the subscript "path" to emphasize that the expected values is calculated with respect to path probability density x [ ] and not with respect to a phase space probability p(x).The path integral x ...

30integrates over the space of all possible time-discretized paths of length τ = nΔt.

31If an analytical expression for the relative path probability x x / [ ] [ ] can be found, the path expected value in eq 7 can be estimated from a set of paths S = (x 1 ,...x nd paths ) generated at the simulation potential V(q) as

32A critical question is under which conditions the relative path probability x x / [ ] [ ] exists.For time-continuous paths, these conditions have been discussed by Girsanov 27 and Onsager and Machlup. 26It depends on the integrator in the case of time-discretized paths; ref 37 (unpublished reference) discusses path probability ratios for Langevin splitting operators.

33The potential energy V(q), at which the simulation is carried out, and the target potential energy V ̃(q), to which the path expected value is reweighted, are related by a potential U(q)

34Equation 9 takes the viewpoint of a perturbation, 18,20,33,36 (ref 37 unpublished results), where the target potential differs from the reference (simulation) potential by a perturbation U(q).Alternatively, one can take the viewpoint of enhanced sampling simulations, where a bias potential U bias (q) needs to be subtracted from the simulation potential V(q) to obtain the molecular (target) potential, thus V q V q U q ( ) ( ) ( ) bias

=

35. By setting U(q) = −U bias (q), one can reconcile 19 the enhanced sampling viewpoint with eq 9.It is important to be aware of the sign-convention since it enters the equations for the reweighting factor.

36Using eq 5, the path probability density ratio can be expressed as 36 i

37where k is the random number vector that yields an update x k → x k+1 at the target potential V ̃(q), and η k is the random number vector that yields the same update at the simulation potential V(q).The intuition is that one calculates k and compares it to the random number vector η k , which was used

38The Journal of Physical Chemistry B in the simulation at V(q).However, in our implementation, k is never calculated directly.Instead, the two random number vectors are related by a random number difference vector Δη k with

39The random numbers η l,k can be recorded during the simulation at simulation potential V(q), but Δη k,l needs to be calculated at each integration time step.The equation for Δη k,l depends on the integrator, and the equations for various Langevin integrators are reported later in the text.Analogously, using eq 6, the path probability density ratio can be expressed as 36

40with random number differences

41The formulas for Δη l,k , Δη l,k (1) , and Δη l,k (2) depend on the Langevin integrator 37 (unpublished reference).

42The path probability ratio can be decomposed into the probability ratio of the initial state p x p x ( )/ ( ) 0 0 and the ratio of the path probabilities conditioned on the initial state

43where the conditional path probability ratio M[x|x 0 ] is given by the product over time steps k in eqs 10 or 12.If the initial state x 0 is drawn from the Boltzmann distribution eq 3, the probability ratio of the initial state in eqs 10 and 12 is given as i k j j j j j y

44Girsanov Reweighting for Langevin Integrators.Commonly used Langevin integrators are based on the splitting method. 51,52Equation 1 is formulated as a vector field and separated in three terms, each of which is integrated separately, yielding three update operators, 35,51 (ref 37 unpublished results) for the position q l,k and the momentum p M q l k ll l k , , = i k j j j j j j y { z z z z z z i k j j j j j j y { z z z z z z i k j j j j j j y { z z z z z z i k j j j j j j j y { z z z z z z z i k j j j j j j y { z z z z z z i k j j j j j j j y { z z z z z z z q p q ap p q p q p b q q p q dp f ( )

45where

46We have formulated the three update operators here as operators that act on a single degree of freedom l.In the simulation of a multidimensional system, these update operators are applied to each degree of freedom.

47A full update of x k → x k+1 is obtained by sequentially applying all three update operators.Different Langevin integrators can be derived by varying the sequence in which the update operators are applied.Symmetric splitting integrators use a symmetric sequence.An example is the ABOBA algorithm, which applies the sequence q p ( , ) k k T , where update operators that appear twice in the sequence are applied with half a time step and are denoted with a prime.The corresponding parameters a′, b′(q), d′, and f ′ are obtained by replacing Δt with t 2 in eq 18

48(1 exp( ) .In eq 16, we formulated the updates for position and momenta, which leads to the ABO notation of the update operators. 51,53The update can analogously be formulated for position and velocities, 39,52 i k j j j j j y { z z z z z i k j j j j j j y

49where an -step is the analogue of an -step, a V-step is the analogue of a -step, and a a M

50. Equation 19 leads to the RVO notation of Langevin splitting operators. 39,52 systematic approach to derive the random number difference between an update x k → x k+1 at the simulation potential V(q) and the same update at the target potential V ̃(q) is given in ref 37 (unpublished results).The reference also discusses why the relative path probability density x x / [ ] [ ] may not be defined for some Langevin splitting integrators.In these cases, path reweighting is not possible.For

51The Journal of Physical Chemistry B Langevin splitting integrators, which have a finite relative path probability density, the expressions for the random number differences are summarized in Table 1.The same equations for the random number difference are obtained when deriving them from the RVO update operators in eq 19.As an example, consider the RVO algorithm, whose random number difference is

52where P(τ) is the MSM transition matrix with dimension n states × n s t a t e s .τ is the MSM lag time.Its elements P q t q t ( ) ( ( ) ( ) )

53contain the conditional probability of finding the system in state Ω j at time t + τ, given that it has been in state Ω i at time t.By definition, the matrix is row-normalized, such that P ( ) 1

54The conditional transition probability P ij (τ) can be calculated from the absolute transition probability C ij (τ) between states Ω i and Ω j as

55The absolute transition probability can be formulated as a path integral. 17,18h q h q x x ( ) ( ) ( ) ) where h i (q) is the indicator function of state

56Analogously, h j (q) is the indicator function of state Ω j .The path observable s[x] = h i (q 0 )h j (q n ) thus evaluates to one if the path x starts in Ω i and ends in Ω j and to zero otherwise.C ij (τ) can be reweighted according to eq 8, and the reweighted estimator is ) where S = (x 1 ,...x nd paths ) is a set of paths of length τ = nΔt generated at the simulation potential V(q), q 0 (m) is the initial position of the mth path and q n (m) is its last position.C ( ) ij is the absolute transition probability at a target potential V ̃(q).Note that due to the normalization of the transition probability in eq 21, the constant ratio of the partition functions Z/Z ãppearing in eq 15 cancels. 18nce the reweighted MSM transition matrix P ̃(τ) has been calculated, the MSM is analyzed via the eigenvalue and eigenvectors of P ̃(τ)

57where l i is the ith left eigenvector and λ i (τ) is the associated eigenvalue.Due to the row-normalization of P ̃(τ), the leading

58: perturbation force is evaluated before position update; U q ( ) q l k , 1 l + : perturbation force is evaluated after position update; U q ( )

59: perturbation force is evaluated at an intermediate position during update sequence of the Langevin integrator.

The Journal of Physical Chemistry B

60eigenvalue is always λ 0 = 1 and its associated eigenvector l 0 is the stationary density of the MSM.For a molecular system evolving according to eq 1, it should be equal to the (discretized) configurational Boltzmann density.The slow dynamic processes are represented by eigenvectors with eigenvalues close to 1.

61In Markovian dynamics, the eigenvalues of the MSM transition matrix decay exponentially with the lag time τ:

62Thus, if the time-evolution of p(t) can indeed be modeled by a Markov process, the implied time scale should be independent of τ t ln( ( ))

63The implied time scale test 43 uses eq 26 to check the approximation quality of an MSM by calculating MSM transition matrices at various lag times and checking whether the right-hand side of eq 26 is indeed independent of τ.

64■ METHODS General Approach.Performing Girsanov path reweighting for MSMs requires two main steps: (i) computing the relative path probability (eqs 10 and 15) and (ii) estimating the reweighted MSM transition matrix (eq 24).The first step is handled by the MD simulation program on-the-fly during the simulation.The second step is handled by an MD analysis program.The data that is exchanged between the simulation and the analysis program are the position trajectory and an associated trajectory of path reweighting factors.Figure 1 illustrates the data flow.

65In path reweighting, and in Girsanov reweighting in particular, the role of MD simulation is to generate a set of paths S = (x 1 ,...x nd paths ) at the simulation potential V(q).While it is possible to run a separate MD simulation for each path x i , in the context of MSMs the paths are usually extracted from a long trajectory via a sliding window.The path length is then τ = nΔt = n out •n interval Δt, where n out represents the interval (in number of MD time steps Δt) between writing coordinates to the output trajectory file, and n interval is the number of intervals n out Δt that fit into the path length τ.To illustrate, in Figure 1 coordinates are written to file every n out = 10 time steps, and n interval = 4 of these recording intervals fit into a path, yielding a path length of τ = 40Δt.We denote the iteration of the MD integrator with index k and the index of the recorded coordinates by k′.The indices are related via k = k′n out .

66path probability density is calculated and written to a file at the same interval as the coordinates.To do this efficiently, the relative path probability for a path starting at k = k′ = 0 is decomposed into a product of two factors as shown in eq 14.Inserting eq 15 and omitting the factor Z/Z ̃yields i k j j j j j y

67We omitted the factor Z/Z ̃because it cancels in the equation for the MSM transition probability (eq 21).The factor also cancels in other rate estimators. 33sing a sliding window, path x i may start at any time-point k = k′n out at which coordinates are written to file.The indices in eq 27 then shift accordingly, i.e., q 0 → q k′ and [x 0 , x 1 ...x n ] → [x k′ , x k′+1 ...x k′+n ].To be able to calculate the relative probability of the initial state of a sliding window path, the perturbation energy U(q k′ ) (or equivalently the bias energy U bias (q k′ )) is written to the reweighting file, whenever coordinates q q k k n out = are written to file.

68For a Langevin integrator which draws a single random number per degree of freedom and simulation time step, M[x|x 0 ] is given by the double product in eq 10.To account for the recording interval, we reformulate the factor as according to the appropriate equation in Table 1.The terms

69+ are then summed over all degrees of freedom l, and the result is added to a buffer variable S D k 1 .The buffer variable is accumulated throughout the recording is written to the reweighting factor trajectory, and the buffer variable is reset to zero.

70To calculate Δη k , one needs the bias force −∇U bias or the perturbation force −∇U.When Girsanov reweighting is used to unbias a biased simulation, the bias force is already available within the inner loop of the simulation.When Girsanov reweighting is used in a prospective manner to predict the influence of a perturbation U(q) on a reference potential V(q), perturbation forces −∇U(q) need to be calculated in addition to the forces −∇V(q) that are used to propagate the system.

71For Langevin integrators that draw two random numbers per integration time step, S D k 1 is given as

72The variable name

73is a nod to the path action, where D is the diffusion constant.When formulating the path probability in terms of the path action, 15,26,54 S[x], eqs 29 and 30 can be interpreted as the action difference between the simulation and the target potential, scaled by the diffusion constant.

74Given the position trajectory at the simulation potential V(q) and the trajectory of path reweighting factors, an MSM at the target potential V ̃(q) can be obtained via eq 24.The relative path probability density is calculated from the path reweighting factors by summing up S D k 1 for all n intervals recording intervals that make up the path x (eq 28) and multiplying the resulting conditional path reweighting factor M[x|x 0 ] with the relative probability density of the initial state of the path (eq 27).

75Implementation in OpenMM via Openmmtools is a Python library layer that provides tools that allow for a user-friendly setup of complex simulation protocols.For our purpose, the most important openmmtools class is LangevinIntegrator.This class ultimately extends the OpenMM CustomIntegrator class (Figure 2) and provides access to Langevin Splitting integrators. 35,52,53penmmtools used the RVO notation.The precise integrator can be conveniently specified by passing the sequence of update operators (eq 16) as a string.LangevinIntegrator implements the update operators as member functions _add_R_step(), _add_V_step(), and _add_O_step().The sequence of update operations is realized by the function _add_integrator_steps(), which reads a string input, e.g., 'R V O V R' and outputs the corresponding update sequence.

76To implement the reweighting factor trajectory, we created the new class LangevinSplittingGirsanov within openmmtools.With this new class, Girsanov reweighting simulations can be set up simply by specifying the Langevin integrator as a string, as one would normally do for a Langevin simulation with openmmtools.Figure 2b shows a sample OpenMM script for a Girsanov reweighting simulation.

77LangevinSplittingGirsanov extends Lange-vinIntegrator and thus inherits all methods from LangevinIntegrator and its parent classes (Figure 2).In this way, variables for M ll , T, ξ, Δt, etc. are automatically set.The random number differences Δη l,k are implemented as a dispatch table, which can be accessed via the class function _delta_eta_table(self).When initializing the LangevinSplittingGirsanov with a string of update operators, the __init__-function checks whether Girsanov reweighting is possible for this particular Langevin integrator and whether the random number difference has been implemented.The variable S D k 1 is provided by the function _get_logM(), which performs the summation over the 3N degrees of freedom, the recording interval n out , and, if necessary, the number of random numbers drawn per integration step.An additional factor sets the buffer variable for S D k 1 to zero before the next recording step is performed.An OpenMM simulation requires the input of an external force field file, which is processed to the OpenMM System object and can be called within the inner loop of the simulation; for more details cf. Figure S1.Additional bias forces can be provided by an interface like openmm-plumed 55 and are stored in a separate force group of the OpenMM Force object.To ensure the bias force update at the Implementation in Deeptime.Deeptime 47 is a Python library for the analysis of time series data and offers a wide range of tools to construct and analyze Markov models via the module markov.It implements estimation of a count matrix from a discretized trajectory via the function count_matrix_coo2_mult(•••), which is provided by the module deeptime.markov.tools.estimation.The function currently implements the direct maximumlikelihood estimator for the matrix elements C ij (τ), which is obtained by setting the path probability ratio in eq 8 to one.We modified this function to implement the reweighted estimator in eq 24.The modified function accepts a trajectory of reweighting factors as an argument in addition to the discretized trajectory.If a trajectory of reweighting factors is passed to the function, the reweighted estimator is calculated; otherwise, it calculates the direct estimator.For each lag time τ, the reweighting factors are aggregated according to eqs 28 and 27 and used to calculate the reweighted count estimate according to eq 24.

78The extended function is called by the class Girsanov-ReweightingEstimator, which is a child class of the class TransitionCountEstimator.The Maximum-LikelihoodMSM class is available as a higher-level estimator of the MSM transition probabilities, which inputs the GirsanovReweightingEstimator, like the TransitionCountEstimator, and transforms the reweighted count matrix (21) into a transition matrix (eq 21).From there, all functionalities available in Deeptime, including the evaluation of the dominant eigenvalues (eq 25) and implied time scales (eq 26) for a series of lag times, can be achieved by feeding this transition matrix into the Markov-StateModel class.

■ RESULTS

79In this section, the performance of the LangevinSplittingGirsanov class is investigated.Being part of the openmmtools package, the LangevinSplittingGirsanov class receives its forces from an OpenMM simulation object, which requires a molecular force field as the input (Figure 2).The LangevinSplittingGirsanov class thus cannot be directly compared to a reference implementation of a Langevin dynamics on an arbitrary low-dimensional potential.The OpenMM CustomIntegrator class can handle arbitrary lowdimensional potential as well as molecular force fields.To ensure consistency, we first compare the reference implementation to the OpenMM CustomIntegrator class using the Muller−Brown potential. 56Then we compare the OpenMM CustomIntegrator class to our LangevinSplittingGirsanov class by using a dissociation process in water.

80Muller−Brown Potential.We use the Muller−Brown potential V x y ( , ) MB 56 (Figure 3a, parametrized according to eq 31 and Table 2) to compare our reference implementation to the implementation using the OpenMM CustomIntegrator class.The potential is characterized by a global minimum around (−0.5, 1.5) and two local minima around (0.0,0.5) and (0.5,0.0).The system was propagated on two biased potentials

81, where the first potential had a The Journal of Physical Chemistry B linear bias along x (Figure 3b), and the second potential had a strong polynomial bias along x (Figure 3c), cf.eq 32.The second form is motivated by a plumed-like bias, which is applied along a reaction coordinate and thus approximates a polynomial of the potential function.The linear bias was chosen to avoid position dependence in the force calculation.

82A consequence of applying the bias along x is that the path probabilities for the y-component of the path are the same in the simulation and the target potential.

83The reference implementation uses the analytical forces from this potential and the Langevin splitting integrator ABOBA 35 to propagate the system.The OpenMM Custom-Integrator class uses numerical forces provided by OpenMM and also the Langevin splitting integrator ABOBA 35 to propagate the system.Similarly, analytical bias forces are used to calculate the path reweighting factors S D k 1 (eq 29) in the reference implementation, whereas numerical forces are used for this purpose in the OpenMM CustomIntegrator class.

84Figure 3d−f shows the x-component of the position and momentum trajectory, as well as the trajectory of the bias energy for 100 simulation steps.We used the same random number sequence in both implementations.The simulations with the OpenMM CustomIntegrator class are shown as colored solid lines: orange for the linear bias and blue for the polynomial bias.The trajectories from the reference implementation are shown as black dotted lines.Visually the trajectories from the two implementations coincide.In fact, the difference between the two implementations is in the range of floating point precision.Figure 3g shows the difference of the momentum trajectories between the two implementations, which is on the order of 10 −14 nm amu over 100 time steps, as an example.The difference of the position trajectory and the difference of the bias energy are shown in Figure S2.However, we do find that the bias force can differ in the two implementations (Figure 3h).While for the linear bias, analytical and numerical bias forces are identical (orange line in Figure 3h), the numerical force deviates from the analytical force for a nonlinear bias potential (blue line in Figure 3h).Since the bias force is used to calculate the random number difference, Δη k differs between the two implementations for the nonlinear bias (Figure 3i).

85In summary, apart from the difference between analytical and numerical forces, the OpenMM CustomIntegrator implementation reproduces the trajectories and path reweighting factor trajectories from our reference implementation.

86Next, we confirmed that we can reweight an MSM using the OpenMM CustomIntegrator class.Figure 4b shows the left dominant MSM eigenvectors l 0 and l 1 of the unbiased Muller− Brown potential, which is our target potential.l 0 represents the stationary density of the Muller−Brown potential.l 1 changes sign at the largest barrier of the potential and represents equilibration across this barrier.The MSM was obtained by a simulation at the unbiased Muller−Brown potential V x y ( , ) MB .Figure 4c shows the same eigenvectors obtained by simulating at a linearly biased potential

87= + and then reweighting the MSM estimator (eq 24).The reweighted eigenvectors are in excellent agreement with the eigenvectors obtained from the unbiased simulation.Figure 4a shows the implied time scales of the MSM from the unbiased simulations (gray dashed line) and the MSM of the biased simulation without reweighting (dotted orange line) and with reweighting (solid orange line).Also for the implied time scales, the reweighted results agree very well with the results obtained from unbiased simulations.The Journal of Physical Chemistry B distance of 0.9 nm along the z-coordinate.The Ca 2+ cation was allowed to diffuse between these two anions, by applying medium strong harmonic restraints along the y and x coordinates of the Ca 2+ cation.The resulting dynamics resembles a double-well dynamics along z, where the Ca 2+ cation alternates between being bound to the I − anion and being bound to the other I − anion.In between the two bound states, there is a considerable free-energy barrier.The target potential V ̃(q) consists of the molecular potential for this system including the above-mentioned restraints.In the potential V q V q U q ( ) (

88+ , a linear bias potential along z is added, where q is the position vector of all atoms in the system.

89Similar to the Muller−Brown potential (Figure 3), we compared the two implementations for a trajectory of 100 time steps, which was generated at the biased potential V(q).The two simulations use the same random number sequence for each degree of freedom.We observe a slight difference in the position and momentum trajectories between the OpenMM CustomIntegrator and the LangevinSplittingGirsanov. We suspect this can be attributed to slight algorithmic differences between our OpenMM CustomIntegrator implementation of the ABOBA algorithm and the implementation of the ABOBA algorithm via the parent class of LangevinSplittingGirsanov, the class LangevinIntegrator.Apart from this slight drift, the trajectory from our LangevinSplittingGirsanov class follows the trajectory from the OpenMM CustomIntegrator class very closely (Figure 5b−d).

90Figure 5e−g shows trajectories of the bias force F bias (q z,k ), of S D k

1

91, and of the random number η z,k .The trajectories from the two implementations are identical for the bias (Figure S3a,b).Thus, the LangevinSplittingGirsanov imple- Figure 5h−j tests whether we can reweight an MSM of the CaI 2 dynamics using the LangevinSplittingGirsanov class.The MSM has been constructed by discretizing the z-coordinate, thereby neglecting the solvent degrees of freedom.Figure 5i shows the eigenvector l 0 (gray solid line), which represents the stationary density at the target potential V ̃(q), and the eigenvector l 1 (blue dotted line), which represents the stationary density at the biased potential.Due to the bias potential, the two stationary densities differ.Reweighting the simulation data from the biased simulation recovers the stationary density l 0 at the target potential V ̃(q) with high accuracy.Figure 5j shows the eigenvectors l 1 and l 1 , which represent the equilibration between the two bound states.Interestingly, the process seems to be insensitive to the bias, and thus the results from all three MSMs coincide.Figure 5h shows the associated implied time scales from simulations at the target potential V ̃(q), simulations at the biased potential V(q), and simulations at the biased potential V(q) reweighted to the target potential V ̃(q).While the MSM eigenvectors can be reweighted with high accuracy, the reweighted implied time scale exhibits a large statistical uncertainty.We will discuss possible reasons for this in Conclusions.

■ COMPUTATIONAL DETAILS

92Muller−Brown Potential.The Muller−Brown potential 56 is

93)

94its parameters are reported in Table 2.

95We used two different bias potentials along the x-coordinate .The particle mass was set to m p = 1 amu.The ideal gas constant was set to R = 8.314 J/(K mol).The system was simulated using the Langevin splitting algorithm ABOBA 35 with time step Δt = 0.5 fs, friction coefficient ξ = 5 ps −1 , and temperature T = 300 K. We used two different implementations of ABOBA: (i) a reference stand-alone implementation in Python and (ii) an abstraction using the OpenMM CustomIntegrator class.Both implementations are available via GitHub. 57,58n the simulations using the reference implementation, the initial positions were drawn randomly from a uniform distribution and the initial velocities were set to v 0 = (0.0, 0.0).We then generated 5 trajectories with 2.5 × 10 8 time steps each for V MB (x, y) and 5 trajectories with 2.5 × 10 8 time steps each for V MB (x, y) + U bias,linear (x).

96In the simulations using the OpenMM CustomIntegrator class, the initial positions were drawn randomly from a uniform distribution, and the initial velocities were chosen according to the Boltzmann distribution at 300 K. We then generated 5 trajectories with 10 8 time steps each for V MB (x, y), 5 trajectories with 10 8 time steps each for V MB (x, y) + U bias,linear (x).

97From the trajectories, we constructed two-dimensional MSMs on a grid with 36 states, where the x-dimension was discretized in the range −3.5 ≤ x ≤ 1.5, and the y-dimension was discretized in the range −1.5 ≤ y ≤ 3.5.The lag time was varied between 0.5 and 24.5 ps in steps of 1 ps.We calculated un-reweighted MSMs for the trajectories at V MB (x, y) and V MB (x, y) + U bias,linear (x) using the estimators provided by Deeptime. 47We calculated reweighted MSMs for the trajectories at V MB (x, y) + U bias,linear (x) using our implementation of the reweighted estimators which extends Deeptime.ABOBA simulations were performed either with openmmtools LangevinIntegrator 40 or for biased runs with LangevinSplittingIntegrator. 58The initial positions were drawn randomly from a uniform distribution, and the initial velocities were chosen according to the Boltzmann distribution at 300 K.The step size of the integrator was 1 fs, with the friction coefficient of 2 ps −1 .The particle mesh Ewald summation was used to calculate the interaction of all particle pairs within a cutoff of 0.49 nm.

98Five trajectories with 2.5 × 10 8 time steps each were created for the reference simulations at the unbiased potential.A total of 5 trajectories with 2 × 10 8 time steps each were created at the biased potential.

99To apply the bias linearly along one Cartesian coordinate of the Ca 2+ ion

100with k linear = 5 kJ/mol/nm, the degrees of freedom of the three atoms are restricted in the other two dimensions by a harmonic potential of the strength k x = k y = 200 × 10 3 kJ/mol/nm.The displacement of the two iodide atoms is restricted in all directions, k z = 500 × 10 3 kJ/mol/nm.Restraining the degrees of freedom of the three atoms and the reduction to the collective variable of the iodide-calcium distance d I−Ca means that the slowest process takes place on a double-well potential.The trajectories were used to construct one-dimensional MSMs on a grid with 50 states of the iodide-calcium distance d I−Ca in the range 0.3 ≤ d I−Ca ≤ 0.6.The lag time was varied between 5 and 100 ps in steps of 5 ps.The unreweighted MSMs for both the reference and biased trajectories are calculated using the estimators provided by Deeptime, 47 cf. Figure S4.The reweighted MSMs based on trajectories at a biased potential are performed with our implementation of the reweighted estimator. 57

■ CONCLUSIONS

101This paper presents a guide for implementing Girsanov reweighting in MD simulation and analysis programs using the OpenMM with openmmtools and Deeptime as examples.

The Journal of Physical Chemistry B

102In openmmtools, we extended an existing Langevin integrator class such that the reweighting factors are calculated on-the-fly and, at regular intervals, are written to a reweighting factor trajectory file.In Deeptime, we extended the MSM estimator class such that the transition counts are reweighted according to the reweighting factor trajectory.We demonstrated the correct functioning and error-free applicability of the newly implemented functions and classes using both a low-dimensional test system and a molecular system.The implementation can be readily used for larger systems.The extended software as well as instructions on how to use it are freely available. 57,58,60,61he computational cost of the Girsanov reweighting is usually small.During the simulation, it consists of recording the bias forces and energies and the random numbers for the degrees of freedom that are affected by the bias.During the analysis, it consists of evaluating eqs 29 or 30.Since the bias is typically low-dimensional, i.e., it affects only a few atoms in the simulation box, l k n k , interval + is zero for most dimensions l, and the evaluation of the sums in eqs 29 and 30 incurs no relevant computational cost.In our example of calcium−iodine ion dissociation in water, the bias was applied along the zdimension of the Ca 2+ cation.Thus, the bias force was onedimensional and the sum over the dimensions in eq 29 contained a single term.This is negligible compared to the cost of evaluating a single MD simulation step with a 450dimensional force vector (49 water molecules and 3 ions in the simulation box).

103A more critical question is under which circumstances Girsanov reweighting is efficient.One condition for efficiency is that the length of the reweighted paths has to be considerably shorter than the slow processes in the system.MSMs are one way to construct Girsanov-reweighted kinetic models from short paths because in these models the path length is equal to the MSM lag time. 18,19,36,62This is the approach we used here.Alternatively, one can reweight transition rates within the framework of transition path sampling or transition interface sampling, in which case only the typically short transition paths are reweighted. 33The second factor that influences the efficiency of Girsanov reweighting is the bias.Finding an optimal bias is closely connected to optimal control theory and to finding an optimal reaction coordinate along which the bias is applied. 29,63hen reweighting MSMs, the reweighted dominant eigenvectors tend to be more accurate than the reweighted implied time scales. 18,36This might be due to several reasons.First, the relative path probability decreases exponentially with an increasing path length, falling below the numerical floating point accuracy.One simple remedy is to use a library which allows for a higher precision in the floating point numbers when analyzing the reweighting factor trajectories (for generating the path reweighting trajectory, the usual double precision should be sufficient).Second, in high-dimensional systems, the bias might shift the transition path ensemble for transitions across the barriers.A shifted transition path ensemble at the biased potential is then not representative of paths at the unbiased potential, which causes the relative path probability to be analytically close to zero.To avoid a shift in the transition paths, the bias can be deposited exclusively in the minima of the potential energy function. 22Finally, drifting implied time scales with large statistical uncertainties also occur in discrete Markov models which are estimated from unbiased simulations.This effect might be magnified by reweighting.More accurate Markov models are obtained by using an arbitrary ansatz function instead of a crisp discretization, such as tICA-Markov models, 64,65 variational Markov models, 66 or core-set Markov models. 45,62,67Since it is straightforward to reweight the estimators for these Markov models by the Girsanov relative path probability density, using suitable ansatz functions instead of crisp states will likely improve the accuracy of the reweighted implied time scales.

104OpenMM provides very clean and clear access to the inner loop of the MD simulation via the CustomIntegrator class, and in previous studies, we have taken advantage of this class to implement Girsanov reweighing. 18,19,36However, this approach requires a detailed understanding of both the numerical schemes used to implement Langevin splitting integrators and the equations for the relative path probability.With the LangevinSplittingIntegrator class presented here, the running of a Girsanov reweighting simulation is simplified to one line of code in the OpenMM simulation script.A simple and errorresistant way to set up a Girsanov reweighting simulation is the starting point for more reweighting studies on large molecular systems.

Data Availability Statement

105We provide the software for MD simulation with Girsanov reweighting as a pull request to the original openmmtools and openmm repository.added class LangevinSplitting-Girsanov: https://github.com/choderalab/openmmtools/pull/729, added class ReweightingReporter: https:// github.com/openmm/openmm/pull/4533.The extensions of the deeptime 47 package for Girsanov reweighted Markov state models are also available as a pull request.modified class count_matrix_coo2_mult and added Girsanov-ReweightingEstimator: https://github.com/deeptime-ml/deeptime/pull/290.All simulation scripts and input files can be viewed in our reweightingtools repository.https://github.com/bkellerlab/reweightingtools.

* sı Supporting Information

106The Supporting Information is available free of charge at https://pubs.acs.org/doi/10.1021/acs.jpcb.4c01702.

107Illustration of simulation software setup with tools for Girsanov path reweighting; representation of difference in x-dimension of 100-steps long trajectories; difference between the OpenMM CustomIntegrator class and LangevinSplittingGirsanov for 100 time steps of simulation; and dynamical properties of the I − -Ca 2+ -I − system (PDF)

108■

109the product over the integration time steps k into an outer product over the recording intervals k′ and an inner product over the simulation time steps k″ within a given recording interval.The indices in eqs 10 and 29 are related by k = k′n interval + k″.Furthermore, we have the inner loop of the MD simulation program.At each integration time step k and for each degree of freedom, the random number l k

Figure 1 .

110Figure 1.Overview of path reweighting.

Figure 2 .

111Figure 2. Implementation of the Girsanov reweighting in OpenMM via openmmtools.(a) Inheritance structure for the class LangevinSplittingGirsanov; (b) sketch of an OpenMM simulation script.LangevinSplittingGirsanov is called analogously to LangevinInegrator.

Figure 3 .

112Figure 3.Comparison of the reference implementation (dotted) and the OpenMM CustomIntegrator class (solid) (a) Muller−Brown potential; (b) Muller−Brown potential and linear bias; (c) Muller−Brown potential and polynomial bias; Trajectories for 100 time steps of simulation: (d) xcomponent of the position, (e) x-component of the momentum, and (f) potential energy due to the bias.Difference between reference implementation and the OpenMM CustomIntegrator class (solid) for 100 time steps of simulation: (g) difference in x-component of ththe momentume momentum, (h) difference in the bias force F q U q ( ) ( ) k x k bias bias = , and (i) difference in the random number difference Δη k .

113I − −Ca 2+ −I − Dissociation Process in Water.We use simulations of CaI 2 in TIP3P water (Figure 5a) to compare the implementation using the OpenMM CustomIntegrator class to our new LangevinSplittingGirsanov class (Figure 5b−g).The I − anions were position restrained such that they maintained aTable 2. Parameters for Muller−Brown Potential

Figure 4 .

114Figure 4. MSMs of the dynamics on the Muller−Brown potential.(a) Implied time scale t 1 ITS associated with the slowest process.(b) MSM eigenvectors l 0 and l 1 from an unbiased simulation on the Muller−Brown potential.(c) Reweighted MSM eigenvectors l 0 and l 1 from a simulation on the linearly biased Muller−Brown potential.

Figure 5 . 1 ,

115Figure 5. Molecular system of Ca 2+ I 2 − ion pair in TIP3P water is shown in (a).Comparison between OpenMM CustomIntegrator (black dashed) and LangevinSplittingGirsanov class (orange solid) for 100 time steps of simulation: (b) position q z,k , (c) momentum p z,k , (d) bias potential U bias (q z,k ), (e) bias force F bias (q z,k ), (f) reweighting factors S D k 1, and (g) random number η z,k .Implied time scales from I − −Ca 2+ −I − reference simulation at a unbiased potential (gray solid), as well as from a reweighted MSM (solid) and a standard MSM (dotted) from linearly biased simulations with k z = 5 kJ/mol/nm in blue (h).First (i) and second (j) left dominant MSM eigenvectors are shown, with the same color code used in (h).

116k linear = 1 kJ/mol/nm and k polynom = 50 kJ/mol/nm, m = 13,a 1 = 2.06e − 02 nm −1 , a 2 = −2.32e− 02 nm −2 , a 3 = 3.83e − 03 nm −3 , a 4 = 3.92e − 02 nm −3 , a 5 = −1.39e− 02 nm −3 , a 6 = −3.39e− 02 nm −3 , a 7 = 3.82e − 04 nm −3 , a 8 = 1.24e − 02 nm −3 , a 9 = 3.37e − 03 nm −3 , a 10 = −1.18e− 03 nm −3 , a 11 = −7.50e− 04 nm −3 , a 12 = −1.38e− 04 nm −3 , a 13 = −8.81e− 06 nm −3

57 I

117− −Ca 2+ −I − .The model system is a Ca 2+ I 2 − ion pair (m Ca = 40.08amu, m I = 126.90amu) in an explicit TIP3P water box, containing 49 hydrogen bonds restrained water molecules.The nonbonded interaction parameters are chosen according to the AMBER99 force field, 59 σ Ca = 3.05 × 10 −1 , ε Ca = 1.92, σ I = 4.19 × 10 −1 , and ε I = 1.67.

Table 1 . Reweighting a Markov State Model. In

118which is the equation given in a Markov state model (MSM),41−46the 3N-dimensional position space Ω is discretized into n state nonoverlapping states Ω i , i.e., contains the time-dependent probabilities p i (t) of finding the system in Ω i at time t.The time-evolution of this discrete probability vector is then modeled as a Markov process

119=.The probability vector p(t)

Table 1 .

120Random Number Differences as Function of Perturbation Force U Terms for Underdamped Langevin Integrators a

121q l or Bias Force − ∇U bias , Integration Step Δt, Dissipation d, and Fluctuation f

참고문헌 67건

  1. An Introduction to Markov State Models and Their Application to Long Timescale Molecular Simulation Advances in experimental medicine and biology · Springer Nature · 2013 10.1007/978-94-007-7606-7
  2. Using Nonequilibrium Fluctuation Theorems to Understand and Correct Errors in Equilibrium and Nonequilibrium Simulations of Discrete Langevin Dynamics Physical Review X · American Physical Society · 2013 10.1103/physrevx.3.011007
  3. Communication: Maximum caliber is a general variational principle for nonequilibrium statistical mechanics The Journal of Chemical Physics · American Institute of Physics · 2015 10.1063/1.4928193
  4. Markov state models based on milestoning The Journal of Chemical Physics · American Institute of Physics · 2011 10.1063/1.3590108
  5. Robust and efficient configurational molecular sampling via Langevin dynamics The Journal of Chemical Physics · American Institute of Physics · 2013 10.1063/1.4802990
  6. Replica Exchange with Solute Scaling: A More Efficient Version of Replica Exchange with Solute Tempering (REST2) The Journal of Physical Chemistry B · American Chemical Society · 2011 10.1021/jp204407d
  7. Predicting slow structural transitions in macromolecular systems: Conformational flooding Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 1995 10.1103/physreve.52.2893
  8. Variational Approach to Molecular Kinetics Journal of Chemical Theory and Computation · American Chemical Society · 2014 10.1021/ct4009156
  9. Fluctuations and Irreversible Process. II. Systems with Kinetic Energy Physical Review · American Institute of Physics · 1953 10.1103/physrev.91.1512
  10. Nonphysical sampling distributions in Monte Carlo free-energy estimation: Umbrella sampling Journal of Computational Physics · Elsevier BV · 1977 10.1016/0021-9991(77)90121-8
  11. On the calculation of time correlation functions by potential scaling The Journal of Chemical Physics · American Institute of Physics · 2006 10.1063/1.2159476
  12. Dynamic properties of force fields The Journal of Chemical Physics · American Institute of Physics · 2015 10.1063/1.4909549
  13. Replica Monte Carlo Simulation of Spin-Glasses Physical Review Letters · American Physical Society · 1986 10.1103/physrevlett.57.2607
  14. Coarse Master Equations for Peptide Folding Dynamics The Journal of Physical Chemistry B · American Chemical Society · 2008 10.1021/jp0761665
  15. Stochastic Actions for Diffusive Dynamics: Reweighting, Sampling, and Minimization The Journal of Physical Chemistry B · American Chemical Society · 2007 10.1021/jp0751458
  16. Transition from Quantum to "Classical" Partition Function Physical Review · American Institute of Physics · 1957 10.1103/physrev.106.13
  17. OpenMM: A Hardware-Independent Framework for Molecular Simulations Computing in Science & Engineering · AIP Publishing · 2010 10.1109/mcse.2010.27
  18. Replica-exchange molecular dynamics method for protein folding Chemical Physics Letters · Elsevier BV · 1999 10.1016/s0009-2614(99)01123-9
  19. A Direct Approach to Conformational Dynamics Based on Hybrid Monte Carlo Journal of Computational Physics · Elsevier BV · 1999 10.1006/jcph.1999.6231
  20. Local elevation: A method for improving the searching properties of molecular dynamics simulation Journal of Computer-Aided Molecular Design · Springer Science+Business Media · 1994 10.1007/bf00124016
  21. From Metadynamics to Dynamics Physical Review Letters · American Physical Society · 2013 10.1103/physrevlett.111.230602
  22. Efficient dynamic importance sampling of rare events in one dimension Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 2000 10.1103/physreve.63.016702
  23. On Transforming a Certain Class of Stochastic Processes by Absolutely Continuous Substitution of Measures Theory of Probability and Its Applications · Society for Industrial and Applied Mathematics · 1960 10.1137/1105027
  24. Location of saddle points and minimum energy paths by a constrained simplex optimization procedure Theoretical Chemistry Accounts · Springer Science+Business Media · 1979 10.1007/bf00547608
  25. Markov models of molecular kinetics: Generation and validation The Journal of Chemical Physics · American Institute of Physics · 2011 10.1063/1.3565032
  26. Markov state models and molecular alchemy Molecular Physics · Taylor & Francis · 2014 10.1080/00268976.2014.944597
  27. A path-sampling scheme for computing thermodynamic properties of a many-body system in a generalized ensemble The European Physical Journal B · Springer Science+Business Media · 2004 10.1140/epjb/e2004-00159-0
  28. Automatic discovery of metastable states for the construction of Markov models of macromolecular conformational dynamics The Journal of Chemical Physics · American Institute of Physics · 2007 10.1063/1.2714538
  29. Describing Protein Folding Kinetics by Molecular Dynamics Simulations. 1. Theory The Journal of Physical Chemistry B · American Chemical Society · 2004 10.1021/jp037421y
  30. Transition Path Sampling and Other Advanced Simulation Techniques for Rare Events Springer eBooks · Springer Nature · 2009 10.1007/978-3-540-87706-6_3
  31. Identification of slow molecular order parameters for Markov model construction The Journal of Chemical Physics · American Institute of Physics · 2013 10.1063/1.4811489
  32. Escaping free-energy minima Proceedings of the National Academy of Sciences · National Academy of Sciences · 2002 10.1073/pnas.202427399
  33. Rational Construction of Stochastic Numerical Methods for Molecular Sampling Applied Mathematics Research eXpress · Oxford University Press · 2012 101093amrxabs010
  34. Force Fields for Protein Simulations Advances in protein chemistry · Academic Press · 2003 10.1016/s0065-3233(03)66002-x
  35. Improvements in Markov State Model Construction Reveal Many Non-Native Interactions in the Folding of NTL9 Journal of Chemical Theory and Computation · American Chemical Society · 2013 10.1021/ct300878a
  36. Handbook of stochastic methods Advances in Mathematics · Elsevier BV · 1985 10.1016/0001-8708(85)90015-5
  37. Density-based cluster algorithms for the identification of core sets The Journal of Chemical Physics · American Institute of Physics · 2016 10.1063/1.4965440
  38. Weighted Ensemble Simulation: Review of Methodology, Applications, and Software Annual Review of Biophysics · Annual Reviews · 2017 10.1146/annurev-biophys-070816-033834
  39. Girsanov reweighting for path ensembles and Markov state models The Journal of Chemical Physics · American Institute of Physics · 2017 10.1063/1.4989474
  40. Dynamic Histogram Analysis To Determine Free Energies and Rates from Biased Simulations Journal of Chemical Theory and Computation · American Chemical Society · 2017 10.1021/acs.jctc.7b00373
  41. Girsanov reweighting for metadynamics simulations The Journal of Chemical Physics · American Institute of Physics · 2018 10.1063/1.5027728
  42. Calculating Kinetic Rates and Membrane Permeability from Biased Simulations The Journal of Physical Chemistry B · American Chemical Society · 2018 10.1021/acs.jpcb.8b07442
  43. Targeted Molecular Dynamics Calculations of Free Energy Profiles Using a Nonequilibrium Friction Correction Journal of Chemical Theory and Computation · American Chemical Society · 2018 10.1021/acs.jctc.8b00835
  44. Quantifying Configuration-Sampling Error in Langevin Simulations of Complex Molecular Systems Entropy · Multidisciplinary Digital Publishing Institute · 2018 10.3390/e20050318
  45. Dynamical reweighting methods for Markov models Current Opinion in Structural Biology · Elsevier BV · 2020 10.1016/j.sbi.2019.12.018
  46. Identification of slow molecular order parameters for Markov model construction 2013
  47. Rational Construction of Stochastic Numerical Methods for Molecular Sampling Applied Mathematics Research eXpress · Oxford University Press · 2012 10.1093/amrx/abs010
  48. Communication: Maximum caliber is a general variational principle for nonequilibrium statistical mechanics The Journal of Chemical Physics · American Institute of Physics · 2015 10.1063/1.4928193
  49. Girsanov reweighting for path ensembles and Markov state models The Journal of Chemical Physics · American Institute of Physics · 2017 10.1063/1.4989474
  50. Using Nonequilibrium Fluctuation Theorems to Understand and Correct Errors in Equilibrium and Nonequilibrium Simulations of Discrete Langevin Dynamics Physical Review X · American Physical Society · 2013 10.1103/physrevx.3.011007
  51. Path probability ratios for Langevin dynamics—Exact and approximate The Journal of Chemical Physics · American Institute of Physics · 2021 10.1063/5.0038408
  52. OPLS4: Improving Force Field Accuracy on Challenging Regimes of Chemical Space Journal of Chemical Theory and Computation · American Chemical Society · 2021 10.1021/acs.jctc.1c00302
  53. Reinforcement learning of rare diffusive dynamics The Journal of Chemical Physics · American Institute of Physics · 2021 10.1063/5.0057323
  54. Deeptime: a Python library for machine learning dynamical models from time series data Machine Learning Science and Technology · IOP Publishing · 2021 10.1088/2632-2153/ac3de0
  55. Enhanced sampling without borders: on global biasing functions and how to reweight them Physical Chemistry Chemical Physics · Royal Society of Chemistry · 2021 10.1039/d1cp04809k
  56. Enhanced Sampling Methods for Molecular Dynamics Simulations [Article v1.0] Living Journal of Computational Molecular Science · University of Colorado Boulder · 2022 10.33011/livecoms.4.1.1583
  57. Molecular Dynamics Interdisciplinary applied mathematics · Springer Nature · 2015 10.1007/978-3-319-16375-8
  58. Stochastic Differential Equations Universitext · Springer Nature · 2003 10.1007/978-3-642-14394-6
  59. Path Integrals for Stochastic Processes 2012 10.1142/8695
  60. Enhanced sampling methods for molecular dynamics simulations HAL (Le Centre pour la Communication Scientifique Directe) · Le Centre pour la Communication Scientifique Directe · 2022 10.33011/livecoms.4.1.1583
  61. End-to-end differentiable construction of molecular mechanics force fields Chemical Science · Royal Society of Chemistry · 2022 10.1039/d2sc02739a
  62. A review of Girsanov reweighting and of square root approximation for building molecular Markov state models Journal of Mathematical Physics · American Institute of Physics · 2022 10.1063/5.0127227
  63. Stochastic Approximation to MBAR and TRAM: Batchwise Free Energy Estimation Journal of Chemical Theory and Computation · American Chemical Society · 2023 10.1021/acs.jctc.2c00976
  64. Girsanov reweighting for simulations of underdamped Langevin dynamics. Theory arXiv (Cornell University) · Cornell University · 2023 10.48550/arxiv.2303.14696
  65. Girsanov Reweighting Enhanced Sampling Technique (GREST): On-the-Fly Data-Driven Discovery of and Enhanced Sampling in Slow Collective Variables The Journal of Physical Chemistry A · American Chemical Society · 2023 10.1021/acs.jpca.3c00505
  66. Optimizing molecular potential models by imposing kinetic constraints with path reweighting The Journal of Chemical Physics · American Institute of Physics · 2023 10.1063/5.0151166
  67. Nonequilibrium Statistical Mechanics 2001 10.1093/oso/9780195140187.001.0001