Molecular dynamics simulation method and device
By using machine learning models and graph neural networks to correct the interaction force in molecular dynamics simulation, the contradiction between simulation accuracy and speed in the existing technology is solved, and more efficient molecular dynamics simulation is achieved.
Patent Information
- Application Number
- CN202510344192.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-07-08
AI Technical Summary
The existing molecular dynamics simulation methods are difficult to improve the simulation speed while improving the simulation accuracy, especially the classical approximation method has poor fitting effect, while the first principle calculation method and machine learning method have a conflict of speed and accuracy.
The machine learning model is used to determine the interaction forces in the preprocessed atomic graph, and the interaction forces are corrected to make their size the same, combining parallel simulation processes and graph neural networks to optimize the simulation process.
While improving the accuracy of molecular dynamics simulation, it accelerates the simulation speed, achieving more efficient molecular dynamics simulation.
Smart Images

Figure CN120280005A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of molecular dynamics, and more specifically, to a molecular dynamics simulation method and apparatus. Background Art
[0002] Molecular Dynamics (MD) is a method for simulating materials at the atomic scale by solving the equations of motion of atoms based on Newtonian physics. MD enables people to observe the evolution of a system along the time axis, thereby understanding the dynamic characteristics of materials and biological systems. These dynamic characteristics are very helpful for industrial applications such as material design, catalyst research, drug discovery, and protein deciphering.
[0003] The simulated materials may contain millions or even billions of atoms. Therefore, decomposing the simulation space and performing simulations in parallel is one of the most effective solutions for large-scale MD simulations.
[0004] Existing MD simulation methods include the following three:
[0005] 1) Classical approximation methods such as the Lennard Jones potential and the Tersoff potential, which have a fast simulation speed and good scalability, but a poor fitting effect.
[0006] 2) First-principles calculation methods, for example, methods based on density functional theory, which are more accurate in simulation, but are limited to dozens or at most hundreds of atoms.
[0007] 3) Machine learning methods, mainly using two force prediction methods, namely the gradient force method and the direct force method. However, there is a conflict between speed and accuracy in the gradient force method and the direct force method. For example, the gradient force method has better accuracy but slower speed, while the direct force method has poorer accuracy but faster speed.
[0008] Therefore, there is an urgent need for a method and apparatus that can improve the simulation speed while improving the accuracy of molecular dynamics simulation. Summary of the Invention
[0009] The object of the present invention is to provide a molecular dynamics simulation method and apparatus to improve the simulation speed while improving the simulation accuracy.
[0010] According to one aspect of the embodiments of the present disclosure, a molecular dynamics simulation method is provided, including: determining the forces between interacting atoms in a preprocessed atomic graph using a machine learning model, where the preprocessed atomic graph is composed of an original atomic graph and an original atomic graph mirror-replicated around the original atomic graph; correcting each pair of forces in the pairwise interaction forces such that the magnitudes of the two forces are the same; determining the resultant force of the atoms in the preprocessed atomic graph acting on each atom in the original atomic graph based on the corrected forces; and predicting the position of each atom based on the resultant force.
[0011] According to Newton's third law, the magnitudes of pairwise interaction forces should be equal. Therefore, correcting the force pairs such that the magnitudes of the two forces in each pair of interaction forces are the same can make the simulation more accurate.
[0012] Optionally, the pairwise interaction forces include: pairwise interaction forces obtained in the same simulation process and pairwise interaction forces obtained in different simulation processes, where one force and another force in the pairwise interaction forces obtained in the same simulation process are obtained in the same simulation process, and one force in the pairwise interaction forces obtained in different simulation processes is obtained by a first simulation process, and the other force is obtained by a second simulation process different from the first simulation process.
[0013] Optionally, the step of determining the forces between interacting atoms in the preprocessed atomic graph includes: determining the forces between interacting atoms in a first preprocessed atomic graph through a first simulation process; and determining the forces between interacting atoms in a second preprocessed atomic graph through a second simulation process, where the first preprocessed atomic graph and the second preprocessed atomic graph are obtained by partitioning the preprocessed atomic graph, and the first simulation process and the second simulation process are parallel simulation processes.
[0014] Optionally, the method further includes: assigning the same ID to each atom in the original atomic graph and the atom in the mirror-replicated original atomic graph corresponding to the each atom in the original atomic graph; and matching the pairwise interaction forces based on the IDs of the atoms in the preprocessed atomic graph.
[0015] Optionally, the method further includes: mapping the preprocessed atomic graph to a lambda space, where the lambda space includes multiple subspaces; determining the ID of the subspace corresponding to one of the two atoms corresponding to each pair of interaction forces; determining the ID of the subspace corresponding to the other atom of the two atoms based on the ID of the subspace corresponding to one atom; and determining whether each pair of interaction forces needs to be corrected based on the ID of the subspace corresponding to one atom and the ID of the subspace corresponding to the other atom.
[0016] Optionally, the step of correcting the forces includes: obtaining an average value of the magnitudes of two forces in a pair of interaction forces as the magnitude of each of the two forces.
[0017] Optionally, the machine learning model includes a graph neural network and a plurality of force prediction networks. The graph neural network includes a plurality of cascaded layers. The step of determining the forces between interacting atoms in the preprocessed atomic graph includes: obtaining the features output by each layer of the graph neural network by inputting the features output by the previous layer of each layer of the graph neural network into each layer, where the input of the first layer of the graph neural network is the preprocessed atomic graph; and determining the forces between the interacting atoms in the preprocessed atomic graph based on the features output by each layer using the force prediction network corresponding to each layer.
[0018] According to another aspect of an embodiment of the present disclosure, there is provided a molecular dynamics simulation device, including: a first determination unit configured to: use a machine learning model to determine the forces between interacting atoms in a preprocessed atomic graph, where the preprocessed atomic graph is composed of an original atomic graph and an original atomic graph mirror-replicated around the original atomic graph; a correction unit configured to: correct the two forces in each pair of interaction forces in the pair of interaction forces so that the magnitudes of the two forces are the same; a second determination unit configured to: determine the resultant force of the atoms in the preprocessed atomic graph acting on each atom in the original atomic graph based on the corrected forces; and a prediction unit configured to: predict the position of each atom based on the resultant force.
[0019] Optionally, the pair of interaction forces includes: a pair of interaction forces obtained in the same simulation process and a pair of interaction forces obtained in different simulation processes, where one force and another force in the pair of interaction forces obtained in the same simulation process are obtained in the same simulation process, and one force in the pair of interaction forces obtained in different simulation processes is obtained by a first simulation process, and the other force is obtained by a second simulation process different from the first simulation process.
[0020] Optionally, the first determination unit is configured to: determine the forces between the interacting atoms in a first preprocessed atomic graph through a first simulation process; and determine the forces between the interacting atoms in a second preprocessed atomic graph through a second simulation process, where the first preprocessed atomic graph and the second preprocessed atomic graph are obtained by dividing the preprocessed atomic graph, and the first simulation process and the second simulation process are parallel simulation processes.
[0021] Optionally, the molecular dynamics simulation device further includes: a matching unit configured to: assign the same ID to each atom in the original atomic graph and the atom corresponding to each atom in the original atomic graph in the mirror-replicated original atomic graph; and match pairwise interaction forces based on the IDs of the atoms in the preprocessed atomic graph.
[0022] Optionally, the molecular dynamics simulation device further includes: a third determination unit configured to: map the preprocessed atomic graph to a lambda space, where the lambda space includes multiple subspaces; determine the ID of the subspace corresponding to one of the two atoms corresponding to each pair of interaction forces; determine the ID of the subspace corresponding to the other atom among the two atoms based on the ID of the subspace corresponding to the one atom; and determine whether each pair of interaction forces needs to be corrected based on the ID of the subspace corresponding to the one atom and the ID of the subspace corresponding to the other atom.
[0023] Optionally, the correction unit is configured to: obtain the average value of the magnitudes of the two forces in the pairwise interaction force as the magnitude of each of the two forces.
[0024] Optionally, the machine learning model includes a graph neural network and multiple force prediction networks. The graph neural network includes multiple cascaded layers. The first determination unit is configured to: obtain the features output by each layer of the graph neural network by inputting the features output by the previous layer of each layer of the graph neural network into each layer, where the input of the first layer of the graph neural network is the preprocessed atomic graph; and determine the forces between the interacting atoms in the preprocessed atomic graph based on the features output by each layer using the force prediction network corresponding to each layer.
[0025] On the other hand, according to an embodiment of the present disclosure, there is provided a computer-readable storage medium storing a program, which when executed by a processor causes the processor to execute the molecular dynamics simulation method as described herein. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Through the following description with reference to the drawings showing exemplary embodiments, the above and other objects and features of the present invention will become clearer, where:
[0027] Figure 1 Shows an example comparison of replicating local atoms to create ghost atoms in the prior art and replicating local atoms to create ghost atoms according to an embodiment of the present disclosure;
[0028] Figure 2 Shows a schematic diagram of predicting pairwise forces in the related art;
[0029] Figure 3Shows a flowchart of a molecular dynamics simulation method according to an embodiment of the present disclosure;
[0030] Figure 4 Shows a schematic diagram of parallel simulation with 16 processes;
[0031] Figure 5 Shows a schematic diagram of matching paired edges based on two processes;
[0032] Figure 6 Shows a schematic diagram of an example of simulation based on two processes according to an embodiment of the present disclosure;
[0033] Figure 7 Shows a schematic diagram of calibrating the forces on the edges so that the magnitudes of each pair of forces are equal;
[0034] Figure 8 Shows a diagram of an example of a lambda space according to an embodiment of the disclosure;
[0035] Figure 9 Shows a schematic diagram of sorting paired edges;
[0036] Figure 10 Shows a schematic diagram of the communication of paired forces obtained between different processes;
[0037] Figure 11 Shows a schematic diagram of obtaining the resultant force received by atom 1;
[0038] Figure 12 Shows a schematic flowchart of using a pre-trained machine learning model to determine the forces of each atom in the preprocessed atom graph that interacts with each atom in the original atom graph received by each atom according to an embodiment of the present disclosure; and
[0039] Figure 13 Shows a schematic diagram of matching edge pairs for the case where the simulation space is divided into 4 processes; and
[0040] Figure 14 Is a block diagram showing the structure of a molecular dynamics simulation device according to an embodiment of the present disclosure. Detailed implementation manners
[0041] In the following, various exemplary embodiments of the present disclosure will be described with reference to the accompanying drawings, in which the same reference numerals are used to denote the same or similar elements, features, and structures. However, it is not intended to limit the present disclosure to the specific embodiments described herein, and it is intended that the present disclosure cover all modifications, equivalents, and / or alternatives thereof, as long as they are within the scope of the appended claims and their equivalents. The terms and words used in the following specification and claims are not limited to their dictionary meanings, but are only used to enable a clear and consistent understanding of the present disclosure. Therefore, it should be apparent to those skilled in the art that the following description of the various embodiments of the present disclosure is for illustrative purposes only and not for the purpose of limiting the present disclosure defined by the appended claims and their equivalents.
[0042] It should be understood that, unless the context clearly indicates otherwise, the singular forms include the plural forms. The terms "comprising," "including," and "having" as used herein indicate the presence of the disclosed functions, operations, or elements, but do not exclude other functions, operations, or elements.
[0043] For example, the expressions "A or B," or "at least one of A and / or B" may indicate A and B, A or B. For example, the expressions "A or B" or "at least one of A and / or B" may indicate (1) A, (2) B, or (3) both A and B.
[0044] In various embodiments of the present disclosure, it is intended that when a component (e.g., a first component) is referred to as being "coupled" or "connected" to another component (e.g., a second component) or being "coupled" or "connected" to another component (e.g., a second component), the component may be directly connected to the other component or may be connected through another component (e.g., a third component). In contrast, when a component (e.g., a first component) is referred to as being "directly coupled" or "directly connected" to another component (e.g., a second component) or being directly coupled to or directly connected to another component (e.g., a second component), there is no other component (e.g., a third component) between the component and the other component.
[0045] The expression "configured to" used in describing various embodiments of the present disclosure may be interchangeably used with expressions such as "suitable for", "capable of...", "designed to", "fitted to", "manufactured to", and "able to" depending on the context, for example. The term "configured to" does not necessarily indicate "specially designed" in terms of hardware. Instead, in some cases, the expression "a device configured to..." may indicate that the device and another device or part "are capable of...". For example, the expression "a processor configured to execute A, B, and C" may indicate a dedicated processor (e.g., an embedded processor) for executing the corresponding operations or a general-purpose processor (e.g., a central processing unit CPU or an application processor (AP)) for executing the corresponding operations by executing at least one software program stored in a memory device.
[0046] The terms used herein are for describing certain embodiments of the present disclosure, but are not intended to limit the scope of other embodiments. Unless otherwise indicated herein, all terms used herein (including technical or scientific terms) may have the same meaning as commonly understood by those skilled in the art. Generally, terms defined in a dictionary should be regarded as having the same meaning as their context in the relevant art, and should not be construed differently or be construed as having an overly formal meaning unless explicitly defined herein. In any case, the terms defined in the present disclosure are not intended to exclude embodiments of the present disclosure.
[0047] Molecular dynamics is a method of studying the properties and behaviors of substances by simulating the motion of molecular particles through a computer.
[0048] As an example, simulation applications or programs such as the Large-scale Atomic / Molecular Massively Parallel Simulator (LAMMPS) can be used to perform MD simulations.
[0049] The method of periodic boundary conditions can be adopted in molecular dynamics simulations to minimize the boundary effects in a finite system. In molecular dynamics simulations, particles are placed in a space-filling box surrounded by identical mirror units, and the entire system becomes a system without boundaries, which can avoid systematic errors caused by finite boundaries. In other words, the atoms of the system to be simulated can be placed in a space-filling box surrounded by copies of the system itself after translation.
[0050] Figure 1 Examples of replicating local atoms to create ghost atoms in the prior art and replicating local atoms to create ghost atoms according to embodiments of the present disclosure are shown for comparison.
[0051] As an example, a local atom may refer to an atom to be simulated, and a ghost atom may refer to an atom obtained by translating the atom to be simulated itself for performing the simulation. Referring to Figure 1 the left and right figures of
[0052] As an example, the space corresponding to the local atom or the space where it is located may be referred to as the local space, and the space corresponding to the ghost atom or the space where it is located may be referred to as the ghost space or the surrounding space.
[0053] Referring to Figure 1 the left figure of
[0054] For ease of description, in this article, the force between atoms is referred to as the force on the edge, and the force on a pair of edges indicates the mutual force between two atoms. The edge described in this article can be understood as a vector or a connection line from the position of one atom to the position of another atom. For example, the vector from atom 42 to atom 1 and the vector from atom 1 to atom 42 are paired vectors or paired edges or paired lines, which can be marked as f 421 and f 142 ,f 421 and f 142 and the force on f
[0055]
[0056] For example, the force of atom 42 on atom 1 and the force of atom 1 on atom 42 are forces on paired edges. The force of atom 5 on atom 3 and the force of atom 3 on atom 5 are also forces on paired edges. Figure 2 Although
[0057] only a two-dimensional schematic diagram of replicated atoms is shown, this is only exemplary and does not limit the present disclosure.
[0058] As an example, the simulation can be performed based on direct force calculation. Specifically, the simulation method based on direct force can obtain the features of the edges using a graph neural network based on the atomic graph, determine the forces on the edges using a force predictor based on the features of the edges, determine the resultant force on an atom based on the forces of other atoms on the atom, and update the position of the atom based on the resultant force on the atom and the simulation time step. As understood by those skilled in the art, the features of the edges can indicate the features of the atoms corresponding to the edges.
[0059] Figure 2 Ordinary simulation methods based on direct force calculation can improve the model prediction speed. According to Newton's third law, the magnitudes of the mutual forces should be the same. However, the paired forces predicted by ordinary simulation methods based on direct force calculation may not be equal, resulting in poor accuracy.Shows a schematic diagram of predicting pairwise forces based on direct force calculation in the related art.
[0060] Referring to Figure 2 , for the force of the starting atom on the target atom and the force of the target atom on the starting atom For such pairwise forces, their local structures may be different after spatial decomposition, which results in different embedding features for them. Therefore, the magnitudes (or sizes) of the pairwise forces predicted based on these features may be different, which conflicts with Newton's third law of motion. Inaccurate force prediction will lead to low model calculation accuracy, non-conservation of energy, and unstable simulation.
[0061] Figure 3 Shows a flowchart of a molecular dynamics simulation method according to an embodiment of the present disclosure.
[0062] Referring to Figure 3 , in step S301, a machine learning model is used to determine the forces between interacting atoms in a preprocessed atomic graph, where the preprocessed atomic graph is composed of an original atomic graph and an original atomic graph mirror-copied around the original atomic graph.
[0063] As an example, a preprocessed atomic graph can be obtained by copying the original atomic graph based on periodic boundary conditions.
[0064] Returning to the reference Figure 2 The two-dimensional schematic diagram of copying local atoms shown, a preprocessed atomic graph is obtained by periodically copying local atoms (or the original atomic graph) around local atoms (or the original atomic graph). In other words, the preprocessed atomic graph includes the original atomic graph and the copied original atomic graph.
[0065] In step S302, the two forces in each pair of pairwise interaction forces are corrected so that the magnitudes of the two forces are the same.
[0066] For example, referring to Figure 1 the right figure of
[0067] The force of atom 6 in subspace 1 on atom 1 in subspace 5 and the force of atom 1 in subspace 5 on atom 6 in subspace 1 are pairwise interaction forces. According to an embodiment of the present disclosure, correcting the force pair so that the magnitudes of the two forces in each pair of pairwise interaction forces are the same can make the simulation more accurate.
[0068] As an example, Figure 3 the method shown also includes: assigning the same ID to each atom in the original atomic graph and the atom corresponding to each atom in the original atomic graph in the mirror-copied original atomic graph; and matching pairwise interaction forces based on the IDs of the atoms in the preprocessed atomic graph.
[0069] Referring to Figure 1 the right figure of [[reference]], in the embodiments of the present disclosure, the ID (or number) assigned to a ghost atom is the same as the ID (or number) of the corresponding native atom of the ghost atom.
[0070] For example, atoms 42, 12, 24, 30, 36, 54 in the surrounding space correspond to atom 6 (referring to Figure 1 the left figure of [[reference]]), and thus are assigned the number 6 (referring to Figure 1 the right figure of [[reference]]).
[0071] Obviously, compared with the atomic graph shown in the Figure 1 left figure, the preprocessed atomic graph according to the embodiments of the present disclosure can more conveniently match edge pairs.
[0072] As an example, the pairwise interaction forces include: pairwise interaction forces obtained in the same simulation process and pairwise interaction forces obtained in different simulation processes, where one force and another force in the pairwise interaction forces obtained in the same simulation process are obtained in the same simulation process, and one force in the pairwise interaction forces obtained in different simulation processes is obtained by a first simulation process, and the other force is obtained by a second simulation process different from the first simulation process.
[0073] As an example, the steps of determining the forces between interacting atoms in the preprocessed atomic graph include: determining the forces between interacting atoms in a first preprocessed atomic graph through a first simulation process; and determining the forces between interacting atoms in a second preprocessed atomic graph through a second simulation process, where the first preprocessed atomic graph and the second preprocessed atomic graph are obtained by partitioning the preprocessed atomic graph, and where the first simulation process and the second simulation process are parallel simulation processes.
[0074] Figure 4 shows a schematic diagram of parallel simulation with 16 processes.
[0075] Referring to Figure 4 , the original atomic graph is partitioned into 16 processes for simulation ( Figure 7 the green boxes in [[reference]] correspond to all the atoms in the original atomic graph, where the label of each box represents the simulation process corresponding to the atoms in the box). For example, the atoms in green box 0 are simulated through process 0 to obtain the forces on the atoms. Figure 4 The atomic graph shown on the left is obtained by copying the atoms in the green boxes. Figure 4 The atomic graph shown on the right indicates the forces on the middle atom from other atoms simulated through process 0.
[0076] Figure 5 shows a schematic diagram of matching pairwise edges based on two processes.
[0077] Refer to Figure 5 , in Process 1, obtain the forces on edges f 4′7 , f 10′11 and f 17′15 .
[0078] The forces on edges f 7′4 , f 11′10 and f 15′17 obtained in Process 1. According to the above, f 4′7 and f 7′4 are edge pairs, f 10′11 and f 11′10 are edge pairs, f 17′15 and f 15′17 are edge pairs. Therefore, the forces on f 4′7 , f 10′11 and f 17′15 and the forces on f 7′4 , f 11′10 and f 15′17 are respectively paired forces.
[0079] As understood by those skilled in the art, in a three-dimensional simulation space, each local space has 26 directions. Therefore, Figure 5 only an example of the matching edge pairs in one direction is shown.
[0080] As an example, the paired forces obtained in different processes can be synchronized based on MPI communication between different processes.
[0081] Figure 6 shows a schematic diagram of an example of simulation based on two processes according to an embodiment of the present disclosure.
[0082] Refer to Figure 6 , each process simulates the forces on the atoms in a part of the preprocessed original atomic graph. For example, in Process 0, obtain the forces on the atomic edges in the preprocessed atoms Figure 1 , and in Process 1, obtain the forces on the atomic edges in the preprocessed atoms Figure 2 . To synchronize the paired forces obtained by different processes, force synchronization can be performed based on MPI.
[0083] For example, the forces on f 4′7 , f 10′11 and f 17′15 obtained in Process 0 are synchronized to Process 1, and the forces on f 7′4 , f 11′10 and f 15′17 obtained in Process 1 are synchronized to Process 0.
[0084] As an example, the step of correcting the force includes: obtaining the average value of the magnitudes of the two forces in the pair of interaction forces as the magnitude of each of the two forces.
[0085] Figure 7 A schematic diagram showing the forces on the calibration side to make the magnitudes of each pair of forces equal is shown.
[0086] Referring to Figure 7 , before correction, the magnitudes of the pair of interaction forces are not the same, and by taking the average, the magnitudes of the corrected pair of interaction forces are made equal.
[0087] Those skilled in the art should understand that the correction method based on averaging is only an example and does not limit the present disclosure. Other solutions that make the magnitudes of the pair of interaction forces equal can be adopted. For example, the magnitude of the smaller or larger force can be selected as the magnitude of the corrected force.
[0088] As an example, Figure 3 The method shown further includes: mapping the preprocessed atomic graph to the lambda space, where the lambda space includes a plurality of subspaces; determining the ID of the subspace corresponding to one of the two atoms corresponding to each pair of interaction forces; determining the ID of the subspace corresponding to the other atom among the two atoms based on the ID of the subspace corresponding to one atom; and determining whether each pair of interaction forces needs to be corrected based on the ID of the subspace corresponding to one atom and the ID of the subspace corresponding to the other atom.
[0089] As described above, the local space indicates the space corresponding to the original atomic graph or the original atom, and the ghost space indicates the space corresponding to the replicated atomic graph or the replicated atom, and can also be referred to as the surrounding space. For example, the preprocessed atomic graph obtained by periodically replicating the original atomic graph around the original atomic graph may include the local space and the ghost space (or the surrounding space), the local space corresponds to the original atomic graph or the original atom, and the ghost space or the surrounding space corresponds to the replicated atomic graph or the replicated atom.
[0090] As an example, the simulation space can be mapped to the lambda space based on the following equation.
[0091]
[0092] Where, The coordinates in the lambda space (a cubic simulation space with side length 1) are only used for atomic tracking and not for energy and force calculations.
[0093] H: The upper triangular 3*3 shape matrix of the triclinic space.
[0094] x: The coordinates in the Cartesian space.
[0095] x0: Lower bound of the triclinic space.
[0096] As an example, the subspace where the opposite edge is located can be determined based on the following equation:
[0097]
[0098] edge_cell_shift: Relative offset between the neighboring subspace and the local subspace. As an example, the relative offset is an integer value such as -2, -1, 0, 1, 2, etc. Only the edges with relative offsets of -1, 0, 1 can be retained for force synchronization. The edge from the starting (or ghost) atom s to the target (or local) atom t.
[0099] x s : Coordinates of the starting (or ghost) atom s.
[0100] midpoint: Midpoint coordinates of the simulation space of the current process.
[0101] subbox: Size of the local space.
[0102]
[0103] Where [0][1][2] represents the indices of the three dimensions in the lambda space.
[0104] Figure 8 A diagram showing an example of the lambda space according to the disclosed embodiments.
[0105] Refer to Figure 8 , box_size = 3 3 = 27, side_zise = 3 2 = 9, edge_size = 3, max_ID = box_size - 1, Where box_size, side_zise, and edge_size represent the size of the lambda space, the size of the side, and the size of the edge, respectively.
[0106] As described above, as understood by those skilled in the art, the subspace where the opposite edge or paired edges are located indicates the subspace where the atoms (or ghost atoms) involved in the opposite edge or paired edges are located.
[0107] For example, in process 0, f 4′7 , f 10′11 and f 17′15 are in subspace ID 0, that is, the subspace ID where 4′, 10′, and 17′ are located is 0. Then in process 1, f 7′4 , f 11′10 and f15′17 The subspace ID where it is located is 26. Similarly, if the subspace IDs where 4′, 10′, and 17′ are located are 1, then f 7′4 , f 11′10 and f 15′17 The subspace ID where it is located is 25.
[0108] As an example, the edges of each process can be rearranged based on the obtained subspace ID. If the opposite edges are in other processes, the corresponding pairwise interaction forces need to be corrected.
[0109] According to an embodiment of the present disclosure, after determining the processes and subspaces of the opposite edges, the forces on the pairwise edges can be conveniently synchronized.
[0110] As an example, the forces on the pairwise edges can also be sorted.
[0111] Figure 9 A schematic diagram showing the sorting of pairwise edges is shown. As an example, the sorting can be performed according to the size of the atomic ID or number.
[0112] Referring to Figure 9 , after sorting, the forces on the pairwise edges can be more easily synchronized.
[0113] Figure 10 A schematic diagram showing the communication of pairwise forces obtained between different processes is shown. Referring to Figure 10 , through the communication of forces, Process 1 and Process 2 can respectively correct the forces based on the magnitudes of the pairwise interaction forces.
[0114] In step S303, based on the corrected forces, determine the resultant force exerted on each atom in the original atomic graph by the atoms in the preprocessed atomic graph.
[0115] As an example, the resultant force exerted on an atom can be obtained based on the following equation.
[0116]
[0117] Figure 11 A schematic diagram showing the resultant force exerted on Atom 1 is shown.
[0118] In step S304, predict the position of each atom based on the resultant force. As understood by those skilled in the art, the updated coordinates of an atom can be determined according to the force exerted on the atom and the simulation step size.
[0119] As an example, the machine learning model includes a graph neural network and a plurality of force prediction networks. The graph neural network includes a plurality of cascaded layers. The step of determining the forces between the interacting atoms in the preprocessed atomic graph includes: obtaining the features output by each layer of the graph neural network by inputting the features output by the previous layer of each layer of the graph neural network into each layer, wherein the input of the first layer of the graph neural network is the preprocessed atomic graph; and determining the forces between the interacting atoms in the preprocessed atomic graph by using the force prediction network corresponding to each layer based on the features output by each layer.
[0120] Figure 12 FIG. shows a schematic flowchart of determining the forces of each atom in the original atomic graph exerted by each atom interacting with the each atom in the preprocessed atomic graph by using a pre-trained machine learning model according to an embodiment of the present disclosure.
[0121] Referring to Figure 12 , the machine learning model includes a graph neural network and three force predictors, wherein the graph neural network includes three layers.
[0122] Edge feature 1 is obtained by inputting the preprocessed atomic graph into the first layer of the graph neural network, edge feature 2 is obtained by inputting edge feature 1 into the second layer of the graph neural network, edge feature 3 is obtained by inputting edge feature 2 into the third layer of the graph neural network, the values of the forces on the edges 1-3 are obtained by inputting edge features 1-3 into force predictors P1-P3 respectively, and the finally predicted force on the edge is obtained based on the values of the forces on the edges 1-3. In the related art, only edge feature 3 is used to predict the force on the edge.
[0123] According to an embodiment of the present disclosure, obtaining the final force on the edge based on the forces on the edges of all layers can bring higher accuracy and faster convergence speed.
[0124] The machine learning model according to an embodiment of the present disclosure is applicable to a spatially partitioned atomic graph.
[0125] As an example, according to the training process of the model, the values of the forces 1-3 can be directly added to obtain the final force on the edge or the final force on the edge can be obtained based on weighted summation. As an example, the summation weights can be obtained through training.
[0126] As described above, after the edges are matched, the process and the subspace to which the paired edges belong can be found, so as to obtain the forces on the opposite edges to correct or calibrate the forces on the opposite edges.
[0127] Figure 13 FIG. shows a schematic diagram of matching edge pairs for the case where the simulation space is divided into 4 processes.
[0128] Referring to Figure 13, for example, the force of the atoms in the ghost space calculated in process 0 on the atoms in the local space and the force of the ghost space calculated in the other three processes on the atoms in the local space are matching pairwise forces.
[0129] The above reference Figures 1 to 13 described a molecular dynamics simulation method according to an embodiment of the present disclosure. Below, with reference to Figure 14 a molecular dynamics simulation according to an embodiment of the present disclosure will be described.
[0130] Reference Figure 14 , the molecular dynamics simulation device 1400 may include: a first determination unit 1410, a correction unit 1420, a second determination unit 1430, and a prediction unit 1440.
[0131] As understood by those skilled in the art, the molecular dynamics simulation device 1400 may also additionally include other components, and at least one of the components included in the molecular dynamics simulation device 1400 may be split or combined.
[0132] As an example: The first determination unit 1410 may be configured to: use a machine learning model to determine the forces between interacting atoms in a preprocessed atomic graph, where the preprocessed atomic graph is composed of an original atomic graph and an original atomic graph mirror-copied around the original atomic graph.
[0133] As an example, the correction unit 1420 may be configured to: correct each of the two forces in each pair of pairwise interaction forces so that the magnitudes of the two forces are the same.
[0134] As an example, the second determination unit 1430 may be configured to: based on the corrected forces, determine the resultant force of the atoms in the preprocessed atomic graph on each atom in the original atomic graph.
[0135] As an example, the prediction unit 1440 may be configured to: based on the resultant force, predict the positions of each atom.
[0136] As an example, the pairwise interaction forces include: pairwise interaction forces obtained in the same simulation process and pairwise interaction forces obtained in different simulation processes, where one force and another force in the pairwise interaction forces obtained in the same simulation process are obtained in the same simulation process, and one force in the pairwise interaction forces obtained in different simulation processes is obtained by a first simulation process, and the other force is obtained by a second simulation process different from the first simulation process.
[0137] As an example, the first determination unit 1410 may be configured to: determine the forces between the interacting atoms in the first preprocessed atomic graph through a first simulation process; and determine the forces between the interacting atoms in the second preprocessed atomic graph through a second simulation process, where the first preprocessed atomic graph and the second preprocessed atomic graph are obtained by partitioning the preprocessed atomic graph, and the first simulation process and the second simulation process are parallel simulation processes.
[0138] As an example, the molecular dynamics simulation device may further include: a matching unit (not shown), configured to assign the same ID to each atom in the original atomic graph and the atom corresponding to each atom in the original atomic graph in the mirror-replicated original atomic graph; and match the pairwise interaction forces based on the IDs of the atoms in the preprocessed atomic graph.
[0139] As an example, the molecular dynamics simulation device 1400 may further include: a third determination unit (not shown), configured to: map the preprocessed atomic graph to a lambda space, where the lambda space includes a plurality of subspaces; determine the ID of the subspace corresponding to one of the two atoms corresponding to each pair of interaction forces; determine the ID of the subspace corresponding to the other atom among the two atoms based on the ID of the subspace corresponding to one atom; and determine whether each pair of interaction forces needs to be corrected based on the ID of the subspace corresponding to one atom and the ID of the subspace corresponding to the other atom.
[0140] As an example, the correction unit 1420 may be configured to: obtain the average value of the magnitudes of the two forces in the pairwise interaction forces as the magnitude of each of the two forces.
[0141] As an example, the machine learning model includes a graph neural network and a plurality of force prediction networks. The graph neural network includes a plurality of cascaded layers. The first determination unit 1410 may be configured to: obtain the features output by each layer of the graph neural network by inputting the features output by the previous layer of each layer of the graph neural network into each layer, where the input of the first layer of the graph neural network is the preprocessed atomic graph; and determine the forces between the interacting atoms in the preprocessed atomic graph by using the force prediction network corresponding to each layer based on the features output by each layer.
[0142] According to an embodiment of the present disclosure, a computer-readable storage medium storing instructions may also be provided, wherein when the instructions are run by at least one processor, the at least one processor is caused to execute the molecular dynamics simulation method according to an embodiment of the present disclosure. Examples of such computer-readable storage media include: read-only memory (ROM), programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-RLTH, BD-RE, Blu-ray or optical disc storage, hard disk drive (HDD), solid state drive (SSD), cartridge memory (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk, and any other device configured to store a computer program and any associated data, data files, and data structures in a non-transitory manner and to provide the computer program and any associated data, data files, and data structures to a processor or computer such that the processor or computer can execute the computer program. The computer program in the above computer-readable storage medium may run in an environment deployed in computer devices such as clients, hosts, proxy devices, servers, etc. In addition, in one example, the computer program and any associated data, data files, and data structures are distributed on a networked computer system such that the computer program and any associated data, data files, and data structures are stored, accessed, and executed in a distributed manner by one or more processors or computers.
[0143] According to an embodiment of the present disclosure, a computer program product may also be provided, and the instructions in the computer program product may be executed by a processor of a computer device to complete the molecular dynamics simulation method described herein.
[0144] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed by the present disclosure. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of the present disclosure are pointed out by the following claims.
Claims
1. A molecular dynamics simulation method, comprising: Determining forces between interacting atoms in a preprocessed atomic graph using a machine learning model, wherein the preprocessed atomic graph is composed of an original atomic graph and an original atomic graph mirror-copied around the original atomic graph; Correcting two forces in each pair of pairwise interaction forces such that the magnitudes of the two forces are the same; Determining the resultant force exerted on each atom in the original atomic graph by the atoms in the preprocessed atomic graph based on the corrected forces; and Predicting the position of each atom based on the resultant force.
2. The method according to claim 1, wherein the pairwise interaction forces include: Pairwise interaction forces obtained in the same simulation process and pairwise interaction forces obtained in different simulation processes, wherein one force and another force in the pairwise interaction forces obtained in the same simulation process are obtained in the same simulation process, and one force in the pairwise interaction forces obtained in different simulation processes is obtained by a first simulation process, and the other force is obtained by a second simulation process different from the first simulation process.
3. The method according to claim 2, wherein The step of determining forces between interacting atoms in the preprocessed atomic graph includes: Determining forces between interacting atoms in a first preprocessed atomic graph through a first simulation process; and Determining forces between interacting atoms in a second preprocessed atomic graph through a second simulation process, wherein the first preprocessed atomic graph and the second preprocessed atomic graph are obtained by partitioning the preprocessed atomic graph, and the first simulation process and the second simulation process are parallel simulation processes.
4. The method according to claim 3, further comprising: Assigning the same ID to each atom in the original atomic graph and the atom corresponding to each atom in the original atomic graph in the mirror-copied original atomic graph; and Matching the pairwise interaction forces based on the IDs of the atoms in the preprocessed atomic graph.
5. The method according to claim 1, further comprising: Mapping the preprocessed atomic graph to a lambda space, wherein the lambda space includes a plurality of subspaces; Determining the ID of the subspace corresponding to one of the two atoms corresponding to each pair of interaction forces; Determining the ID of the subspace corresponding to the other atom among the two atoms based on the ID of the subspace corresponding to one atom; and Determining whether each pair of interaction forces needs to be corrected based on the ID of the subspace corresponding to one atom and the ID of the subspace corresponding to the other atom.
6. The method according to claim 1, wherein the step of correcting the forces includes: Obtaining the average value of the magnitudes of the two forces in the pairwise interaction forces as the magnitude of each of the two forces.
7. The method according to claim 1, wherein the machine learning model includes a graph neural network and a plurality of force prediction networks, the graph neural network includes a plurality of cascaded layers, and the step of determining forces between interacting atoms in the preprocessed atomic graph includes: Obtaining the features output by each layer of the graph neural network by inputting the features output by the previous layer of each layer of the graph neural network into each layer, wherein the input of the first layer of the graph neural network is the preprocessed atomic graph; and Based on the features output by each layer, use the force prediction network corresponding to each layer to determine the forces between the interacting atoms in the preprocessed atomic graph.
8. A molecular dynamics simulation device, comprising: A first determination unit configured to: use a machine learning model to determine the forces between the interacting atoms in the preprocessed atomic graph, wherein the preprocessed atomic graph is composed of an original atomic graph and an original atomic graph mirror-replicated around the original atomic graph; A correction unit configured to: correct the two forces in each pair of pairwise interaction forces so that the magnitudes of the two forces are the same; A second determination unit configured to: based on the corrected forces, determine the resultant force of the atoms in the preprocessed atomic graph acting on each atom in the original atomic graph; and A prediction unit configured to: predict the position of each atom based on the resultant force.
9. The molecular dynamics simulation device according to claim 8, wherein the pairwise interaction forces include: Pairwise interaction forces obtained in the same simulation process and pairwise interaction forces obtained in different simulation processes, wherein, one force and another force in the pairwise interaction forces obtained in the same simulation process are obtained in the same simulation process, and one force in the pairwise interaction forces obtained in different simulation processes is obtained by a first simulation process, and the other force is obtained by a second simulation process different from the first simulation process.
10. A computer-readable storage medium storing a program, the program causing the processor to execute the molecular dynamics simulation method according to any one of claims 1-7 when executed by the processor.