Molecular Dynamics in Different Ensembles

Posted by Hongjin Wang on February 15, 2018

Abstract

The most important concept of molecular dynamics is that the ensemble average of a state function can be represented by the average of certain time-dependent trajectories. The procedure of molecular dynamics is to use classical mechanics to generate such trajectories, i.e. the equations of motion(EoM) of a series of $N$ particles in volume $V$ are solved numerically.

In this paper, Anderson expanded the molecular dynamics application from the traditional micro canonical ensemble (NVE) to three other ensembles: canonical (NVT) ensemble, isothermal-isobaric (NPT) ensemble and the isoenthalpic-isobaric (NPH) ensemble. All these four ensembles are equivalent for the calculation of the thermodynamics quantities. For intensive properties, $F_{NVE}$, $F_{NVT}$, $F_{NPT}$ and $F_{NPH}$ are equivalent except for the order of $N^{-1}$. And if $F$ is extensive property, all four should be the same.

Molecular Dynamics in NVE

The object of interest in Anderson’s paper is atomic fluid with a small number (between 50 and 1000) of $N$ particles, with coordinates $\textbf{r}_1, \textbf{r}_2,…,\textbf{r}_N$ in a cubic volume $V$. In real world, this physical system is more like a droplet where severe surface effect happens. A periodic boundary condition is employed to obtain the results for a bulk liquid: for particle $i$ at $\textbf{r}_i$, a series of virtual particles exists at position $\textbf{r}_i+\textbf{n}V^{1/3}$, where $\textbf{n}$ is a vector with integer components.

The Lagrangian for this system is:

where $\sum\limits_{i<j} u(\textbf{r}_{ij})$ is the total potential energy of the atoms

The Hamiltonian is:

Then we can build Lagrangian EoM for this system:

In statistical thermodynamics, a thermodynamic property $F$ of the system can be expressed as a function $F(\textbf{r}^N,\textbf{p}^N,V)$. The micro-canonical ensemble average is denoted as $F_{NVE}(N, V, E)$:

where

is the microcanonical ensemble partition function.

Then we can define the trajectory average to calculate the thermodynamics properties. For a function $F(\textbf{r}^N,\textbf{p}^N,V)$, the initial state $\textbf{r}^N(0)$ and $\textbf{p}^N(0)$ is chosen by initialize lattice coordinates and temperatures. The trajectory average of function $F(\textbf{r}^N,\textbf{p}^N,V)$ is defined as:

When $N$ and $V$ are fixed, implement EoM in Eq.\ref{EoM}. The hypothesis is made that the trajectory spends equal time in every state(equal volume with the same value of energy). So that

This is the theoretical foundation of the molecular dynamics. And Anderson made modification on the usual molecular dynamics to generate trajectories that can be used in $NPH$, $NVT$ and $NPT​$ ensembles.

Molecular dynamics in NPH

At constant pressure, the volume is no longer a fixed value with fluctuation present. In this case, the trajectory average will be the case of $NPH​$. Some alteration need to be made to accommodate to this CPMD situation.

Firstly, we replace the coordinates $\textbf{r}_1, \textbf{r}_2,…,\textbf{r}_N$ of atoms with a scaled coordinates$\textbf{$\rho$}_1, \textbf{$\rho$}_2,…,\textbf{$\rho$}_N$:

So that the coordinates in the new system are no longer a fixed number but a quantities vary with volume $V​$ between 0 and 1. Thus we can call it scaled system.

Then we introduce such Lagrangian for this system:

Here $Q$ is a new “volume” and $\alpha$ is the “pressure”. Compare Eq.$\ref{lagr2}$ with Eq.$\ref{lagr1}$, we can find that the first two terms are just the same. The third term in Eq.$\ref{lagr2}$ is the kinetic energy of $Q$, and $\alpha Q$ is the potential energy of $Q$. Anderson gives the last two term a physical interpretation. Suppose the as-simulated fluid in a volume-variable container, whose volume can be changed by a piston. Thus $Q$ will be the coordinate of the piston and $\alpha V$ is the potential by an external pressure $\alpha$.

The generalized momentum conjugate to $\rho_i$ is :

and which for $Q$ is:

Thus the Hamiltonian is:

So the EoM are:

Actually, there’s one typo in Anderson’s paper in Eq.$\ref{typo}$, where $\dot{p}$ should be $\dot{\rho}$.

And there exist one-to-one correspondences between parameters in the scaled system and original system in phase space

With EoM, we can generate the trajectory of the new system by $\rho(t)$, $\pi(t)$, $Q(t)$, $\Pi(t)$. And using the correspondences in phase space, we can generate the trajectories in original system by the trajectories in the scaled system. Add time dependence to Eq.$\ref{corespondences1}$-$\ref{corespondences3}$, we get:

Substitute them into the EoM of the scaled system:

Compared these equations with Eq.$\ref{EoM1}$-$\ref{EoM2}$, when mass of the piston $M$ is relatively large, so that $dV/dt=0$, i.e. volume is invariant, Eq. $\ref{EoMO1}$-$\ref{EoMO3}$ reduced to the original system.

Of course, we can calculate the thermodynamics properties in this new isoenthalpic-isobaric system by using the time average of the trajectories generated in this system, just like in $NVE$ system, i.e.:

The trajectory average $G(\rho^N,\pi^N,Q,\Pi)$ of the scaled system has similar form as Eq.$\ref{tave}$:

For any function $F(r^N, p^N, V)$, there is a corresponding $G(\rho^N, \pi^N, Q, \Pi)$ that

Using Eq.$\ref{tave}$ and $\ref{tavec2}$, we can get:

This time average $\bar{G}$ is equal to an ensemble average of $G$ over an $NE$ ensemble, i.e., an ensemble with fixed energy and fixed number of particles. This is just like a scaled system in microcanonical ensemble, as the coordinates $\rho_i$ are a dimensionless unit volume. So that:

where

the partition function

Here the coordinate $\rho_i$ is integrated over the unit cube. Value $E$ comes from Eq.$\ref{tavec2}$, where $E$ is the constant energy of the trajectory calculated.

Similar to Eq.$\ref{FNVE}$, in $NPH$ ensemble, $F_{NPH}(N,\alpha,H)$ is defined as:

where

Compare Eq.$\ref{GNE}$ with Eq.$\ref{FNPH}$, we can find resemblance in the two equations, besides one integral over $d\Pi$. This term does not appear in the original system, but relatively important in the $NPH$ term. For $\bar{F} = G_{NE}$, using Eq.$\ref{FNPH}$ and Eq.$\ref{ParNPH}$, we can get

The numerator can be expended in Taylor series of $\Pi^2/2M$:

If $F$ were an extensive property, the correction term would be the order of $N^{-1}$

Thus $\bar{F}$ can be expressed as:

The ratio of the two integral is $\overline{\Pi^2/2M}$. Therefore,

So Eq.$\ref{conclusion}$ is proved. Enthalpy $H$ for this ensemble is $E-\overline{\Pi^2/2M}$, which is the energy of the trajectory in the scaled system, minus the average kinetic energy associated with the motion of Q.