espressopp.integrator.LangevinBarostat

This is the barostat implementation to perform Langevin dynamics in a Hoover style extended system according to the paper [Quigley04]. It includes corrections of Hoover approach which were introduced by Martyna et al [Martyna94]. If LangevinBarostat is defined (as a property of integrator) the integration equations will be modified. The volume of system \(V\) is introduced as a dynamical variable:

\[\boldsymbol{\dot{r}}_{i} = \frac{\boldsymbol{p}_{i}}{m_{i}} + \frac{p_{\epsilon}}{W}\boldsymbol{r}_{i}\]
\[\boldsymbol{\dot{p}}_{i} = -\bigtriangledown_{\boldsymbol{r}_{i}}\Phi - (1+\frac{n}{N_{f}})\frac{p_{\epsilon}}{W}\boldsymbol{p}_{i} - \gamma\boldsymbol{p}_{i} + \boldsymbol{R}_{i}\]
\[\dot{V} = dVp_{\epsilon}/W\]
\[\dot{p}_{\epsilon} = nV(X-P_{ext})+ \frac{n}{N_{f}}\sum^{N}_{i=1}\frac{\boldsymbol{p}_{i}^{2}}{m_{i}} - \gamma_{p}p_{\epsilon} + R_{p}\]

where volume has a fictitious mass \(W\) and associated momentum \(p_{\epsilon}\), \(\gamma_{p}\) - friction coefficient, \(P_{ext}\) - external pressure and \(X\) - instantaneous pressure without white noise contribution from thermostat, \(n\) - dimension, \(N_{f}\) - degrees of freedom (if there are no constrains and \(N\) is the number of particles in system \(N_{f}=nN\)). \(R_{p}\) - values which are drawn from Gaussian distribution of zero mean and unit variance scaled by

\[\sqrt{\frac{2k_{B}TW\gamma_{p}}{\Delta t}}\]

!IMPORTANT Terms \(- \gamma\boldsymbol{p}_{i} + \boldsymbol{R}_{i}\) correspond to the termostat. They are not included here and will not be calculated if the Langevin Thermostat is not defined.

Example:

>>> rng = espressopp.esutil.RNG()
>>> langevinP = espressopp.integrator.LangevinBarostat(system, rng, desiredTemperature)
>>> langevinP.gammaP = 0.05
>>> langevinP.pressure = 1.0
>>> langevinP.mass = pow(10.0, 4)
>>> integrator.addExtension(langevinP)

!IMPORTANT This barostat is supposed to be run in a couple with thermostat in order to simulate the npt ensamble, because the term \(R_{p}\) needs the temperature as a parameter.

Definition:

In order to define the Langevin-Hoover barostat

>>> langevinP = espressopp.integrator.LangevinBarostat(system, rng, desiredTemperature)

one should have the System and RNG defined and know the desired temperature.

Properties:

  • langevinP.gammaP

    The property ‘gammaP’ defines the friction coefficient \(\gamma_{p}\).

  • langevinP.pressure

    The property ‘pressure’ defines the external pressure \(P_{ext}\).

  • langevinP.mass

    The property ‘mass’ defines the fictitious mass \(W\).

Methods:

  • setMassByFrequency( frequency )

    Set the proper langevinP.mass using expression \(W=dNk_{b}T/\omega_{b}^{2}\), where frequency, \(\omega_{b}\), is the frequency of required volume fluctuations. The value of \(\omega_{b}\) should be less then the lowest frequency which appears in the NVT temperature spectrum [Quigley04] in order to match the canonical distribution. \(d\) - dimensions, \(N\) - number of particles, \(k_{b}\) - Boltzmann constant, \(T\) - desired temperature.

NOTE The langevinP.mass can be set both directly and using the (setMassByFrequency( frequency ))

Adding to the integration:

>>> integrator.addExtension(langevinP)

It will define Langevin-Hoover barostat as a property of integrator.

One more example:

>>> rngBaro = espressopp.esutil.RNG()
>>> lP = espressopp.integrator.LangevinBarostat(system, rngBaro, desiredTemperature)
>>> lP.gammaP = .5
>>> lP.pressure = 1.0
>>> lP.mass = pow(10.0, 5)
>>> integrator.addExtension(lP)

Canceling the barostat:

If one do not need the pressure regulation in system anymore or need to switch the ensamble or whatever :)

>>> # define barostat with parameters
>>> rngBaro = espressopp.esutil.RNG()
>>> lP = espressopp.integrator.LangevinBarostat(system, rngBaro, desiredTemperature)
>>> lP.gammaP = .5
>>> lP.pressure = 1.0
>>> lP.mass = pow(10.0, 5)
>>> integrator.langevinBarostat = lP
>>> ...
>>> # some runs
>>> ...
>>> # disconnect barostat
>>> langevinBarostat.disconnect()
>>> # the next runs will not include the modification of integration equations

Connecting the barostat back after the disconnection

>>> langevinBarostat.connect()

References:

[Quigley04](1, 2)
  1. Quigley, M.I.J. Probert, J. Chem. Phys., 120, 2004, p. 11432
[Martyna94]
  1. Martyna, D. Tobias, M. Klein, J. Chem. Phys., 101, 1994, p. 4177
espressopp.integrator.LangevinBarostat(system, rng, temperature)
Parameters:
  • system
  • rng
  • temperature