Molecular dynamics simulation-based coordinate reduction method, device, equipment and medium
By obtaining and comparing the coordinate information of atoms in molecular dynamics simulation, and combining boundary conditions, efficient reduction of atomic coordinates is achieved, solving the problems of computational complexity and high calculation amount in the prior art.
Patent Information
- Application Number
- CN202411536844.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-18
AI Technical Summary
In molecular dynamics simulation, it is difficult for the prior art to effectively reduce the atomic coordinates after periodic boundary conditions to unprocessed coordinates, resulting in large calculation complexity and calculation amount.
By obtaining the atomic information of the current frame and the previous frame in the molecular dynamics simulation processed by periodic boundary conditions, comparing the current coordinates and the previous coordinates of the target atom, combining the boundary length of the simulation box, determining the atom's traversal situation, and Restore the current coordinate to unconstrained coordinates based on this.
This method can significantly reduce the computational volume of electronic devices, simplify the reduction process of atomic coordinates, making it more efficient and fast.
Smart Images

Figure CN119479842A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of molecular dynamics simulation, and in particular to a coordinate restoration method, device, equipment and medium based on molecular dynamics simulation. Background Art
[0002] In molecular dynamics simulations, atomic coordinates are often processed using periodic boundary conditions. That is, during the movement of atoms, if one or more atoms run out of the box enclosed by the periodic boundary, one or more atoms must return to the box from the opposite boundary, thereby confining the atoms inside the box. However, in some specific cases, such as when calculating conductivity, it may be necessary to restore the atomic coordinates processed by periodic boundary conditions to the unprocessed coordinates.
[0003] In the prior art, the atomic coordinates after periodic boundary condition processing can be restored to unprocessed coordinates through first-principles calculation methods and atomic coordinate processing algorithms. However, this method of coordinate restoration is relatively complex and requires a large amount of calculation. Summary of the invention
[0004] The present invention provides a coordinate restoration method, device, equipment and medium based on molecular dynamics simulation, which can reduce the calculation amount of electronic equipment when restoring atomic coordinates after periodic boundary condition processing to unprocessed coordinates.
[0005] In a first aspect, an embodiment of the present invention provides a coordinate restoration method based on molecular dynamics simulation, comprising:
[0006] Under the molecular dynamics simulation with periodic boundary conditions, the current atomic information of the current frame and the previous atomic information of the previous frame are obtained;
[0007] Determine the current coordinates of any target atom participating in the motion in the current frame and the previous coordinates in the previous frame according to the current atom information and the previous atom information;
[0008] Comparing the current coordinate with the previous coordinate, and combining the boundary length of the simulation box corresponding to the periodic boundary condition, determining the crossing condition of the target atom in the simulation box;
[0009] Based on the current coordinates, the boundary length and the crossing condition, the current coordinates are restored to unconstrained coordinates that are not constrained by the simulation box.
[0010] In a second aspect, an embodiment of the present invention provides a coordinate restoration device based on molecular dynamics simulation, comprising:
[0011] An acquisition module, used for acquiring current atom information of a current frame and previous atom information of a previous frame under a molecular dynamics simulation processed with periodic boundary conditions;
[0012] A determination module, used to determine the current coordinates of any target atom participating in the motion in the current frame and the previous coordinates in the previous frame according to the current atom information and the previous atom information;
[0013] A comparison module, used for comparing the current coordinates with the previous coordinates, and determining the crossing of the target atom in the simulation box in combination with the boundary length of the simulation box corresponding to the periodic boundary condition;
[0014] A restoration module is used to restore the current coordinates to unconstrained coordinates that are not constrained by the simulation box based on the current coordinates, the boundary length and the crossing condition.
[0015] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0016] at least one processor; and
[0017] a memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method according to the first aspect.
[0019] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0020] The present invention provides a coordinate restoration method, device, equipment and medium based on molecular dynamics simulation, the method comprising: obtaining the current atomic information of the current frame and the previous atomic information of the previous frame under molecular dynamics simulation processed by periodic boundary conditions; determining the current coordinates of any target atom participating in the motion in the current frame and the previous coordinates in the previous frame according to the current atomic information and the previous atomic information; comparing the current coordinates and the previous coordinates, and determining the crossing of the target atom in the simulation box in combination with the boundary length of the simulation box corresponding to the periodic boundary conditions; based on the current coordinates, the boundary length and the crossing situation, restoring the current coordinates to unconstrained coordinates not constrained by the simulation box. The above technical solution can restore the current coordinates of the target atom in the current frame to unconstrained coordinates not constrained by the simulation box by simply comparing the coordinates of any target atom participating in the motion in two adjacent frames, thereby reducing the amount of calculation of the electronic device.
[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 is a flow chart of a coordinate restoration method based on molecular dynamics simulation provided according to Embodiment 1 of the present invention;
[0024] Figure 2 is a flow chart of a coordinate restoration method based on molecular dynamics simulation provided according to Embodiment 2 of the present invention;
[0025] Figure 3 is a schematic structural diagram of a coordinate restoration device based on molecular dynamics simulation provided according to a fourth embodiment of the present invention;
[0026] Figure 4 It is a schematic diagram of the structure of an electronic device implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the present invention are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Embodiment 1
[0030] Figure 1 This is a flow chart of a coordinate restoration method based on molecular dynamics simulation provided according to the first embodiment of the present invention. This embodiment is applicable to the case where the atomic coordinates after periodic boundary condition processing are restored to unprocessed coordinates. The method can be performed by a coordinate restoration device based on molecular dynamics simulation, which can be implemented in the form of software and / or hardware and integrated in an electronic device. Further, the electronic device includes but is not limited to: computers, laptops, servers, etc.
[0031] like Figure 1 As shown, the method includes:
[0032] S110 . Under the molecular dynamics simulation with periodic boundary conditions, obtain current atom information of the current frame and previous atom information of the previous frame.
[0033] Molecular dynamics simulation essentially aims to obtain macroscopic properties by describing microscopic states, which requires sufficient particles, but this undoubtedly increases the amount of calculation. Therefore, boundary conditions are introduced to reduce the amount of calculation.
[0034] In molecular dynamics simulation, commonly used boundary conditions can include periodic boundary conditions, and periodic boundary conditions can be used to process atomic coordinates. The main reason for using periodic boundary conditions is that during the movement of particles, if one or more particles run out of the model, one or more particles must return to the model from the opposite interface, thereby ensuring that the number of particles in the simulation system is constant.
[0035] The current frame and the previous frame corresponding to the current frame are adjacent frames for data collection during molecular dynamics simulation. The current atomic information is the atomic information collected in the current frame. The previous atomic information is the atomic information collected in the previous frame. The atomic information is the information of the atoms participating in the motion in the corresponding frame, and the specific content of the atomic information is not limited here.
[0036] In one embodiment, within the time interval from the previous frame to the current frame, any target atom participating in the motion crosses the boundary of the simulation box at most once.
[0037] The target atom is any atom involved in the motion in the molecular dynamics simulation. The simulation box is a box constrained by periodic boundary conditions, and the shape of the box can be a cuboid. The time interval from the previous frame to the current frame can be less than a set threshold, so that during two adjacent frames, if the target atom crosses the boundary of the simulation box, it crosses at most once.
[0038] In this step, the electronic device can obtain current atomic information in the current frame and obtain previous atomic information in the previous frame corresponding to the current frame. The acquisition method is not limited, for example, it can be obtained through software that implements molecular dynamics simulation.
[0039] In one embodiment, the current atom information or the previous atom information is obtained from a trajectory frame file generated by a trajectory frame generation chip in a corresponding frame.
[0040] The trajectory frame file may be a file that records information about particles that change over time in a molecular dynamics simulation. The trajectory frame generation chip may be any chip that can obtain a trajectory frame file, and is not limited here. By parsing a trajectory frame file obtained from any frame, the atomic information corresponding to the frame may be obtained.
[0041] S120. Determine, according to the current atom information and the previous atom information, the current coordinates of any target atom participating in the motion in the current frame and the previous coordinates in the previous frame.
[0042] The current coordinates can be the coordinates of the target atom in the current frame. The previous coordinates can be the coordinates of the target atom in the previous frame. Both the current coordinates and the previous coordinates are the coordinates constrained by the simulation box.
[0043] In one embodiment, the current atom information or the previous atom information at least includes coordinates and atom identifiers of all atoms in the corresponding frame, and the atom identifiers are used to determine the same atoms in the current frame and the previous frame.
[0044] In this step, the current atomic information can be parsed to obtain the coordinates and atomic identifications of all atoms constrained by the simulation box in the current frame; the previous atomic information can be parsed to obtain the coordinates and atomic identifications of all atoms constrained by the simulation box in the previous frame; through the atomic identifications of all atoms included in the current atomic information and the atomic identifications of all atoms included in the previous atomic information, any atom with the same atomic identification in the two frames is determined as the target atom; the current coordinates of the target atom in the current frame are determined in the current atomic information, and the previous coordinates of the target atom in the previous frame are determined in the previous atomic information.
[0045] S130, comparing the current coordinates with the previous coordinates, and determining the crossing of the target atom in the simulation box in combination with the boundary length of the simulation box corresponding to the periodic boundary condition.
[0046] In the embodiment of the present invention, the simulation box constrained by the periodic boundary condition can be placed in a three-dimensional coordinate system composed of the horizontal axis direction, the longitudinal axis direction, and the vertical axis direction. Correspondingly, the current coordinate and the previous coordinate can be coordinates composed of the values of the above three directions, and the boundary length of the simulation box can have different boundary lengths in different directions. Therefore, the crossing of the target atom in the simulation box can be determined respectively through the above three different directions.
[0047] In the horizontal direction, the value of the current coordinate in the horizontal direction can be compared with the value of the previous coordinate in the horizontal direction, and the difference between the two can be compared with half the boundary length of the simulation box in the horizontal direction. Through the results of the above two comparisons, the crossing of the target atom in the horizontal direction of the simulation box can be determined. Among them, the crossing situation includes the target atom crossing once in the positive direction of the horizontal direction, at which time the number of crossings of the target atom in the horizontal direction is increased by one; or includes the target atom crossing once in the negative direction of the horizontal direction, at which time the number of crossings of the target atom in the horizontal direction is reduced by one.
[0048] In the longitudinal and vertical directions, the target atom's passage through the simulation box is basically the same as that in the horizontal direction, and will not be described here.
[0049] It should be noted that the number of times a target atom crosses the simulation box in any direction in the embodiment of the present invention can be continuously accumulated through multi-frame data processing, and the number of crossings accumulated in multiple frames can be a positive value or a negative value.
[0050] S140: Based on the current coordinates, the boundary length, and the crossing condition, restore the current coordinates to unconstrained coordinates that are not constrained by the simulation box.
[0051] The unconstrained coordinates may be coordinates that are not constrained by the simulation box after the current coordinates are restored, that is, the real coordinates of the target atoms in the current frame in the coordinate system that are not restricted by the periodic boundary conditions.
[0052] In the horizontal direction, the value of the unconstrained coordinate may be the sum of the product of the boundary length of the simulation box in the horizontal direction and the number of crossings indicated by the crossing in the horizontal direction, and the value of the current coordinate in the horizontal direction.
[0053] In the longitudinal and vertical axis directions, the method for determining the value of the unconstrained coordinates is basically the same as that in the horizontal axis direction, and will not be repeated here.
[0054] The present invention provides a coordinate restoration method, device, equipment and medium based on molecular dynamics simulation, the method comprising: obtaining the current atomic information of the current frame and the previous atomic information of the previous frame under molecular dynamics simulation processed by periodic boundary conditions; determining the current coordinates of any target atom participating in the motion in the current frame and the previous coordinates in the previous frame according to the current atomic information and the previous atomic information; comparing the current coordinates and the previous coordinates, and determining the crossing of the target atom in the simulation box in combination with the boundary length of the simulation box corresponding to the periodic boundary conditions; based on the current coordinates, the boundary length and the crossing situation, restoring the current coordinates to unconstrained coordinates not constrained by the simulation box. The above technical solution can restore the current coordinates of the target atom in the current frame to unconstrained coordinates not constrained by the simulation box by simply comparing the coordinates of any target atom participating in the motion in two adjacent frames, thereby reducing the amount of calculation of the electronic device.
[0055] Embodiment 2
[0056] Figure 2 It is a flow chart of a coordinate restoration method based on molecular dynamics simulation provided according to the second embodiment of the present invention. This embodiment is based on the above-mentioned first embodiment, and further refines the crossing situation of the target atom in the simulation box by comparing the current coordinate and the previous coordinate, combined with the boundary length of the simulation box corresponding to the periodic boundary condition; and further refines the restoration of the current coordinate to an unconstrained coordinate that is not constrained by the simulation box based on the current coordinate, the boundary length and the crossing situation.
[0057] like Figure 2 As shown, the method includes:
[0058] S110 . Under the molecular dynamics simulation with periodic boundary conditions, obtain current atom information of the current frame and previous atom information of the previous frame.
[0059] S120. Determine, according to the current atom information and the previous atom information, the current coordinates of any target atom participating in the motion in the current frame and the previous coordinates in the previous frame.
[0060] S131. In a set direction, if the current coordinate is greater than the previous coordinate, and the portion of the greater coordinate exceeds half of the boundary length, determining the crossing condition indicates that the number of crossings of the target atom in the set direction is reduced by one.
[0061] S132. In the set direction, if the current coordinate is smaller than the previous coordinate, and the smaller portion exceeds half of the boundary length, determining the crossing condition indicates that the number of crossings of the target atom in the set direction is increased by one.
[0062] The set direction includes any one of the horizontal axis direction, the vertical axis direction and the vertical axis direction of the coordinate axis where the target atom is located.
[0063] S131 and S132 are explained as follows:
[0064] When the direction is set to the horizontal direction, if the value of the current coordinate in the horizontal direction is greater than the value of the previous coordinate in the horizontal direction, and the greater part exceeds half of the boundary length of the simulation box in the horizontal direction, the distance of atomic movement in normal adjacent frames will not exceed half of the boundary length. Therefore, it means that the target atom crosses the simulation box in the horizontal direction in the negative direction once, and the crossing situation is confirmed by reducing the number of crossings of the target atom in the horizontal direction by one.
[0065] When the direction is set to the horizontal direction, if the value of the current coordinate in the horizontal direction is less than the value of the previous coordinate in the horizontal direction, and the smaller part exceeds half of the boundary length of the simulation box in the horizontal direction, it means that the target atom has crossed the simulation box in the horizontal direction once in the positive direction, and the crossing situation is confirmed by indicating that the number of crossings of the target atom in the horizontal direction is increased by one.
[0066] In the longitudinal and vertical directions, the target atom's passage through the simulation box is basically the same as that in the horizontal direction, and will not be described here.
[0067] S141. In a set direction, determine the sum of the product of the boundary length and the number of crossings indicated by the crossing situation and the current coordinate as the unconstrained coordinate of the current coordinate after restoration in the set direction.
[0068] When the direction is set to the horizontal axis, the unconstrained coordinates of the current coordinates after restoration in the horizontal axis = the value of the current coordinates in the horizontal axis + the number of crossings indicated by the crossing situation in the horizontal axis × the boundary length of the simulated box in the horizontal axis.
[0069] In the longitudinal and vertical axis directions, the method for determining the value of the unconstrained coordinates is basically the same as that in the horizontal axis direction, and will not be repeated here.
[0070] The technical solution of the embodiment of the present invention can restore the current coordinates to unconstrained coordinates by simply comparing the coordinates of any target atom participating in the motion in adjacent frames, and comparing the difference between the coordinates of adjacent frames and half the length of the boundary of the simulation box. It has the characteristics of small calculation amount and is relatively simple and fast.
[0071] Embodiment 3
[0072] The embodiments of the present invention are illustrative descriptions of the above embodiments.
[0073] In the molecular dynamics simulation scenario, the trajectory frame generation chip can be used to obtain trajectory frame files for multiple consecutive frames. The prerequisite for obtaining the files should be that the atoms cross the boundary of the simulation box at most once during the adjacent rounds of frames. The trajectory frame files obtained for each frame are parsed to obtain the atomic information corresponding to the frame. The atomic information of multiple frames is used to record the situation of each atom crossing the boundary of the simulation box in each frame to restore the coordinates. The specific implementation steps include:
[0074] Step 1: Determine the atomic information of the first frame, parse out the coordinates and atomic identifiers of all atoms included in the atomic information; and initialize three variable arrays, which are used to record the number of times each atom crosses the boundary of the simulation box in the horizontal direction X, the vertical direction Y, and the vertical direction Z, namely AtomCrocssTimesX, AtomCrocssTimesY, and AtomCrocssTimesZ. Initialize the three variable arrays to have the corresponding number of times for all atoms to be 0.
[0075] Step 2: Determine the atomic information of the second frame and parse out the coordinates and atomic identities of all atoms included in the atomic information.
[0076] Step 3: Set the second frame as the current frame and the first frame as the previous frame.
[0077] Step 4: Determine any atom with the same atomic identification in the two frames as the target atom, determine the current coordinates of the target atom in the current frame and the previous coordinates of the target atom in the previous frame; if the value of the current coordinate in the X direction is greater than the value of the previous coordinate, and the greater part exceeds half of the boundary length of the simulation box in the X direction, then the AtomCrocssTimesX of the target atom is reduced by one; if the value of the current coordinate in the X direction is less than the value of the previous coordinate, and the less part exceeds half of the boundary length of the simulation box in the X direction, then the AtomCrocssTimesX of the target atom is increased by one; similarly, the same operation is performed in the Y and Z directions. Perform the above operations, compare all atoms in the two frames, and obtain the AtomCrocssTimesX, AtomCrocssTimesY, and AtomCrocssTimesZ corresponding to all atoms in the current frame.
[0078] Step 5: Calculate the unconstrained coordinates of each atom in the current frame, taking any target atom as an example, as follows:
[0079] Unconstrained coordinate X = current coordinate X + AtomCrocssTimesX × X direction boundary length;
[0080] Unconstrained coordinate Y = current coordinate Y + AtomCrocssTimesY × Y direction boundary length;
[0081] Unconstrained coordinate Z = current coordinate Z + AtomCrocssTimesZ × Z direction boundary length.
[0082] Step 6: Assign the atomic information of the current frame to the previous frame, read the atomic information of the next frame and parse it as the atomic information of the new current frame.
[0083] Step 7: Repeat steps 4, 5, and 6 until all frames that need to be calculated are completed.
[0084] Optionally, the AtomCrocssTimesX, AtomCrocssTimesY and AtomCrocssTimesZ corresponding to all atoms may be recorded in each frame without restoring the coordinates. Instead, the coordinates may be restored by the accumulated crossing times of multiple frames when all frames that need to be calculated are completed.
[0085] The technical solution of the embodiment of the present invention can restore the unconstrained coordinates that each atom should have in each round by simply comparing the coordinates of adjacent rounds and logical judgment and calculation. It has the characteristics of small amount of calculation and relatively simple and fast, and can quickly calculate the unconstrained coordinates of atoms in a large number of trajectory frame files.
[0086] The technical solution of the embodiment of the present invention sets a small time interval between adjacent frames to ensure that any target atom participating in the motion crosses the boundary of the simulation box at most once. When the time interval between adjacent frames is smaller, the amount of calculation is larger, and the trajectory frame generation chip can quickly calculate the molecular trajectories of different rounds, providing a favorable basis for coordinate restoration.
[0087] The technical solution of the embodiment of the present invention can quickly and conveniently count the number of times each atom crosses the box in each frame through the setting of three variable arrays AtomCrocssTimesX, AtomCrocssTimesY and AtomCrocssTimesZ.
[0088] Embodiment 4
[0089] Figure 3 is a schematic diagram of the structure of a coordinate restoration device based on molecular dynamics simulation according to the fourth embodiment of the present invention. This embodiment is applicable to the case where the atomic coordinates processed by periodic boundary conditions are restored to the unprocessed coordinates. Figure 3 As shown, the specific structure of the device includes:
[0090] An acquisition module 31 is used to acquire current atom information of a current frame and previous atom information of a previous frame under a molecular dynamics simulation with periodic boundary conditions;
[0091] A determination module 32, for determining the current coordinates of any target atom participating in the motion in the current frame and the previous coordinates in the previous frame according to the current atom information and the previous atom information;
[0092] A comparison module 33, used to compare the current coordinates with the previous coordinates, and determine the crossing of the target atom in the simulation box in combination with the boundary length of the simulation box corresponding to the periodic boundary condition;
[0093] The restoration module 34 is used to restore the current coordinates to unconstrained coordinates that are not constrained by the simulation box based on the current coordinates, the boundary length and the crossing condition.
[0094] The coordinate restoration device based on molecular dynamics simulation provided in this embodiment obtains the current atomic information of the current frame and the previous atomic information of the previous frame under the molecular dynamics simulation processed by periodic boundary conditions through the acquisition module; determines the current coordinates of any target atom participating in the movement in the current frame and the previous coordinates in the previous frame according to the current atomic information and the previous atomic information through the determination module; compares the current coordinates with the previous coordinates through the comparison module, and determines the crossing of the target atom in the simulation box in combination with the boundary length of the simulation box corresponding to the periodic boundary condition; restores the current coordinates to unconstrained coordinates not constrained by the simulation box based on the current coordinates, the boundary length and the crossing situation through the restoration module. The above technical solution can restore the current coordinates of the target atom in the current frame to unconstrained coordinates not constrained by the simulation box by simply comparing the coordinates of any target atom participating in the movement in two adjacent frames, thereby reducing the amount of calculation of the electronic device.
[0095] Furthermore, the comparison module 33 includes:
[0096] A first comparison submodule is used to determine that the crossing condition indicates that the number of crossings of the target atom in the set direction is reduced by one if the current coordinate is greater than the previous coordinate and the greater portion exceeds half of the boundary length in the set direction;
[0097] A second comparison submodule is used to determine that the crossing condition indicates that the number of crossings of the target atom in the set direction is increased by one if the current coordinate is smaller than the previous coordinate and the smaller part exceeds half of the boundary length in the set direction;
[0098] The set direction includes any one of the horizontal axis direction, the vertical axis direction and the vertical axis direction of the coordinate axis where the target atom is located.
[0099] Furthermore, the restoration module 34 is specifically used for:
[0100] In the set direction, the sum of the product of the boundary length and the number of crossings indicated by the crossing situation and the current coordinate is determined as the unconstrained coordinate of the current coordinate after restoration in the set direction.
[0101] Furthermore, within the time interval from the previous frame to the current frame, any target atom participating in the movement crosses the boundary of the simulation box at most once.
[0102] Furthermore, the current atom information or the previous atom information at least includes coordinates and atom identifiers of all atoms in the corresponding frame, and the atom identifiers are used to determine the same atoms in the current frame and the previous frame.
[0103] Furthermore, the current atom information or the previous atom information is obtained from a trajectory frame file generated by a trajectory frame generation chip in a corresponding frame.
[0104] The coordinate restoration device based on molecular dynamics simulation provided by the embodiment of the present invention can execute the coordinate restoration method based on molecular dynamics simulation provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0105] Embodiment 5
[0106] Figure 4 Schematic diagram of the structure of the electronic device implementing the embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0107] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0108] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0109] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a coordinate reduction method based on molecular dynamics simulation.
[0110] In some embodiments, the coordinate restoration method based on molecular dynamics simulation can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the coordinate restoration method based on molecular dynamics simulation described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the coordinate restoration method based on molecular dynamics simulation by any other appropriate means (for example, by means of firmware).
[0111] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0112] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0113] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0114] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0115] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0116] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0117] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0118] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A coordinate reduction method based on molecular dynamics simulation, characterized in that: include: Under the molecular dynamics simulation with periodic boundary conditions, the current atomic information of the current frame and the previous atomic information of the previous frame are obtained; Determine the current coordinates of any target atom participating in the motion in the current frame and the previous coordinates in the previous frame according to the current atom information and the previous atom information; Comparing the current coordinate with the previous coordinate, and combining the boundary length of the simulation box corresponding to the periodic boundary condition, determining the crossing condition of the target atom in the simulation box; Based on the current coordinates, the boundary length and the crossing condition, the current coordinates are restored to unconstrained coordinates that are not constrained by the simulation box.
2. The method according to claim 1, characterized in that Comparing the current coordinate with the previous coordinate, and combining the boundary length of the simulation box corresponding to the periodic boundary condition to determine the crossing of the target atom in the simulation box, includes: In the set direction, if the current coordinate is greater than the previous coordinate, and the portion of the greater coordinate exceeds half of the boundary length, determining that the crossing condition indicates that the number of crossings of the target atom in the set direction is reduced by one; In the set direction, if the current coordinate is smaller than the previous coordinate, and the smaller portion exceeds half of the boundary length, determining the crossing condition indicates that the number of crossings of the target atom in the set direction is increased by one; The set direction includes any one of the horizontal axis direction, the vertical axis direction and the vertical axis direction of the coordinate axis where the target atom is located.
3. The method according to claim 2, characterized in that Based on the current coordinates, the boundary length, and the crossing condition, restoring the current coordinates to unconstrained coordinates that are not constrained by the simulation box, including: In the set direction, the sum of the product of the boundary length and the number of crossings indicated by the crossing situation and the current coordinate is determined as the unconstrained coordinate of the current coordinate after restoration in the set direction.
4. The method according to claim 1, characterized in that In the time interval from the previous frame to the current frame, any target atom participating in the movement crosses the boundary of the simulation box at most once.
5. The method according to claim 1, characterized in that The current atom information or the previous atom information at least includes coordinates and atom identifiers of all atoms in the corresponding frame, and the atom identifiers are used to determine the same atoms in the current frame and the previous frame.
6. The method according to claim 1, characterized in that The current atomic information or the previous atomic information is obtained from a trajectory frame file generated by a trajectory frame generation chip under a corresponding frame.
7. A coordinate restoration device based on molecular dynamics simulation, characterized in that: include: An acquisition module, used for acquiring current atom information of a current frame and previous atom information of a previous frame under a molecular dynamics simulation processed with periodic boundary conditions; A determination module, used to determine the current coordinates of any target atom participating in the motion in the current frame and the previous coordinates in the previous frame according to the current atom information and the previous atom information; A comparison module, used for comparing the current coordinates with the previous coordinates, and determining the crossing of the target atom in the simulation box in combination with the boundary length of the simulation box corresponding to the periodic boundary condition; A restoration module is used to restore the current coordinates to unconstrained coordinates that are not constrained by the simulation box based on the current coordinates, the boundary length and the crossing condition.
8. The device according to claim 7, characterized in that The comparison module comprises: A first comparison submodule is used to determine that the crossing condition indicates that the number of crossings of the target atom in the set direction is reduced by one if the current coordinate is greater than the previous coordinate and the greater portion exceeds half of the boundary length in the set direction; A second comparison submodule is used to determine that the crossing condition indicates that the number of crossings of the target atom in the set direction is increased by one if the current coordinate is smaller than the previous coordinate and the smaller part exceeds half of the boundary length in the set direction; The set direction includes any one of the horizontal axis direction, the vertical axis direction and the vertical axis direction of the coordinate axis where the target atom is located.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.