betaFeedback

WorksPhysics and Astronomy

Efficient variable cell shape geometry optimization

Abstract

A fast and reliable geometry optimization algorithm is presented that optimizes atomic positions and lattice vectors simultaneously. Using a series of benchmarks, it is shown that the method presented in this paper outperforms in most cases the standard optimization methods implemented in popular codes such as QUANTUM ESPRESSO and VASP. To motivate the variable cell shape optimization method presented in here, the eigenvalues of the lattice Hessian matrix are investigated thoroughly. It is shown that they change depending on the shape of the cell and the number of particles inside the cell. For certain cell shapes the resulting condition number of the lattice matrix can grow quadratically with respect to the number of particles. By a coordinate transformation which can be applied to all variable cell shape optimization methods, the undesirable conditioning of the lattice Hessian matrix is eliminated.

Introduction

Dynamically stable structures of periodic materials are of great scientific interest in solid state physics and materials science. Every local minimum on the potential energy surface (PES) corresponds to a dynamically stable structure. Finding local minima on the PES is a standard operation for which the availability of highly efficient algorithms is of great importance since it is used in many contexts. For isolated clusters, a wide variety of geometry optimization methods is available. The BFGS method [1, 2, 3, 4] is widely used for various optimization problems and can also be applied directly to the optimization of atomic positions. One can also use methods that were specially developed for geometry optimizations of molecules such as the modified conjugate gradient method developed by Schlegel[5], the DIIS algorithm[6, 7], methods based on internal coordinates [8] or the molecular dynamics based FIRE method[9]. To the best of our knowledge, there are, however, no publications which discuss the optimal treatment of lattice vectors in geometry optimizations. Standard electronic structure codes contain implementations of variable cell shape geometry optimization algorithms, all with differing levels of efficiency and reliability. At first sight, the problem might seem trivial because the lattice vectors can be treated like atomic coordinates, which is what the existing implementations in electronic structure codes do. While this works well in most cases, problems arise in ill conditioned system such as molecular crystals or systems with non-compact lattice shapes. The methods presented in this paper solve these problems and therefore improve a basic tasks in the computational physics and material sciences toolbox. To improve the efficiency of variable cell shape geometry optimizations we use a change of variables which is somewhat similar to the transformation to internal coordinates[8] that improves the efficiency of geometry optimizations for single molecules.

Periodic boundary conditions (PBC) require the addition of the degrees of freedom of the lattice to the PES:

E(x1,x2,…,xNat)→E(x1,x2,…,xNat,Alat)=E(Alat⋅r1,Alat⋅r2,…,Alat⋅rNat,Alat)(1)E(\mathbf{x}_1,\mathbf{x}_2,\ldots,\mathbf{x}_{N_{\mathrm{at}}}) \to E(\mathbf{x}_1,\mathbf{x}_2,\ldots,\mathbf{x}_{N_{\mathrm{at}}},\mathbf{A}_{\mathrm{lat}}) = E(\mathbf{A}_{\mathrm{lat}}\cdot\mathbf{r}_1,\mathbf{A}_{\mathrm{lat}}\cdot\mathbf{r}_2,\ldots,\mathbf{A}_{\mathrm{lat}}\cdot\mathbf{r}_{N_{\mathrm{at}}},\mathbf{A}_{\mathrm{lat}}) \tag*{(1)}

Eq. (1) shows this modification where xi\mathbf{x}_i are the Cartesian coordinates of an atom, Alat=(a∣b∣c)\mathbf{A}_{\mathrm{lat}}=(\mathbf{a}|\mathbf{b}|\mathbf{c}) is the three by three matrix containing the three lattice vectors a\mathbf{a}, b\mathbf{b}, c\mathbf{c} and ri\mathbf{r}_i are the reduced (fractional) coordinates of the atoms that specify the atomic positions in terms of the lattice vectors. All components of the reduced coordinates ri\mathbf{r}_i are in the interval [0,1][0,1]. The form of the PES for PBC in Eq. (1) introduces some complications for finding local minima on the PES. The coordinates x~i\tilde{\mathbf{x}}_i and A~\tilde{\mathbf{A}} of a local minimum on the PES with PBC are defined by Eq. (2) and a curvature condition.

∂E(x1,…,xNat,Alat)∂Alat∣xi=x~i, Alat=A~=0\left.\frac{\partial E(\mathbf{x}_1,\ldots,\mathbf{x}_{N_{\mathrm{at}}},\mathbf{A}_{\mathrm{lat}})}{\partial\mathbf{A}_{\mathrm{lat}}}\right|_{\mathbf{x}_i=\tilde{\mathbf{x}}_i,\ \mathbf{A}_{\mathrm{lat}}=\tilde{\mathbf{A}}}=0
∂E(x1,…,xNat,Alat)∂xi∣xi=x~i, Alat=A~=0∀ i=1,…,Nat(2)\left.\frac{\partial E(\mathbf{x}_1,\ldots,\mathbf{x}_{N_{\mathrm{at}}},\mathbf{A}_{\mathrm{lat}})}{\partial\mathbf{x}_i}\right|_{\mathbf{x}_i=\tilde{\mathbf{x}}_i,\ \mathbf{A}_{\mathrm{lat}}=\tilde{\mathbf{A}}}=0\quad\forall\ i=1,\ldots,N_{\mathrm{at}} \tag*{(2)}

In order to find a local minimum on the PES it is not sufficient to adjust the atomic positions xi\mathbf{x}_i. It is necessary to relax the lattice matrix Alat\mathbf{A}_{\mathrm{lat}} as well. The implicit dependence of atomic positions on the lattice vectors in Eq. (1) complicates the extension of geometry relaxation algorithms from free to periodic systems. This article extends the stabilized quasi Newton method (SQNM) developed for free structures by Schaefer et al.[10] to periodic structures and proposes a new step size control method. The resulting method will then be tested against several implementations of periodic geometry relaxation algorithms included in standard electronic structure codes.

The largest eigenvalue of the Hessian matrix (λmax⁡\lambda_{\max}) contains important information for geometry optimizations. Its inverse is the optimal step size for steepest descent algorithms. For the Hessian matrix of the atomic positions, λmax⁡\lambda_{\max} is not dependent on the system size. The smallest eigenvalue of the Hessian matrix of the atomic position decreases as the system is increased in size[11]. In this paper we will present an analytical calculation of the largest eigenvalue of the lattice part of the Hessian matrix which demonstrates that λmax⁡\lambda_{\max} is indeed dependent on the number of particles. In order to corroborate this result λmax⁡\lambda_{\max} is calculated numerically using energy and forces obtained with a force-field[12] and Quantum ESPRESSO[13, 14, 15].

The results of the analytical calculation, combined with a thorough numerical investigation of the lattice Hessian matrix, show that there are some serious ill-conditioning problems in variable cell shape geometry optimizations. In Section 5 we present a new variable cell shape geometry optimization method that is not affected by these problems.

Dependence of curvature of the PES with respect to the lattice parameters on the number of particles and cell shapes

In this section we present both analytical and numerical calculations of eigenvalues of the Hessian matrix of the lattice part of the PES.

Analytic calculation

Here, three scenarios are presented where the eigenvalues of the lattice part of the Hessian matrix can be calculated analytically.

In the first case, a cubic cell is considered with cell length aa. Here, aa is varied while the particle density remains the same. In this scenario, the eigenvalue of the lattice part of the Hessian matrix is the second derivative of the PES with respect to the cell parameter aa. Since the total energy is an extensive quantity, the energy of two crystals with cell parameters aa, NatN_{\mathrm{at}} and a~=m⋅a\tilde{a}=m\cdot a, N~at=m3Nat\tilde{N}_{\mathrm{at}}=m^{3}N_{\mathrm{at}} is related by E(a,Nat)=a3a~3E(a~,N~at)=1m3E(a~,N~at)E(a,N_{\mathrm{at}})=\frac{a^{3}}{\tilde{a}^{3}}E(\tilde{a},\tilde{N}_{\mathrm{at}})=\frac{1}{m^{3}}E(\tilde{a},\tilde{N}_{\mathrm{at}}). Differentiating both sides twice with respect to aa leads to ∂2E(a,Nat)∂a2=1m∂2E(a~,N~at)∂a~2\frac{\partial^{2}E(a,N_{\mathrm{at}})}{\partial a^{2}}=\frac{1}{m}\frac{\partial^{2}E(\tilde{a},\tilde{N}_{\mathrm{at}})}{\partial\tilde{a}^{2}}. Therefore, ∂2E(a)∂a2\frac{\partial^{2}E(a)}{\partial a^{2}} is proportional to the lattice parameter aa. Because the particle density remains constant, ∂2E(a)∂a2\frac{\partial^{2}E(a)}{\partial a^{2}} is also proportional to Nat13N_{\mathrm{at}}^{\frac{1}{3}}.

