betaFeedback

WorksPhysics and Astronomy

Cluster expansion constructed over Jacobi-Legendre polynomials for accurate force fields

Abstract

We introduce a compact cluster expansion method, constructed over Jacobi and Legendre polynomials, to generate highly accurate and flexible machine-learning force fields. The constituent many-body contributions are separated, interpretable and adaptable to replicate the physical knowledge of the system. In fact, the flexibility introduced by the use of the Jacobi polynomials allows us to impose, in a natural way, constrains and symmetries to the cluster expansion. This has the effect of reducing the number of parameters needed for the fit and of enforcing desired behaviours of the potential. For instance, we show that our Jacobi-Legendre cluster expansion can be designed to generate potentials with a repulsive tail at short inter-atomic distances, without the need of imposing any external function. Our method is here continuously compared with available machine-learning potential schemes, such as the atomic cluster expansion and potentials built over the bispectrum. As an example we construct a Jacobi-Legendre potential for carbon, by training a slim and accurate model capable of describing crystalline graphite and diamond, as well as liquid and amorphous elemental carbon.

Introduction

Machine-learning potentials (MLPs) are rapidly becoming the gold standard for molecular dynamics and thermodynamical sampling in materials science [1, 2, 3, 4]. The general idea is that of performing a high-dimension fit of the potential energy surface (PES) computed with an electronic ab-initio method, for instance with density functional theory (DFT), to obtain a numerical atomic energy functional for large-scale simulations. In particular, one aims at using a conveniently limited number of electronic structure data to interpolate the potential energy surface at an accuracy comparable with that of the electronic method itself. MLPs can thus be defined as parametric functions that associate to a given chemical structure the system energy. The mathematical relation between the input features describing a structure, often called descriptors, and the output target can be either linear [5] [6, 7] or non linear [8–10]. Furthermore, the target quantity may be different from the energy and may include electronic properties [11–14], or even tensorial quantities [15].

The specific descriptors choice is crucial to the construction of a MLP. It is commonly agreed that a strategy to drastically reduce the size of the training set and to improve the model accuracy is that of designing descriptors invariant with respect to the symmetries of the target quantity. In the case of the total energy, this results in descriptors, which are invariant for translations, rotations and permutations of identical atoms. In principle, one can then combine any choice of descriptors with any desired machine-learning model, going from simple regressions, to neural networks of various complexity, to kernel-based schemes. Typically, there is a subtle tradeoff between the model complexity, the descriptor type and the size and composition of the dataset needed to construct the MLP. Complex many-body descriptors [16] are usually combined with linear models, while simpler structure representations are used as input to deep-learning algorithms. In both cases, there may be issues of interpretability, namely it is not always transparent what is the level of physics learned by the model itself. As a consequence one often relies on numerical techniques to establish whether a particular atomic configuration is interpolated or extrapolated by the model [17].

In this work we introduce a novel linear model built over a set of descriptors derived from the energy cluster expansion. Our MLP, that we name the Jacobi-Legendre Potential (JLP), is close in spirit to the recently introduced Atomic Cluster Expansion (ACE) [5] [18]. In fact, given the completeness of the ACE [19], one can establish a one-to-one mapping between the two potentials. Importantly, our JLPs adopt internal coordinates, so that they are, in essence, expansions of the NN-body potentials in orthogonal polynomials evaluated on distances and angles between atoms. As such, the JLPs are not affected by issues concerning the invariant coupling of different angular momenta channels [20, 21]. Our use of the internal coordinates is closer to the recently developed Proper Orthogonal Descriptors (PODs) [22, 23]. Here, however, we retain the spherical harmonics formalism by mean of the Legendre polynomials, so that a comparison between the JLPs and the other well-known potentials can be naturally drawn. Our scheme also makes extensive use of Jacobi polynomials, of which the Legendre ones are a particular case.

One of the most important property of MLPs is the achievement of linear scaling with respect to the number of atoms in the neighborhood of a chosen one. Here, we will show that linear scaling can be achieved for the JLPs too and, in doing so, we will establish a link between well-known MLPs and the internal coordinate representation used here.

