NewtonNet: A Newtonian message passing network for deep learning of interatomic potentials and forces
NewtonNet Modules
The core idea behind the iterative message passing of the atomic environments is to update the feature array that represent each atom in its immediate environment. This level of feature representation is invariant to the rotations of the initial configuration in NewtonNet through the following operations.
Atomic Feature Aggregator. We initialize the atomic features based on trainable embedding of atomic numbers , i.e., and . We next use the edge function to represent the interatomic distances using radial Bessel functions as introduced by Klicpera et al.?
where is the cutoff radius and returns the interatomic distance between any atom and . We follow Schutt et al.? in using a self-interaction linear layer to combine the output of radial basis functions with each other. This operation is followed by using an envelop function to implement a continuous radial cutoff around each atom. For this purpose, we use the polynomial function introduced by Klicpera et al.? with the choice of degree of polynomial . Thus, the edge operation is defined as a trainable transformation of relative atom position vectors in the cutoff radius
(1) |
The output of is rotationally invariant as it only depends on the interatomic distances. Following the notation of neural message passing, we define a message function to collect the neighboring information and update atomic features. Here, we tend to pass a symmetric message between any pair of atoms, i.e., the message that is passed between atom and atom are the same in both directions. Thus, we introduce our symmetric message passing by element-wise product between all feature arrays involved in any two-body interaction,
(2) |
where indicates a trainable and differentiable network with a nonlinear activation function SiLU ? after the first layer. Note that the is the same function applied to all atoms. Thus, due to the weight sharing and multiplication of output features of both heads of the two-body interaction, the remain symmetric at each layer of message passing. To complete the feature array aggregator, we use the equation LABEL:eqn:aggregate to simply sum all messages received by central atom from its neighbors . Finally, we update the atomic features at each layer using the sum of received messages,
(3) |
force calculator. So far, we have followed a standard message passing that is invariant to the rotation. We begin to take advantage of directional information starting from the force calculator module. The core idea behind this module is to construct latent force vectors using the Newton’s third law. The third law states that the force that atom exerts on atom is equal and in opposite direction of the force that atom exerts on atom . This is the reason that we intended to introduce a symmetric message passing operator. Thus, we can estimate the symmetric force magnitude as a function of , i.e., . The product of the force magnitude by unit distance vectors gives us antisymmetric interatomic forces that obey the Newton’s third law (note that ),
(4) |
where is a differentiable learned function, and . The total force at each layer on atom is the sum of all the forces from the neighboring atoms in the atomic environment,
(5) |
and updating the latent force vectors at each layer,
(6) |
We ultimately use the latent force vector from the last layer , in the loss function to ensure this latent space truly mimics the underlying physical rules.
To complete the force calculator module, we borrow the idea of continuous filter from Schut et al. to decompose and scale latent force vectors along each dimension using another learned function . This way we can featurize the vector field to avoid too much of abstraction in the structural information that they carry with themselves,
(7) |
As a result, the constructed latent interatomic forces are decomposed by rotationally invariant features along each dimmension, i.e., . We call this type of representation feature vectors. Following the message passing strategy, we update the force feature vectors with after each layer, while they are initialized with zero values, ,
(8) |
momentum calculator. This is the step that we try to estimate a measure of atomic displacement due to the forces that are exerted on them. We accumulate their dispalcements at each layer without updating the position of each atom. The main idea in this module is that the displacement must be along the updated force features in the previous step. Inspired by Newton’s second law, we approximate the displacement factor using a learned function that acts on the current state of each atom presented by its atomic features ,
(9) |
We finally update the displacement feature vectors by and a weighted sum of all the atomic displacements from the previous layer. The weights are estimated based on a trainable function of messages () between atoms,
(10) |
The weight component in this step works like attention mechanism to concentrate on the two-body interactions that cause maximum movement in the atoms. Since forces at are zero, the displacements are also initialized with zero values, i.e., .
energy calculator. The last module contracts the directional information to the rotationally invariant atomic features. Since we developed the previous steps based on the Newton’s equations of motion, one immediate idea is to approximate the potential energy change for each atom using and , considering that . Thus, we find energy change for each atom by
(11) |
where and is a differentiable learned function that operates on the atomic features and predicts the energy coefficient for each atom. The dot product of two feature vectors contracts the features along each dimension to a single feature array. We finally update the atomic features once again using the contracted directional information presented as atomic potential energy change,
(12) |
This approach is both physically and mathematically consistent with the rotational equivariance operations and the goals of our model development. Physically, the energy change is the meaningful addition to the atomic feature arrays as they are used to predict the atomic energies eventually. Mathematically, the dot product of two feature vectors contracts the rotationally equivariant features to invariant features similar to euclidean distance that we used in the atomic feature aggregator module.
Proof of Equivariance and Invariance
We prove that our model is rotationally equivariant on the atomic positions and atomic numbers for a rotation matrix . In the equation 1, the euclidean distance is invariant to the rotation, as it can be shown that
(13) |
which means that the euclidean distance is indifferent to the rotation of the positions as it is quite well-known for this feature. Consequently, feature arrays , , and all the linear or non-linear functions acting on them will result in invariant outputs. The only assumptions for this proof is that a linear combination of vectors or their product with invariant features will remain rotationally equivariant. Base on this assumption we claim that equation 5 to 11 will remain equivariant to the rotations. For instance, the same rotation matrix propagates to equation 5 such that,
(14) |
The last operator, equation 12, will remain invariant to the rotations due to the use of dot product. The proof for the invariant atomic energy changes is that,
(15) |
This is how we contract equivariant features to invariant arrays. The addition of these arrays to atomic features preserves the invariance for the final prediction of atomic contributions to the total potential energy.