In the second scenario, we consider an orthorhombic cell where the cell lengths are aa, aa and bb. Once again the energies of two crystals with cell parameters (a,a,b)(a,a,b) and (a~=m⋅a,a~=m⋅a,b)(\tilde{a}=m\cdot a,\tilde{a}=m\cdot a,b) where the second crystal cell is scaled by a factor mm. The number of particles is chosen such that the density remains constant and therefore, N~at=m2Nat\tilde{N}_{\mathrm{at}}=m^{2}N_{\mathrm{at}}. The energies are related by E(a,b,Nat)=a2ba~2bE(a~,b,N~at)=1m2E(m⋅a,b,m2Nat)E(a,b,N_{\mathrm{at}})=\frac{a^{2}b}{\tilde{a}^{2}b}E(\tilde{a},b,\tilde{N}_{\mathrm{at}})=\frac{1}{m^{2}}E(m\cdot a,b,m^{2}N_{\mathrm{at}}). The second derivatives are ∂2E(a,b,Nat)∂a2=∂2E(a~,b,N~at)∂a~2\frac{\partial^{2}E(a,b,N_{\mathrm{at}})}{\partial a^{2}}=\frac{\partial^{2}E(\tilde{a},b,\tilde{N}_{\mathrm{at}})}{\partial\tilde{a}^{2}}, ∂2E(a,b,Nat)∂a∂b=1m2∂2E(a~,b,N~at)∂a~∂b\frac{\partial^{2}E(a,b,N_{\mathrm{at}})}{\partial a\partial b}=\frac{1}{m^{2}}\frac{\partial^{2}E(\tilde{a},b,\tilde{N}_{\mathrm{at}})}{\partial\tilde{a}\partial b} and ∂2E(a,b,Nat)∂b2=1m2∂2E(a~,b,N~at)∂b2\frac{\partial^{2}E(a,b,N_{\mathrm{at}})}{\partial b^{2}}=\frac{1}{m^{2}}\frac{\partial^{2}E(\tilde{a},b,\tilde{N}_{\mathrm{at}})}{\partial b^{2}}. Since the number of atoms is proportional to m2m^{2} one can write the Hessian matrix HlatH_{\mathrm{lat}} in terms of the number of atoms:

Hlat=(∂2E(a,b)∂a2=const.∂2E(a,b)∂a∂b∼Nat∂2E(a,b)∂a∂b∼Nat∂2E(a,b)∂b2∼Nat).(3)H_{\mathrm{lat}}=\begin{pmatrix} \frac{\partial^{2}E(a,b)}{\partial a^{2}}=\mathrm{const.} & \frac{\partial^{2}E(a,b)}{\partial a\partial b}\sim\sqrt{N_{\mathrm{at}}}\\ \frac{\partial^{2}E(a,b)}{\partial a\partial b}\sim\sqrt{N_{\mathrm{at}}} & \frac{\partial^{2}E(a,b)}{\partial b^{2}}\sim N_{\mathrm{at}} \end{pmatrix}. \tag*{(3)}

The first eigenvalue of Eq. (3) grows asymptotically linear with respect to the number of atoms and the second eigenvalue is asymptotically constant. This can be seen by plugging the Hessian matrix from Eq. (3) into the formula that calculates eigenvalues of two by two matrices.

Lastly, we consider two orthorhombic cells with cell lengths (a,b,b)(a,b,b) and (a~,b,b)=(m⋅a,b,b)(\tilde{a},b,b)=(m\cdot a,b,b). Once again the number of particles is scaled such that the particle density remains constant: N~at=mNat\tilde{N}_{\mathrm{at}}=mN_{\mathrm{at}}. Their energies are given by E(a,b,Nat)=1mE(m⋅a,b,N~at)E(a,b,N_{\mathrm{at}})=\frac{1}{m}E(m\cdot a,b,\tilde{N}_{\mathrm{at}}). The calculation of the Hessian matrix is analogous to the derivation of Eq. (3) and the resulting Hessian matrix has the form

Hlat=(∂2E(a,b)∂a2∼1Nat∂2E(a,b)∂a∂b=const.∂2E(a,b)∂a∂b=const.∂2E(a,b)∂b2∼Nat).(4)H_{\mathrm{lat}}=\begin{pmatrix} \frac{\partial^{2}E(a,b)}{\partial a^{2}}\sim\frac{1}{N_{\mathrm{at}}} & \frac{\partial^{2}E(a,b)}{\partial a\partial b}=\mathrm{const.}\\ \frac{\partial^{2}E(a,b)}{\partial a\partial b}=\mathrm{const.} & \frac{\partial^{2}E(a,b)}{\partial b^{2}}\sim N_{\mathrm{at}} \end{pmatrix}. \tag*{(4)}

In this case, one eigenvalue of Eq. (4) grows asymptotically linear and the other one approaches 1Nat\frac{1}{N_{\mathrm{at}}} asymptotically.

Numerical evaluation of the Hessian matrix and its eigenvalues

In this section we confirm our analytical results by numerical experiments. The eigenvalues of the lattice part of the Hessian matrix are calculated for increasing numbers of particles for the cell shapes, studied in the previous section. In contrast to the analytical calculation, all six degrees of freedom of the lattice Hessian matrix are now incorporated in the numerical test of the model developed in § 2.1.

The cubic growth was done using a force field developed by Bazant et al. [12]. The ground state that was represented in a cell containing 64 atoms was then expanded equally in all directions and the lattice part of the Hessian matrix was calculated numerically. Figure 1 shows the results of this calculation. The fitted lines in Figure 1 all have a slope of nearly exactly 13\frac{1}{3} which shows that all eigenvalues are proportional to Nat13N_{\mathrm{at}}^{\frac{1}{3}}.

Figure 1. A log plot of all six eigenvalues of the Hessian matrix of a silicon force field [12]. λ2−6\lambda_{2-6} are degenerate and not all lines are visible. A fit gives a slope of nearly exactly 13\frac{1}{3} for all eigenvalues.

The other two cell shapes are analyzed by expanding a diamond cell in one and two directions which resulted in long and flat cells. The energies are calculated on the DFT level using the Quantum ESPRESSO package and the Hessian matrix was calculated numerically using finite differences. Figure 2 and Figure 3 show the results of this calculation. In the flat simulation cell three eigenvalues depend linearly on the number of particles and the remaining three are constant. For the long cell where the lattice cell was expanded in only one direction five eigenvalues grow linear with respect to the number of particles and one is proportional to 1Nat\frac{1}{N_{\mathrm{at}}}. The analytic model which is derived in § 2.1 does not perfectly predict the numerically calculated eigenvalues shown in Figure 2 and Figure 3. Since the model from § 2.1 only predicts the asymptotic behaviour of the eigenvalues one would have to consider very large cells for results that tend to the asymptotic value. Another challenge is the noise which is inherently present in all DFT calculations which makes it challenging to accurately calculate derivatives using finite differences. We repeated the calculations for the eigenvalues from Figure 2 and Figure 3 using a force field and more atoms which results in a nearly perfect agreement between the model presented in § 2.1 and the numerically calculated eigenvalues.

Figure 2. Log plot of the eigenvalues of a cell expansion in two directions. The fitted slopes of λ1−6\lambda_{1-6} are 0.95, 0.87, 0.94, 0.00, 0.01 and 0.00 respectively.

Figure 3. Log plot of the eigenvalues of a cell expansion in a single direction. A cell of this kind is pictured in Figure 6. The fitted slopes of λ1−6\lambda_{1-6} are 1.00, 1.00, 0.98, 0.98, 0.93 and -0.91 respectively.

Conditioning of the lattice Hessian matrix

The condition number of an optimization problem is defined by the ratio between the largest and the smallest eigenvalue of the Hessian matrix. In Sections 2.1 and 2.2 the lattice cells are expanded equally in all directions such that the proportions of the cells remained the same. The resulting condition number is constant with respect to the number of particles. This can be seen from Figure 1 where all the eigenvalues are proportional to Nat13N_{\mathrm{at}}^{\frac{1}{3}}. Hence the ratio is constant.

When the lattice cell is not expanded equally in all directions, the condition number does not remain constant with respect to the number of particles. The condition number that grows linearly with respect to the number of particles in a flat cell and in long cells the condition number can even grow quadratically with respect to the number of particles in the simulation cell.

Lattice updates

The implicit dependence of the atomic positions on the lattice vectors introduces some difficulty to update lattice vectors. In Section 1 it is shown that the Cartesian positions of all atoms change when the lattice vectors are changed for fixed reduced coordinates. This behaviour is problematic when standard quasi Newton methods based on Cartesian coordinates are used to optimize the energy on the PES. Quasi Newton methods extract curvature information based on the differences between input vectors and gradients from previous iterations. When a lattice vector update changes the atomic positions, the quasi Newton algorithm is disturbed and extracts poor curvature information. This has to be avoided. In this work we present several possibilities to overcome this problem.

Lattice update in reduced atomic positions