The use of an explicit expansion over orthogonal and complete polynomials gives several advantages, such as the enforcement of symmetries and local constraints. Indeed, our potentials are constructed so that key properties, such the smooth vanishing contribution at the cut-off radius, arise naturally without the need of introducing ad-hoc cut-off functions. In fact, these properties are enforced by applying constrains on the expansion coefficients. Crucially, the procedure here presented is completely general, so that not only the number of coefficients to learn can be substantially reduced, but also the physical knowledge of the PESs can be introduced, in a natural way.

For instance, a desired feature arising from the choice of the Jacobi polynomials and of the constraining procedure, is that, by appropriately tuning the hyperparameters, a repulsive behaviour naturally emerges for the potential at small distances. This is also obtained without introducing any external repulsive function. Moreover, while it is not generally possible to completely separate the body-order contributions, we formally avoid any mixing between them. This allows us to reconstruct the NN-body functional dependence in terms of the learned coefficients. As a consequence, by combining these two properties, one can introduce an inductive-bias in the models by selecting, for example, only the hyper-parameters that lead to a repulsive short-range behaviour of the two-body interaction. Since small distances are usually absent from the training set, a direct consequence is that the potentials naturally possess a physically meaningful behaviour in this extrapolated regime.

The paper is organized as follows. An extensive Methods section presents in detail each body-order of the expansion, with a discussion on the relevant properties of each term. Then, the potential is fitted to the carbon dataset used to train the GAP17 potential of Reference [24]. The result of the fit on energies, forces and stress are reported. Furthermore, we will close this case study by presenting the phonon dispersion curves for graphene and diamond predicted by the trained JLP model.

Methods

In this section, we introduce the JLPs. This class of potentials is based on the total energy cluster (many-body) expansion. Therefore, after a discussion of the main idea behind such strategy, we will proceed with the systematic introduction of each many-body term and their associated technical details. Note that a similar strategy can be also used to construct JLP-like model for quantities different from the energy, such as the charge density at a particular point in space [25]

Introduction

An overview of the strategy behind the construction of the JLPs is provided in Fig. 1. In general, it is reasonable to assume that a system total energy, EE, can be partitioned into a short- and a long-range contribution. Our proposed MLP accounts only for short-ranged part, EshortE_{\mathrm{short}}, that can be further expanded over terms vanishing at distances larger than a characteristic interaction range. In particular we follow the well-known strategy of a multi-body expansion for the energy and write

Eshort=E1+E2+E3+E4…(1)E_{\mathrm{short}} = E_1 + E_2 + E_3 + E_4 \ldots \tag*{(1)}

Here the single-body contribution, E1E_1, is an energy offset depending on the number of atomic species present in the system, E2E_2 is the two-body (2B) energy, depending only on atoms pairs, E3E_3 is the three-body (3B) energy depending on triplets of atoms and, in general, EnE_n describes the nn-body (nnB) energy term.

A second essential assumption is that we can decompose each of the nnB energy term in local quantities, such that each term can be written as a sum of atom-centered contributions. Explicitly, this writes

En=∑iatomsεi(n),(2)E_n = \sum_i^{\mathrm{atoms}} \varepsilon_i^{(n)}, \tag*{(2)}

with n≥2n \ge2, and where the sum runs over all possible atoms in the system. Each local contribution, εi(n)\varepsilon_i^{(n)}, depends only on the local neighborhood of the ii-th atom (the red atom in Fig. 1), up to a cut-off distance rcutr_{\mathrm{cut}}.

In essence, the JLPs consist of a linear expansion of the εi(n)\varepsilon_i^{(n)} contributions. As such, at the core, the JLP is closely related to linear MLPs such as the Spectral Neighbour Analysis Potential (SNAP)[6], the Moment Tensor Potentials (MTPs) [7], and the Atomic Cluster Expansion (ACE) [5] [18]. Since the successful generalization of the coupling scheme of the powerspectrum (a 3B representation) and the bispectrum (a 4B representation) [20, 21] to any higher-body order, first introduced in the ACE potentials, all new potentials build from the same set of assumptions (many-body expansion of the energy and locality), differ in the way of constructing the basis functions, or on the introduction of completely new basis sets [1, 2]. The JLPs are not different in this regards. Based on a particular choice of basis functions (radial and angular), they are also complete, so that a one-to-one mapping between the terms of a JLP and the analogous ones of the ACE is possible. In particular, as the name suggests, we chose the Jacobi polynomials as radial basis and the Legendre polynomials as the angular one.

