Graph Neural Network with Local Frame for Molecular Potential Energy Surface
Abstract
Modeling molecular potential energy surface is of pivotal importance in science.
Graph Neural Networks have shown great success in this field.
However, their message passing schemes need special designs to capture geometric information and fulfill symmetry requirement like rotation equivariance, leading to complicated architectures.
To avoid these designs, we introduce a novel local frame method to molecule representation learning and analyze its expressivity.
Projected onto a frame, equivariant features like 3D coordinates are converted to invariant features, so that we can capture geometric information with these projections and decouple the symmetry requirement from GNN design.
Theoretically, we prove that given non-degenerate frames, even ordinary GNNs can encode molecules injectively and reach maximum expressivity with coordinate projection and frame-frame projection.
In experiments, our model uses a simple ordinary GNN architecture yet achieves state-of-the-art accuracy.
The simpler architecture also leads to higher scalability.
Our model only takes about 30% inference time and 10% GPU memory compared to the most efficient baselines.
Introduction
Prediction of molecular properties is widely used in fields such as material searching, drug designing, and understanding chemical reactions [1].
Among properties, potential energy surface (PES) [2], the relationship between the energy of a molecule and its geometry, is of pivotal importance as it can determine the dynamics of molecular systems and many other properties.
Many computational chemistry methods have been developed for the prediction, but few can achieve both high precision and scalability.
In recent years, machine learning (ML) methods have emerged, which are both accurate and efficient.
Graph Neural Networks (GNNs) are promising among these ML methods.
They have improved continuously [3–10] and achieved state-of-the-art performance on many benchmark datasets.
Compared with popular GNNs used in other graph tasks [11], these models need special designs, as molecules are more than a graph composed of merely nodes and edges.
Atoms are in the continuous 3D space, and the prediction targets like energy are sensitive to the coordinates of atoms.
Therefore, GNNs for molecules must include geometric information.
Moreover, these models should keep the symmetry of the target properties for generalization.
For example, the energy prediction should be invariant to the coordinate transformations in O(3) group, like rotation and reflection.
All existing methods can keep the invariance.
Some models [4, 5, 8] use hand-crafted invariant features like distance, angle, and dihedral angle as the input of GNN.
Others use equivariant representations, which change with the coordinate transformations.
Among them, some [6, 9, 12] use irreducible representations of the SO (3) group.
The other models [7, 10] manually design functions for equivariant and invariant representations.
All these methods can keep invariance, but they vary [Figure] in performance.
Therefore, expressivity analysis is necessary.
However, the symmetry requirement hinders the application of the existing theoretical framework for ordinary GNNs [13].
By using the local frame, we decouple the symmetry requirement.
As shown in Figure 1, our model, namely GNN-LF , first produces a frame (a set of bases of R 3 space) equivariant to O (3) transformations.
Then it projects the relative positions and frames of neighbor atoms on the frame as the edge features.
Therefore, an ordinary GNN with no special design for symmetry can work on the graph with only invariant features.
The expressivity of the GNN for molecules can also be proved using a framework for ordinary GNNs [13].
As the GNN needs no special design for symmetry, GNN-LF also has a simpler architecture and, thus, better scalability.
Our model achieves state-of-the-art performance on the MD17 and QM9 datasets.
It also uses only 30% time and 10%
GPU memory than the fastest baseline on the PES task.
Preliminaries
Ordinary GNN.
Message passing neural network (MPNN) [14] is a common framework of GNNs.
For each node, a message passing layer aggregates information from neighbors to update the node representations.
The k th layer can be formulated as follows.
[Equation]
where h ( k ) v is the representations of node v at the k th layer, N ( v ) is the set of neighbors of v , h (0) v is the node v ’s features,
e uv is the features of edge uv , and U ( k ) , M ( k ) are some functions.
Xu et al.
[13] provide a theoretical framework for the expressivity of ordinary GNNs.
One message passing layer can encode neighbor nodes injectively and then reaches maximum expressivity.
With several message passing layers, MPNN can learn the information of multi-hop neighbors.
Modeling PES.
PES is the relationship between molecular energy and geometry.
Given a molecule with N atoms, our model takes the kinds of atoms z ∈ Z N and the 3D coordinates of atoms ⃗r ∈ R N × 3 as input to predict the energy ˆ E ∈ R of this molecule.
It can also predict the force ˆ ⃗ F ∈ R N × 3 = −∇ ⃗r ˆ E .
Equivariance.
To formalized the symmetry requirement, we define equivariant and invariant functions as in [15].
Definition 2.1.
Given a function h : X → Y and a group G acting on X and Y as ⋆ .
We say that h is
[Equation]
The energy is invariant to the permutation of atoms, coordinates’ translations, and coordinates’ orthogonal transformations (rotations and reflections).
GNN naturally keeps the permutation invariance.
As the relative position ⃗r ij = ⃗r i − ⃗r j ∈ R 1 × 3 , which is invariant to translation, is used as the input to
GNNs, the translation invariance can also be ensured.
So we focus on orthogonal transformations.
Orthogonal transformations of coordinates form the group O (3) =
{ Q ∈ R 3 × 3 | QQ T
= I } , where
I is the identity matrix.
Representations are considered as functions of z and ⃗r , so we can define equivariant and invariant representations.
Definition 2.2.
Representation s is called an invariant representation if s ( z,⃗r ) =
s ( z,⃗ro T ) , ∀ o ∈
O (3) , z ∈ Z N ,
⃗r ∈ R N × 3 .
Representation ⃗v is called an equivariant representation
if ⃗v ( z,⃗r ) o T = ⃗v ( z,⃗ro T ) , ∀ o ∈ O (3) , z ∈ Z N ,⃗r ∈ R N × 3 .
Invariant and equivariant representations are also called scalar and vector representations respectively in some previous work [7].
Frame is a special kind of equivariant representation.
Through our theoretical analysis, frame ⃗E is an orthogonal matrix in R 3 × 3 , ⃗E ⃗E T
=
I .
GNN-LF generates a frame ⃗E i ∈ R 3 × 3 for each node i .
We will discuss how to generate the frames in Section 5.
In Lemma 2.1, we introduce some basic operations of representations.
Lemma 2.1.
• Any function of invariant representation s will produce an invariant representation.
• Let s ∈ R F denote an invariant representation, ⃗v ∈ R F × 3 denote an equivariant representation.
We define s · ⃗v ∈ R F × 3 as a matrix whose ( i, j ) th element is s i ⃗v ij .
When ⃗v ∈ R 1 × 3 , we first broadcast it along the first dimension.
Then the output is also an equivariant representation.
• Let ⃗v ∈ R F × 3 denote an equivariant representation.
⃗E ∈ R 3 × 3 denotes an equivariant frame.
The projection of ⃗v to ⃗E , denoted as P ⃗E ( ⃗v ) := ⃗v ⃗E T , is an invariant representation in R F × 3 .
For ⃗v , P ⃗E is a bijective function.
Its inverse P − 1 ⃗E convert an invariant representation s ∈ R F × 3 to an equivariant representation in R F × 3 , P − 1 ⃗E ( s ) =
s ⃗E .
• Projection of ⃗v to a general equivariant representation ⃗v ′ ∈ R F ′ × 3 is an invariant representation in R F × F ′ , P ⃗v ′ ( ⃗v ) =
⃗v⃗v ′ T .
Local Environment.
Most PES models set a cutoff radius r c and encode the local environment of each atom as defined in Definition 2.3.
Definition 2.3.
Let r ij denote
|| ⃗r
ij || .
The local environment of atom i is LE i
= { ( s j ,⃗r ij )
| r ij < r c } , the set of invariant atom features s j (like atomic numbers) and relative positions ⃗r ij of atoms j within the sphere centered at i with cutoff distance r c , where r c is usually a hyperparameter.
In this work, orthogonal transformation of a set/sequence means transforming each element in the set/sequence.
For example, an orthogonal transformation o will map { ( s j ,⃗r ij ) | r ij < r c } to { ( s j ,⃗r ij o T ) | r ij < r c } .
Related work
We classify existing ML models for PES into two classes: manual descriptors and GNNs.
GNN-LF outperforms the representative of each kind in experiments.
Manual Descriptor.
These models first use manually designed functions with few learnable parameters to convert one molecule to a descriptor vector and then feed the vector into some ordinary ML models like kernel regression [16–18] and neural network [19–21] to produce the prediction.
These methods are more scalable and data-efficient than GNNs.
However, due to the hard-coded descriptors, they are less accurate and cannot process variable-size molecules or different kinds of atoms.
GNN.
These GNNs mainly differ in the way to incorporate geometric information.
Invariant models use rotation-invariant geometric features only.
Schutt et al.
[3] and Schütt et al.
[4] only consider the distance between atoms.
Klicpera et al.
[5] introduce angular features, and Gasteiger et al.
[8] further use dihedral angles.
Similar to GNN-LF, the input of the GNN is invariant.
However, the features are largely hand-crafted and are not expressive enough, while our projections on frames are learnable and provably expressive.
Moreover, as some features are of multiple atoms (for example, angle is a feature of three-atom tuple), the message passing scheme passes messages between node tuples rather than nodes, while GNN-LF uses an ordinary GNN with lower time complexity.
Recent works have also utilized equivariant features, which will change as the input coordinates rotate.
Some [6, 9, 12, 22] are based on irreducible representations of the SO (3) group .
Though having certain theoretical expressivity guarantees [23], these methods and analyses are based on polynomial approximation.
High-order tensors are needed to approximate complex functions like high-order polynomials.
However, in implementation, only low-order tensors are used, and these models’ empirical performance is not high.
Other works [7, 10] model equivariant interactions in Cartesian space using both invariant and equivariant representations.
They achieve good empirical performance but have no theoretical guarantees.
Different sets of functions must be designed separately for different input and output types (invariant or equivariant representations), so their architectures are also complex.
Our work adopts a completely different approach.
We introduce O (3) -equivariant frames and project all equivariant features on the frames.
The expressivity can be proved using the existing framework [13] and needs no high-order tensors.
Frame models .
Some of existing methods [24, 25] designed for other tasks also use frame to decouple the symmetry requirement.
However, in conclusion, these methods differ significantly from ours in task, theory, and method as follows.
• Most target properties of molecules are O(3)-equivariant or invariant (including energy and force).
Our model can fully describe symmetry, while existing "frame" models cannot.
For example, a molecule and its mirroring must have the same energy, and GNN-LF will produce the same prediction while existing models cannot keep the invariance.
• Our theoretical analysis removes group representation used in [23, 26].
• Existing models use some schemes not learnable to initialize frames and update them.
GNN-LF uses a learnable message passing scheme to produce frames and will not update them, leading to simpler architecture and lower overhead.
The comparison is detailed in Appendix F.
How frames boost expressivity?
Though symmetry imposes constraints on our design, our primary focus is expressivity.
Therefore, we only discuss how the frame boosts expressivity in this section.
Our methods, implementations, and how our model keeps invariance will be detailed in Section 6 and Appendix J. We assume the existence of frames in this section and will discuss it in Section 5.
All proofs are in Appendix A.
4.1 Decoupling symmetry requirement
Though equivariant representations have been used for a long time, it is still unclear how to transform them ideally.
Existing methods [7, 10, 15, 27] either have no theoretical guarantee or tend to use too many parameters.
This section asks a fundamental question: can we use invariant representations instead of equivariant ones and keep expressivity?
Given any frame ⃗E , the projection P ⃗E ( ⃗x ) will contain all the information of the input equivariant feature ⃗x , because the inverse projection function can resume ⃗x from projection, P − 1 ⃗E ( P ⃗E ( ⃗x ))
=
⃗x .
Therefore, we can use P ⃗E and P − 1 ⃗E to change the type (invariant or equivariant representation) of input and output of any function without information loss.
Proposition 4.1.
Given frame ⃗E and any equivariant function g , there exists a function ˜
g =
P ⃗E ◦ g ◦ P − 1 ⃗E which takes invariant representations as input and outputs invariant representations, where ◦ is function composition.
g can be expressed with ˜ g : g = P − 1 ⃗E ◦ ˜
g ◦ P ⃗E .
We can use a multilayer perceptron (MLP) to approximate the function ˜ g and thus achieving universal approximation for all O (3) -equivariant functions.
Proposition 4.1 motivates us to transform equivariant representations to projections in the beginning and then fully operate on the invariant representation space.
Invariant representations can also be transformed back to equivariant prediction with inverse projection operation if necessary.
4.2 Projection boosts message passing layer
The previous section discusses how projection decouples the symmetry requirement.
This section shows that projections contain rich geometry information.
Even ordinary GNNs can reach maximum expressivity with projections on frames, while existing models with hand-crafted invariant features [Figure] are not expressive enough.
The discussion is composed of two parts.
Coordinate projection boosts the expressivity of one single message passing layer, and frame-frame projection boosts the whole
GNN composed of multiple message passing layers.
Note that in this section, we consider input x 1 , x 2 (local environment or the whole molecule) as equal if they can interconvert with some orthogonal transformation ( ∃ o ∈ O(3) , o ( x 1 ) = x 2 ), because the invariant representations and energy prediction are invariant under O(3) transformation.
Therefore, injective mapping and maximum expressivity mean that function can differentiate inputs unequal in this sense.
Encoding local environment.
Similar to that MPNN can encode neighbor nodes injectively on the graph, GNN-LF can encode neighbor nodes injectively in 3D space.
Other models can also be analyzed from an encoding local environments perspective.
GNNs for PES only collect messages from atoms within the sphere of radius r c , so one message passing layer of them is equivalent to encoding the local environments in Definition 2.3.
When mapping local environments injectively , a single message passing layer reaches maximum expressivity.
Some popular models are under-expressive.
For example, as shown in Figure 2a, SchNet [4] only considers the distance between atoms and neglects the angular information, leading to the inability to differentiate some simple local environments.
Moreover, Figure 2b illustrates that though DimeNet [5] adds angular information to message passing, its expressivity is still limited, which may be attributed to the loss of high-order geometric information like dihedral angle.
In contrast, no information loss will happen when we use the coordinates projected on the frame.
Theorem 4.1.
There exists a function χ .
Given a frame ⃗E i of the atom i , χ encodes the local environment of atom i injectively into atom i’s embeddings.
[Equation]
Theorem 4.1 shows that an ordinary message passing layer can encode local environments injectively with coordinate projection as an edge feature.
Passing messages across local environments.
In physics, interaction between distant atoms is usually not negligible.
Using one single message passing layer, which encodes atoms within cutoff radius only, leads to loss of such interaction.
When using multiple message passing layers, GNN can pass messages between two distant atoms along a path of atoms and thus model the interaction.
However, passing messages in multiple steps may lead to loss of information.
For example, in Figure 2c, two molecules are different as a part of the molecule rotates.
However, the local environment will not change.
So the node representations, the messages passed between nodes, and finally, the energy prediction will not change while two molecules have different energy.
This problem will also happen in previous PES models [4, 5].
Loss of information in multi-step message passing is a fundamental and challenging problem even for ordinary GNN [13].
Nevertheless, the solution is simple in this special case.
We can eliminate the information loss by frame-frame projection , i.e., projecting ⃗E
i (the frame of atom j ) on ⃗E j (the frame of atom i ).
For example, in Figure 2c, as the molecule rotates, frame vectors also rotate, leading to frameframe projection change, so our model can differentiate them.
We also prove the effectiveness of frame-frame projection in theory.
Theorem 4.2.
Let G denote the graph in which node i represents the atom i and edge ij exists iff r ij < r c , where r c is the cutoff radius.
Assuming frames exist, if G is a connected graph whose diameter is L , GNN with L message passing layers as follows can encode the whole molecule { ( s j ,⃗r ij ) | j ∈ { 1 , 2 , ..., n }} injectively into the embedding of node i .
[Equation]
Theorem 4.2 shows that an ordinary GNN can encode the whole molecule injectively with coordinate projection and frame-frame projection as edge features.
In conclusion, when frames exist, even ordinary GNN can encode molecule injectively and thus reach maximum expressivity with coordinate projection and frame-frame projection.
How to build a frame?
We propose frame generation method after discussing how to use frames because generation method’s connection to expressivity is less direct.
Whatever frame generation method is used, GNN-LF can keep expressivity as long as the frame does not degenerate.
A frame degenerates iff it has less than three linearly independent vectors.
This section provides one feasible frame generation method.
A straightforward idea is produce frames using invariant features of each atom, like the atomic number.
However, function of invariant features must be invariant representations rather than equivariant frames.
Therefore, we consider producing the frame from the local environment of each atom, which contains equivariant 3D coordinates.
In Theorem 5.1, we prove that there exists a function mapping the local environment to an O (3) -equivariant frame.
Theorem 5.1.
There exists an O (3) -equivariant function g mapping the local environment LE i to an equivariant representation in R 3 × 3 .
The output forms a frame if ∀ o ∈ O (3) , o
̸
= I, o ( LE i ) ̸
=
LE i .
Proof is in Appendix A.5.
Frames produced by the function in Theorem 5.1 will not degenerate if local environments have no symmetry elements, like inversion centers, rotation axes, or mirror planes.
Building a frame for a symmetric local environment remains a problem in our current implementation but will not seriously hamper our model .
Firstly, our model can produce reasonable output even with symmetric input and is provably more expressive than a widely used model SchNet [4] (see
Appendix G).
Secondly, symmetric molecules are rare and form a zero-measure set.
In our two representative real-world datasets, less than 0 .
01% of molecules (about ten molecules in the whole datasets of several hundred thousand molecules) are symmetric.
Thirdly, symmetric geometry may be captured with a degenerate frame.
As shown in Figure 3a, water is a symmetric molecule.
We can use a frame with one vector to describe its geometry.
Based on node identity features and relational pooling [28], we also propose a scheme in Appendix H to completely solve the expressivity loss caused by degeneration.
However, for scalability, we do not use it in GNN-LF.
A message passing layer for frame generation.
The existence of the frame generation function is proved in Theorem 4.2.
Here we demonstrate how to implement it.
There exists a universal framework for approximating O (3) -equivariant functions [15] which can be used to implement the function in Theorem 5.1.
For scalability, we use a simplified form of that framework which has empirically good performance:
[Equation]
6) where g ′ maps invariant features and distance to invariant weights and the entire framework reduces to a message passing process.
The derivation is detailed in Appendix B.
Local frame vs global frame.
With the message passing framework in Equation 6, an individual frame, called local frame , is produced for each atom.
These local frames can also be summed to
[Figure]
produce
[Equation]
The global frame can replace local frames and keep the invariance of energy prediction.
All previous analysis will still be valid if the frame degeneration does not happen.
However, the global frame is more likely to degenerate than local frames.
As shown in Figure 3b, the benzene molecule has central symmetry and produces a zero global frame.
However, when choosing each atom as the center, the central symmetry is broken, and a non-zero local frame can be produced.
We further formalize this intuition and prove that the global frame is more likely to degenerate in Appendix I.
In conclusion, we can generate local frames with a message passing layer .
GNN with local frame
We formally introduce our GNN with local frame (GNN-LF) model.
The whole architecture is detailed in Appendix C. The time and space complexity are O
( Nn ) , where N is the number of atoms in the molecule, and n is the maximum number of neighbor atoms of one atom.
Notations.
Let F denote the hidden dimension.
We first convert the input features, coordinates ⃗r ∈ R N × 3 and atomic numbers z ∈ N N , to a graph.
The initial node feature s (0) i ∈
R F is an embedding of the atomic number z i .
Edge ij has two features: the edge weight w ij = cutoff ( r ij ) (where cutoff means the cutoff function), and the radial basis expansion of the distance d 0 ij = rbf ( r ij ) .
Edge weight w ij is not necessary for expressivity.
However, to ensure that the energy prediction is a smooth function of coordinates, messages passed among atoms must be scaled with w ij [19].
These special functions are detailed in Appendix C.
Producing frame.
The message passing scheme for producing local frames implements Equation (6).
[Equation]
where f 1 is an MLP.
Note that frame ⃗E i ∈ R F × 3 in implementation is not restricted to have three vectors.
The number of vectors equals the hidden dimension.
The frame in R F × 3 can be considered as an ensemble of F 3 frames in R 3 × 3 , so this design will not hamper the expressivity.
Coordinate projection is as follows,
[Equation]
The projection in implementation is scaled by 1 r ij to decouple the distance information in s ( e ) ij .
Frame-frame projection .
⃗E i ⃗E
Tj is a large matrix.
Therefore, we only use the diagonal elements of the projection.
To keep the expressivity, we transform the frame with two ordinary linear layers.
[Equation]
Adding the projections to edge features, we get a graph with invariant features only.
GNN working on the invariant graph .
The message passing scheme uses the form in Theorem 4.1.
Let the s ( l ) i denote the node representations produced by the l th message passing layers.
s (0)
i
[Equation]
where ρ is an MLP.
We further use a filter decomposition design as follows.
[Equation]
The distance information d 0 ij is easier to learn as it has been expanded with a set of bases, so a linear layer g 1 is enough.
In contrast, projections need a more expressive MLP g 2 .
Sharing filters.
Generating different filters f 2 ( d 0 ij , d 1 ij , d 2 ij ) for each message passing layer is timeconsuming.
Therefore, we share filters between different layers.
Experimental results show that sharing filters leads to minor performance loss and significant scalability gain.
Gaps between the implementation and expressivity analysis.
Unlike the expressivity analysis in section 4, GNN-LF in implementation uses an ensemble of frames instead of only one, takes a different form of frame-frame projection, and does not constrain the generated frames to be orthogonal.
In conclusion, experimental results show that GNN-LF with a single frame for each node can still achieve outstanding performance, and these implementation tricks are harmless to expressivity in theory.
The discussion is detailed in Appendix M.
Experiment
In this section, we compare GNN-LF with existing models and do an ablation analysis.
Experimental settings are detailed in Appendix D.
The code is available at https://github.com/GraphPKU/
GNN-LF .
We report the mean absolute error (MAE) on the test set (the lower, the better).
All our results are averaged over three random splits.
Baselines’ results are from their papers.
The best and the second best results are shown in bold and underline respectively in tables.
7.1 Modeling PES
We first evaluate GNN-LF for modeling PES on the MD17 dataset [29], which consists of MD trajectories of small organic molecules.
GNN-LF is compared with a manual descriptor model: FCHL [18] , invariant models: SchNet [4], DimeNet [5], GemNet [8], a model using irreducible representations:
NequIP [9], and models using equivariant representations: PaiNN [7] and TorchMD [10].
The results are shown in Table 1.
GNN-LF outperforms all the baselines on 9 / 16 targets and achieves the second-best performance on other 6 targets.
Our model leads to 10% lower loss on average than
GemNet, the best baseline.
The outstanding performance verifies the effectiveness of the local frame method for modeling PES.
Moreover, our model also uses fewer parameters and only about 30% time and 10% GPU memory compared with the baselines as shown in Appendix E.
7.2 Ablation study
We perform an ablation study to verify our model designs.
The results are shown in Table 2.
On average, ablation of frame-frame projection (NoDir2) leads to 18% higher MAE, which verifies the necessity of frame-frame projection.
The column Global replaces the local frames with the global frame, resulting in 100% higher loss, which verifies local frames’ advantages over global frame.
Ablation of filter decomposition (NoDecomp) leads to 10% higher loss, indicating the advantage of separately processing distance and projections.
Although using different filters for each message passing layer (NoShare) uses much more computation time ( 1 . 67 × ) and parameters ( 3 . 55 × ), it only leads to 0 .
01% lower loss on average, illustrating that sharing filters does little harm to the expressivity.
7.3 Other chemical properties
Though designed for PES, our model can also predict other properties directly.
The QM9 dataset [30] consists of 134k stable small organic molecules.
The task is to use the atomic numbers and coordinates to predict properties of these molecules.
We compare our model with invariant models:
[Table] [Table]
SchNet [4], DimeNet++ [31], ComENet [32], a model using irreducible representations: Cormorant [6], SE(3)-Transformer [22]
[Table]
and models using equivariant representations: EGNN [33],
PaiNN [7] and TorchMD [10].
Results are shown in Table 3.
Our model outperforms all other models on 7 / 12 tasks and achieves the second-best performance on 4 / 5 left tasks, which illustrates that the local frame method has the potential to be applied to other fields.
Conclusion
This paper proposes GNN-LF, a simple and effective molecular potential energy surface model.
It introduces a novel local frame method to decouple the symmetry requirement and capture rich geometric information.
In theory, we prove that even ordinary GNNs can reach maximum expressivity with the local frame method.
Furthermore, we propose ways to construct local frames.
In experiments,
[Table]
our model outperforms all baselines in both scalability (using only 30% time and 10% GPU memory) and accuracy ( 10% lower loss).
Ablation study also verifies the effectiveness of our designs.
A Proofs
Due to repulsive force, atoms cannot be too close to each other in stable molecules.
Therefore, we assume that there exist an upper bound N of the number of neighbor atoms.
A.1 Proof of Lemma 2.
Proof.
For all function g , invariant representation s , transformation o ∈
O
(3) , g ( s ( z,⃗ro T ))
=
g ( s ) .
Therefore, g ( s ) is an invariant representation.
For all invariant representation s , equivariant representation ⃗v , and transformation o ∈ O (3) ,
[Equation]
Therefore, s · ⃗v is an equivariant representation.
For all equivariant representations ⃗v ,
[Equation]
P ⃗E is inversible because
[Equation]
For all invariant representations s ∈ R F × 3 ,
[Equation]
Similarly,
[Equation]
Therefore, projection on general equivariant representations can also produce invariant representation.
A.2 Proof of Proposition 4.
Proof.
Assume that s is an invariant representation.
[Equation]
The representation ˜ g ( s ) can be written as a function of ( z,⃗r ) .
Then, we have
[Equation]
Therefore, ˜ g ( s ) is also an invariant representation
[Equation]
A.3 Proof of Theorem 4.
We first prove that when the multiset of invariant features and coordinate projections equal, the multiset of invariant features and coordinates are just distinguished from each other with an orthogonal transformation.
Lemma A.1.
Given two frames ⃗E 1 , ⃗E 2 , and two sets of atoms { ( s 1 ,i ,⃗r 1 ,i | i = 1 , 2 , ..., n } , { ( s 2 ,i ,⃗r 2 ,i | i = 1 , 2 , ..., n } .
If { ( s 1 ,i , P ⃗E 1 ( ⃗r 1 ,i ) | i = 1 , 2 , ..., n } = { ( s 2 ,i , P ⃗E 2 ( ⃗r 2 ,i ) | i = 1 , 2 , ..., n } , there exists o ∈ O(3), { ( s 1 ,i ,⃗r 1 ,i | i = 1 , 2 , ..., n }
= { ( s 2 ,i ,⃗r 2 ,i o T | i = 1 , 2 , ..., n }
Proof.
As { ( s 1 ,i , P ⃗E 1 ( ⃗r 1 ,i ) | i = 1 , 2 , ..., n } = { ( s 2 ,i , P ⃗E 2 ( ⃗r 2 ,i ) | i = 1 , 2 , ..., n } , there exists permutation π : { 1 , 2 , ..., n } → { 1 , 2 , ..., n } , so that
[Equation]
As ⃗E 1 , ⃗E 2 are both orthogonal matrix, ⃗E T 2 ⃗E 1 ∈ O(3).
Let o denotes ⃗E T 2 ⃗E 1 ,
{ ( s 1 ,i ,⃗r 1 ,i |
[Equation]
According to [34], there exists ρ and ψ so that
[Equation]
encoding { ( P ⃗E i ( ⃗r ij ) , s j ) | r ij < r c } injectively.
Let χ denote this function.
According to Lemma A.1, χ encodes local environments injectively when the difference caused by orthogonal transformation is neglected.
A.4 Proof of Theorem 4.
Notation: Given a molecule with atom coordinates ⃗r ∈ R N × 3 and atomic features (like embedding of atomic number) s ∈ R N × F , let G denote the undirected graph corresponding to the molecule.
Node i in G represents the atom i in the molecule.
G has edge ij iff r ij < r c , where r c is the cutoff radius.
Let d ( G , i, j ) denote the shortest path distance between node i and j in graph G .
Note that a single layer defined in Equation 5 can still encode the local environment, as extra frame-frame projection cannot lower the expressivity.
Lemma A.2.
Given a frame ⃗E , with suitable functions ρ and ψ , χ defined in Equation 5 encodes the local environment injectively.
Proof.
According to Theorem 4.1, there exists ρ ′ and ψ ′ so that
[Equation]
can encode local environment injectively.
Let ρ equals to ρ ′ ,
[Equation]
Then,
[Equation]
encodes local environment injectively
Now we begin to prove the Theorem 4.2.
Proof.
We use cat to represent concatenate throughout the proof.
Let N ( i ) l denote { j | d ( G , i, j ) ≤ l } .
The l th message passing layer has the following form.
[Equation]
where s (0) i =
s i .
By enumeration on l , we prove that there exist ρ l , ψ l so that s ( l ) i =
φ ( { cat ( s j , P ⃗E
i
( ⃗r ij
[Equation]
| j ∈ N l ( i ) } ) .
We first define some auxiliary functions.
According to [34], there exists a multiset function φ mapping a multiset of invariant representations to an invariant representation injectively.
φ can have the following form
[Equation]
where I is some finite index set.
As φ is injective, it has an inverse function.
We define function m, m ′ , m ′′ to extract invariant representation from concatenated node features.
[Equation]
[Equation]
Last but not least, there exist a function T transforming coordinate projections from one frame to another frame.
[Equation]
38) l = 1 : let ψ
=
ψ · m , ρ 1 is identity mapping.
l > 1 : Assume for all l ′ <
l , s ( l ′ )
i
[Equation]
ψ l has the following form.
[Equation]
Therefore
[Equation]
Note ψ l transforms coordinate projection from an old frame to a new frame.
Therefore, the input of ρ l , namely a ( l ) i , has the following form.
[Equation]
We can transform a ( l ) i to a set of set of invariant representations with the following function.
[Equation]
[Equation]
Therefore, η ( a ( l ) i ) = {{ cat ( s k , P ⃗E i ( ⃗r ik ))
| k ∈ N l − 1 ( j ) }| j ∈ N
( i ) }
We can use another function ι unions invariant representation sets in set S to a set of invariant representation.
[Equation]
ρ l has the following form.
[Equation]
Therefore, the output is
[Equation]
Therefore, ∀ l ∈ N , there exists ρ l , ψ l so that s ( l ) i =
φ ( { cat ( s j , P ⃗E
i ( ⃗r ij ))
| j ∈ N l
( i ) } ) .
As L is the diameter of G , s ( L )
i
[Equation]
= φ ( { cat ( s j , P ⃗E
i ( ⃗r ij ))
| j ∈ { 1 , 2 , ..., n }} ) .
As φ is an injective function, GNN with L message passing layers defined in Equation 5 can encode the { ( s i , P ⃗E i ⃗r ij ) | j ∈ { 1 , 2 , ..., n }} injectively to s ( L ) i .
According to Lemma A.1, this GNN encodes the whole molecule { ( s i ,⃗r ij ) | j ∈ { 1 , 2 , ..., n }} when the difference caused by orthogonal transformation is neglected.
A.5 Proof of Theorem 5.
Proof.
(1) We first prove there exists an O(3)-equivariant function g mapping the local environment
LE i to a frame ⃗E i ∈ R 3 × 3 .
The frame has full rank if there does not exist o ∈ O (3) , o ̸
= I, o ( LE i ) =
LE i .
Let γ denote a function mapping local environments to sets of vectors.
[Equation]
in which s j is reshaped as F × 1 , ⃗r ij is of shape 1 × 3 .
γ is O (3) -equivariant.
Therefore, we discuss the aggregation function on a set of equivariant representation, denoted as { ⃗u i | i
= 1 , 2 , ..., n, ⃗u i ∈ R F × 3 } .
Assume that V = {{ ⃗u i | i = 1 , 2 , ..., n, ⃗u i ∈ R F × 3 }| n = 1 , 2 , ..., N } , where N is the upper bound of the size of local environment, is the set of sets of equivariant messages in local environment.
An equivalence relation can be defined on V : v 1 ∈ V, v 2 ∈ V, v 1 ∼ v 2 iff there exists o ∈
O (3) , o ( v 1 )
= v 2 .
Let ˜ V = V/ ∼ denote the quotient set.
For each equivalence class [ v ] with no symmetry, a representative v can be selected.
We can define a function r : ˜ V − { [ v ] | [ v ] ∈ ˜ V , ∃ v ∈ [ v ] , o ∈ O (3) , o ̸
= I, o ( v )
= v } → V as r ([ v ])
= v mapping each equivalence class with no symmetry to its representative.
For a message set with no symmetry, the transformation from its representative to it is also unique.
Let h : V − { v | v ∈ V, ∃ o ∈ O (3) , o ̸
= I, o ( v )
= v } → O (3) .
h ( v ) =
o, o ( r ([ v ]))
= v .
Therefore, the function g can take the form as follows.
[Equation]
if there exists o ∈ O(3) , o ̸
= I, ov = v
[Equation]
otherwise
Therefore, g ◦ γ is the required function.
We further detail how to select the representative elements: We first define a linear order relation ≤ l in V .
If v 1 , v 2 ∈ V, | v 1 | < | v 2 | , v 1 < l v 2 .
So we only consider the order relation between two sets of the same size n .
We first define a function φ mapping message set to a sequence injectively.
φ ( { u i |
i
= 1 , 2 , ..., n, u i ∈ R F × 3 } )
=
[ flatten ( u π ( i ) )
| i = 1 , 2 , ..., n, π is a permutation sorting u i by lexicographical order ] .
Forall v 1 , v 2 ∈ V, | v 1 | = | v 2 | , v 1 ≤ l v 2 iff φ ( v 1 ) ≤ φ ( v 2 ) by lexicographical order.
As the size of local environent is bounded, the sequence is also of a finite length.
Therefore, the lexicographical order and thus the linear order relation ≤ l are well-defined.
All permutations of { 1 , 2 , ..., n } form a permutation set Π n .
For all [ v ] ∈ ˜ V , let r ([ v ]) =
arg min v ′ ∈
[ v ] φ ( v ′ ) .
To illustrate the existence of such minimal sequence, we reform it.
[Equation]
where S ( o, π ) =
[ flatten ( u π ( i ) o T ) | i = 1 , 2 , ..., n ] .
Each element of this sequence is continuous to o .
We first fix the π .
As O (3) is a compact group, arg min o ∈ O (3) S ( o, π ) 1 exists.
Let L 1 = { o | o ∈
O (3) , S ( o, π ) 1 = min o ′ ∈
O (3) S ( o ′ , π ) 1 } is still a compact set.
Therefore, arg min o ∈ L 1 S ( o, π )exists.
Let L 2 = { o | o ∈ L 1 , S ( o, π ) 2 =
min o ′ ∈
L 1 S ( o ′ , π ) 2 } .
Similarly, L 3 , L 4 , ..., L 3 Fn can be defined and they are non-empty set.
Forall o 1 , o 2 ∈
L 3 Fn , as S ( o 1 , π ) ≤ S ( o 2 , π ) and S ( o 2 , π ) ≤
S ( o 1 , π ) by lexicographical order, S ( o 2 , π ) =
S ( o 1 , π ) and thus o 1 ( v ) =
o 2 ( v ) .
If v has no symmetry, ∀ o ∈ O (3) , o ̸
= I, o ( v ) ̸
= v , o 1 ( v ) =
o 2 ( v ) =
⇒ o
1 =
o 2 .
Therefore, L 3 Fn contains a unique element o (0) v and min o ∈ O (3) S ( o, π ) is unique.
As Π n is a finite set, if min o ∈ O (3) S ( o, π ) exist for all π ∈ Π n , min π ∈ Π n min o ∈ O (3) S ( o, π ) must exist.
Therefore the minimal sequence exists.
As ≤ l is a linear order, the minimal sequence is unique.
With the unique sequence, the unique representative can be determined.
(2) Then we prove there does not exist o ∈ O (3) , o ̸
= I, o ( LE i ) =
LE i if the frame has full rank.
The frame ⃗E is a function of local environment.
If there exists
[Equation]
i .
Then ⃗E ( o ( LE i ))
=
⃗E ( LE i )
o T =
⃗E ( LE i ) .
As ⃗E is an invertible matrix, o = I .
Therefore, LE i has no symmetry.
B Derivation of the message passing section for frame
The framework proposed by Villar et al.
[15] is
[Equation]
) where h n is the aggregation function for n messages.
g is a O (3) -invariant functions.
We can further reform it.
[Equation]
where g ( n ) 1 , g ( n − 1)are two O (3) -invariant functions.
With this equation, we can recursively build n message aggregation function h n with h n − 1 .
Its universal approximation power has been proved in [15].
However, as they can have varied numbers of neighbors, different nodes have to use different aggregation functions, which is hard to implement.
Therefore, we desert the recursive term h n − 1 .
[Equation]
𝑍𝑍 𝑖𝑖 𝑟𝑟 𝑖𝑖 embedding 𝑠𝑠 𝑖𝑖 ( 0 )
MP MP
MP …
MP ∑ 𝑠𝑠 𝑖𝑖 ( 𝑇𝑇 ) linear geo2filter filter 𝑖𝑖𝑖𝑖 �𝐸𝐸 ⃗𝑣𝑣 𝑖𝑖𝑖𝑖 ( 𝑒𝑒 )
𝑠𝑠 𝑖𝑖𝑖𝑖 ( 𝑒𝑒 ) linear
MPv 2-layer mlp filter1 ij 𝑤𝑤 𝑖𝑖𝑖𝑖 ( 𝑒𝑒 ) •
• filter 𝑖𝑖𝑖𝑖 projection 𝑟𝑟 𝑖𝑖 − ⃗𝑟𝑟 𝑖𝑖 rbf cutoff ||•|| ⋅ || ⋅ || 𝑟𝑟 𝑖𝑖 linear 𝑠𝑠 𝑖𝑖 • filter 𝑖𝑖𝑖𝑖 message 𝑖𝑖𝑖𝑖 ∑ j Δ s j + 𝑠𝑠 𝑖𝑖 linear • filter1 𝑖𝑖𝑖𝑖 message 𝑖𝑖𝑖𝑖 ∑ j ⃗𝑣𝑣 𝑖𝑖 • ⃗𝑣𝑣 𝑖𝑖𝑖𝑖 ( 𝑒𝑒 ) 𝑒𝑒𝑣𝑣 𝑖𝑖𝑖𝑖 ⃗𝑣𝑣 𝑖𝑖 ⟨⋅ , ⋅⟩ ⃗𝑣𝑣 𝑖𝑖 cat ⟨⋅ , ⋅⟩ linear linear
[Figure]
[Figure]
The message ⃗m ij can have the form Concatenate (1 , s ) · ⃗r ij in Theorem 4.1.
As g is an invariant function, we can further simplify Equation 54.
[Equation]
[Equation]
where g ′ is a function mapping invariant representations to invariant representations.
C Archtecture of GNN-LF
The full architecture is shown in Figure 4.
Following Thölke and Fabritiis [10], we also use a neighborhood embedding block which aggregates neighborhood information as the initial atom feature.
[Equation]
where Emb 1 and Emb 2 are two embedding layers and f is the filter function.
These special functions are proposed by previous methods [19, 35].
[Equation] [Equation]
where β k , µ k are coefficients of the k th basis.
For PES tasks, the output module is a sum pooling and a linear layer.
Other invariant prediction tasks can also use this module.
However, on the QM9 dataset, we design special output modules for two properties.
For dipole moment µ , given node representations [ s i | i = 1 , 2 , ..., N ] and atom coordinates
⃗r i | i = 1 , 2 , ..., N ] , our prediction is as follows.
[Equation]
59) where q i ∈ R , the prediction of charge, is function of s i .
We use a linear layer to convert s i to q i .
As the whole molecule is electroneutral, we use q i − average j ( q j ) .
For electronic spatial extent ⟨ R 2 ⟩ , we make use of atom mass (known constants)
[ m i | i = 1 , 2 , ..., N ] .
The output module is as follows.
[Equation]
where x i ∈ R is an invariant representation feature of node i .
We also use a linear layer to convert s i to x i .
[Table] [Table]
D Experiment settings
Computing infrastructure.
We leverage Pytorch for model development.
Hyperparameter searching and model training are conducted on an Nvidia A100 GPU.
Inference times are calculated on an
Nvidia RTX 3090 GPU.
Training process.
For MD17/QM9 dataset, we set an upper bound (6000/1000) for the number of epoches and use an early stop strategy which finishes training if the validation score does not increase after 500/50 epoches.
We utilize Adam optimizer and ReduceLROnPlateau learning rate scheduler to optimize models.
Model hyperparameter tuning.
Hyperparameters were selected to minimize l1 loss on the validation sets.
For MD17/QM9, we fix the initial lr to 1 e − 3 / 3 e − 4 , batch size to 16 / 64 , hidden dimension to 256 .
The cutoff radius is selected from [4 , 12] .
The number of message passing layer is selected from [4 , 8] .
The dimension of rbf is selected from [32 , 96] .
Please refer to our code for the detailed settings.
Dataset split.
We randomly split the molecule set into train/validation/test sets.
For MD17, the size of the train and validation set are 950 , 50 respectively.
All remaining data is used for test.
For QM9:
The sizes of randomly splited train/validation/test sets are 110000 , 10000 , 10831 respectively.
E Scalability
To assess the scalability of our model, we show the inference time of random MD17 batches ofmolecules on an NVIDIA RTX 3090 GPU.
The results are shown in Table 4.
Note that GemNet consumes too much memory, and only batches of 16 molecules can fit in the GPU.
Our model only takes 30% time and 12% space compared with the fastest baseline.
Moreover, NoShare use 260% more space and 67% more computation time than GNN-LF with filter sharing technique.
We also compare computational overhead on tasks other than PES in the QM9 dataset (see Table 5).
As we use the same model for different tasks in the QM9 dataset, models are only compared on Utask.
GNN-LF achieves the lowest GPU memory consumption, competitive inference speed, and model size.
F Existing methods using frame
Though some previous works [24–26, 33, 36] also use the term "frame" or designs similar to "frame", they are very different methods from ours.
The primary motivation of our work is to get rid of equivariant representation for higher and provable expressivity, simpler architecture, and better scalability.
We only use equivariant representations in the frame generation and projection process.
After projection, all the remaining parts of our model only operates on invariant representations.
In contrast, existing works [24, 26, 33, 36] still use both equivariant and invariant representations, resulting in extra complexity even after using frame.
For example, functions for equivariant and invariant representations still need to be defined separately, and complex operation is needed to mix the information contained in the two kinds of representations.
In addition, our model can beat the representative methods of this kind in both accuracy and scalability on potential energy surface prediction tasks.
Other than the different primary motivation, our model has an entirely different architecture from existing ones.
Generating frame: ClofNet [26] and LoCS [25] produces a frame for each pair of nodes and use some process not learnable to produce the frame.
Both EGNN [33] and GMN [36] use coordinate embeddings which are initialized with coordinates.
Luo et al.
[24] initializes the frame with zero.
Then these models use some schemes to update the frame.
Our model uses a novel message passing scheme to produce frames and will not update it, leading to simpler architecture and low computation overhead.
Projection: Existing models [24, 26, 33, 36] only project equivariant features onto the frame, while we also use frame-frame projection, which is verified to be critical both experimentally and theoretically.
Message passing layer:
Existing models [24–26, 33, 36] all use both invariant representation and equivariant features and pass both invariant and equivariant messages, which needs to mix invariant representations and equivariant representations, update invariant representations, and update equivariant representations, while our model only uses invariant representations, resulting in an entirely different and much simpler design with significantly higher scalability.
Our designing tricks, including: message passing scheme to produce frame, filter decomposition, and filter sharing, are not used in [24, 26, 33, 36].
Our experiments and ablation study verified their effectiveness.
Furthermore, existing models use different groups to describe symmetry.
Luo et al.
[24], Kofinas et al.
[25], Du et al.
[26] design SO (3) -equivariant model, while our model is O (3) -equivariant.
We emphasize that this is not a constraint of our model but a requirement of the task.
As most target properties of molecules are O (3) -equivariant (including energy and force we aim to predict), our model can fully describe the symmetry.
Our theoretical analysis is also novel.
Luo et al.
[24], Satorras et al.
[33], Huang et al.
[36] have no theoretical analysis of expressivity.
Du et al.
[26]’s analysis is primarily based on the framework of
Dym and Maron [37], which is further based on the polynomial approximation and the group representation theory.
The conclusion is that a model needs many message passing layers to approximate high-order polynomials and achieve universality.
Our theoretical analysis gets rid of polynomial and group representation and provides a much simpler analysis.
We also prove that one message passing layer proposed in our paper are enough to be universal.
In summary, although also using “frame”, our work is significantly different to any existing work in either method, theory, or task.
Gauge-equivariant CNNs Gauge-equivariance methods [38–40] have never been used in the potential energy surface task.
The methods seem similar to ours as they also project equivariant representations onto some selected orientations.
However, the differences are apparent.
Some of these methods are not strictly O(3)-equivariant.
For example, the model of de Haan et al.
[39] is not strictly equivariant for angle ̸ = 2 π/N , while our model (and all existing models for potential enerby surface) is strictly O (3) -equivariant
Loss of O (3) -equivariance leads to high sample complexity.
Building grid is infeasible for potential energy surface tasks as atoms can move in the whole space.
Moreover, the energy prediction must be a smooth function of the coordinates of atoms.
Therefore, the space should not be discretized.
The model of Suk et al.
[40] works on some discrete grid and cannot be used for the molecular force field.
Even though Suk et al.
[40] seem to achieve strict O(3)-equivariance with high complexity, it only uses the tangent plane’s angle and loses some information.
Only one angle relative to a reference neighbor is used.
Such an angle is expressive enough in a 2D tangent space because the coordinate can be represented as ( r cos θ, r sin θ ) .
However, for molecule in 3D space, such an angle is not enough(the coordinates can be represented as ( r cos θ sin ϕ, r sin θ sin ϕ, r cos ϕ ) .
The angles in tangent space only provide θ ).
In contrast, we use the projection on three frame directions, so our model can fully capture the coordinates.
Gauge-equivariance methods all use some constained kernels, which needs careful designation.
Our model needs no specially designed kernel and can directly use the ordinary message passing scheme.
Such simple design leads to provable expressivity, simpler architecture
, and low time
complexity.
Our time
complexity is O
( Nn )
while the
that
of Suk et al
[40] is O
( Nn 2 )
, where N is the number of atoms, n is the maximum node degree).
G Expressivity with symmetric input
We use the symbol in Equation 5 SchNet’s message can be formalized as follows.
[Equation]
In implementation, GNN-LF has the following form.
[Equation]
<
[Equation]
c ψ ( Concatenate ( P
[Equation]
Therefore, for all input molecules, GNN-LF is at least as expressive as SchNet.
Theorem G.1.
∀
L ∈ N + , for all L layer SchNet, there exists a L layer GNN-LF produce the same output for all input molecule.
Proof.
Let the following equation denote the l th layer SchNet.
[Equation]
Let ρ l = ρ ′ l , ψ l ( Concatenate ( P ⃗E i ( ⃗r ij ) , P ⃗E i ( ⃗E j ) , s j , r ij ))
= ψ ′ l ( Concatenate ( s j , r ij )) , which neglects the projection input.
Let the l th layer of GNN-LF have the following form.
[Equation]
This GNN-LF produces the same output as the SchNet.
H How to overcome the frame degeneration problem.
As shown in Theorem 5.1, if the frame is O (3) -equivariant, no matter what scheme is used, the frame will degenerate when the input molecule is symmetric.
In other words, the projection degeneration problem roots in the symmetry of molecule.
Therefore, we try to break the symmetry by assigning node identity features s ′ to atoms.
The i th row of s ′ is i .
We concatenate s and s ′ as the new node feature ˜ s ∈ R N × ( F +1) .
Let η denote a function concatenating node feature s and node identity features s ′ , η ( s ) =
˜ s .
Its inverse function removes the node identity η − 1 (˜ s )
= s .
In this section, we assume that the cutoff radius is large enough so that local environments cover the whole molecule.
Let [ n ] denote the sequence 1 , 2 , ..., n .
Let s ∈ R N × F denote the invariant atomic features, ⃗r ∈ R N × 3 denote the 3D coordinates of atoms, and ⃗r i , the i th row of ⃗r , denote the coordinates of atom i .
Let ⃗r
−
⃗r i denote an N × 3 matrix whose j th row is ⃗r j − ⃗r i .
We assume that
N > 1 throughout this section.
Now each atom in the molecule has a different feature.
The frame generation is much simpler now.
Proposition H.1.
With node identity features, there exists an O(3)-equivariant function mapping the local environment LE i
=
(˜ s i ,⃗r ij ) | j ∈ [ N ] } to a frame ⃗E i ∈ R 3 × 3 , and the first rank ( ⃗E i ) rows of ⃗E i form an orthonormal basis of span ( { ⃗r ij | j ∈ [ N ] } ) while other rows are zero.
Proof.
For node i , we can use the following procedure to produce a frame.
Initialize ⃗E i as an empty matrix.
For j in [1 , 2 , 3 , ..., n ] , if ⃗r ij is linearly independent to row vectors in ⃗E i , add ⃗r ij as a row vector of ⃗E i .
Therefore, when the procedure finishes, the row vectors of ⃗E form a maximal linearly independent system of { ⃗r ij | j ∈ [ N ] } .
Then, we use the Gram-Schmidt process to orthonormalize the non-empty row vectors in ⃗E , and then use zero to fill the empty rows in ⃗E to form a 3 × 3 matrix.
Therefore, the first rank ( ⃗E i ) rows of ⃗E i are orthonormal, and can linearly express all vector in { ⃗r ij | j ∈ [ N ] } .
In other words, the first rank ( ⃗E i ) rows of ⃗E i form an orthonormal basis of span ( { ⃗r ij | j ∈ [ N ] } ) .
Note that ⃗r ij , ⃗ 0 are O
(3) -equivariant vectors.
Therefore, the frame produced with this scheme is
O (3) -equivariant.
With the frame, GNN-LF has the universal approximation property.
Proposition H.2.
Assuming that the node identity features are used, and the frame is produced by the method in Proposition H.1.
For all O (3) -invariant and translation-invariant functions f ( s,⃗r ) , f can be written as a function of the embeddings of node 1 produced by one message passing layer proposed in Theorem 4.1.
Proof.
Let e r ∈ R 3 × 3 denote a diagonal matrix whose first r diagonal elements are 1 and others are 0 .
With node identity features and method in Proposition H.1, the first rank ( ⃗E i ) rows of ⃗E i form an orthonormal basis of span ( { ⃗r ij | j ∈ [ N ] } ) while other rows are zero.
Especial, all vectors in { ⃗r 1 j | j ∈ [ N ] } can be written as linear combination of rows in ⃗E 1 , ⃗r 1 j = w 1 j ⃗E j .
Therefore, the projection operation P ⃗E 1 : { ⃗r 1 j | j ∈ [ N ] } → { ( ⃗r 1 j ) ⃗E T 1 | j ∈ [ N ] } is injective, as
[Equation]
According to the proof of Theorem 4.1, there exists injective function χ so that node embeddings z
[Equation]
[Equation]
Note that both ⃗E 1 and z 1 are functions of LE 1 .
Let τ denote a function ( z 1 , ⃗E 1 )
=
τ ( { (˜ s j ,⃗r 1 j ) | j ∈
[ N ] } ) , so that
[Equation]
Moreover, τ is also an invertible function because {
[Equation]
Because the last column of ˜ s is the node identity feature, there exists an bijective function φ converting set of features to matrix of features.
[Equation]
Intuitively, it puts the features of atom with node identity i to the i th row of feature matrix.
Similarly,
[Equation]
As f is a translation- and O(3)-invariant function,
[Equation]
Let g = f ◦ φ ◦ τ − 1 .
So
[Equation]
Let extend ( E i ) ∈
O (3) denote any matrix whose first rank ( E i ) rows equals to E
i ’s first rows.
Therefore,
[Equation]
Note that rank ( ⃗E 1 )
=
rank ( ⃗r − ⃗r 1 ) =
rank ( P ⃗E 1 ( ⃗r − ⃗r 1 ))
=
rank ( ι ◦ φ ′ ◦ χ − 1 ( z i )) , where ι is a selection function: ι ( z, − ( ⃗r − ⃗r 0 ) ⃗E T 1 )
= − ( ⃗r − ⃗r 0 )
⃗E
T 1 .
Therefore, f ( s,⃗r ) =
g ′ ( rank ( ι ◦ χ − 1 ( z 1 )) , z 1 ) = g ′′ ( z 1 ) .
For simplicity, let function ψ denote GNN-LF with node identity features (including adding node identity feature, generating frame, and a message passing layer proposed in Theorem 4.1), ψ ( z,⃗r ) is the embeddings of node 1 .
Node identity features help avoiding expressivity loss caused by frame degeneration.
However, GNNLF’s output is no longer permutation invariant.
Therefore, we use the relational pooling method [28], which introduces extra computation overhead and keeps the permutation invariance.
To illustrate this method, we first define some concepts.
Function π : [ n ] → [ n ] is a permutation iff it is bijective.
All permutation on [ n ] forms the permutation group S n .
We compute the output of all possible atom permutations and average them, in order to keep permutation invariance.
We define the permutation of matrix here: for all matrix of shape N × m , ∀ π ∈ S N , the i th row of π ( M ) equals to the ( π − 1 ( i ))
th row of M .
Proposition H.3.
For all O (3) -invariant, permutation-invariant and translation invariant function f ( s,⃗r ) , there exists GNN-LF ψ and some function g , with which 1 N !
(cid:80) π ∈ S N g ( ψ ( π ( s ) , π ( ⃗r ))) is permutation invariant and equals to f ( s,⃗r ) .
Proof.
Define a "frame" (defined in Definition 1 in [28]) F : V → 2 S n , where V is the embedding space.
∀ v ∈ V , F ( v ) =
S n .
So the relational pooling of GNN-LF with node identity features ⟨ g ◦ ψ ⟩ F ( s,⃗r )
= 1 N !
(cid:80) π ∈ S N g ( ψ ( π ( s )) , π ( ⃗r )) .
Note that the permutation operation π and O(3) operation o commute: π ( ⃗ro T ) =
π ( ⃗r ) o T .
According to Theorem 2 in [28], ⟨ g ◦ ψ ⟩ F is permutation invariant.
According to Theorem 4 in [28], if there exist function g ′ and ψ ′ so that g ′ ◦ ψ ′ =
f (the existence is shown in Proposition H.2), there will also exist GNN-LF ψ and function g , so that ⟨ g ◦ ψ ⟩ F ( s,⃗r ) =
f ( s,⃗r ) .
Therefore, we can completely solve the frame degeneration problem with the relational pooling trick and node identity features.
However, the time complexity is up to O ( N ! N 2 ) , so we only analyze this method theoretically.
I Why is global frame more likely to degenerate than local frame?
Let [ N ] denote the sequence 1 , 2 , ..., N .
N is the number of atoms in the molecule.
We first consider when local frame degenerates.
As shown in Theorem 5.1, the degeneration happens if and only if the local environment is symmetric under some orthogonal transformations.
[Equation]
The global frame has the following form,
[Equation]
We first prove some properties of ⃗E function.
Proposition I.1.
⃗ E is an O (3) -equivariant, translation-invariant, and permutation-invariant function.
Proof.
O (3) -equivariance: ∀ o ∈ O(3), ⃗E i ( s,⃗ro T )
=
⃗E i ( s,⃗r )
o T .
Therefore,
[Equation]
Translation-invariance: For all translation ⃗ t ∈ R 3 , let ⃗r + ⃗ t denote a matrix of shape N × 3 whose i th row is ⃗r i + ⃗t .
As ⃗E i is a function of ⃗r i − ⃗r j
= ⃗r i + ⃗t − ( ⃗r j + ⃗t ) , ⃗E i ( z,⃗r + t )
=
⃗E i ( z,⃗r ) .
Therefore, ⃗E ( s,⃗r + t ) =
N (cid:88) i
= ⃗E
i ( s,⃗r + t ) =
N (cid:88) i
= ⃗E
i ( s,⃗r ) =
⃗E ( s,⃗r ) .
Permutation-invariance: for all permutation
π
[Equation]
Then we prove a sufficient condition for global frame degeneration.
Proposition I.2.
rank ( ⃗E < 3) if there exists ⃗t ∈ R 3 and o ∈ O (3) , o ̸
= I such that { ( s i ,⃗r i − ⃗t ) | i ∈
[ N ] } = { ( s i , ( ⃗r i − ⃗t ) o T ) | i ∈
[ N ] } .
Proof.
As ⃗E is a permutation invariant function,
[Equation]
As ⃗E is a translation-invariant and O (3) -equivariant function,
[Equation]
Therefore, under the condition { ( s i ,⃗r i − ⃗t ) | i ∈
[ N ] } = { ( s i , ( ⃗r i − ⃗t ) o T ) | i ∈
[ N ] } , we have
[Equation]
Therefore, rank ( ⃗E ) + rank
( I − o T ) − 3 ≤ 0 .
As I ̸ = o T , rank ( I − o T ) > 0 , rank ( ⃗E ) < 3 .
The main difference between the degeneration conditions is the choice of origin.
The local frame of atom i degenerates when the molecule is symmetric with atom i as the origin point, while the global frame degenerates if the molecule is symmetric with any origin point .
Therefore, the global frame is more likely to degenerate.
Corollary I.1.
Assume the cutoff radius is large enough so that local environments contain all atoms.
If there exists i , rank ( ⃗E i ) < 3 , then rank ( ⃗E ) < 3 .
Proof.
As rank ( ⃗E i ) < 3 , ∃ o ∈ O (3) , o ̸
= I, { ( s j , ( ⃗r i − ⃗r j ) o T ) | j ∈
[ N ] } = { ( s j , ( ⃗r i − ⃗r j ))
| j ∈ [ N ] } .
Therefore, {
[Equation] [Equation]
Let ⃗t
= ⃗r
i , according to Proposition I.2, rank ( ⃗E ) < 3 .
Therefore, when the cutoff radius is large enough, the global frame will also degenerate if some local frame degenerates.
J How does GNN-LF keep O(3)-invariance.
The input of GNN-LF is atomic numbers z ∈ Z N and 3D coordinates
⃗r ∈
R N × 3 , where N is the number of atoms in our molecule.
The energy prediction produced by GNN-LF should be O(3)- equivariant.
To formalize, ∀ o ∈ O (3) , GNN-LF ( z,⃗r )
= GNN-LF ( z,⃗ro T ) .
For example, when the input molecule rotates, the output of GNN-LF should not change.
We state the Definition 2.2 and Lemma 2.1 here again.
Definition J.1.
Representation s is called an invariant representation if s ( z,⃗r ) =
s ( z,⃗ro T ) , ∀ o ∈
O (3) , z ∈ Z N ,
⃗r ∈ R N × 3 .
Representation ⃗v is called an equivariant representation
if ⃗v ( z,⃗r ) o T = ⃗v ( z,⃗ro T ) , ∀ o ∈ O (3) , z ∈ Z N ,⃗r ∈ R N × 3 .
Lemma J.1.
Any function of invariant representation s will produce an invariant representation.
Let s ∈ R F denote an invariant representation, ⃗v ∈ R F × 3 denote an equivariant representation.
We define s · ⃗v ∈ R F × 3 as a matrix whose ( i, j ) th element is s i ⃗v ij .
When ⃗v ∈ R 1 × 3 , we first broadcast it along the first dimension.
Then the output is also an equivariant representation.
Let ⃗v ∈ R F × 3 denote an equivariant representation.
⃗ E ∈ R 3 × 3 denotes an equivariant frame.
The projection of ⃗v to ⃗E , denoted as P ⃗E ( ⃗v ) := ⃗v ⃗E T , is an invariant representation in R F × 3 .
For ⃗v , P ⃗E is a bijective function.
Its inverse P − 1 ⃗E convert an invariant representation s ∈ R F × 3 to an equivariant representation in R F × 3 , P − 1 ⃗E ( s ) =
s ⃗E .
4. Projection of ⃗v to a general equivariant
representation ⃗v ′ ∈ R F ′ × 3 can also be defined.
It produces an invariant representation in R F × F ′ , P ⃗v ′ ( ⃗v ) =
⃗v⃗v ′ T .
As shown in Figure 1, GNN-LF first generates a frame for each atom and projects equivariant features of neighbor atoms onto the frame.
A graph with only invariant features is then produced.
An ordinary
GNN is then used to process the graph and produce the output.
We illustate them step by step.
Notations.
The initial node feature of node i , z i ∈ N , is an integer atomic number, which neural network cannot process directly.
So we first use an embedding layer to transform z i to float features s i =
s ( z i ) ∈ R F , where F is the hidden dimension.
According to the first point of Lemma J.1, s i is an invariant representation.
⃗r i ∈ R 1 × 3 , the 3D coordinates of atom i , is an equivariant representation.
⃗r ij
= ⃗r i − ⃗r j ∈ R 1 × 3 is the position of atom i relative to atom j .
[Equation]
so ⃗r ij is an equivariant representation.
r ij denotes the distance between atom i and atom j . r ij = (cid:113) ⃗r ij ⃗r Tij ∈ R .
According to the fourth point of Lemma J.1, ⃗r ij ⃗r
Tij is an invariant representation.
According to the first point of Lemma J.1, r ij = (cid:113) ⃗r ij ⃗r
Tij is thus an invariant representation.
Frame Generation.
As shown in Equation 8, our frame has the following form.
[Equation]
where w ( r ij ) ∈ R and f ( r ij ) ∈ R F denotes two function of r ij , ⊙ denotes Hadamard product.
w ( r ij ) r ij ( f ( r ij ) ⊙ s j ) as a whole is a function of r ij and s j , which are both invariant representations.
According to the first point of Lemma J.1, w ( r ij ) r ij ( f ( r ij ) ⊙ s j ) is an invariant representation ∈ R F . · denotes the scale operation described in the second point of Lemma J.1, so w ( r ij ) r ij ( f ( r ij ) ⊙ s j ) · ⃗r ij is an equivariant representation.
The frame of atom i , namely ⃗E i ∈ R F × 3 , is an equivariant
[Table]
representation, because
[Equation]
Projection.
Projection is composed of two parts.
As shown in Equation 9 and Equation 6.
[Equation] [Equation]
where W 1 , W 2 ∈ R F × F are two learnable linear layers.
According to the fourth point of lemma J.1, d 1 ij = ⃗r ij ⃗E Ti are invariant representations.
According to the fourth point of lemma J.1, ⃗E j ⃗E Ti are invariant representations.
d 2 ij =
diag
( W 1 ⃗E j ⃗E Ti W T 2 ) is a function of ⃗E
j ⃗E Ti , so d 2 ij are invariant representations.
Graph Neural Network.
We use an ordinary GNN to produce the energy prediction.
The GNN takes s i as the input node features and ( r ij , d 1 ij , d 2 ij ) as the input edge features.
[Equation]
As all inputs of GNN is invariant to O (3) operation, the energy prediction will also be O (3) -invariant.
Our GNN has an ordinary message passing scheme.
The message from atom j to atom r is
[Equation]
where f ′ is a neural network, whose output ∈ R F .
The message combines the features of edge i, j and node j .
Each message passing layer will update the node feature
s i .
[Equation]
where g is a multi-layer perceptron, N ( i ) is the set of neighbor nodes of node i .
After some message passing processes, s i contains rich graph information.
The energy prediction is
[Equation]
where h is a multi-layer perceptron.
[Table]
K How cutoff radius affects performance
Instead of taking a physically motivated cutoff radius
[Table]
we set it to be a hyperparameter and tune it.
Intensive hyperparameter tuning may prohibit GNN-LF from real-world applications.
However
[Table]
we find that GNN-LF is robust to the cutoff radius and does not need a lot of tuning.
As shown in Table
[Table]
when the cutoff radius is low
[Table]
the accuracy is low and unstable.
However, when the cutoff radius is large enough
[Table]
GNN-LF outperforms the strongest baseline torchmd and achieves the performance of GNN-LF with a tuned cutoff radius.
L Results with DimeNet split
Our baselines take slightly different dataset splits.
For comparison, we use the same split as our strongest baseline [10].
It is also the split with the fewest training and validation samples and, thus, the most challenging setting.
Other baselines may use slightly larger training and validation datasets.
For example, in the MD17 dataset, our split uses 950 training samples, while DimeNet usestraining samples.
With the split of DimeNet, the performance of GNN-LF increases by 0 .
5% on average (see Table 7).
So the differences in dataset split will not hamper our conclusion: GNN-LF achieves state-of-the-art performance in PES tasks.
M Gap between GNN-LF’s implementation and expressivity analysis
There are three gaps between implementation and expressivity analysis.
We clarify them as follows.
M.1 Frame ensemble
The theoretical expressivity can be ensured if the frame contains at least 3 vectors.
So the choice of
F , the number of vectors in the frame, is mainly for implementation convenience.
We set F =hidden dimension, so GNN-LF does not need an extra linear layer to change representations’ dimension when producing frames.
We also do ablation study.
Let 1-frame denote GNN-LF with a single frame.
Though frame ensemble contributes significant performance gain, GNN-LF with only one frame still achieves the second-best performance among existing models.
The experimental results in MD17 dataset are shown in Table 8.
Ablation of frame ensemble leads to 10% test loss increase.
However, the performance of 1-frame is still competitive, as 1-frame
[Figure]
outperforms all baselines on 3 / 16 targets and achieves the second-best performance on 11 / 16 targets.
The outstanding performance of GNN-LF validates our expressivity analysis.
Though frame ensemble is not vital for performance, we always use it in GNN-LF.
As GNN-LF generates frames and projections only once, using frame ensembles will not lead to significant computation overhead.
In the setting of Table 4, both 1-frame and GNN-LF with frame ensemble take 9 ms per inference iteration.
M.2 Orthogonality Constraint
Let f denote the target function.
In expressivity analysis, we have shown that there exists parameter w , GNN-LF with w can approximate f , and the frames produced by GNN-LF are orthogonal.
Then this conclusion ⇒ there exists parameter w , GNN-LF with w can approximate f ⇔ GNN-LF without the constraint can approximate f
Therefore, without the constraint, GNN-LF can still maintain expressivity.
In other words, producing orthogonal frames is one particular solution to our task.
By building a specific solution, we prove the existence of the solution.
In implementation, optimized GNN-LF
[Table]
may produce orthogonal frames, and it can also reach other solutions and thus does not produce orthogonal frames.
As expressivity analysis only considers the existence of a solution and ignores how to reach the solution, it is somehow counter-intuitive.
However, the theoretical analysis is still helpful and motivates the designs of GNN-LF.
Moreover, removal of orthogonal constraint does not result in frame degeneration.
We visualize local frames of atoms in Figure 5.
In these molecules, frame vector directions are diverse.
Therefore, frames are not likely to degenerate, and frames in the same ensemble vary greatly rather than collapse into a single frame.
M.3 Inplementation of frame-frame projection
In theory, frame-frame projection is ⃗E
i ⃗E Tj .
However, in implementation, we use diag ( W 1 ⃗E i ⃗E Tj W T 2 ) (see Equation 10).
This section explains the reason for the difference.
Directly using ⃗E i ⃗E
Tj leads to large computation overhead.
⃗E i ⃗E
Tj is a matrix ∈ R F × F , where F is the hidden dimension, usually 256 .
Flattening ⃗E
i ⃗E Tj and transforming it to F dimension needs at least a linear layer with 16M parameters (ten times more than the total number of parameters of
GNN-LF in MD17 dataset), which is infeasible.
Therefore, sampling elements in ⃗E i ⃗E Tj is a must.
Moreover, our sampling method will not hamper expressivity.
In theory, frames with 3 vectors and 3 × 3 frame-frame projections are enough.
Therefore, simply selecting a 3 × 3 diagonal block in ⃗E ⃗E T can fulfill the theoretical requirements.
We use a learnable process to simulate this operation.
Now we explain the sampling method in GNN-LF.
Note that we do not directly take the diagonals of ⃗E i ⃗E Tj .
Instead, we use diag ( W 1 ⃗E i ⃗E
Tj W T 2 ) , where W 1 , W 2 ∈ R F × F are two learnable matrix used to select elements.
Appropriate W 1 , W 2 can select arbitrary F elements in ⃗E i ⃗E Tj .
For example, given
[Equation]
where 1 i,j denotes the matrix whose ( i, j ) elements is 1, other elements are 0,
[Equation] [Equation]