Instead of optimizing the Cartesian xi\mathbf{x}_i coordinates of the PES one can also optimize the reduced coordinates ri\mathbf{r}_i.

E~(r1,r2,…,rNat,A)=E(A⋅r1,A⋅r2,…,A⋅rNat,A)=E(x1,x2,…,xNat,A)(5)\widetilde{E}(\mathbf{r}_1,\mathbf{r}_2,\ldots,\mathbf{r}_{N_{\mathrm{at}}},A) = E(A\cdot\mathbf{r}_1,A\cdot\mathbf{r}_2,\ldots,A\cdot\mathbf{r}_{N_{\mathrm{at}}},A) = E(\mathbf{x}_1,\mathbf{x}_2,\ldots,\mathbf{x}_{N_{\mathrm{at}}},A) \tag*{(5)}
∂E~∂ri=∂xi∂ri⏟Alat⋅∂E∂xi=Alat⋅∂E∂xi(6)\frac{\partial\widetilde{E}}{\partial\mathbf{r}_i} = \underbrace{\frac{\partial\mathbf{x}_i}{\partial\mathbf{r}_i}}_{A_{\mathrm{lat}}}\cdot\frac{\partial E}{\partial\mathbf{x}_i} = A_{\mathrm{lat}}\cdot\frac{\partial E}{\partial\mathbf{x}_i} \tag*{(6)}

Since ∂E~∂ri=0⟺∂E∂xi=0\frac{\partial\widetilde{E}}{\partial\mathbf{r}_i}=0 \Longleftrightarrow\frac{\partial E}{\partial\mathbf{x}_i}=0 and since AlatA_{\mathrm{lat}} can be chosen to be positive definite, each local minimum of EE corresponds to a local minimum of E~\widetilde{E}.

This update mechanism is also problematic. Usually, the cell vectors differ in length and these differences can even be arbitrarily large. The transformation of the Cartesian coordinates to the reduced coordinates maps all entries of the atomic coordinates into the interval [0,1][0,1]. If the lattice vector is long the distance between the mapped point is small which leads to an increase of the curvature. Hence the condition number grows for cells whose lattice vectors have different lengths.

Quasi Cartesian coordinates

By introducing quasi Cartesian coordinates it is possible to eliminate the increase of the condition number for flat or elongated cells. Let A0A_0 be the lattice matrix from the initial non-relaxed cell and qi=A0⋅Alat−1⋅xi=A0⋅ri\mathbf{q}_i=A_0\cdot A_{\mathrm{lat}}^{-1}\cdot\mathbf{x}_i=A_0\cdot\mathbf{r}_i the quasi Cartesian coordinates describing the position of atom ii. Instead of optimizing the usual PES which depends on the Cartesian coordinates xix_i and the lattice matrix AlatA_{\mathrm{lat}} we now optimize

E~(q1,…,qNat,Alat)=E(Alat⋅A0−1⋅q1,…,Alat⋅A0−1⋅qNat,Alat)=E(x1,…,xNat,Alat).(7)\widetilde{E}(q_1,\ldots,q_{N_{\mathrm{at}}},A_{\mathrm{lat}}) = E(A_{\mathrm{lat}}\cdot A_0^{-1}\cdot q_1,\ldots,A_{\mathrm{lat}}\cdot A_0^{-1}\cdot q_{N_{\mathrm{at}}},A_{\mathrm{lat}}) = E(x_1,\ldots,x_{N_{\mathrm{at}}},A_{\mathrm{lat}}). \tag*{(7)}

The derivatives of E~\widetilde{E} can be calculated using the chain rule:

∂E~∂qi=∂xi∂qi∂E∂xi=Alat⋅A0−1∂E∂xi.(8)\frac{\partial\widetilde{E}}{\partial q_i}=\frac{\partial x_i}{\partial q_i}\frac{\partial E}{\partial x_i}=A_{\mathrm{lat}}\cdot A_0^{-1}\frac{\partial E}{\partial x_i}. \tag*{(8)}

Improving the condition number of the lattice optimization

Supercell lattice derivatives

In § 2 it was shown, that the condition number is very large when very long or very flat cells are considered. This problem can be overcome by expanding the non-compact cell into a supercell where all of the cell vectors have the same length and calculating the lattice derivatives of this supercell. It is not necessary to calculate the lattice derivatives directly for this supercell. Using the fact that the stress tensor σ\sigma remains invariant under this expansion and the relation

∂E∂Alat=−det⁡(Alat)⋅σ⋅(Alat−1)T(9)\frac{\partial E}{\partial A_{\mathrm{lat}}}=-\det(A_{\mathrm{lat}})\cdot\sigma\cdot(A_{\mathrm{lat}}^{-1})^{\mathrm{T}} \tag*{(9)}

it is possible to transform the lattice derivatives of the small, original cell to the bigger hypothetical cell. A good choice for the hypothetical cell A~\widetilde{A} is

A~∼Alat⋅(1∥a0∥0001∥b0∥0001∥c0∥)(10)\widetilde{A}\sim A_{\mathrm{lat}}\cdot \begin{pmatrix} \frac{1}{\lVert a_0\rVert} & 0 & 0\\ 0 & \frac{1}{\lVert b_0\rVert} & 0\\ 0 & 0 & \frac{1}{\lVert c_0\rVert} \end{pmatrix} \tag*{(10)}

where a0a_0, b0b_0 and c0c_0 are the lengths of the initial lattice vectors. Eq. (10) transforms AlatA_{\mathrm{lat}} to A~\widetilde{A} where all lattice vectors have approximately the same length. The lattice derivatives A~\widetilde{A} are proportional to

∂E∂Alat⋅(1∥a0∥0001∥b0∥0001∥c0∥).(11)\frac{\partial E}{\partial A_{\mathrm{lat}}}\cdot \begin{pmatrix} \frac{1}{\lVert a_0\rVert} & 0 & 0\\ 0 & \frac{1}{\lVert b_0\rVert} & 0\\ 0 & 0 & \frac{1}{\lVert c_0\rVert} \end{pmatrix}. \tag*{(11)}

The size of A~\widetilde{A} is somewhat arbitrary. Because of that only the proportionality of Eqs. (10) and (11) is given. A good choice for the size of supercells is presented in § 4.2.

Resulting transformation of lattice vectors

In order to improve the condition number of the lattice matrix the lattice vectors should be transformed such that the resulting lattice derivatives have the form of Eq. (11). The transformation

A~=γ⋅Alat⋅(1∥a0∥0001∥b0∥0001∥c0∥)(12)\widetilde{A}=\gamma\cdot A_{\mathrm{lat}}\cdot \begin{pmatrix} \frac{1}{\lVert a_0\rVert} & 0 & 0\\ 0 & \frac{1}{\lVert b_0\rVert} & 0\\ 0 & 0 & \frac{1}{\lVert c_0\rVert} \end{pmatrix} \tag*{(12)}

results in a lattice derivative of the desired form where γ\gamma is a scaling factor that will be set appropriately later in this section. Now, instead of optimizing E(x1,x2,…,xNat,Alat)E(\mathbf{x}_1,\mathbf{x}_2,\ldots,\mathbf{x}_{N_{\mathrm{at}}},A_{\mathrm{lat}}), we optimize

E~(q1,q2,…,qNat,A~)=E(x1,x2,…,xNat,A~⋅1γ(∥a0∥000∥b0∥000∥c0∥))(13)\widetilde{E}(\mathbf{q}_1,\mathbf{q}_2,\ldots,\mathbf{q}_{N_{\mathrm{at}}},\widetilde{A}) =E\left(\mathbf{x}_1,\mathbf{x}_2,\ldots,\mathbf{x}_{N_{\mathrm{at}}},\widetilde{A}\cdot\frac{1}{\gamma}\begin{pmatrix}\lVert\mathbf{a}_0\rVert& 0 & 0 \\ 0 & \lVert\mathbf{b}_0\rVert& 0 \\ 0 & 0 & \lVert\mathbf{c}_0\rVert\end{pmatrix}\right) \tag*{(13)}

with respect to A~\widetilde{A}. The lattice derivative of Eq. (13) is given by:

∂E~∂A~=∂Alat∂A~∂E∂Alat=∂E∂Alat1γ(∥a0∥000∥b0∥000∥c0∥).(14)\frac{\partial\widetilde{E}}{\partial\widetilde{A}}=\frac{\partial A_{\mathrm{lat}}}{\partial\widetilde{A}}\frac{\partial E}{\partial A_{\mathrm{lat}}}=\frac{\partial E}{\partial A_{\mathrm{lat}}}\frac{1}{\gamma}\begin{pmatrix}\lVert\mathbf{a}_0\rVert& 0 & 0 \\ 0 & \lVert\mathbf{b}_0\rVert& 0 \\ 0 & 0 & \lVert\mathbf{c}_0\rVert\end{pmatrix}. \tag*{(14)}