The choice of Jacobi polynomials [26], Pn(α,β)(x)P_n^{(\alpha,\beta)}(x), is motivated by their dependence on the two real parameters, α\alpha and β\beta, which can lead to a broad selection of different orthogonal polynomials. Two classical examples are the Legendre polynomials (α=β=0\alpha= \beta= 0) and the Chebyshev polynomials of the second kind (α=β=1/2\alpha= \beta= 1/2). Thus, treating α\alpha and β\beta as hyper-parameters allows one to optimize the radial basis set, and removes the need for manually choosing the best basis. In contrast, we have chosen the Legendre polynomials not only since they lead to a certain homogeneity in the representation (being the Legendre polynomials a particular instance of the Jacobi ones), but also for their strong relation with the spherical harmonics. This means that a spherical harmonics decomposition can always be performed, a key feature for achieving computational-linear scaling with respect to the number of atoms (neighbours) inside the interaction cut-off sphere.

Workflow of the linear model, showing two-body, three-body, and four-body terms, distance and angle expansions, Jacobi polynomials, local constraints, and Legendre polynomials

Figure 1. The workflow of the linear model presented in this work. We first decompose the total energy over the terms of a local multi-body expansion, as in Eq. (1). Each contribution is then further expanded over atomic contributions [Eq. (2)], εi(n)\varepsilon_i^{(n)}, which depend on the distances and the angles between a central atom (in red) and atoms in its neighborhood (in black). For instance, the two-body term consists only of one distance, the three-body one of two distances and one angle, etc. By assuming short-range interaction, the distances are then mapped onto the interval [−1,1][-1,1], so that each distance-dependent term can be expanded as products of Jacobi polynomials. The angles are then mapped onto scalar products, so that the functional dependence on the angles can be similarly expanded in terms of Legendre polynomials. Crucially, the expansions on the distances is locally constrained, so that effective polynomials will be employed in place of the Jacobi polynomials.

After performing the expansion over the chosen basis, we will present a general way for constraining the expansion coefficients, so that known physical (and local) properties of the system can be encoded directly in the descriptors at any body order. As a bi-product of applying the constrain on Jacobi polynomials, we will show the natural emergence of the widely-used cut-off function, fc=(1−cos⁡(x))/2f_c = (1-\cos(x))/2. As far as we know, this is the only case in which a cut-off function, fcf_c, is not externally imposed on the basis set, but instead emerges naturally from the formalism.

Finally, since it has been proved that all four-body descriptors mentioned before are not complete, in the sense that one could find two distinct local environments with the same set of descriptors [27], or manifold with slow-varying fingerprints with respect to a similarity measure [28, 29], we will explicitly investigate the JLP up to the five-body order term, E5E_5. We will then briefly discuss that the internal coordinates constitute an over-complete set at the five-body level, so that the coupling introduced in ACE is preferred to the one presented here. However, we anticipate that the choice of the Jacobi polynomial as a basis set, and the associated constraining procedure, can be applied also to other potentials. Indeed, they can be exported easily to other multi-body expansion approaches, so that, for example, one could use the constrained-Jacobi basis as a radial basis for ACE.

First five Jacobi polynomials

Figure 2. First five Jacobi polynomials, Pn(α,β)P_n^{(\alpha,\beta)}, with α=β=1\alpha= \beta= 1. In the plot the functions are composed with a cosine, so to give a better idea of the representation used in the expansion of Eq. (8). It can be appreciated how the derivative is zero at both edges of the domain.

The Two-Body Term

