A fast calculation method of long-range interaction force between particles based on GPU
By using GPUs to parallelize the calculation of long-range particle interaction forces in molecular dynamics simulations, the problem of high computational complexity of Coulomb interactions in existing technologies is solved, achieving more efficient molecular dynamics simulations.
Patent Information
- Application Number
- CN202410819150.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-06-24
AI Technical Summary
When existing molecular dynamics simulation software calculates large-scale molecular systems, the long-range nature of Coulomb interactions leads to high computational complexity, making it difficult to extend to real systems and limiting parallel efficiency.
A GPU-based approach is adopted, which adapts the CPU and GPU through VTK-m packaging technology. The Metropolis-Hasting algorithm is used to randomly extract some Fourier terms from the Fourier space. The multi-threading capability of the GPU is used to parallelize the calculation of the long-range interaction forces of particles, and the operators Map and Reduce are constructed for summation calculation.
The efficiency of Coulomb long-range force calculation is improved, communication consumption is reduced, the optimal linear complexity of O(N) is maintained, and the calculation speed and accuracy are improved.
Smart Images

Figure CN118673774B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the fields of multi-body intelligence, molecular dynamics simulation and high-performance computing, and in particular relates to a fast computing method for realizing long-range interactions between particles based on a GPU. Background Art
[0002] A multi-agent system is a computational system composed of multiple interacting agents. For example, a multi-agent system represented by molecular dynamics (MD) is a classic method for micro- and nanoscale computer simulations. It provides an important tool for studying the microstructural evolution and macroscopic properties of biological macromolecules, and is widely used in disciplines and fields such as life sciences, energy, materials, and medicine.
[0003] Despite significant advances in molecular dynamics algorithms and software development, mainstream molecular dynamics simulations are currently limited to systems with as few as one million atoms, far from adequate for characterizing realistic systems. The calculation of Coulomb interactions is a major bottleneck. Its long-range nature makes convergence difficult and requires intensive communication between computer cores, significantly reducing the parallel efficiency of supercomputing clusters. Current mainstream molecular simulation software typically uses grid interpolation methods based on fast Fourier transforms (FFTs), including PPPM (used in LAMMPS), PME (used in GROMACS), and SPME (used in AMBER). Their overall computational complexity is O(NlogN), where N represents the amount of input data, such as the number of particles. Another widely accepted algorithm is the fast multipole method (FMM), based on multi-level expansions, which offers a mathematically asymptotically optimal O(N) complexity. However, with the rapid advancement of high-performance computing, both FFT and FMM have encountered scalability bottlenecks, limiting larger-scale molecular dynamics simulations and becoming a significant challenge that needs to be addressed. Summary of the Invention
[0004] In order to solve the problems existing in the background technology, the present invention provides a method for quickly calculating the long-range interaction force between particles based on GPU. The algorithm introduces random ideas and utilizes the multi-threading capabilities of GPU to distribute particle information to GPU threads, calculate the long-range interaction of particles in parallel, and improve the calculation efficiency of long-range interaction force.
[0005] To achieve the above technical objectives, the present invention provides the following technical solution: a GPU-based method for rapidly calculating long-range interactions between particles, comprising:
[0006] S1: Use VTK-m packaging technology to adapt the CPU and GPU;
[0007] S2: Use the Metropolis-Hasting algorithm on the CPU to randomly extract some Fourier terms from the Fourier space;
[0008] S3: Obtaining a Coulomb long-range force expression of the particle in the Fourier space according to some Fourier terms randomly extracted from the Fourier space, the charge distribution in the Fourier space, and the charge of the particle;
[0009] S4: Construct the operator Map and operator Reduce. The operator Map is used to process multiple particle information in parallel through the multi-threading capability of the GPU. The operator Reduce is used to calculate the sum of large-scale particle information through the GPU.
[0010] S5: Calculate the Coulomb long-range force of the particle using the operator Map and the operator Reduce according to the Coulomb long-range force expression of the particle in Fourier space.
[0011] Preferably, the randomly extracting some Fourier terms from the Fourier space using the Metropolis-Hasting algorithm comprises:
[0012] S21: From discrete Gaussian distributions in Fourier space In Three independent samples were taken in three directions ,composition :
[0013]
[0014] Where L is the side length of the simulation system, represents pi, is the splitting parameter; represents the independent variable of the discrete Gaussian distribution function;
[0015] S22: Initialize the number of iterations ;
[0016] S23: Similar to step S21, from discrete Gaussian distribution Sample points are taken ,composition , Represents the rounding function, and then calculates In the x, y, and z directions The acceptance probability is:
[0017]
[0018]
[0019]
[0020]
[0021] in, , express exist Three directions The probability of acceptance;
[0022] S24: Randomly generate a random number between 0 and 1 ,like , then let ,otherwise , then order Repeat steps S23 to S24 until So far, get indivual , and then get a Sampling points , .
[0023] Preferably, the Coulomb long-range force expression of the particle in Fourier space includes:
[0024]
[0025]
[0026]
[0027] in, Represents particles Coulomb long-range force; represents the number of Fourier terms extracted from Fourier space; Represents particles The amount of charge; represents the first pixel extracted from Fourier space. Fourier terms; Im represents the imaginary part; represents the volume of the simulation system; represents the distance between particles; represents an imaginary unit; Represents the structure factor information of the particle; Represents the total number of particles in the simulation system; Represents particles The amount of charge; Represents the distance between particles.
[0028] Preferably, the calculating the Coulomb long-range force of the particle comprises:
[0029] S51: Evenly distribute all particles in the simulation system to each thread of the GPU;
[0030] S52: traverse the extracted Fourier terms and call the operator Map to calculate the intermediate information of the particle in the Fourier terms in parallel on each thread of the GPU;
[0031] S53: Calling the operator Reduce to sum the intermediate information of the particle in the Fourier term on each thread of the GPU to obtain the structure factor information of the particle in the Fourier term;
[0032] S54: Calculate the Coulomb long-range force of the particle based on the structure factor information of the particle in all Fourier terms.
[0033] Preferably, the intermediate information of the particle in the Fourier term includes:
[0034]
[0035] in, Represents particles In the Fourier term intermediate information.
[0036] Preferably, the structure factor information of the particle in the Fourier term includes:
[0037]
[0038] in, Represents the particle in the Fourier term The structure factor information.
[0039] Another aspect of the present invention provides a fast calculation system for long-range interactions between particles based on a GPU, comprising: a sampling module and a Coulomb long-range force calculation module;
[0040] The sampling module is used to randomly extract some Fourier terms from the Fourier space;
[0041] The Coulomb long-range force calculation module includes: a structure factor calculation unit, a Coulomb long-range force calculation unit, and multiple particle intermediate information calculation units;
[0042] The plurality of particle intermediate information calculation units are used to calculate the intermediate information of the particles in Fourier terms in parallel;
[0043] The structure factor calculation unit is used to calculate the structure factor information of the particle in the Fourier term based on the intermediate information of the particle in the Fourier term;
[0044] The Coulomb long-range force calculation unit is used to calculate the Coulomb long-range force of the particle according to the structure factor information of the particle in all Fourier terms.
[0045] Preferably, the sampling module is implemented based on a CPU; the Coulomb long-range force calculation module is implemented based on a GPU; and the CPU and GPU are adapted through VTK-m packaging technology.
[0046] On the other hand, the present invention provides a device for quickly calculating long-range interaction forces between particles based on a GPU, comprising a memory, a CPU, a GPU, and a computer program stored in the memory and capable of running on the CPU and GPU. The device is characterized in that the CPU and GPU are configured to be able to implement the method for quickly calculating long-range interaction forces between particles based on a GPU when executing the computer program.
[0047] Another aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the aforementioned method for rapidly calculating long-range interaction forces between particles based on a GPU.
[0048] The present invention has at least the following beneficial effects
[0049] (1) The expected error in the calculation of Coulomb long-range force is reduced to zero, which improves efficiency while maintaining the dynamic properties.
[0050] (2) The number of Fourier terms that need to be calculated each time becomes a constant, which is independent of the number of particles in space, reducing the amount of data communication and thus greatly reducing the communication consumption, making the algorithm extremely efficient in parallel and maintaining the optimal linear complexity of O(N).
[0051] (3) The present invention utilizes the multi-threading capability of the GPU to distribute particle information to GPU threads, and calculates the long-range interactions of particles in parallel, thereby improving the calculation efficiency of long-range interaction forces. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 Schematic diagram of the method flow of the present invention;
[0053] Figure 2 This is a comparison diagram of the temperature evolution of the implicit salt solution system of this embodiment;
[0054] Figure 3 This is a comparison diagram of the total energy evolution of the implicit salt solution system of this embodiment;
[0055] Figure 4 This is a comparison diagram of the radial distribution function of the implicit salt solution system of this embodiment;
[0056] Figure 5 2 is a comparison chart of the computational efficiency of this embodiment. DETAILED DESCRIPTION
[0057] The following describes the embodiments of the present invention by means of specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0058] Among them, the accompanying drawings are only for illustrative purposes and represent only schematic diagrams rather than actual pictures, and should not be understood as limiting the present invention. In order to better illustrate the embodiments of the present invention, some parts of the accompanying drawings may be omitted, enlarged or reduced, and do not represent the dimensions of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions may be omitted in the accompanying drawings.
[0059] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if there are terms such as "upper", "lower", "left", "right", "front", "back", etc. indicating directions or positional relationships, they are based on the directions or positional relationships shown in the drawings. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operate in a specific direction. Therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0060] See also Figure 1 The present invention provides the following technical solution: a method for rapidly calculating long-range interaction forces between particles based on a GPU, comprising:
[0061] S1: Use VTK-m packaging technology to adapt the CPU and GPU;
[0062] In this embodiment, VTK-m provides an abstract execution model, enabling the same algorithm code to run on different computing devices. Specifically, different execution models are set by configuring different options in the configuration file to set the DeviceTag in vtkm. For example, "serial" corresponds to vtkm::cont::DeviceAdapterTagSerial, indicating CPU execution; "openmp" corresponds to vtkm::cont::DeviceAdapterTagOpenMP, indicating multi-core parallel execution; and "cuda" corresponds to vtkm::cont::DeviceAdapterTagCuda, indicating CUDA-supported GPU execution. Furthermore, by integrating with the MPI library, parallel execution on multiple GPUs is also possible.
[0063] S2: randomly extracting some Fourier terms from a Fourier space using a Metropolis-Hasting algorithm through a CPU; wherein the Fourier space corresponds to a function for calculating the Coulomb long-range force;
[0064] Preferably, the randomly extracting some Fourier terms from the Fourier space using the Metropolis-Hasting algorithm comprises:
[0065] S21: From discrete Gaussian distributions in Fourier space In Three independent samples were taken in three directions ,composition :
[0066]
[0067] Where L is the side length of the simulation system, is the splitting parameter; represents the independent variable of the discrete Gaussian distribution function;
[0068] S22: Initialize the number of iterations ;
[0069] S23: Similar to step S21, from discrete Gaussian distribution Sample points are taken ,composition , Represents the rounding function, and then calculates In the x, y, and z directions The acceptance probability is:
[0070]
[0071]
[0072]
[0073]
[0074] in, , express exist Three directions The probability of acceptance;
[0075] S24: Randomly generate a random number between 0 and 1 ,like , then let ,otherwise , then order Repeat steps S23 to S24 until So far, get indivual , and then get a Sampling points , .
[0076] In this embodiment, in order to ensure accurate results while using fewer samples and less computation, the sampling method of randomly extracting some Fourier terms from the Fourier space using the Metropolis-Hasting algorithm to obtain calculation samples is particularly important. It must ensure that the expected value of the calculation error is as small as possible, ideally zero, to ensure accurate calculation results.
[0077] S3: Obtaining a Coulomb long-range force expression of the particle in the Fourier space according to some Fourier terms randomly extracted from the Fourier space, the charge distribution in the Fourier space, and the charge of the particle;
[0078] S4: Construct the operator Map and operator Reduce. The operator Map is used to process multiple particle information in parallel through the multi-threading capability of the GPU. The operator Reduce is used to calculate the sum of large-scale particle information through the GPU.
[0079] S5: Calculate the Coulomb long-range force of the particle using the operator Map and the operator Reduce according to the Coulomb long-range force expression of the particle in Fourier space.
[0080] Preferably, the Coulomb long-range force expression of the particle in Fourier space includes:
[0081]
[0082]
[0083]
[0084] in, Represents particles Coulomb long-range force; represents the number of Fourier terms extracted from Fourier space; Represents particles The amount of charge; represents the first pixel extracted from Fourier space. Fourier terms; Im represents the imaginary part; represents the volume of the simulation system; represents the distance between particles; represents an imaginary unit; Represents the structure factor information of the particle; Represents the total number of particles in the simulation system; Represents particles The amount of charge; Represents the distance between particles.
[0085] Preferably, the calculating the Coulomb long-range force of the particle comprises:
[0086] S51: Evenly distribute all particles in the simulation system to each thread of the GPU;
[0087] S52: traverse the extracted Fourier terms and call the operator Map to calculate the intermediate information of the particle in the Fourier terms in parallel on each thread of the GPU;
[0088] S53: Calling the operator Reduce to sum the intermediate information of the particle in the Fourier term on each thread of the GPU to obtain the structure factor information of the particle in the Fourier term;
[0089] S54: Calculate the Coulomb long-range force of the particle based on the structure factor information of the particle in all Fourier terms.
[0090] In this embodiment, the advantage of the RBE algorithm over the PPPM algorithm in terms of computational efficiency is that it avoids the computational overhead of PPPM. In the process of using FFT and inverse FFT to map the position of the global particle to the grid point, and mapping it back from the grid point to the original position, thereby greatly reducing the communication time and computing time; at the same time, the P group obtained by the sampling method All P groups can be calculated in parallel through the GPU reduce operation , thereby fully utilizing the multi-threaded parallel advantages of GPU and greatly accelerating the calculation of RBE.
[0091] Preferably, the intermediate information of the particle in the Fourier term includes:
[0092]
[0093] in, Represents particles In the Fourier term intermediate information.
[0094] Preferably, the structure factor information of the particle in the Fourier term includes:
[0095]
[0096] in, Represents the particle in the Fourier term The structure factor information.
[0097] Another aspect of the present invention provides a fast calculation system for long-range interactions between particles based on a GPU, comprising: a sampling module and a Coulomb long-range force calculation module;
[0098] The sampling module is used to randomly extract some Fourier terms from the Fourier space;
[0099] The Coulomb long-range force calculation module includes: a structure factor calculation unit, a Coulomb long-range force calculation unit, and multiple particle intermediate information calculation units;
[0100] The plurality of particle intermediate information calculation units are used to calculate the intermediate information of the particles in Fourier terms in parallel;
[0101] The structure factor calculation unit is used to calculate the structure factor information of the particle in the Fourier term based on the intermediate information of the particle in the Fourier term;
[0102] The Coulomb long-range force calculation unit is used to calculate the Coulomb long-range force of the particle according to the structure factor information of the particle in all Fourier terms.
[0103] Preferably, the sampling module is implemented based on a CPU; the Coulomb long-range force calculation module is implemented based on a GPU; and the CPU and GPU are adapted through VTK-m packaging technology.
[0104] On the other hand, the present invention provides a device for quickly calculating long-range interaction forces between particles based on a GPU, comprising a memory, a CPU, a GPU, and a computer program stored in the memory and capable of running on the CPU and GPU. The device is characterized in that the CPU and GPU are configured to be able to implement the method for quickly calculating long-range interaction forces between particles based on a GPU when executing the computer program.
[0105] Another aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the aforementioned method for rapidly calculating long-range interaction forces between particles based on a GPU.
[0106] Experimental simulation,
[0107] System settings: (using simplified units)
[0108] 1) Simulation box: ;
[0109] 2) Particles: 500 monovalent cations; 500 monovalent anions;
[0110] 3) Cutoff radius: ;
[0111] 4) RBE-GPU parameters: number of samples ; Error control constant ;
[0112] 5) PPPM parameters: number of samples ; Error control constant ;
[0113] 6) Simulation time: pre-equilibrium Step; Equilibrium sampling step;
[0114] 7) Integration step:
[0115] 8) Hot bath method: Nose-Hoover
[0116] In this embodiment, the RBE-GPU and PPPM proposed in the present invention are simulated under the above experimental environment settings, and the comparison results are as follows: Figures 2 to 5 As shown, through Figure 2 It can be found that the system temperature fluctuates strongly in the initial stage of iteration and gradually stabilizes; at the same time, the system temperature achieved by the RBE-GPU and PPPM algorithms has good final consistency. Figure 2 It can be found that the total energy of the system gradually converges during the iteration process and stabilizes around the equilibrium point. The total energy of the system achieved by the RBE-GPU and PPPM algorithms has good final consistency. Figure 3 Implicit radial distribution function of salt solution system: Through PPPM and RBE-GPU algorithm, it is found that the results obtained by this method are completely consistent with those obtained by traditional PPPM method. Figure 5In comparison with the method and the PPPM algorithm on the A4000 GPU and the A4090 GPU, the method greatly reduces the calculation energy consumption on different GPUs.
[0117] The technical solutions provided by the present application can be systems, methods, apparatuses, and / or computer program products. The computer program product can include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the present application.
[0118] In some embodiments, the present application also provides a computer device, apparatus or terminal. The computer device, apparatus or terminal includes a processor, a memory, a network interface, a display screen and an input device connected by a system bus. Among them, the processor is used to provide computing and control capabilities, and the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface is used to communicate with the external terminal through the network connection. The computer program is executed by the processor to implement various methods, processes, steps disclosed in the present application, or the processor executes the computer program to realize the functions of various modules or units in the embodiments disclosed in the present application. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device can be a touch layer overlaid on the display screen, or a button, trackball or touchpad arranged on the shell, or an external keyboard, touchpad or mouse, etc.
[0119] For example, the computer program can be divided into one or more modules or units, which are stored in the memory and can be executed by the processor to realize the technical solutions of the present application. These modules or units can be a series of computer program instruction segments that can complete a specific function, which are used to describe the execution process of the computer program in the apparatus, device or terminal.
[0120] The apparatus, device or terminal described above can be a desktop computer, a notebook, a mobile electronic device, a palm computer and a cloud server, etc. Those skilled in the art should understand that the structure shown in the figure is only a block diagram of part of the structure related to the present application scheme, and does not constitute a limitation on the apparatus, device or terminal to which the present application scheme is applied. The specific apparatus, device or terminal can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0121] The memory can be used to store computer programs, modules and data, and the processor implements various functions of the apparatus, device or terminal by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc.; and the data storage area can store various data (such as multimedia data, documents, operation history records, etc.) created according to the application, etc. In addition, the memory can include a high-speed random access memory, and can also include a nonvolatile memory, for example, a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, a magnetic disk storage device, a flash memory device, or other volatile solid-state memory devices.
[0122] The computer readable storage medium provided in the embodiments of the present application stores the computer program, and the computer program is executed by the processor to implement the steps of the above method. The processor includes a CPU and a GPU adapted based on the VTK-m encapsulation technology. Those skilled in the art can understand that all or part of the processes in the above method embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above method embodiments can be included. Any reference to memory, storage, database or other medium used in the embodiments of the present application can include non-volatile and / or volatile memory. The non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. The volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0123] The modules and units integrated in the above-mentioned devices or terminal equipment, if implemented in the form of software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the various methods disclosed in this application can also be completed by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned methods when executed by a processor. Among them, the computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0124] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solutions, which should all be included in the scope of the claims of the present invention.
Claims
1. A GPU-based method for rapidly calculating long-range interaction forces between particles, characterized in that: include: S1: Use VTK-m packaging technology to adapt the CPU and GPU; S2: Use the Metropolis-Hasting algorithm on the CPU to randomly extract some Fourier terms from the Fourier space; S3: Obtaining a Coulomb long-range force expression of the particle in the Fourier space according to some Fourier terms randomly extracted from the Fourier space, the charge distribution in the Fourier space, and the charge of the particle; S4: Construct the operator Map and operator Reduce. The operator Map is used to process multiple particle information in parallel through the multi-threading capability of the GPU. The operator Reduce is used to calculate the sum of large-scale particle information through the GPU. S5: Calculate the Coulomb long-range force of the particle using the operator Map and the operator Reduce according to the Coulomb long-range force expression of the particle in Fourier space.
2. The method for rapidly calculating long-range interaction forces between particles based on a GPU according to claim 1, characterized in that: The method of randomly extracting some Fourier terms from the Fourier space using the Metropolis-Hasting algorithm includes: S21: From discrete Gaussian distributions in Fourier space In Three independent samples were taken in three directions ,composition : Where L is the side length of the simulation system, represents pi, is the splitting parameter; represents the independent variable of the discrete Gaussian distribution function; represents a set of integers; S22: Initialize the number of iterations ; S23: Similar to step S21, from discrete Gaussian distribution Sample points are taken ,composition , Represents the rounding function, and then calculates In the x, y, and z directions The acceptance probability is: in, , express exist Three directions The probability of acceptance; S24: Randomly generate a random number between 0 and 1 ,like , then let ,otherwise , then order Repeat steps S23 to S24 until So far, get indivual , and then get a Sampling points , .
3. The method for rapidly calculating long-range interaction forces between particles based on a GPU according to claim 2, characterized in that: The Coulomb long-range force expression of the particle in Fourier space includes: in, Represents particles Coulomb long-range force; represents the number of Fourier terms extracted from Fourier space; Represents particles The amount of charge; represents the first pixel extracted from Fourier space. Fourier terms; Im represents the imaginary part; represents the volume of the simulation system; represents the distance between particles; represents an imaginary unit; Represents the structure factor information of the particle; Represents the total number of particles in the simulation system; Represents particles The amount of charge; Represents the distance between particles.
4. The method for rapidly calculating long-range interaction forces between particles based on a GPU according to claim 3, characterized in that: The calculation of the Coulomb long-range force of the particle includes: S51: Evenly distribute all particles in the simulation system to each thread of the GPU; S52: traverse the extracted Fourier terms and call the operator Map to calculate the intermediate information of the particle in the Fourier terms in parallel on each thread of the GPU; S53: Calling the operator Reduce to sum the intermediate information of the particle in the Fourier term on each thread of the GPU to obtain the structure factor information of the particle in the Fourier term; S54: Calculate the Coulomb long-range force of the particle based on the structure factor information of the particle in all Fourier terms.
5. The method for rapidly calculating long-range interaction forces between particles based on a GPU according to claim 4, characterized in that: The intermediate information of the particle in the Fourier term includes: in, Represents particles In the Fourier term intermediate information.
6. The method for rapidly calculating long-range interaction forces between particles based on a GPU according to claim 5, characterized in that: The structure factor information of the particle in the Fourier term includes: in, Represents the particle in the Fourier term The structure factor information.
7. A device for rapidly calculating long-range interparticle interaction forces based on a GPU, comprising a memory, a CPU, a GPU, and a computer program stored in the memory and capable of running on the CPU and GPU, characterized in that: The CPU and GPU are configured to implement a method for fast calculation of long-range interaction forces between particles based on a GPU as described in any one of claims 1 to 6 when executing the computer program.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it can implement a method for fast calculation of long-range interaction forces between particles based on a GPU according to any one of claims 1 to 6.