Since the lattice derivatives from the modified potential energy surface of Eq. (13) are now the derivatives of a supercell where the lengths of the lattice vectors are equal, the eigenvalues of the lattice Hessian matrix of Eq. (13) now behave like the ones shown in Figure 1 where all of the eigenvectors are proportional to Nat13N_{\mathrm{at}}^{\frac{1}{3}}. Therefore, the condition number of the lattice part of the Hessian matrix is constant with respect to the system size. Since the smallest eigenvalue of the position part of the Hessian matrix decreases with increasing system size, the overall condition number of the entire Hessian matrix is worsened by the Nat13N_{\mathrm{at}}^{\frac{1}{3}} dependence of the eigenvalues from the lattice part of the Hessian matrix. Ideally, the eigenvalues of the lattice part of the Hessian matrix should also be constant. In this way they will not increase the condition number of the entire Hessian matrix. This can be achieved by choosing γ\gamma properly. When γ∼Nat\gamma\sim\sqrt{N_{\mathrm{at}}}, the lattice eigenvalues do not depend on the number of particles anymore. This is derived in the appendix A.

Finally, one has to choose a parameter ww to set the magnitude of γ=w⋅Nat\gamma=w\cdot\sqrt{N_{\mathrm{at}}}. ww determines the overall curvature of the lattice Hessian matrix and should be chosen such that the lattice and position curvature are similar. Based on our experience ww should be between 1 and 2 when atomic units are used. Figure 4 shows that the eigenvalues of the Hessian matrix of the transformed lattice vectors are indeed constant with respect to the system size.

Figure 4. The modified eigenvalues of the lattice Hessian matrix for w=2w = 2 for a long silicon cell. The eigenvalues and the condition number are now invariant with respect to the system size. The problematic spectrum displayed in Figure 3 is corrected.

Summary of the transformations that eliminate ill-conditioning

Our theoretical analysis of the periodic potential energy surface shows the the condition number is improved when the lattice and position variables are transformed. Therefore, one should optimize E~(q1,…,A~)\widetilde{E}(\mathbf{q}_1,\ldots,\widetilde{A}) with respect to qi\mathbf{q}_i and A~\widetilde{A}. Each minimum on E~\widetilde{E} corresponds to a minimum on EE. The two transformations are: qi=A0⋅Alat−1⋅xi=A0⋅ri\mathbf{q}_i=A_0\cdot A_{\mathrm{lat}}^{-1}\cdot\mathbf{x}_i=A_0\cdot\mathbf{r}_i and

A~=w⋅Nat⋅Alat⋅(1∥a0∥0001∥b0∥0001∥c0∥)(15)\widetilde{A}=w\cdot\sqrt{N_{\mathrm{at}}}\cdot A_{\mathrm{lat}}\cdot\begin{pmatrix}\frac{1}{\lVert\mathbf{a}_0\rVert} & 0 & 0 \\ 0 & \frac{1}{\lVert\mathbf{b}_0\rVert} & 0 \\ 0 & 0 & \frac{1}{\lVert\mathbf{c}_0\rVert}\end{pmatrix} \tag*{(15)}

with the derivatives being ∂E~∂qi=Alat⋅A0−1∂E∂xi\frac{\partial\widetilde{E}}{\partial q_i}=A_{\mathrm{lat}}\cdot A_0^{-1}\frac{\partial E}{\partial x_i} and

∂E~∂A~=∂E∂Alat⋅1w⋅Nat⋅(∥a0∥000∥b0∥000∥c0∥)(16)\frac{\partial\widetilde{E}}{\partial\widetilde{A}}=\frac{\partial E}{\partial A_{\mathrm{lat}}}\cdot\frac{1}{w\cdot\sqrt{N_{\mathrm{at}}}}\cdot\begin{pmatrix}\lVert\mathbf{a}_0\rVert& 0 & 0 \\ 0 & \lVert\mathbf{b}_0\rVert& 0 \\ 0 & 0 & \lVert\mathbf{c}_0\rVert\end{pmatrix} \tag*{(16)}

with ww being a value between one and two atomic units. After these transformations of the potential energy surface any minimization method can be applied to E~\widetilde{E}. The quasi newton method only sees the variables qi\mathbf{q}_i and A~\widetilde{A}. After a stationary point is found i.e. ∂E~∂qi=0\frac{\partial\widetilde{E}}{\partial q_i}=0 and ∂E~∂A~=0\frac{\partial\widetilde{E}}{\partial\widetilde{A}}=0, the coordinates are transformed back and xi\mathbf{x}_i and A~\widetilde{A} are returned. We use the SQNM method [10] as our optimizer, since it is reliable, efficient and developed especially for potential energy surfaces. Any other gradient based optimization method can also be accelerated by the transformations described in this paper.

Additional useful functionalities of our geometry optimizer

The equations and functionalities derived in this chapter can be useful even when other optimization methods are used and they may be applied to fixed cell optimization problems. Whenever a vector x\mathbf{x} is referred to, we assume that the quasi cartesian coordinates qiq_i and the transformed lattice vectors A~\widetilde{A} are concatenated into this vector.

Improved step size control for the SQNM method

The step size control mechanism is improved in our implementation of the variable cell SQNM (vc-SQNM) method. Instead of using the angle between the original gradient and the preconditioned gradient as a feedback as described in the original SQNM [10] method, we use the gain ratio, a quantity which is used in trust region methods[16] to adjust the trust radius. It is defined by:

ρ=actual gainexpected gain=Ek−Ek+1mk−mk+1(17)\rho= \frac{\text{actual gain}}{\text{expected gain}} = \frac{E_k - E_{k+1}}{m_k - m_{k+1}} \tag*{(17)}

where EkE_k is the energy at iteration kk and mkm_k is the approximated energy that can be calculated using the estimated Hessian matrix in quasi Newton methods. The approximated Hessian matrix outside of the significant subspace in the SQNM method is diagonal and all diagonal elements are equal to the inverse stepsize of the current iteration. A good way to adapt the step size is to increase the step size if the gain ratio is bigger than one and to decrease it if the gain ratio is smaller than 0.5.

Estimation of a lower bound for the ground state energy

A feature of quasi Newton methods is their estimate of the Hessian matrix of the PES which is systematically improved during the geometry optimization. This can be utilized to estimate a lower bound for the energy of the local minimum that the geometry optimization is approaching. Let EME_\mathrm{M} be the quadratic model of the PES that the quasi Newton method generates. It has the form

EM(x)=E0+(x−x0)T∇E(x0)⏟=0+12(x−x0)TA(x−x0).(18)E_\mathrm{M}(\mathbf{x}) = E_0 + (\mathbf{x} - \mathbf{x}_0)^\mathrm{T} \underbrace{\nabla E(\mathbf{x}_0)}_{=0} + \frac{1}{2}(\mathbf{x} - \mathbf{x}_0)^\mathrm{T} A(\mathbf{x} - \mathbf{x}_0). \tag*{(18)}

x0\mathbf{x}_0 is the vector holding the coordinates of the local minimum, AA is the current quasi Newton estimate of the symmetric Hessian matrix and E0E_0 is the energy of the local minimum. ∇E(x0)=0\nabla E(\mathbf{x}_0) = 0 because there are no residual forces in the local minimum. The gradient of EME_\mathrm{M} can be written as ∇EM(x)=A(x−x0)\nabla E_\mathrm{M}(\mathbf{x}) = A(\mathbf{x} - \mathbf{x}_0). EME_\mathrm{M} can be expressed in terms of its own gradient: EM(x)=E0+∇EM(x)A−1∇EM(x)E_\mathrm{M}(\mathbf{x}) = E_0 + \nabla E_\mathrm{M}(\mathbf{x}) A^{-1} \nabla E_\mathrm{M}(\mathbf{x}). When the quadratic model EME_\mathrm{M} captures the shape of the PES well, EM(x)≈E(x)E_\mathrm{M}(\mathbf{x}) \approx E(\mathbf{x}) and ∇EM(x)≈−F(x)\nabla E_\mathrm{M}(\mathbf{x}) \approx-\mathbf{F}(\mathbf{x}). Therefore,

E(x)≈E0+12F(x)TA−1F(x)⏟≤∥F(x)∥2λmin⁡(19)E(\mathbf{x}) \approx E_0 + \frac{1}{2}\underbrace{\mathbf{F}(\mathbf{x})^\mathrm{T} A^{-1}\mathbf{F}(\mathbf{x})}_{\le\frac{\lVert\mathbf{F}(\mathbf{x})\rVert^2}{\lambda_{\min}}} \tag*{(19)}

where λmin⁡\lambda_{\min} is the smallest eigenvalue of AA. This leads to the estimate of the lower bound of the ground state energy

E0≥E(x)−∥F(x)∥22λmin⁡.(20)E_0 \ge E(\mathbf{x}) - \frac{\lVert\mathbf{F}(\mathbf{x})\rVert^2}{2\lambda_{\min}}. \tag*{(20)}