In this section we introduce the expansion of the two-body energy term, E2E_2. Since the total energy is a scalar, it must be invariant under translations and rotations of the reference frame. A possible way to satisfy such invariance is to assume that the energy depends only on the distances between atom pairs, and that this dependency is realized by a continuous function (potential), v(2)v^{(2)}. Furthermore, we assume that the actual functional form depends only on the atomic species of the atoms involved, so that, if ZiZ_i is the atomic number of the atom located at the position ri\mathbf{r}_i, and rji=∣rj−ri∣r_{ji} = \lvert\mathbf{r}_j - \mathbf{r}_i \rvert, we have

v(2)≡v(2)(rji;Zj,Zi)≡vZjZi(2)(rji),(3)v^{(2)} \equiv v^{(2)}(r_{ji}; Z_j, Z_i) \equiv v_{Z_j Z_i}^{(2)}(r_{ji}), \tag*{(3)}

and

E2=∑i∑j≠ivZjZi(2)(rji).(4)E_2 = \sum_i \sum_{j \ne i} v_{Z_j Z_i}^{(2)}(r_{ji}). \tag*{(4)}

The two-body potentials, vZjZi(2)v_{Z_j Z_i}^{(2)}, is thus defined symmetric under the exchange Zj↔ZiZ_j \leftrightarrow Z_i, namely vZjZi(2)=vZiZj(2)v_{Z_j Z_i}^{(2)} = v_{Z_i Z_j}^{(2)}. Note that, in principle, one can still explicitly distinguish nonequivalent atoms belonging to the same specie, by introducing “virtual” species.

It is useful to remark that the 2B term in Eq. (4) can be re-casted in the form of Eq. (2), where εi=∑j≠ivZjZi(2)(rji)\varepsilon_i = \sum_{j \ne i} v_{Z_j Z_i}^{(2)}(r_{ji}) is the energy associated to the ii-th atom resulting from the pairwise interaction with its local atomic neighbourhood. Note that that these local contributions are well defined because of the short-ranged

nature of the interaction. Thus, there exists a natural cut-off radius rcutr_{\mathrm{cut}}, such that vZjZi(2)(rji)≃0v_{Z_j Z_i}^{(2)}(r_{ji}) \simeq0 for rji>rcutr_{ji} > r_{\mathrm{cut}}.

We now provide the proposed expansion for the potentials vZjZi(2)v_{Z_j Z_i}^{(2)}, followed by its derivation. The expansion is

vZjZi(2)(rji)=∑n=1nmax⁡anZjZiP~n(α,β)(cos⁡(πrji−rmin⁡rcut−rmin⁡)),(5)v_{Z_j Z_i}^{(2)}(r_{ji}) = \sum_{n=1}^{n_{\max}} a_n^{Z_j Z_i} \widetilde{P}_n^{(\alpha,\beta)}\left(\cos\left(\pi\frac{r_{ji} - r_{\min}}{r_{\mathrm{cut}} - r_{\min}}\right)\right), \tag*{(5)}

where the sum is truncated to a suitable polynomial order, nmax⁡n_{\max}, and where anZjZia_n^{Z_j Z_i} are the expansion coefficients for the nn-th order. The vanishing-Jacobi polynomials, P~n(α,β)\widetilde{P}_n^{(\alpha,\beta)}, employed here are defined in terms of the Jacobi polynomials, Pn(α,β)P_n^{(\alpha,\beta)}, as

P~n(α,β)(x)=Pn(α,β)(x)−Pn(α,β)(−1)for −1≤x≤1,(6)\widetilde{P}_n^{(\alpha,\beta)}(x) = P_n^{(\alpha,\beta)}(x) - P_n^{(\alpha,\beta)}(-1) \quad\text{for } -1 \le x \le1, \tag*{(6)}

for n≥1n \ge1. Thus, the P~n(α,β)\widetilde{P}_n^{(\alpha,\beta)} have the property to vanish at the right-hand side extreme of their domain, namely at rcutr_{\mathrm{cut}}. The Jacobi polynomials are shown in Fig. (2), while the corresponding vanishing-Jacobi polynomials are in Figure 3. The expansion presents five hyper-parameters, α\alpha, β\beta, rcutr_{\mathrm{cut}}, rmin⁡r_{\min} and nmax⁡n_{\max}, with α\alpha and β\beta being real numbers greater than −1-1. We will refer to Eq. (5) as the 2B-Jacobi-Legendre (2B-JL) expansion.

