Molecular system momentum correction method, system, computer device and storage medium
By adjusting the symbol-based preset value of the fixed-point operation results of atoms in the molecular dynamics calculation system, the momentum of the molecular system is corrected, the energy non-conservation problem caused by fixed-point operation is solved, and the calculation accuracy is improved.
Patent Information
- Application Number
- CN202411985396.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-08
AI Technical Summary
In the molecular dynamics calculation system, the cutoff method of fixed-point operation causes the calculation performance and accuracy of atomic forces to be affected, resulting in unconservation of the overall energy and causing serious calculation errors.
By obtaining the first atomic weight and the second atomic weight of each atom in the molecular system, performing fixed-point operation, obtaining the initial fixed-point operation result, and increasing the preset value according to the positive and negative symbols of the result, obtaining the corrected target fixed-point operation result, and finally performing a global calculation to correct the momentum of the molecular system.
The calculation results that satisfy the conservation of the system's energy is achieved, the correctness of the conformation of the molecular system is ensured, and the accuracy of the overall energy calculation of the molecular dynamics system is improved.
Smart Images

Figure CN119785900A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of molecular dynamics technology, and in particular, to a method, system, computer device and storage medium for correcting momentum of a molecular system. Background Art
[0002] The molecular dynamics calculation system needs to ensure that the sum of the forces acting on all atoms is zero when performing any calculations and simulations, so as to ensure the conservation of energy in the overall molecular dynamics calculation system. If the sum of the forces in the overall molecular dynamics calculation system is not zero, serious calculation errors will occur, which will have a serious impact on the conformation and energy trajectory of the system.
[0003] The total number of atoms in the system for molecular dynamics calculations often reaches tens of thousands or millions. Each time step requires the calculation of the interaction forces between atoms, such as the van der Waals and electrostatic interactions between atoms, which requires a huge amount of calculation. In order to quickly calculate the atomic forces, the process is often implemented using fixed-point operations. The truncation method of fixed-point operations will have different effects on the calculation performance and accuracy of the atomic forces. Compared with rounding off the forces, the truncation method of rounding down can be implemented more quickly, but it will cause the resultant force of the atomic system to be non-zero, making the energy of the overall molecular dynamics calculation system not conserved, causing serious calculation errors.
[0004] Therefore, the overall energy calculation accuracy of the current molecular dynamics system is relatively poor. Summary of the invention
[0005] The embodiments of the present application provide a method, system, computer device and storage medium for correcting momentum of a molecular system.
[0006] A first aspect of an embodiment of the present application provides a method for correcting momentum of a molecular system, comprising:
[0007] Obtain the first atomic weight and the second atomic weight of each atom in the molecular system;
[0008] Performing fixed-point number operations on the first atomic mass and the second atomic mass to obtain an initial fixed-point operation result of the third atomic mass;
[0009] For each atom, a corresponding preset value is added according to the sign of the initial fixed-point calculation result to obtain a corrected target fixed-point calculation result;
[0010] A global calculation is performed on all atoms in the molecular system according to the target fixed-point calculation result to obtain the corrected momentum of the molecular system.
[0011] In an optional embodiment of the present application, the first atomic weight is a fitting parameter between two atoms, the second atomic weight is a relative distance between the two atoms, and the third atomic weight is an interaction force between the two atoms.
[0012] In an optional embodiment of the present application, the first atomic mass and the second atomic mass are subjected to fixed-point number operation to obtain an initial fixed-point operation result of the third atomic mass, which is calculated according to the following formula:
[0013] F i =gamma×△r
[0014] F j =-gamma×△r
[0015] Among them, F i represents the force on atom i, F j represents the force acting on atom j, gamma represents the fitting parameter, and △r represents the relative distance between atoms i and j.
[0016] In an optional embodiment of the present application, for each atom, adding a corresponding preset value according to the sign of the initial fixed-point operation result to obtain a corrected target fixed-point operation result includes:
[0017] If the initial fixed-point calculation result is a positive value, adding a first preset value to the initial fixed-point calculation result to obtain the target fixed-point calculation result;
[0018] If the initial fixed-point operation result is a negative value, then adding a second preset value to the initial fixed-point operation result to obtain the target fixed-point operation result; or,
[0019] If the initial fixed-point operation result is a negative value, adding a first preset value to the initial fixed-point operation result to obtain the target fixed-point operation result;
[0020] If the initial fixed-point operation result is a positive value, a second preset value is added to the initial fixed-point operation result to obtain the target fixed-point operation result.
[0021] In an optional embodiment of the present application, the first preset value is a binary value starting with 1 and ending with 0, wherein the number of "0" is the truncation shift amount minus 1;
[0022] The second preset value is a binary value that starts with 1 and ends with 1, wherein the number of "1"s is the truncation shift amount minus 1.
[0023] In an optional embodiment of the present application, for each atom, adding a corresponding preset value according to the sign of the initial fixed-point operation result to obtain a corrected target fixed-point operation result includes:
[0024] For each atom, a corresponding preset value is added according to the sign of the initial fixed-point calculation result to obtain a corrected intermediate fixed-point calculation result;
[0025] The intermediate fixed-point operation result is rounded down and truncated based on a preset storage bit width to obtain the target fixed-point operation result.
[0026] In an optional embodiment of the present application, the above molecular system momentum correction method further includes:
[0027] The truncation shift amount is determined according to a bit width difference between the intermediate fixed-point operation result and the preset storage bit width.
[0028] A second aspect of the embodiments of the present application provides a molecular system momentum correction system, comprising:
[0029] An acquisition module, used for acquiring the first atomic weight and the second atomic weight of each atom in the molecular system;
[0030] A first operation module, used for performing fixed-point number operation on the first atomic mass and the second atomic mass to obtain an initial fixed-point operation result of a third atomic mass;
[0031] A second operation module is used to increase the corresponding preset value according to the sign of the initial fixed-point operation result for each atom to obtain a corrected target fixed-point operation result;
[0032] The correction module is used to perform global calculation on all atoms in the molecular system according to the target fixed-point calculation result to obtain the corrected momentum of the molecular system.
[0033] According to a third aspect of an embodiment of the present application, a computer device is provided, comprising: a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above methods when executing the computer program.
[0034] According to a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0035] The molecular system momentum correction method provided in the embodiment of the present application performs fixed-point number operations on the first atomic weight and the second atomic weight to obtain an initial fixed-point operation result of the third atomic weight, and then, for each atom, adds a corresponding preset value according to the positive or negative sign of the initial fixed-point operation result to obtain a corrected target fixed-point operation result; the initial fixed-point operation result is corrected by simply adding a preset value to obtain a corrected target fixed-point operation result, and finally, a global calculation is performed on all atoms in the molecular system according to the target fixed-point operation result to obtain the corrected momentum of the molecular system, so that the calculation result meets the requirements of system energy conservation, ensures the correctness of the molecular system conformation, and thus improves the overall energy calculation accuracy of the molecular dynamics system. At the same time, the molecular system momentum correction method provided in the embodiment of the present application has strong adaptability, and can be used in the calculation process of various forces in molecular dynamics, such as van der Waals, electrostatic forces, etc., and has a wider range of applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0037] Figure 1 A schematic diagram of an application scenario of a molecular system momentum correction method provided in one embodiment of the present application;
[0038] Figure 2 A flow chart of a method for correcting momentum of a molecular system provided in one embodiment of the present application;
[0039] Figure 3 A schematic diagram of the structure of a molecular system momentum correction system provided in one embodiment of the present application;
[0040] Figure 4 A schematic diagram of the computer device structure provided for one embodiment of the present application. DETAILED DESCRIPTION
[0041] In the process of implementing the present application, the inventors found that the overall energy calculation accuracy of the current molecular dynamics system is relatively poor.
[0042] In response to the above problems, the embodiments of the present application provide a molecular system momentum correction method, system, computer device and storage medium to improve the overall energy calculation accuracy of the molecular dynamics system.
[0043] The solutions in the embodiments of the present application can be implemented using various computer languages, for example, the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0044] In order to make the technical solutions and advantages in the embodiments of the present application more clearly understood, the exemplary embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0045] The following is a brief description of the application environment of the molecular system momentum correction method provided in the embodiment of the present application:
[0046] The molecular system momentum correction method provided in the embodiments of the present application can be applied to any electronic device such as servers, computers, laptops, mobile terminals, wearable devices, etc., which are not listed exhaustively here and can be flexibly configured according to actual conditions.
[0047] See also Figure 1 The following embodiments use any of the above electronic devices as the execution subject to specifically illustrate the method for correcting the momentum of a molecular system provided by the embodiment of the present application. The method for correcting the momentum of a molecular system provided by the embodiment of the present application includes the following steps 101 to 104:
[0048] Step 101, obtaining the first atomic weight and the second atomic weight of each atom in the molecular system;
[0049] Step 102, performing fixed-point number operations on the first atomic mass and the second atomic mass to obtain an initial fixed-point operation result of the third atomic mass;
[0050] A molecular system includes multiple atoms. For example, a water molecule system (H2O) includes two H atoms and one O atom. Of course, this is only an example and does not constitute a limitation on the molecular system and corresponding atoms of the embodiments of the present application.
[0051] Among them, the first atomic weight, the second atomic weight and the third atomic weight are all atomic physical quantities involved in the atomic fixed-point number calculation process, such as mass, speed, coordinates, distance, force, etc., and other parameters required for calculating these physical quantities, such as correction coefficients, fitting parameters, etc., which are not exhaustively listed here and can be flexibly configured and selected according to actual conditions. It should be emphasized that the third atomic weight is the fixed-point calculation result of the first atomic weight and the second atomic weight, for example, C=A×B, where A represents the first atomic weight, B represents the second atomic weight, and C represents the third atomic weight.
[0052] Step 103: for each atom, a corresponding preset value is added according to the sign of the initial fixed-point operation result to obtain a corrected target fixed-point operation result;
[0053] That is, when the initial fixed-point operation result is a positive value, the first preset value may be added to the initial fixed-point operation result; when the initial fixed-point operation result is a negative value, the second preset value may be added to the initial fixed-point operation result.
[0054] Step 104: Perform a global calculation on all atoms in the molecular system according to the target fixed-point calculation result to obtain the corrected momentum of the molecular system.
[0055] For example, the forces acting on all atoms in a molecular system are calculated globally to obtain the total momentum of the molecular system.
[0056] The molecular system momentum correction method provided in the embodiment of the present application performs fixed-point number operations on the first atomic weight and the second atomic weight to obtain an initial fixed-point operation result of the third atomic weight, and then, for each atom, adds a corresponding preset value according to the positive or negative sign of the initial fixed-point operation result to obtain a corrected target fixed-point operation result; the initial fixed-point operation result is corrected by simply adding a preset value to obtain a corrected target fixed-point operation result, and finally, a global calculation is performed on all atoms in the molecular system according to the target fixed-point operation result to obtain the corrected momentum of the molecular system, so that the calculation result meets the requirements of system energy conservation, ensures the correctness of the molecular system conformation, and thus improves the overall energy calculation accuracy of the molecular dynamics system. At the same time, the molecular system momentum correction method provided in the embodiment of the present application has strong adaptability, and can be used in the calculation process of various forces in molecular dynamics, such as van der Waals, electrostatic forces, etc., and has a wider range of applications.
[0057] In an optional embodiment of the present application, the above molecular system momentum correction method further includes the following steps:
[0058] The truncation shift amount is determined according to a bit width difference between the intermediate fixed-point operation result and the preset storage bit width.
[0059] For example, the above example C=A×B, wherein A represents the first atomic quantifier, B represents the second atomic quantifier, and C represents the third atomic quantifier. For example, the preset storage bit width WorldSize is 32 bits, the first atomic quantifier A and the second atomic quantifier B are both 32 bits, and the obtained third atomic quantifier C (i.e., the intermediate fixed-point operation result) exceeds the preset storage bit width WorldSize. In order to avoid C from being converted to a saturated value, it is generally necessary to shift the third atomic quantifier C to the right to correctly store the third atomic quantifier C within the preset storage bit width. The truncated shift amount in the embodiment of the present application is the right shift amount, that is, the truncated shift amount is the bit width difference between the intermediate fixed-point operation result and the preset storage bit width.
[0060] See also Figure 2In an optional embodiment of the present application, in the above step 103, for each atom, the corresponding preset value is added according to the sign of the initial fixed-point operation result to obtain the corrected target fixed-point operation result, including the following steps 201-202:
[0061] Step 201: for each atom, a corresponding preset value is added according to the sign of the initial fixed-point operation result to obtain a corrected intermediate fixed-point operation result;
[0062] Step 202: perform rounding and truncation processing on the intermediate fixed-point operation result based on a preset storage bit width to obtain the target fixed-point operation result.
[0063] The molecular system momentum correction method provided in the embodiment of the present application, after adding the corresponding preset value to the sign of the initial fixed-point calculation result, rounds down the numerical value of the obtained intermediate fixed-point calculation result (for example, the third atomic weight C mentioned above), which is equivalent to rounding off, can greatly reduce the subsequent calculation amount, thereby ensuring fast computing performance.
[0064] In an optional embodiment of the present application, the above step 103, for each atom, adding a corresponding preset value according to the sign of the initial fixed-point operation result to obtain a corrected target fixed-point operation result, includes the following two cases:
[0065] First case:
[0066] If the initial fixed-point calculation result is a positive value, adding a first preset value to the initial fixed-point calculation result to obtain the target fixed-point calculation result;
[0067] If the initial fixed-point operation result is a negative value, adding a second preset value to the initial fixed-point operation result to obtain the target fixed-point operation result;
[0068] Second case:
[0069] If the initial fixed-point operation result is a negative value, adding a first preset value to the initial fixed-point operation result to obtain the target fixed-point operation result;
[0070] If the initial fixed-point operation result is a positive value, a second preset value is added to the initial fixed-point operation result to obtain the target fixed-point operation result.
[0071] For the result of the initial fixed-point operation, the preset value of the sum can be swapped, that is, it is sufficient to ensure that the sum values are different when the signs are different. For example, when the initial fixed-point operation result is a negative value, add '100...00' to the result, where the number of '0's after '1' is shift-1 (truncation shift amount -1). When the initial fixed-point operation result is a positive value, add '111...11' to the result, where the number of '1's is shift-1 (truncation shift amount -1), and then round down to ensure that the sum of the forces acting on each atom is 0.
[0072] In an optional embodiment of the present application, the first preset value is a binary value that starts with 1 and ends with 0, wherein the number of "0"s is the truncation shift amount minus 1; the second preset value is a binary value that starts with 1 and ends with 1, wherein the number of "1"s is the truncation shift amount minus 1.
[0073] The first preset value of the binary number '100...00' is approximately equal to 0.5 in decimal, and the second preset value of the binary number '11...11' is approximately equal to 0.4999 in decimal. In the actual binary operation process, the first preset value (a binary number starting with 1 and ending with 0) and the second preset value (a binary number starting with 1 and ending with 1) can be added with the minimum numerical value to achieve correction of the atomic force, thereby achieving correction of the total momentum of the molecular system. The calculation method is simple and fast, saving resource overhead.
[0074] In an optional embodiment of the present application, the first atomic weight is a fitting parameter between two atoms, the second atomic weight is a relative distance between two atoms, and the third atomic weight is an interaction force between two atoms. The interaction force may be a van der Waals force or an interaction force between atoms, etc., which is not specifically limited in the present embodiment.
[0075] In an optional embodiment of the present application, taking the force in the above embodiment as an example, in the above step 102, fixed-point number operations are performed on the first atomic mass and the second atomic mass to obtain an initial fixed-point operation result of the third atomic mass, which is calculated according to the following formula:
[0076] F i =gamma×△r
[0077] F j =-gamma×△r
[0078] Among them, F i represents the force on atom i, F j represents the force acting on atom j, gamma represents the fitting parameter, and △r represents the relative distance between atoms i and j.
[0079] In atomic weight fixed-point calculations, when calculating gamma×△r using the molecular system momentum correction method of the embodiment of the present application, a sign positive or negative judgment is required before rounding down:
[0080] Initial fixed-point operation result F i or F j When it is a negative value, the initial fixed-point operation result F i or F j Add '100...00', where the number of '0's after '1' is shift-1 (truncation shift amount -1). i or F j When it is positive, the initial fixed-point operation result F i or F j Add '111...11', where the number of '1' is shift-1 (truncation shift amount-1), and then round down to ensure F i and F j The sum is 0, which makes the energy of the molecular dynamics system conserved, the resultant force is 0, the total momentum is 0, and the energy approaches a stable state.
[0081] In order to more clearly illustrate the above fixed-point number operation, the following provides an example with a preset storage bit width of 32 bits. The first atomic mass and the second atomic mass are the fitting parameters gamma and △r respectively. The first atomic mass gamma and the second atomic mass △r are both stored in the preset storage bit width of 32 bits. After the fixed-point multiplication operation, it is necessary to right shift 32 bits and then truncate:
[0082] gamma = '01100100100001111110110101010001' (corresponding to decimal number: 843314856)
[0083] Δr = '10001110100100000001110110111001' (corresponding to decimal number: -951578916)
[0084] 1) Calculate gamma × △r to get:
[0085] '11010011011101000001000001110011011101110111001010110000000000'
[0086] If the result is negative, add: '1111111111111111111111111111111'
[0087] get:
[0088] '1101001101110100000100000111001111110111101011001010110000000000'
[0089] Shift right 32 bits and truncate down to get F i :
[0090] '11010011011101000001000001110011' (corresponding to the decimal number: -747368333)
[0091] 2) Calculate -gamma×△r to get:
[0092] '00101100100010111110111110001100100010000101001101010000000000'
[0093] If the result is positive, add: '10000000000000000000000000000000000'
[0094] get:
[0095] ′00101100100010111110111110001101000010000101001101010000000000′
[0096] Shift right 32 bits and truncate down to get F j :
[0097] '00101100100010111110111110001101' (corresponding decimal number: 747368333)
[0098] In an optional embodiment of the present application, in the above step 104, after performing a global calculation on all atoms in the molecular system according to the target fixed-point operation result to obtain the corrected momentum of the molecular system, the molecular system momentum correction method further simulates the molecular system:
[0099] For each molecular system, virtual site information of virtual sites in the molecular system is calculated in parallel based on each of the calculation units, and the virtual site information and charge information of the virtual site are updated to the virtual site information table in the storage unit; wherein the virtual site refers to any virtual point in the molecular system used to characterize the molecular system;
[0100] For each atom in each molecular system, atomic information of each atom in the molecular system is calculated in parallel based on each of the calculation units; wherein the atomic information includes at least one of short-range forces and long-range electrostatic forces between atoms, and atomic positions and atomic velocities of each atom;
[0101] Based on the obtained atomic information, the virtual site information of each virtual site is updated to obtain new virtual site information;
[0102] Assigning the obtained new virtual site information to each atom to obtain new atomic information of each atom;
[0103] Based on the new atomic information, the boundary of the dynamic system where the molecular system is located is constrained, and the integrated data of the dynamic system is output.
[0104] In an optional embodiment of the present application, the virtual site information of the virtual sites in the molecular system is calculated in parallel based on each of the calculation units, including:
[0105] A plurality of data structures are configured in each of the storage units, and molecular computing model parameters are configured in a global control unit in the computing unit; wherein the plurality of data structures at least include: a molecular information list, an atom information list, and the virtual site information list;
[0106] For each of the molecular systems, each of the calculation units calculates the molecular centroid position and the molecular target calculation unit of each of the molecular systems based on the molecular calculation model parameters, and stores the molecular centroid position and the molecular target calculation unit in the molecular information list corresponding to the storage unit, and stores the atomic information of each atom in the molecular system in the molecular information list corresponding to the storage unit;
[0107] For each of the molecular systems, each of the calculation units calculates the virtual site information of the virtual site based on the molecular calculation model parameters, and stores the virtual site information in the virtual site information list.
[0108] In an optional embodiment of the present application, if the molecular system is a water molecule, the molecular centroid position is calculated according to the following formula:
[0109] r_com=(r_O+r_H1+r_H2) / 3
[0110] Among them, r_com represents the position of the molecular centroid, r_O represents the calculation of the three-dimensional coordinates of the O atom, r_H1 represents the calculation of the three-dimensional coordinates of the first H atom, and r_H2 represents the calculation of the three-dimensional coordinates of the second H atom;
[0111] The molecular target calculation unit is calculated according to the following formula:
[0112] CU:(x,y,z)=floor(r_com / box_size*[X,Y,Z])
[0113] CU: (x, y, z) represents the coordinates of the molecular target calculation unit, r_com represents the position of the molecular centroid, and box_size*[X, Y, Z] represents the total length of the three directions of the simulation box.
[0114] In an optional embodiment of the present application, if the molecular system is a water molecule, the virtual site information is calculated according to the following formula:
[0115] a=b=0.5*(r_OM(cos(θ_HOM)*r_OH))
[0116] x_M=x_O+a*(x_H1–x_O)+b*(x_H2–x_O)
[0117] y_M=y_O+a*(y_H1–y_O)+b*(y_H2–y_O)
[0118] z_M=z_O+a*(z_H1–z_O)+b*(z_H2–z_O)
[0119] Among them, a and b represent the weight coefficients of the virtual site M, which are determined according to the angles between O, H, and M atoms; x_M, y_M, and z_M represent the three-dimensional coordinates of the virtual site M, respectively; x_O, y_O, and z_O represent the three-dimensional coordinates of the O atom, respectively; x_H1, y_H1, and z_H1 represent the three-dimensional coordinates of the first H atom, respectively; x_H2, y_H2, and z_H2 represent the three-dimensional coordinates of the second H atom, respectively; r_OM and r_OH represent the position vectors of OM and OH, respectively; and θ_HOM represents the angle between OM and OH.
[0120] In an optional embodiment of the present application, the calculating atomic information of each atom in the molecular system based on each of the calculating units in parallel includes:
[0121] The short-range force in the atomic information is calculated according to the following formula:
[0122] U_LJ(r)=4ε[(σ / r)^12-(σ / r)^6]
[0123] F_LJ(r)=24ε[(σ / r)^6*1 / r^2–2*(σ / r)^12*1 / r^2]*x
[0124] Among them, U_LJ(r) represents the Lanner-Jones potential between atoms, F_LJ(r) represents the Lanner-Jones force between atoms, ε and σ represent the Lanner-Jones interaction parameters, r represents the set cutoff radius, and x represents the distance between atoms;
[0125] The long range electrostatic forces are calculated according to the kgse method.
[0126] In an optional embodiment of the present application, before updating the virtual site information of each virtual site based on the obtained atomic information to obtain new virtual site information, the method further includes:
[0127] For each of the molecular systems, the force acting on the virtual site in the molecular system is distributed to each atom to obtain the virtual force acting on each atom.
[0128] In an optional embodiment of the present application, if the molecular system is a water molecule, then for each molecular system, the force exerted on the virtual site in the molecular system is distributed to each atom to obtain the virtual force exerted on each atom, which is calculated according to the following formula:
[0129] F_O=F_O_direct+F_M*(1-ab)
[0130] F_H1=F_H1_direct+F_M*a
[0131] F_H2=F_H2_direct+F_M*b
[0132] Among them, F_O, F_H1, F_H2 are the virtual forces acting on the O atom, the first H atom and the second H atom respectively, F_O_direct, F_H1_direct, F_H2_direct represent the total forces of the long-range electrostatic force, short-range force and the allocated virtual force acting on the O atom, the first H atom and the second H atom respectively, F_M represents the virtual force acting on the virtual site M, a and b represent the weight coefficients of the virtual site M, which are determined according to the angles between the O, H and M atoms.
[0133] In an optional embodiment of the present application, the step of assigning the obtained new virtual site information to each atom to obtain new atomic information of each atom includes:
[0134] After allocating the obtained new virtual site information to each atom, each of the calculation units calculates the position information and atomic velocity information of each atom in parallel.
[0135] In an optional embodiment of the present application, each of the calculation units calculates the position information and atomic velocity information of each atom in parallel based on the following formula:
[0136] r(t+Δt)=r(t)+v(t)Δt+0.5a(t)Δt^2
[0137] v(t+Δt / 2)=v(t)+0.5a(t)Δt
[0138] a(t+Δt)=F(t+Δt) / m
[0139] v(t+Δt)=v(t+Δt / 2)+0.5a(t+Δt)Δt
[0140] Among them, r represents the set cutoff radius, v represents the atomic velocity, a represents the atomic acceleration, F represents the sum of the short-range force and the long-range electrostatic force acting on the atom, m represents the atomic mass, t represents the current moment, and Δt represents the time step.
[0141] In an optional embodiment of the present application, after allocating the obtained new virtual site information to each atom to obtain new atomic information of each atom, the method further includes:
[0142] The mshake / mrattle algorithm was applied to maintain the rigid structure of each of the described molecular systems.
[0143] In an optional embodiment of the present application, the method further includes:
[0144] The virtual site information of the virtual site is recalculated according to the molecular information and atomic information of each molecule after maintaining the rigid structure of each molecular system.
[0145] In an optional embodiment of the present application, the constraining the boundary of the dynamic system where the molecular system is located based on the new atomic information and outputting the integrated data of the dynamic system includes:
[0146] Determine whether each of the molecular systems and each atom in the molecular system is beyond a preset range, and if the molecular system or each atom in the molecular system is beyond the preset range, redetermine the position of the target computing unit;
[0147] The molecular system or atom beyond the preset range is relocated, and the molecular information list, the atom information list and the virtual site information list are updated based on the molecular information and atom information after the relocation.
[0148] In an optional embodiment of the present application, for atoms beyond the boundary of the simulation box, the position information of the migrated atoms is calculated according to the following formula:
[0149] r_new=r_old-box_size*fix(r_old / box_size)
[0150] Among them, r_new represents the atomic coordinates after migration, r_old represents the atomic coordinates before migration, box_size represents the size of the simulation box, and fix represents the truncation operation.
[0151] In an optional embodiment of the present application, the method further includes:
[0152] The global control unit calculates global information of the dynamics system where all molecular systems are located and distributes it to each of the calculation units;
[0153] Each calculation unit repeatedly iteratively calculates the molecular information and atomic information of each molecular system until an iteration condition is met, and then outputs the integrated data of the dynamic system.
[0154] It should be understood that, although the various steps in the flow chart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0155] See also Figure 3 One embodiment of the present application provides a molecular system momentum correction system 300, comprising: an acquisition module 310, a first operation module 320, a second operation module 330 and a correction module 340, wherein:
[0156] The acquisition module 310 is used to acquire the first atomic weight and the second atomic weight of each atom in the molecular system;
[0157] The first operation module 320 is used to perform fixed-point number operation on the first atomic mass and the second atomic mass to obtain an initial fixed-point operation result of the third atomic mass;
[0158] The second operation module 330 is used to increase the corresponding preset value according to the sign of the initial fixed-point operation result for each atom to obtain a corrected target fixed-point operation result;
[0159] The correction module 340 is used to perform global calculation on all atoms in the molecular system according to the target fixed-point calculation result to obtain the corrected momentum of the molecular system.
[0160] In an optional embodiment of the present application, the first atomic weight is a fitting parameter between two atoms, the second atomic weight is a relative distance between the two atoms, and the third atomic weight is an interaction force between the two atoms.
[0161] In an optional embodiment of the present application, the first operation module 320 is specifically used to calculate the initial fixed-point operation result according to the following formula:
[0162] F i =gamma×△r
[0163] F j =-gamma×△r
[0164] Among them, F i represents the force on atom i, F j represents the force acting on atom j, gamma represents the fitting parameter, and △r represents the relative distance between atoms i and j.
[0165] In an optional embodiment of the present application, the second operation module 330 is specifically configured to, if the initial fixed-point operation result is a positive value, add a first preset value to the initial fixed-point operation result to obtain the target fixed-point operation result;
[0166] If the initial fixed-point operation result is a negative value, then adding a second preset value to the initial fixed-point operation result to obtain the target fixed-point operation result; or,
[0167] If the initial fixed-point operation result is a negative value, adding a first preset value to the initial fixed-point operation result to obtain the target fixed-point operation result;
[0168] If the initial fixed-point operation result is a positive value, a second preset value is added to the initial fixed-point operation result to obtain the target fixed-point operation result.
[0169] In an optional embodiment of the present application, the first preset value is a binary value starting with 1 and ending with 0, wherein the number of "0" is the truncation shift amount minus 1;
[0170] The second preset value is a binary value that starts with 1 and ends with 1, wherein the number of "1"s is the truncation shift amount minus 1.
[0171] In an optional embodiment of the present application, the second operation module 330 is specifically used to, for each atom, increase a corresponding preset value according to the sign of the initial fixed-point operation result to obtain a corrected intermediate fixed-point operation result;
[0172] The intermediate fixed-point operation result is rounded down and truncated based on a preset storage bit width to obtain the target fixed-point operation result.
[0173] In an optional embodiment of the present application, the second operation module 330 is further configured to determine the truncation shift amount according to a bit width difference between the intermediate fixed-point operation result and the preset storage bit width.
[0174] For the specific definition of the above-mentioned molecular system momentum correction system 300, please refer to the definition of the molecular system momentum correction method above, which will not be repeated here. Each module in the above-mentioned molecular system momentum correction system 300 can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0175] In one embodiment, a computer device is provided, the internal structure diagram of which can be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for correcting the momentum of a molecular system as described above is implemented. It includes: a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, any step in the method for correcting the momentum of a molecular system as described above is implemented.
[0176] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any step in the above molecular system momentum correction method can be implemented.
[0177] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0178] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0179] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0180] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0181] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0182] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for correcting the momentum of a molecular system, characterized in that: include: Obtain the first atomic weight and the second atomic weight of each atom in the molecular system; Performing fixed-point number operations on the first atomic mass and the second atomic mass to obtain an initial fixed-point operation result of the third atomic mass; For each atom, a corresponding preset value is added according to the sign of the initial fixed-point calculation result to obtain a corrected target fixed-point calculation result; A global calculation is performed on all atoms in the molecular system according to the target fixed-point calculation result to obtain the corrected momentum of the molecular system.
2. The method for correcting the momentum of a molecular system according to claim 1, characterized in that: The first atomic weight is a fitting parameter between two atoms, the second atomic weight is a relative distance between the two atoms, and the third atomic weight is an interaction force between the two atoms.
3. The method for correcting the momentum of a molecular system according to claim 2, characterized in that: The fixed-point number operation is performed on the first atomic mass and the second atomic mass to obtain an initial fixed-point operation result of the third atomic mass, which is calculated according to the following formula: F i =gamma×△r F j =-gamma×△r Among them, F i represents the force on atom i, F j represents the force acting on atom j, gamma represents the fitting parameter, and △r represents the relative distance between atoms i and j.
4. The method for correcting the momentum of a molecular system according to claim 1, characterized in that: For each atom, the corresponding preset value is added according to the sign of the initial fixed-point operation result to obtain the corrected target fixed-point operation result, including: If the initial fixed-point calculation result is a positive value, adding a first preset value to the initial fixed-point calculation result to obtain the target fixed-point calculation result; If the initial fixed-point operation result is a negative value, then adding a second preset value to the initial fixed-point operation result to obtain the target fixed-point operation result; or, If the initial fixed-point operation result is a negative value, adding a first preset value to the initial fixed-point operation result to obtain the target fixed-point operation result; If the initial fixed-point operation result is a positive value, a second preset value is added to the initial fixed-point operation result to obtain the target fixed-point operation result.
5. The method for correcting the momentum of a molecular system according to claim 4, characterized in that: The first preset value is a binary value that starts with 1 and ends with 0, wherein the number of "0" is the truncation shift amount minus 1; The second preset value is a binary value that starts with 1 and ends with 1, wherein the number of "1"s is the truncation shift amount minus 1.
6. The method for correcting the momentum of a molecular system according to claim 5, characterized in that: For each atom, the corresponding preset value is added according to the sign of the initial fixed-point operation result to obtain the corrected target fixed-point operation result, including: For each atom, a corresponding preset value is added according to the sign of the initial fixed-point calculation result to obtain a corrected intermediate fixed-point calculation result; The intermediate fixed-point operation result is rounded down and truncated based on a preset storage bit width to obtain the target fixed-point operation result.
7. The method for correcting the momentum of a molecular system according to claim 6, characterized in that: The method further comprises: The truncation shift amount is determined according to a bit width difference between the intermediate fixed-point operation result and the preset storage bit width.
8. A molecular system momentum correction system, characterized in that: include: An acquisition module, used for acquiring the first atomic weight and the second atomic weight of each atom in the molecular system; A first operation module, used for performing fixed-point number operation on the first atomic mass and the second atomic mass to obtain an initial fixed-point operation result of a third atomic mass; A second operation module is used to increase the corresponding preset value according to the sign of the initial fixed-point operation result for each atom to obtain a corrected target fixed-point operation result; The correction module is used to perform global calculation on all atoms in the molecular system according to the target fixed-point calculation result to obtain the corrected momentum of the molecular system.
9. A computer device comprising: The method comprises a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.