Figure 5 shows the energy difference to the ground state and the estimated energy difference that was calculated using Eq. (20) versus the number of geometry optimization iterations.

Figure 5. Exact energy difference to ground state and the estimate of the same quantity, ∥F(x)∥22λmin⁡\frac{\lVert F(x)\rVert^2}{2\lambda_{\min}}, plotted against the number of geometry optimization iterations.

Detection of noise level in the forces

In most atomistic simulations, the PES is calculated by some kind of iterative DFT procedure or by stochastic Monte Carlo methods. In both cases solutions are not exact - they are always approximate and contain therefore some numerical noise. Typically, the error in the forces e.g. the gradients of the PES is larger than the error that is present in the potential energy. A large error in the forces of the PES is undesirable in the context of geometry optimizations and can worsen the performance of the geometry optimization dramatically. Here we present a measure to detect and quantify noise. Noisy forces can be modelled in the following way:

Fi=F~i+ϵi.(21)F_i = \widetilde{F}_i + \epsilon_i. \tag*{(21)}

FiF_i is the force component obtained using the numerical calculation, F~i\widetilde{F}_i is the true value of the force component and ϵi\epsilon_i is a random number drawn from the probability distribution Ei\mathcal{E}_i with zero mean and an unknown variance Var⁡(Ei)\operatorname{Var}(\mathcal{E}_i). Note that Ei\mathcal{E}_i may be a different, independent distribution for each force component. The true force components F~i\widetilde{F}_i must sum up to zero. Therefore, S=∑Fi=∑ϵiS = \sum F_i = \sum\epsilon_i. Using Bienaymé’s identity [17 p. 116] (which states that Var⁡(∑ϵi)=∑Var⁡(ϵi)\operatorname{Var}(\sum\epsilon_i) = \sum\operatorname{Var}(\epsilon_i) in this case), the variance of SS can be expressed as Var⁡(S)=∑Var⁡(ϵi)\operatorname{Var}(S) = \sum\operatorname{Var}(\epsilon_i). The variance of SS can now be estimated using

Var⁡(S)=13∑j=13(∑i=1NatFi,j)2≥Var⁡(El)∀l=1,…,Nat.(22)\operatorname{Var}(S) = \frac{1}{3}\sum_{j=1}^{3}\left(\sum_{i=1}^{N_{\mathrm{at}}}F_{i,j}\right)^2 \ge\operatorname{Var}(\mathcal{E}_l)\quad\forall l=1,\ldots,N_{\mathrm{at}}. \tag*{(22)}

So far we have found a rather weak upper bound of the variances of Ei\mathcal{E}_i. If one also assumes that all Var⁡(Ei)\operatorname{Var}(\mathcal{E}_i) are equal then Var⁡(Ei)=Var⁡(S)Nat∀i=1,…,Nat\operatorname{Var}(\mathcal{E}_i) = \frac{\operatorname{Var}(S)}{N_{\mathrm{at}}}\quad\forall i=1,\ldots,N_{\mathrm{at}}. The standard deviation σ\sigma of Ei\mathcal{E}_i is a measure of the noise level present in the forces. σ\sigma can be calculated using the following relation:

σ=Var⁡(S)Nat=13Nat∑j=13(∑i=1NatFi,j)2.(23)\sigma= \sqrt{\frac{\operatorname{Var}(S)}{N_{\mathrm{at}}}} = \sqrt{\frac{1}{3N_{\mathrm{at}}}\sum_{j=1}^{3}\left(\sum_{i=1}^{N_{\mathrm{at}}}F_{i,j}\right)^2}. \tag*{(23)}

When σ\sigma is comparable to the magnitudes of the force components, the convergence of geometry optimizations will come to a standstill because the forces are dominated by noise.

Estimation of largest eigenvalues

The largest eigenvalue λmax⁡\lambda_{\max} of the Hessian matrix of the PES is an important piece of information for geometry optimizations. It is connected to the initial step size which should be smaller than the reciprocal value of this eigenvalue. λmax⁡\lambda_{\max} is system specific and typically equals the reciprocal curvature of the PES along bond stretching modes involving the strongest covalent bond. Based on empirical rules, it is difficult to predict this curvature for complex systems It however turns out that it is possible to approximate the largest eigenvalue of the hessian matrix using quantities which have to be calculated in the beginning of every geometry optimization. Suppose the geometry optimization is started at x1\mathbf{x}_1 then x2=x1−β∇E(x1)\mathbf{x}_2=\mathbf{x}_1-\beta\nabla E(\mathbf{x}_1) in most quasi Newton methods. λmax⁡\lambda_{\max} can be approximated using either of the following two equations:

λmax⁡≈E(x2)−E(x1)+β∥∇E(x1)∥212β2∥∇E(x1)∥2(24)\lambda_{\max}\approx\frac{E(\mathbf{x}_2)-E(\mathbf{x}_1)+\beta\lVert\nabla E(\mathbf{x}_1)\rVert^2}{\frac{1}{2}\beta^2\lVert\nabla E(\mathbf{x}_1)\rVert^2} \tag*{(24)}
λmax⁡≈∥∇E(x2)−∇E(x1)∥β∥∇E(x1)∥(25)\lambda_{\max}\approx\frac{\lVert\nabla E(\mathbf{x}_2)-\nabla E(\mathbf{x}_1)\rVert}{\beta\lVert\nabla E(\mathbf{x}_1)\rVert} \tag*{(25)}

λmax⁡\lambda_{\max} is an upper bound of both approximations which is presented together with both derivations in Appendix § 11. Therefore, the larger value of the two expressions is closer to λmax⁡\lambda_{\max} and its inverse should be used to approximate the initial step size. One still has to choose a value for the parameter β\beta. On the one hand side β\beta has to be chosen large enough such that the energies and gradients at x1\mathbf{x}_1 and x2\mathbf{x}_2 differ by significantly more than the noise level. On the other hand it has to be chosen smaller than the curvature arising from the stretching of the strongest bonds found in condensed matter such as the N2\mathrm{N}_2 triple bond. A good choice for β\beta is 0.10.1 Hartree/Bohr2^2, respectively 0.0010.001 eV/Å2^2.

During the derivation of Eq. (24) it is assumed that x1\mathbf{x}_1 is in a region of the PES that can be described by a quadratic model centered around a local minimum. In Eq. (25) this assumption is not needed and it should therefore produce more accurate results when the distance between x1\mathbf{x}_1 and the nearest local minimum is large.

In our tests Eqs. (24) and (25) the relative error between the approximation and λmax⁡\lambda_{\max} was usually smaller than 5%.

Benchmarks

In order to test the efficiency of the geometry optimizing algorithm presented in Section 5 the performance was compared with the geometry optimizer of Quantum ESPRESSO [13, 14, 15] and VASP [18, 19, 20, 21, 22, 23, 24].

Benchmark systems

Seven different systems were analyzed in this benchmark.

  • Carbon in the diamond structure, 8 atoms in lattice cell

  • Carbon in the diamond structure, 24 atoms in lattice cell

  • Silicon carbide cell, 8 atoms in lattice cell

  • Silicon carbide cell, 32 atoms in lattice cell

  • Long silicon lattice cell containing 56 atoms which is pictured in Figure 6

  • Formaldehyde, eight formula units

  • Methylammonium lead iodide (CH3_3NH3_3PbI) which is described as the delta phase by Flores-Livas et al. [25] and is also mentioned by Thind et al. [26]

Crystalline cells with lattice vectors of very different length

Figure 6. Without our method crystalline cells, whose lattice vectors have very different length, are difficult to optimize.

For all of these systems at least 50 geometries were generated using variable cell shape molecular dynamics [27] starting from their respective global minimum. The initial kinetic energy was chosen such that all the structures fall back into the global minimum. This worked in all the benchmark systems except the formaldehyde where some exceptions occurred. These structures were then optimized with our optimizer, the one from Quantum ESPRESSO and the one from VASP.

Benchmarking method

In order to make the comparison more meaningful, we used the PES calculated by Quantum ESPRESSO for the vc-SQNM method when it is compared against the geometry optimization algorithm from Quantum ESPRESSO. The same was done for the VASP comparison. An extraordinary high plane wave cutoff of 2200 eV was chosen in order to eliminate inaccuracies that might arise from the change of the plane wave basis which is caused by the varying lattice vectors. When the lattice vectors are varied, either the number of plane waves or the plane wave cutoff must change. For the Quantum ESPRESSO optimizer the default trust radius method was used. In the setup of VASP, the RMM-DIIS optimization algorithm was used. We chose the RMM-DIIS optimization method in VASP since it is stated in the VASP documentation that it is very efficient for structures close to a local minima which is the case in our benchmark[28]. The step size variable POTIM was set manually to ensure the optimal performance of the algorithm. To compare the performance of the algorithms two quantities were used. The total number of energy evaluations and the Euclidean length of the optimization trajectory. The latter quantity is of importance for the performance of electronic structure calculations because the self consistent wave function obtained in the previous iteration is typically reused to start the new SCF cycle. Therefore, a short optimization trajectory reduces the total number of SCF cycles.