First five vanishing-Jacobi polynomials

Figure 3. First five vanishing-Jacobi polynomials, P~n(α,β)\widetilde{P}_n^{(\alpha,\beta)} (α=β=1\alpha= \beta= 1) as defined in Eq. (6), derived from the Jacobi polynomials of Fig. 2. These polynomials are constrained to vanish at the right-hand side edge of the domain.

At this point, it should be noted that there can be a different set of hyper-parameters for each different atomic species. As such, in the case of many-species compounds the hyper-parameter space can potentially become rather large. Then, it may be desirable to take system-based approximations or to perform features selection.

We will now present the arguments leading to Eq. (5). In order to make the formalism more readable, we define the compact notation

P~nji(α,β)≡P~n(α,β)(cos⁡(πrji−rmin⁡rcut−rmin⁡))(7)\widetilde{P}_{nji}^{(\alpha,\beta)} \equiv\widetilde{P}_{n}^{(\alpha,\beta)}\left(\cos\left(\pi\frac{r_{ji}-r_{\min}}{r_{\mathrm{cut}}-r_{\min}}\right)\right) \tag*{(7)}

which will be widely used throughout this work. As already remarked, the potentials should vanish for distances larger than the interaction cut-off radius. With only this constrain in mind, we can expand the potential in terms of Jacobi polynomials as

v(2)(r)=∑n=0nmax⁡anPn(α,β)(cos⁡(πr/rcut))(8)v^{(2)}(r)=\sum_{n=0}^{n_{\max}}a_nP_n^{(\alpha,\beta)}\left(\cos\left(\pi r/r_{\mathrm{cut}}\right)\right) \tag*{(8)}

where, for simplicity, we set rmin⁡=0r_{\min}=0 and omit the explicit dependence on the atomic species.

We have chosen the Jacobi polynomials, Pn(α,β)(x)P_n^{(\alpha,\beta)}(x), since they are complete and orthogonal over the interval x∈[−1,1]x\in[-1,1]. Furthermore, as already noted, their generality, parameterised through the real coefficients α\alpha and β\beta, allows one to perform automatic searches of the most efficient basis set, without any additional hypothesis. We found that, in most cases, there is a large range of optimal α\alpha and β\beta values, so that we usually reduce the number of hyper-parameters by constraining the search to α=β\alpha=\beta.

Note that we are not introducing any cut-off function in the expansion to force a smooth-vanishing behaviour at the cut-off radius. Also, the a0a_0 coefficient is not present in the sum of Eq. (5), while still appears in Eq. (8). We will now impose the right behaviour on the expansion coefficients, so that the resulting potential vanishes by construction at the cut-off radius. The result of this approach is similar, in a sense, to models with naturally vanishing radial functions, such as the Spherical-Bessel descriptors [30]. Explicitly, we constrain the expression in Eq. (8) to satisfy the condition v(2)(rcut)=0v^{(2)}(r_{\mathrm{cut}})=0. Then, since P0(α,β)=1P_0^{(\alpha,\beta)}=1, we obtain that the first coefficient must satisfy

References

  1. [1]D. A. Varshalovich, A. N. Moskalev, and V. K. Khersonskii, Quantum Theory of Angular Momentum (World Scientific, Singapore, 1988).DOI
  2. [2]R. Drautz, Atomic cluster expansion for accurate and transferable interatomic potentials, Phys. Rev. B 99, 014104 (2019).DOI
  3. [3]M. Abramowitz and I. Stegun, Handbook of Mathematical Functions, Dover, Mineola, NY, (1972), ch. 22.
  4. [4]A. P. Bartók, R. Kondor, and G. Csányi, On representing chemical environments, Phys. Rev. B 87, 184115 (2013).DOI
  5. [5]V. L. Deringer and G. Csányi, Machine learning based interatomic potential for amorphous carbon, Phys. Rev. B 95, 094203 (2017).DOI

Paper details

vlnc:W_r2p2dzg9
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