2.6. Predicting Molecular Properties¶
The ACT can be used to perform MD simulations of clusters in the gas-phase using the alexandria simulate command. This module includes the possibility to perform energy minimizations with the flag -minimize. For simulations employing periodic boundaries the OpenMM package [29] should be used instead. For more details about MD simulations, see Section MD Simulations with Alexandria Force Fields.
Below we describe some of the properties that can be computed using the ACT.
2.6.1. Electrostatic Potential¶
The charge distribution \(\rho\) of a molecule is determined by the nuclear position of the \(N\) atoms at positions \(\mathbf{x}\) and the electron density \(n(\mathbf{r})\). The molecular electrostatic potential (MEP) at a point in space \(r^\prime\) is thus given by
where \(N\) is the number of atoms, \(z_i\) are the nuclear charges, \(\varepsilon_0\) is the permittivity of vacuum and integration is over the entire space. The minus sign before the integral is due to the negative charge of electrons.
Accurate knowledge of the MEP contributes to, for example, the understanding of interactions and function of biological macromolecules in solution [31]. For a molecule in the gas phase, Eqn. (2.2) can be evaluated using density functional theory and wave function quantum chemistry, albeit at a significant computational cost. Databases of such calculations for small molecules are available to facilitate reuse [8]. For large condensed-phase systems, however, it is common to apply classical force fields, where electrons are not taken into account explicitly. Instead, effective partial charges on atoms are used. The electronic degrees of freedom, charge polarization, is sometimes taken into account through induced point dipoles and higher electrostatic moments, or by using a core-shell model [32, 33, 34]. For additional background we refer to some excellent reviews [35, 36, 37].
The MEP can be used as a target in model development in the ACT, however we recommend against that for both fundamental and practical reasons [38].
2.6.2. Electrostatic Moments¶
If point \({\bf r}^\prime\) in Eqn. (2.2) is outside the distribution of electron density and \({\bf r}^\prime >> {\bf r}\), the electrostatic potential can be evaluated through the Taylor expansion of \(|{\bf r}-{\bf r}^\prime|^{-1}\) [39]:
where \({\bf \hat r} = {\bf r}^\prime/r\) and \({\mathrm \bf I}\) is the identity matrix. By inserting Eqn. (2.3) into Eqn. (2.2), we get
\(Q\) is the monopole moment, sometimes called the zeroth moment of the molecular electron density. In principle this is the total charge of the molecule. In what follows we combine both the atomic cores and the electron density into \(n(r)\). Then, \(Q\) is given by
\({\bf \mu_0}\) is the vector of the permanent dipole moment, which measures the polarity of the molecular electron density. \({\bf \mu_0}\) is given by
\(\boldsymbol{\Theta_0}\) is the tensor of the permanent quadrupole moment, which exhibits the deviation of the distribution of the molecular electron density from spherical symmetry. \(\boldsymbol{\Theta_0}\) is given by
The quadrupole tensor can be written as a traceless \(3 \times 3\) matrix in the Cartesian coordinate if one writes \(\left({\bf \hat r} \cdot {\bf r} \right)^2\) as:
where \({\bf rr}\) is the outer product of vector \({\bf r}\) with itself. This results in a matrix that can be written in terms of the Cartesian components of the vector \({\bf r}\) as follows:
Finally, we get
2.6.3. Polarizability¶
The shape of the molecular electron density changes when it interacts with an external electric field; hence, the total energy of the molecule changes. The static response of a molecule to a homogeneous external electric field, (\(\bf F\)), can be studied by expanding its energy in a Taylor series [40, 41]:
where
where \({\bf \mu_0}\) is the vector of permanent dipole moment, \({\bf \alpha}\) is the tensor of polarizability, which is the linear part of the response of the molecular electron density with respect to the external electric field, and \(\boldsymbol{\beta}\) is the first hyperpolarizability [40].
Instead of expanding the energy, we can expand the dipole moment of a molecule in an external electric field [41], written as
where \({\bf \alpha} {\bf F}\) gives the vector of induced dipole moment, \({\bf \mu_1}\) [40]:
that can be written in matrix form as
From the polarizability tensor the polarizability isotropy [41, 42],
and the polarizability anisotropy [42],
can be calculated.
2.6.4. Normal Mode Analysis¶
Please note that the text below is largely taken (with permission) from a paper by Henschel et al. [43].
The ACT contains the alexandria nma tool that performs a normal mode analysis to determine the vibrational frequencies of a compound. Vibrational frequencies are required to compute the IR spectra and thermochemistry of molecules. The normal modes of molecular vibrations can be obtained by eigenvalue decomposition of the Hessian matrix, whose elements are the second derivatives of the energy with respect to the atomic coordinates \(q\).
where \(i\) and \(j\) run from \(0\) to \(N-1\), where \(N\) is the number of atoms in the molecule. If virtual sites \(v\) are used, for example, to model the \(\sigma\)-hole for halogen atoms, the energy, E, depends on the positions of both atoms and virtual sites; that is, \(E= E(q_0,...,q_{N-1},v_0,...,v_{M-1})\), where the positions of the \(M\) virtual sites, \(v\), in the compound are a function of the atomic coordinates q.
The Hessian is computed numerically—the N atoms are moved independently in all three spatial dimensions, and the forces are computed. From these forces, the second derivative of the energy is then evaluated numerically. Note that the positions of the virtual sites are updated before each force calculation, which means that their influence on the Hessian is taken into account explicitly when computing \(H\).
2.6.4.1. Infrared Spectra¶
For the calculation of a full IR spectrum, in addition to the vibrational frequencies, the intensities and the line shapes are required.
In case of the quantum chemical calculations both the eigenfrequencies and the corresponding IR intensities are produced by default when a frequency calculation is requested in, for instance, the Gaussian software [44]. The frequencies for about 5000 compounds are available from the Alexandria library [17] at the B3LYP/aug-cc-pvtz level of theory [45, 46, 47, 48].Details of the quantum chemical calculations from which the frequencies were obtained have been presented previously [16, 17].
For the force field calculations, the intensities \(I_{n}\) were derived from the transition dipole derivatives:
where \(k\) iterates over cartesian dimensions, \(p\) is the dipole moment of the molecule, and \(Q_n\) the normal coordinate \(n\). In order to take into account virtual sites \(v\) we note that
and rewrite equation (2.5) as:
where \(s\) iterates over the \(N\) atomic coordinates. To make the calculation of intensities practical, the numerical derivative of the dipole moment with respect to the atomic coordinates \(\displaystyle{\frac{\partial p_{k}}{\partial{q_s}}}\) is stored in a text file during the normal mode analysis and finally we note that the term \(\displaystyle{\frac{\partial q_{s}}{\partial Q_{n}}}\) corresponds to one over component \(s\) of eigenvector \(n\).
As an example, an infrared spectrum can be generated using the OPLS2020 force field [49] and a molprop file using:
alexandria nma -ff OPLS2020 -charges OPLS2020-charges -db ethanol -ir ir-ethanol
yielding the spectrum in Fig. 2.10.
Fig. 2.10 Simulated infrared vibrational spectrum for ethanol, based on the OPLS2020 force field.¶
2.6.4.2. Thermochemistry¶
The Canonical ensemble \(Q(N,V,T)\) can be used to compute the molecular Internal energy \(E\) ((2.6)), the standard Entropy \(S^o\) ((2.7)), and the Heat-Capacity \(C_v\) ((2.8)) at constant volume, using
where \(R\) is the ideal gas constant and \(T\) the absolute temperature. For an ideal gas, \(Q(N,V,T)\) can be decomposed into Partition-Function of different degrees of freedom: electronic (el), translational (tr), rotational (rot) and vibrational (vib) motions. Therefore, for a molecular ideal gas, \(Q(N,V,T)\) can be expressed as:
The Rigid-Rotor and the Quantum-Harmonic-Oscillator can be used to approximate the contribution of the rotational and vibrational motions. The partition function of a rigid rotator is defined as
where \(\sigma\) is the symmetry number, \(\Theta_{\mathrm rot}\) the rotational temperature defined as
where \({\mathrm I}\) is the moment of inertia, \(k_{\beta}\) the Boltzmann constant, and \(h\) the Planck constant. The partition function of a quantum harmonic oscillator is defined as
where \(\nu\) is the vibrational frequency of the oscillator. If we define the vibrational temperature as \(\Theta_{\mathrm vib} = \frac{h \nu}{k_{\beta}}\), then we will have
Applying Eqn. (2.9) to Eqn. (2.6) followed by the multiplication rule in logarithm yields:
and similarly,
Thermochemical properties are computed automatically by the alexandria nma command. For more details, please see Van der Spoel et al. [13].
The alexandria nma used above to generate the infrared spectrum in Fig. 2.10 computes the thermochemical variables as well (Table 2.8). Information on calculation of the enthalpy of formation will be pubslished in the near future.
Property |
Experiment |
OPLS2020 |
|---|---|---|
\(S^o\) (J/mol K) |
281 [50] |
273.0 |
\(C_v\) (J/mol K) |
57 [16] |
62.2 |
2.6.5. Second Virial Coefficient¶
The second Virial-Coefficient is the second term in the Virial-Expansion that describes the deviation from the ideal gas law for real gases:
with \(P\) the pressure, \(R\) the gas constant, \(T\) the temperature and \(\rho\) the density.
\(B_2(T)\) is a useful property gauging interactions in the gas phase because experimental values are available for close to 2000 compounds as a function of temperature. It is computed from an integral weighting the interaction between two molecules over three-dimensional space. The theory behind this is described in textbooks [51, 52] but here we follow the notation due to Schenter et al. [53]
where \(u_{12}({\mathbf r})\) is the potential energy of two compounds, Eqn. (3.48), \(\beta = 1/k_BT\) and the integral is over all space and relative orientations of the compounds. If we sample these adequately (including at close, repulsive, distance) we can simplify the integral to a one-dimensional one:
The above equation is entirely classical and quantum corrections have to be added according to:
for the force on the compounds and
for the torque on the compounds, where \(m_j\) is the mass of the molecules \(j\) and \(\mathbf{F}^2\) is the averaged square force on one molecule given by
and where \(I\) is the moment of inertia of the molecule and \(\tau^2\) is the average square torque on one molecule defined by
The change in \(B_2(T)\) as a function of temperature can be used to scrutinize the repulsive and attractive components of the potential energy. \(B_2(T)\) is negative at low temperatures due to attraction forces, while it becomes positive at higher temperatures as repulsion forces start to dominate, and passes through a maximum and eventually decreases at very high temperatures where repulsion force are fully dominant [54].
Code to compute the second virial coefficient is available in the alexandria b2 command. Since the calculation is relatively expensive it has been implemented to use parallel processing using the message passing library. You can run it on a 16-core machine like:
mpirun -n 16 alexandria b2 -v 3 -g TIP4P -b2 TIP4P -ff TIP4P
-f water#water.pdb -T1 373.15 -T2 673.15 -dT 25.0
-maxdimer 32768
where TIP4P corresponds to the well-known water model [55], the \(T_1\) and \(T_2\) are the temperature limits (note gas-phase for water), \(dT\) is the temperature interval and maxdimer determines how many relative orientations will be evaluated. For each orientation the energies are computed at -ndist equidistant distances between the centers of mass from -mindist to -maxdist, and the integrals are computed over this range. Below -mindist the molecules are assumed to overlap, that is the Mayer function \(e^{-\beta u_{12}}-1\) is -1, which adds \(\frac{2\pi}{3} r_{min}^3\) to \(B_2^{cl}(T)\). Therefore -mindist should be well inside the repulsive wall of the potential.
Several algorithms can be used to sample orientations (-randalg).
If the Sobol algorithm for Quasi-Random numbers is used [56], the number of dimers should be a power of two.
If, on the other hand, Pseudo-random numbers are used, there is no such requirement.
The Gauss algorithm uses a grid of Euler angles instead, as in the program Orient [57]. The cosine of \(\beta\) of each molecule is integrated with -nbeta Gauss-Legendre points, and \(\alpha\) of the second molecule and \(\gamma\) of each molecule with -nalpha and -ngamma equally spaced points. Since rotating both molecules around the line between their centers of mass does not change the dimer, \(\alpha\) of the first molecule is zero. This gives -nalpha \(\times\) -nbeta2 \(\times\) -ngamma2 orientations, -maxdimer is not used, and the orientations are computed in a single round. For linear molecules -ngamma 1 is sufficient. For water, a grid of 9 points for each angle gives the classical second virial and the quantum corrections within a few tenths of a percent, at a fraction of the cost of Sobol sampling with a similar accuracy.
The result is plotted in Fig. 2.11.
2.6.5.1. Flexible molecules and path integrals¶
The equations above are for rigid molecules, with the quantum corrections to first order in \(\hbar^2\). With the option -nbeads the molecules are flexible instead, and the nuclear quantum effects of all motions, including the vibrations within the molecules, can be taken into account by a path integral [58]. In a path integral each molecule is replaced by a ring polymer of \(P\) copies of the molecule, the beads, in which each atom \(i\) is connected to itself in the next bead by a harmonic spring with the frequency \(\omega_P = P k_B T/\hbar\). The quantum mechanical distribution of the atoms of one molecule at the temperature \(T\), without exchange of identical nuclei, is the classical distribution of the ring polymer at the temperature \(PT\) with the Hamiltonian
where \(V\) is the potential energy of the molecule and bead \(P+1\) is bead 1. The second virial coefficient then is
where \(r\) is the distance between the centers of mass of the two ring polymers, \(u_{12}\) is the interaction energy of bead \(k\) of the first molecule with bead \(k\) of the second one, and the average is over the orientations and over the structures of the ring polymers of the two isolated molecules. With one bead this is the classical second virial coefficient of flexible molecules, which differs from that of rigid molecules, since flexible molecules adapt their structures to each other. With more beads it converges to the quantum mechanical result, and the corrections \(B_2^F\) and \(B_2^{\tau}\) are not added. The number of beads that is needed is a few times \(\hbar\omega/k_BT\) for the highest frequency \(\omega\) in the molecule: for water around room temperature 32 beads, and proportionally more at lower temperatures. Please check the convergence with the number of beads.
The interaction energy of a pair of beads is the energy of the dimer minus the energies of the two monomers in the same structures. This holds for any model, also with shells and virtual sites. Only particles with a mass are part of the ring polymers. Virtual sites are constructed for each bead, and shells are relaxed for each bead, in the monomers and in the dimer, such that the energies are those of the adiabatic (Born-Oppenheimer) surface of the model. The charges are those of the monomers in their input structures.
The structures of the monomers are sampled at each temperature by path integral molecular dynamics of the isolated monomers, with the Hamiltonian of Eqn. (2.10). The motion in the springs is integrated exactly in the normal modes of the free ring polymer, and each normal mode has a Langevin thermostat [59], which is applied in the middle of each time step. Each process samples -npolymers structures, -pistride steps of -pidt ps apart, after -piequil steps, and each orientation uses a random one of them for each molecule. For example:
mpirun -n 16 alexandria b2 -g SWM4 -b2 SWM4 -ff SWM4-NDP
-f water#water.pdb -T1 373.15 -T2 673.15 -dT 100.0
-maxdimer 32768 -nbeads 32
Since the structures depend on the temperature, each temperature is a separate calculation, unlike for rigid molecules, where all temperatures use the same dimers. The log file gives for each temperature the average potential and kinetic energy of the monomers, the latter from the centroid virial estimator, and the spread of the beads. The second virial coefficient is given with a standard error, from eight independent parts of the orientations and structures. With quasi-random numbers or a grid of orientations the true error can be smaller.
For the dimers no forces are needed, and the shells start from their positions in the monomers. Therefore a dimer of beads takes less time than a dimer of rigid molecules: for a polarizable water model 32 beads take about five times as long as rigid molecules at one temperature.
The average in Eqn. (2.11), and the corresponding one for rigid molecules, also gives the potential of mean force along the distance between the centers of mass,
where \(f(r)\) is the Mayer function, the average at the distance \(r\) that is integrated for the second virial coefficient. The distribution of the distance in a dimer is proportional to \(r^2\exp\left[-W(r)/k_BT\right]\). With the option -pmf it is written for each temperature, and with -nbeads with its standard error from the eight parts. Distances where \(W\) is more than \(27 k_BT\) at one of the temperatures are left out, since \(1+f\) is not known precisely there. At low temperature few orientations dominate the average and many dimers are needed. A simulation of the dimer itself, at one temperature, is described in Simulations at constant temperature and zero point energy.
Fig. 2.11 Sample second virial coefficient and components for water using the TIP4P model.¶