The periodic geometry optimization method implemented in VASP does not check for convergence of the lattice vectors[29]. Their recommended procedure is to conduct a geometry and lattice optimization simulation, check the convergence of the pressure manually and restart the simulation until the pressure converges. The number of iterations that are obtained in this way for the benchmark are somewhat ambiguous. Because of that we chose a different way to calculate the number of iterations used by VASP. A geometry optimization was stopped when a certain threshold of the norm of the forces was reached. However, this does not guarantee that the pressure is converged in the VASP simulation. Therefore the values in the VASP benchmark are only a lower limit on the number of iterations. In practice, the pressure did however converge in most of the simulations that were done during the benchmarks.

Performance of our method with noisy forces

Since this method may be used in situations where calculating accurate derivatives may be difficult and forces therefore contain a lot of noise, we want to demonstrate how geometry optimizations are affected by noisy forces. This is done by randomly displacing atoms from a the ground configuration of bulk silicon with 64 atoms in the unit cell. Energies, forces and lattice derivatives are calculated using the force field from Bazant et al. [12]. In this force field, the analytic expression of the forces is known. Therefore, the forces and lattice derivatives can be calculated exactly. To simulate an environment where the derivatives contain noise a normal distributed random number with mean zero and a standard deviation of 10−410^{-4} Hartree/Bohr is added to each force and lattice derivative component. In order to see the effect of the artificial noise on the efficiency of the geometry optimization algorithm, the convergence of the maximal force and lattice derivative component is compared against a geometry optimization that starts at the same initial configuration but the noise is not added to the forces.

Figure 7 shows the convergence of the force norm with and without noise. When the convergence of the geometry optimization with noisy forces is compared to the same geometry optimization without noisy forces, two things can be seen. First, the force norms can not be brought below the limit of 3 to 5 times σ\sigma. Secondly, the convergence rate of the geometry optimization starts to slow down only when this limit is reached. This experiment was repeated numerous times and the noisy forces always impacted the geometry optimizations as described above. This observation is especially useful in combination with the result of § 6.3 where we provide a way to estimate the standard deviation of the noise term present in the forces which can be used as a stopping criterion for the geometry optimization.

Figure 7. The maximal absolute value of forces and lattice derivatives with noise added to them is shown in green color and without noise in red color.

Results

The results of the performance comparison are displayed in Table 1 and Table 2. In most of the comparisons, the vc-SQNM method clearly outperforms the methods implemented in VASP and Quantum ESPRESSO. The average length of the optimization trajectory is shorter in every system that is considered here which can speed up DFT calculations.

NstructsN_{\mathrm{structs}}Avg. iterationsAvg. length of traject.
vc-SQNMQEvc-SQNMQE
C8_89211.714.71.83.3
C24_{24}5012.816.02.54.4
C8_8Si8_85013.716.40.80.8
C16_{16}Si16_{16}5028.635.03.04.0
long Si56_{56} cell5030.753.842.442.6
C8_8H16_{16}O8_85061.4139.819.343.75
CH3_3NH3_3PbI50141.3212.59.013.1

Table 1. Results of the benchmark between the optimizer from Quantum ESPRESSO and the vc-SQNM method using energy and forces calculated by Quantum ESPRESSO. NstructsN_{\mathrm{structs}} is the number of different structures that were optimized for each system, the average length of the optimization trajectory is given in Bohr.

NstructsN_{\mathrm{structs}}Avg. iterationsAvg. length of traject.
vc-SQNMVASPvc-SQNMVASP
C8_89212.210.01.52.7
C24_{24}5012.610.22.14.0
C8_8Si8_85014.219.01.23.1
C16_{16}Si16_{16}5022.136.74.18.9
long Si56_{56} cell5036.453.742.493.4
C8_8H16_{16}O8_85095.7580.213.05227.6
CH3_3NH3_3PbI50184.6482.415.416.2

Table 2. Results of the benchmark between the optimizer from VASP and the vc-SQNM method using energies and forces calculated by VASP. NstructsN_{\mathrm{structs}} is the number of different structures that were optimized for each system, the average length of the optimization trajectory is given in Bohr.

The long silicon cell and the formaldehyde system are the most difficult systems to optimize included in the benchmark. In these difficult systems, the difference in performance between the vc-SQNM method and the VASP and Quantum ESPRESSO implementations is particularly larger. As expected, the vc-SQNM method, that uses the transformed coordinates qi\mathbf{q}_i together with A~\tilde{\mathbf{A}}, can handle difficult systems better than competing algorithms.

Conclusion

We introduced a transformation that improves the condition number for variable cell shape optimizations. The vc-SQNM method is compared against the optimization methods from VASP and Quantum ESPRESSO in an extensive benchmark. It is shown that it can outperform the optimizer from Quantum ESPRESSO and VASP in almost all cases that were investigated. Especially for difficult system the number of required energy and force evaluations can be decreased. In all of the systems tested in the benchmark, the average euclidean length of the optimization trajectory was significantly shorter which will reduce the number of steps in the SCF cycle and therefore the computational effort. The high stability of our method is witnessed by the fact that over 300’000 periodic geometry optimization were successfully completed in studies within group[30, 31] where the minima hopping method is used[32, 33, 34, 35].

Upon publication of this manuscript we will publish an implementation of our method on GitHub: https://github.com/.

Acknowledgments

The calculations were performed on the computational resources of the Swiss National Supercomputer (CSCS) under project s1167 and at sciCORE (http://scicore.unibas.ch/) scientific computing center at University of Basel. Financial support was obtained from the Swiss National Science Foundation.

Derivation of the proper side length of the supercell

The modified lattice coordinates have the form a=a~a0ka = \frac{\tilde{a}a_0}{k}, a0a_0 is the side length of the initial cube. The energy of the modified PES is given by E~=E~(r1,…,rNat,a~a0k)\tilde{E} = \tilde{E}(\mathbf{r}_1,\ldots,\mathbf{r}_{N_{\mathrm{at}}},\frac{\tilde{a}a_0}{k}). The first and second derivative are given by:

∂E~∂a~=∂a∂a~∂∂aE(r1,…,rNat,a~a0k)=a0k∂E∂a,∂2E~∂a~2=(∂a∂a~)2∂2E∂a2=a02k2∂2E∂a2∼a02k2Nat13(26)\frac{\partial\tilde{E}}{\partial\tilde{a}}=\frac{\partial a}{\partial\tilde{a}}\frac{\partial}{\partial a}E\left(\mathbf{r}_1,\ldots,\mathbf{r}_{N_{\mathrm{at}}},\frac{\tilde{a}a_0}{k}\right)=\frac{a_0}{k}\frac{\partial E}{\partial a},\qquad\frac{\partial^2\tilde{E}}{\partial\tilde{a}^2}=\left(\frac{\partial a}{\partial\tilde{a}}\right)^2\frac{\partial^2E}{\partial a^2}=\frac{a_0^2}{k^2}\frac{\partial^2E}{\partial a^2}\sim\frac{a_0^2}{k^2}N_{\mathrm{at}}^{\frac{1}{3}} \tag*{(26)}

A good approximation for a0a_0 is n⋅l=Nat13⋅ln\cdot l = N_{\mathrm{at}}^{\frac{1}{3}}\cdot l where ll is the equilibrium bond length and nn is the number of atoms per side length of the cube. Using the fact that the eigenvalues of cubic cells are proportional to Nat13N_{\mathrm{at}}^{\frac{1}{3}} and setting the second derivative constant one gets:

∂2E~∂a~2∼(Nat13)2k2Nat13=Natk2=const.⟹k∼Nat.(27)\frac{\partial^2\tilde{E}}{\partial\tilde{a}^2}\sim\frac{\left(N_{\mathrm{at}}^{\frac{1}{3}}\right)^2}{k^2}N_{\mathrm{at}}^{\frac{1}{3}}=\frac{N_{\mathrm{at}}}{k^2}=const.\quad\Longrightarrow\quad k\sim\sqrt{N_{\mathrm{at}}}. \tag*{(27)}

Derivation largest eigenvalue approximations

Derivation of λmax⁡≈E(x2)−E(x1)+β∥∇E(x1)∥212β2∥∇E(x1)∥2\lambda_{\max}\approx\frac{E(x_2)-E(x_1)+\beta\lVert\nabla E(x_1)\rVert^2}{\frac{1}{2}\beta^2\lVert\nabla E(x_1)\rVert^2}:

The power iteration can be used to approximate the largest eigenvalue of a matrix AA and an arbitrary non-zero vector b\mathbf{b}: λmax⁡=lim⁡k→∞bTA2k+1b∥Akb∥2⟹λmax⁡≈bTA3b∥Ab∥2\lambda_{\max} = \lim_{k\to\infty} \frac{\mathbf{b}^{T}\mathbf{A}^{2^{k+1}}\mathbf{b}}{\lVert\mathbf{A}^{k}\mathbf{b}\rVert^{2}} \Longrightarrow\lambda_{\max} \approx\frac{\mathbf{b}^{T}\mathbf{A}^{3}\mathbf{b}}{\lVert\mathbf{A}\mathbf{b}\rVert^{2}}. Let E(x)E(\mathbf{x}) be the taylor expansion of the PES around a local minimum with coordinates x0\mathbf{x}_0 up to second order:

E(x)=E(x0)+(x−x0)T∇E(x0)⏟=0+12(x−x0)TH(x−x0)(28)E(\mathbf{x}) = E(\mathbf{x}_0) + \underbrace{(\mathbf{x}-\mathbf{x}_0)^T\nabla E(\mathbf{x}_0)}_{=0} + \frac{1}{2}(\mathbf{x}-\mathbf{x}_0)^T H(\mathbf{x}-\mathbf{x}_0) \tag*{(28)}
∇E(x)=H(x−x0).(29)\nabla E(\mathbf{x}) = H(\mathbf{x}-\mathbf{x}_0). \tag*{(29)}

Consider E(x−β∇E(x))=E(x)−β∇E(x)T∇E(x)+12β2∇E(x)TH∇E(x)E(\mathbf{x}-\beta\nabla E(\mathbf{x})) = E(\mathbf{x})-\beta\nabla E(\mathbf{x})^T\nabla E(\mathbf{x})+\frac{1}{2}\beta^2\nabla E(\mathbf{x})^T H\nabla E(\mathbf{x}). Using the power iteration approximation

λmax⁡≈(x−x0)TH3(x−x0)∥H(x−x0)∥2=∇E(x)TH∇E(x)∥∇E(x)∥2=E(x−β∇E(x))−E(x)+β∥∇E(x)∥212β2∥∇E(x)∥2.(30)\begin{aligned} \lambda_{\max} \approx\frac{(\mathbf{x}-\mathbf{x}_0)^T H^3(\mathbf{x}-\mathbf{x}_0)}{\lVert H(\mathbf{x}-\mathbf{x}_0)\rVert^2} = \frac{\nabla E(\mathbf{x})^T H\nabla E(\mathbf{x})}{\lVert\nabla E(\mathbf{x})\rVert^2} \\ &= \frac{E(\mathbf{x}-\beta\nabla E(\mathbf{x}))-E(\mathbf{x})+\beta\lVert\nabla E(\mathbf{x})\rVert^2}{\frac{1}{2}\beta^2\lVert\nabla E(\mathbf{x})\rVert^2}. \tag*{(30)} \end{aligned}

Derivation of λmax⁡≈∥∇E(x2)−∇E(x1)∥β∥∇E(x1)∥\lambda_{\max} \approx\frac{\lVert\nabla E(\mathbf{x}_2)-\nabla E(\mathbf{x}_1)\rVert}{\beta\lVert\nabla E(\mathbf{x}_1)\rVert}

Let E(x)E(\mathbf{x}) be the taylor expansion of the PES around an arbitrary point x0\mathbf{x}_0 up to second order:

E(x)=E(x0)+(x−x0)T∇E(x0)+12(x−x0)TH(x−x0)(31)E(\mathbf{x}) = E(\mathbf{x}_0) + (\mathbf{x}-\mathbf{x}_0)^T\nabla E(\mathbf{x}_0) + \frac{1}{2}(\mathbf{x}-\mathbf{x}_0)^T H(\mathbf{x}-\mathbf{x}_0) \tag*{(31)}
∇E(x)=∇E(x0)+H(x−x0).(32)\nabla E(\mathbf{x}) = \nabla E(\mathbf{x}_0) + H(\mathbf{x}-\mathbf{x}_0). \tag*{(32)}

Consider ∇E(x−β∇E(x))=∇E(x0)+H(x−β∇E(x)−x0)=∇E(x)−βH∇E(x)\nabla E(\mathbf{x}-\beta\nabla E(\mathbf{x})) = \nabla E(\mathbf{x}_0)+H(\mathbf{x}-\beta\nabla E(\mathbf{x})-\mathbf{x}_0) = \nabla E(\mathbf{x})-\beta H\nabla E(\mathbf{x}). Therefore, ∥∇E(x−β∇E(x))−∇E(x)∥=β∥H∇E(x)∥≤β∥H∥∥∇E(x)∥≤βλmax⁡∥∇E(x)∥\lVert\nabla E(\mathbf{x}-\beta\nabla E(\mathbf{x}))-\nabla E(\mathbf{x})\rVert= \beta\lVert H\nabla E(\mathbf{x})\rVert\leq\beta\lVert H\rVert\lVert\nabla E(\mathbf{x})\rVert\leq\beta\lambda_{\max}\lVert\nabla E(\mathbf{x})\rVert because the Frobenius norm is consistent with the Euclidean vector norm. Rearranging the terms results in the following approximation:

λmax⁡≈∥∇E(x−β∇E(x))−∇E(x)∥β∥∇E(x)∥.(33)\lambda_{\max} \approx\frac{\lVert\nabla E(\mathbf{x}-\beta\nabla E(\mathbf{x}))-\nabla E(\mathbf{x})\rVert}{\beta\lVert\nabla E(\mathbf{x})\rVert}. \tag*{(33)}

References

References

  1. [1]C. G. BROYDEN, The Convergence of a Class of Double-rank Minimization Algorithms 1. General Considerations, IMA Journal of Applied Mathematics 6 (1) (1970) 76–90. arXiv:https://academic.oup.com/imamat/article-pdf/6/1/76/2233756/6-1-76.pdf, doi:10.1093/imamat/6.1.76. URL https://doi.org/10.1093/imamat/6.1.76
  2. [2]R. Fletcher, A new approach to variable metric algorithms, The Computer Journal 13 (3) (1970) 317–322. arXiv:https://academic.oup.com/comjnl/article-pdf/13/3/317/988678/130317.pdf, doi:10.1093/comjnl/13.3.317. URL https://doi.org/10.1093/comjnl/13.3.317
  3. [3]D. Goldfarb, A family of variable-metric methods derived by variational means, Mathematics of Computation 24 (109) (1970) 23–26. URL http://www.jstor.org/stable/2004873DOI
  4. [4]D. F. Shanno, Conditioning of quasi-newton methods for function minimization, Mathematics of Computation 24 (111) (1970) 647–656. URL http://www.jstor.org/stable/2004840DOI
  5. [5]H. B. Schlegel, Optimization of equilibrium geometries and transition structures, Journal of Computational Chemistry 3 (2) (1982) 214–218. arXiv: https://onlinelibrary.wiley.com/doi/pdf/10.1002/jcc.540030212, doi:https://doi.org/10.1002/jcc.540030212. URL https://onlinelibrary.wiley.com/doi/abs/10.1002/jcc.540030212
  6. [6]P. Császár, P. Pulay, Geometry optimization by direct inversion in the iterative subspace, Journal of Molecular Structure 114 (1984) 31–34. doi:https://doi.org/10.1016/S0022-2860(84)87198-7. URL https://www.sciencedirect.com/science/article/pii/S0022286084871987
  7. [7]P. Pulay, Convergence acceleration of iterative sequences. the case of scf iteration, Chemical Physics Letters 73 (2) (1980) 393–398. doi:10.1016/0009-2614(80)80396-4. URL http://www.sciencedirect.com/science/article/B6TFN-4490431-79/2/5234d016c4cad3b7ec90ac847d09d282DOI
  8. [8]H. B. Schlegel, A comparison of geometry optimization with internal, cartesian, and mixed coordinates, International Journal of Quantum Chemistry 44 (S26) (1992) 243–252. arXiv:https://onlinelibrary.wiley.com/doi/pdf/10.1002/qua.560440821, doi:https://doi.org/10.1002/qua.560440821. URL https://onlinelibrary.wiley.com/doi/abs/10.1002/qua.560440821
  9. [9]E. Bitzek, P. Koskinen, F. Gähler, M. Moseler, P. Gumbsch, Structural relaxation mode simple, Phys. Rev. Lett. 97 (2006) 170201. doi:10.1103/PhysRevLett.97.170201. URL https://link.aps.org/doi/10.1103/PhysRevLett.97.170201DOI
  10. [10]B. Schaefer, S. Alireza Ghasemi, S. Roy, S. Goedecker, Stabilized quasi-newton optimization of noisy potential energy surfaces, The Journal of Chemical Physics 142 (3) (2015) 034112. arXiv:https://doi.org/10.1063/1.4905665, doi: 10.1063/1.4905665. URL https://doi.org/10.1063/1.4905665
  11. [11]S. Goedecker, F. Lancon, T. Deutsch, Linear scaling relaxation of the atomic positions in nanostructures, Physical Review B 64 (16) (2001) 161102. doi: 10.1103/PhysRevB.64.161102.DOI
  12. [12]M. Bazant, E. Kaxiras, J. Justo, The environment-dependent interatomic potential applied to silicon disordered structures and phase transitions, MRS Proceedings 491 (01 1997). doi:10.1557/PROC-491-339.DOI
  13. [13]P. Giannozzi, S. Baroni, N. Bonini, M. Calandra, R. Car, C. Cavazzoni, D. Ceresoli, G. L. Chiarotti, M. Cococcioni, I. Dabo, A. D. Corso, S. de Gironcoli, S. Fabris, G. Fratesi, R. Gebauer, U. Gerstmann, C. Gougoussis, A. Kokalj, M. Lazzeri, L. Martin-Samos, N. Marzari, F. Mauri, R. Mazzarello, S. Poini, A. Pasquarello, L. Paulatto, C. Sbraccia, S. Scandolo, G. Sclauzero, A. P. Seitsonen, A. Smogunov, P. Umari, R. M. Wentzcovitch, QUANTUM ESPRESSO: a modular and open-source software project for quantum simulations of materials, Journal of Physics: Condensed Matter 21 (39) (2009) 395502. doi:10.1088/0953-8984/21/39/395502. URL https://doi.org/10.1088/0953-8984/21/39/395502
  14. [14]P. Giannozzi, O. Andreussi, T. Brumme, O. Bunau, M. B. Nardelli, M. Calandra, R. Car, C. Cavazzoni, D. Ceresoli, M. Cococcioni, N. Colonna, I. Carnimeo, A. D. Corso, S. de Gironcoli, P. Delugas, R. A. DiStasio, A. Ferretti, A. Floris, G. Fratesi, G. Fugallo, R. Gebauer, U. Gerstmann, F. Giustino, T. Gorni, J. Jia, M. Kawamura, H.-Y. Ko, A. Kokalj, E. Küçükbenli, M. Lazzeri, M. Marsili, N. Marzari, F. Mauri, N. L. Nguyen, H.-V. Nguyen, A. O. de-la Roza, L. Paulatto, S. Poncé, D. Rocca, R. Sabatini, B. Santra, M. Schlipf, A. P. Seitsonen, A. Smogunov, I. Timrov, T. Thonhauser, P. Umari, N. Vast, X. Wu, S. Baroni, Advanced capabilities for materials modelling with quantum ESPRESSO, Journal of Physics: Condensed Matter 29 (46) (2017) 465901. doi:10.1088/1361-648x/aa8f79. URL https://doi.org/10.1088/1361-648x/aa8f79
  15. [15]P. Giannozzi, O. Baseggio, P. Bonfà, D. Brunato, R. Car, I. Carnimeo, C. Cavazzoni, S. de Gironcoli, P. Delugas, F. Ferrari Ruffino, A. Ferretti, N. Marzari, I. Timrov, A. Urru, S. Baroni, Quantum espresso toward the exascale, The Journal of Chemical Physics 152 (15) (2020) 154105. arXiv:https://doi.org/10.1063/5.0005082, doi:10.1063/5.0005082. URL https://doi.org/10.1063/5.0005082
  16. [16]J. Nocedal, S. J. Wright, Numerical Optimization, 2nd Edition, Springer, New York, NY, USA, 2006. doi:10.1007/978-0-387-40065-5.
  17. [17]A. Klenke, Probability Theory: A Comprehensive Course, Universitext, Springer London, 2007. doi:10.1007/978-3-030-56402-5. URL https://link.springer.com/book/10.1007/978-3-030-56402-5
  18. [18]G. Kresse, J. Hafner, Ab initio molecular dynamics for liquid metals, Phys. Rev. B 47 (1993) 558–561. doi:10.1103/PhysRevB.47.558. URL https://link.aps.org/doi/10.1103/PhysRevB.47.558DOI
  19. [19]G. Kresse, J. Hafner, Ab initio molecular-dynamics simulation of the liquid-metal–amorphous-semiconductor transition in germanium, Phys. Rev. B 49 (1994) 14251–14269. doi:10.1103/PhysRevB.49.14251. URL https://link.aps.org/doi/10.1103/PhysRevB.49.14251DOI
  20. [20]G. Kresse, J. Furthmüller, Efficiency of ab-initio total energy calculations for metals and semiconductors using a plane-wave basis set, Computational Materials Science 6 (1) (1996) 15–50. doi:https://doi.org/10.1016/0927-0256(96)00008-0. URL https://www.sciencedirect.com/science/article/pii/0927025696000080
  21. [21]G. Kresse, J. Furthmüller, Efficient iterative schemes for ab initio total-energy calculations using a plane-wave basis set, Phys. Rev. B 54 (1996) 11169–11186. doi:10.1103/PhysRevB.54.11169. URL https://link.aps.org/doi/10.1103/PhysRevB.54.11169DOI
  22. [22]P. E. Blöchl, Projector augmented-wave method, Phys. Rev. B 50 (1994) 17953–17979. doi:10.1103/PhysRevB.50.17953. URL https://link.aps.org/doi/10.1103/PhysRevB.50.17953DOI
  23. [23]G. Kresse, D. Joubert, From ultrasoft pseudopotentials to the projector augmented-wave method, Phys. Rev. B 59 (1999) 1758–1775. doi:10.1103/PhysRevB.59.1758. URL https://link.aps.org/doi/10.1103/PhysRevB.59.1758DOI
  24. [24]J. P. Perdew, A. Zunger, Self-interaction correction to density-functional approximations for many-electron systems, Phys. Rev. B 23 (1991) 5048–5079. doi:10.1103/PhysRevB.23.5048. URL https://link.aps.org/doi/10.1103/PhysRevB.23.5048
  25. [25]J. A. Flores-Livas, D. Tomerini, M. Amsler, A. Boziki, U. Rothlisberger, S. Goedecker, Emergence of hidden phases of methylammonium lead iodide (ch₃nh₃pbi₃) upon compression, Phys. Rev. Materials 2 (2018) 085201. doi:10.1103/PhysRevMaterials.2.085201. URL https://link.aps.org/doi/PhysRevMaterials.2.085201
  26. [26]A. S. Thind, X. Huang, J. Sun, R. Mishra, First-principles prediction of a stable hexagonal phase of ch₃nh₃pbi₃, Chemistry of Materials 29 (14) (2017) 6003–6011. arXiv:https://doi.org/10.1021/acs.chemmater.7b01781, doi:10.1021/acs.chemmater.7b01781. URL https://doi.org/10.1021/acs.chemmater.7b01781
  27. [27]M. Parrinello, A. Rahman, Polymorphic transitions in single crystals: A new molecular dynamics method, Journal of Applied Physics 52 (12) (1981) 7182–7190. arXiv:https://doi.org/10.1063/1.328693, doi:10.1063/1.328693. URL https://doi.org/10.1063/1.328693
  28. [28]VASP, Ibrion (2022). URL https://www.vasp.at/wiki/index.php/IBRION
  29. [29]VASP, Ionic relaxation, stress & cell shapes, phonons and molecular dynamics (2016). URL https://www.vasp.at/wiki/images/2/25/VASP_lecture_Basics3.pdf
  30. [30]M. Gubler, J. A. Flores-Livas, A. Kozhevnikov, S. Goedecker, Missing theoretical evidence for conventional room-temperature superconductivity in low-enthalpy structures of carbonaceous sulfur hydrides, Phys. Rev. Materials 6 (2022) 014801. doi:10.1103/PhysRevMaterials.6.014801. URL https://link.aps.org/doi/10.1103/PhysRevMaterials.6.014801DOI
  31. [31]H. Huber, M. Sommer, M. Gubler, S. Goedecker, Targeting high symmetry in structure predictions by biasing the potential energy surface, arXiv (2022). doi:10.48550/ARXIV.2209.05342. URL https://arxiv.org/abs/2209.05342
  32. [32]S. Goedecker, Minima hopping: An efficient search method for the global minimum of the potential energy surface of complex molecular systems, The Journal of Chemical Physics 120 (21) (2004) 9911–9917. arXiv:https://doi.org/10.1063/1.1724816, doi:10.1063/1.1724816.
  33. [33]M. Amsler, S. Goedecker, Crystal structure prediction using the minima hopping method, The Journal of chemical physics 133 (22) (2010) 224104. doi:10.1063/1.35212900.DOI
  34. [34]M. Sicher, S. Mohr, S. Goedecker, Efficient moves for global geometry optimization methods and their application to binary systems, The Journal of chemical physics 134 (4) (2011) 044106. doi:10.1063/1.3530590.DOI
  35. [35]S. Roy, S. Goedecker, V. Hellmann, Bell-Evans-Polanyi principle for molecular dynamics trajectories and its implications for global optimization, Physical Review E 77 (5) (2008) 056707. doi:10.1103/PhysRevE.77.056707.DOI

Paper details

vlnc:W_mvnxexhv
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents