Particle accelerator multi-particle dynamics efficient simulation method, system, equipment and medium
By combining the physics-AI hybrid approach with the PIC algorithm and deep neural networks, a high-resolution beam phase diagram is generated, which solves the problems of computational efficiency and accuracy in beam simulation under high current conditions and realizes fast and high-precision multi-particle beam dynamics simulation.
Patent Information
- Application Number
- CN202511458925.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-13
- Publication Date
- 2026-01-20
AI Technical Summary
Existing beam dynamics simulation software consumes huge computational resources and takes a long time to simulate under high current intensity conditions, making it difficult to improve simulation speed while meeting accuracy requirements. Furthermore, existing deep learning models have limited generalization ability, insufficient interpretability, and lack physical constraints.
A physics-AI hybrid approach is adopted, which generates a low-resolution phase diagram using the PIC algorithm and inputs it into a deep neural network. By combining the residual channel attention mechanism and the physical constraint loss function, a high-resolution phase diagram is reconstructed to realize multi-particle beam dynamics simulation.
It significantly improves computational efficiency, reduces computation time by hundreds of times, while maintaining high accuracy and good generalization ability, possesses physical interpretability, and enhances accelerator design and optimization efficiency.
Smart Images

Figure CN121365570A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a particle accelerator multi-particle dynamics efficient simulation method, system, device and medium based on a physical-AI hybrid method, and relates to the field of particle accelerators. BACKGROUND
[0002] With the development of global accelerators towards high-current, high-energy and high-power, higher requirements are put forward for beam dynamics simulation. For high-current heavy ion / proton accelerators, the nonlinear space charge effect between charged particles has an important influence on the beam transmission process in the accelerator. These effects can cause the beam emittance to increase, the halo to be generated, and even the beam to be lost in severe cases. In order to study these complex physical phenomena, the particle-in-cell (PIC) algorithm is generally used in large-scale multi-particle simulation by the current beam dynamics simulation software.
[0003] The PIC algorithm simulates the beam dynamics process by tracking the motion trajectories of a large number of macro-particles. However, when the current of the beam is high, in order to obtain a sufficiently accurate simulation result, the PIC algorithm usually needs to track millions or even more macro-particles, resulting in huge consumption of computing resources and long simulation time, which seriously limits the efficiency of accelerator design and optimization. Therefore, for the simulation problem of beam transmission in a high-current accelerator, the existing mainstream algorithm is difficult to achieve high simulation speed while meeting the simulation accuracy.
[0004] In recent years, researchers have begun to try to introduce deep learning technology into the field of beam dynamics simulation to achieve ultra-fast beam dynamics simulation. Existing research shows that the trained neural network model can replace the traditional beam dynamics simulation algorithm to a certain extent, and significantly reduce the calculation time. However, the existing artificial intelligence model has obvious limitations: 1) limited generalization ability: the existing model can usually only accurately simulate the dynamics process of a specific distribution beam in a specific beam line structure, and is difficult to adapt to changes in the initial beam distribution, changes in the beam line parameters or different beam line designs; 2) lack of explainability: pure artificial intelligence methods are usually regarded as a "black box", and it is difficult to explain its internal working mechanism and physical meaning; 3) lack of physical constraints: the model prediction result may violate the physical law, resulting in unrealistic simulation results.
[0005] In summary, there is an urgent need to develop a new simulation method that can balance computational efficiency and simulation accuracy, while having excellent generalization ability and physical explainability. SUMMARY
[0006] The present application aims to at least solve one of the technical problems existing in the prior art. To this end, in view of the above problems, the object of the present application is to provide a particle accelerator multi-particle dynamics efficient simulation method, system, device and medium based on a physical-AI hybrid method, which realizes high-precision and high-efficiency large-scale multi-particle beam dynamics simulation by combining numerical algorithms with artificial intelligence methods.
[0007] In order to achieve the above-mentioned application purposes, the technical scheme adopted by the present application is: In the first aspect, the present application provides a particle accelerator multi-particle dynamics efficient simulation method, comprising: Sampling a small number of macro-particles from an initial macro-particle beam to form a new macro-particle beam; Performing multi-particle beam dynamics simulation on the new macro-particle beam using a PIC algorithm, and projecting the distribution of the new macro-particle beam to four two-dimensional phase spaces to generate low-resolution phase diagrams of the four two-dimensional phase spaces; Obtaining beam physical parameters based on the new macro-particle beam; Inputting the low-resolution phase diagrams and the beam physical parameters into a halo super-resolution network to output high-resolution phase diagrams of each phase space, thereby realizing multi-particle beam dynamics simulation.
[0008] In some possible implementations, the four two-dimensional phase spaces include a phase space, a phase space, a phase space, a phase space, wherein the phase space reflects the relationship between the horizontal position of the beam and the angle; the phase space reflects the relationship between the vertical position of the beam and the angle; the phase space reflects the relationship between the longitudinal position of the beam and the momentum dispersion; the phase space reflects the spatial distribution of the beam in the transverse plane.
[0009] In some possible implementations, each macro-particle is described by 6-dimensional coordinates during the beam dynamics simulation , wherein and are the horizontal position and angle, respectively; and are the vertical position and angle, respectively; and are the longitudinal position and momentum, respectively.
[0010] In some possible implementation manners, the halo super-resolution network adopts a deep neural network with a residual channel attention mechanism to extract phase space image features and beam physical parameter features, and through a physical-vision dual-domain feature fusion mechanism, a multi-level pixel rearrangement up-sampling technology is adopted to reconstruct a low-resolution phase map into a high-resolution phase map.
[0011] In some possible implementation manners, the training process of the halo super-resolution network is as follows: The same simulation task is performed by using 1024 and 1000000 macro-particles respectively by using the PIC algorithm, the macro-particle distribution is projected into four two-dimensional phase spaces to generate a low-resolution phase map and a high-resolution phase map; The low-resolution phase map is subjected to a logarithmic domain transformation; A deep neural network is constructed and trained, wherein the deep neural network comprises an image feature extraction module, a physical attribute feature extraction and fusion module, and a high-resolution phase map generation module, wherein: The image feature extraction module: the low-resolution phase map after the logarithmic domain transformation is extracted through a convolution layer to obtain shallow layer features, and then sequentially passes through a plurality of residual groups, each residual group comprising a plurality of channel attention residual blocks, each channel attention residual block integrating a channel attention mechanism, and after passing through a plurality of channel attention residual block stacks, high-dimensional image features are obtained; The physical attribute feature extraction and fusion module: the beam physical parameters of the particle beam are encoded into attribute features through a fully connected layer, and the high-dimensional image features and the attribute features are spliced and fused in the channel dimension to form joint features containing rich physical semantics; The high-resolution phase map generation module: the joint features are subjected to a pixel shuffle up-sampling operation to rapidly expand the image size, and a convolution layer is used to generate a high-resolution phase map for each channel, and the high-resolution phase map is subjected to a logarithmic domain inverse transformation to realize mapping restoration; A multi-physical constraint loss function is designed for error back propagation for training of the deep neural network, and the halo super-resolution network is obtained after the training is completed.
[0012] In some possible implementation manners, the multi-physical constraint loss function comprises an image-level L1 loss, a particle number conservation term, an emittance and Twiss parameter regularization term, and / or a geometric error indicator term.
[0013] In some possible implementation manners, the total loss function of the physical constraint is
[0014] wherein, is an image-level loss, emittance , is a geometric error loss, 、 and correspond to the weights of the above losses respectively.
[0015] In a second aspect, the present application also provides a particle accelerator multi-particle dynamics efficient simulation system, comprising: a sampling unit configured to sample a small number of macro-particles from an initial macro-particle beamlet to form a new macro-particle beamlet; a low-resolution phase space obtaining unit configured to perform multi-particle beam dynamics simulation on the new macro-particle beamlet using a PIC algorithm, and project the distribution of the new macro-particle beamlet to four two-dimensional phase spaces to generate low-resolution phase diagrams of the four two-dimensional phase spaces; a physical parameter obtaining unit configured to obtain beam physical parameters based on the new macro-particle beamlet; a high-resolution phase diagram output unit configured to input the low-resolution phase diagrams and the beam physical parameters into a beam halo super-resolution network to output high-resolution phase diagrams of each phase space, realizing multi-particle beam dynamics simulation.
[0016] In a third aspect, the present application also provides an electronic device, comprising: at least one processor; and a memory connected with the processor in communication; wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor to enable the processor to execute the method.
[0017] In a fourth aspect, the present application also provides a computer readable storage medium storing one or more programs, the one or more programs comprising computer instructions for causing a computer to execute the method.
[0018] The present application has the following characteristics due to the above technical solutions: 1. Greatly improved calculation efficiency: compared with the traditional PIC algorithm, since the number of macro-particles required for simulation is reduced by 1000 times, the present application can reduce the calculation time of large-scale multi-particle simulation by hundreds of times, effectively reducing the dependence of fine simulation on high-performance computing devices, and greatly accelerating the particle accelerator design and optimization process.
[0019] 2. Maintaining high simulation accuracy: the present application combines physical methods and artificial intelligence technology, and uses a deep neural network to transform the preliminary simulation results containing 1000 macro-particles into fine simulation results containing 1,000,000 macro-particles, ensuring that the accuracy of the simulation results will not be significantly reduced due to the reduction in calculation amount.
[0020] 3. Strong generalization ability: the present application uses preliminary simulation results of beam dynamics, so it can adapt to different initial distributions of beam and different element parameters, and has good generalization ability.
[0021] 4. Introduce physical constraints and have high interpretability: the preliminary simulation based on the physical model not only provides an interpretable physical basis, but also realizes fast and high-precision simulation by fusing physical modeling and deep learning method while maintaining physical interpretability. Tests show that, compared with the traditional PIC algorithm, the application can reduce the calculation time by hundreds of times (about 190 times acceleration ratio), while maintaining high simulation accuracy (SSIM reaches 0.985, R 2 0.990), has strong generalization ability and physical constraint, greatly improves the design and optimization efficiency of the particle accelerator, and provides an efficient core algorithm for strong current accelerator beam transport simulation, error analysis and other tasks.
[0022] In summary, the application combines traditional numerical calculation methods and artificial intelligence technology to improve the defects of current artificial intelligence algorithms in the field of beam dynamics simulation, realizes efficient and high-precision simulation of large-scale multi-particle beam dynamics process, and can be widely applied in the field of particle accelerator beam dynamics simulation. BRIEF DESCRIPTION OF DRAWINGS
[0023] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The accompanying drawings are included to provide a description of the preferred embodiments, and are not intended to limit the application. Throughout the drawings, the same reference numerals are used to represent the same components. In the drawings: Figure 1 A flow chart of the particle accelerator multi-particle dynamics efficient simulation method of the embodiment of the application; Figure 2 A flow chart of the neural network reconstruction high particle number phase diagram module in the embodiment of the application; Figure 3 A convergence curve diagram of the loss function in the process of training the neural network in the embodiment of the application; Figure 4 A reconstruction effect diagram of the low-resolution phase diagram input in the embodiment of the application Figure 1 ; Figure 5 A reconstruction effect diagram of the low-resolution phase diagram input in the embodiment of the application Figure 2 ; Figure 6 A structure diagram of the electronic device of the embodiment of the application. DETAILED DESCRIPTION
[0024] It is to be understood that the terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The terms "comprises", "comprising", "includes", "including" and "has" are inclusive and therefore specify the presence of stated features, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring their performance in the particular order
[0025] Although the terms first, second, third, etc. can be used herein to describe various elements, components, regions, layers and / or sections, these elements, components, regions, layers and / or sections should not be limited by these terms. These terms can be only used to distinguish one element, component, region, layer or section from another region, layer or section. Terms such as "first", "second", and other numerical terms when used herein do not imply a sequence or order unless clearly indicated by the context. Thus, a first element, component, region, layer or section discussed below could be termed a second element, component, region, layer or section without departing from the teachings of the example embodiments.
[0026] Spatially relative terms, such as "inner", "outer", "beneath", "below", "lower", "above", "upper", and the like, can be used herein for ease of description to describe one element or feature's relationship to another element(s) or feature(s) as illustrated in the figures. The spatially relative terms are intended to encompass different orientations of the device in use or operation in addition to the orientations depicted in the figures.
[0027] Traditional particle simulation methods, such as the Particle-In-Cell (PIC) method, offer good physical accuracy but consume enormous computational resources in large-scale simulation scenarios. While existing deep learning methods are faster, they often lack modeling of physical consistency, making them difficult to generalize to complex accelerator tasks with varying distributions and structures. This invention provides an efficient multi-particle dynamics simulation method, system, device, and medium for particle accelerators based on a physics-AI hybrid approach. The method includes: sampling a small number of macroparticles from an initial macroparticle bundle to form a new macroparticle bundle; performing multi-particle beam dynamics simulation on the new macroparticle bundle using the PIC algorithm, and projecting the distribution of the new macroparticle bundle onto four two-dimensional phase spaces to generate low-resolution phase diagrams for the four two-dimensional phase spaces; obtaining beam physical parameters based on the new macroparticle bundle; and inputting the low-resolution phase diagrams and beam physical parameters into a beam halo super-resolution network to output a high-resolution phase diagram for each phase space, thereby achieving multi-particle beam dynamics simulation. Therefore, this invention integrates physical modeling and deep learning methods for particle beam image generation. By introducing low-particle-number simulation results as physical priors and combining them with a deep neural network with residual attention mechanism, it can quickly generate high-particle-number distribution maps while maintaining particle conservation and physical interpretability, thereby improving simulation efficiency and generalization ability.
[0028] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the invention and to fully convey the scope of the invention to those skilled in the art.
[0029] Example 1: As Figure 1 As shown in this embodiment, the efficient simulation method for multi-particle dynamics of particle accelerators based on a physics-AI hybrid approach includes: S1, Traditional beam dynamics numerical simulation.
[0030] In this embodiment, each macroparticle is described by 6-dimensional coordinates during the beam dynamics simulation. ,in, and These refer to the horizontal position and angle, respectively. and These represent the position and angle in the vertical direction, respectively. and The longitudinal position and momentum, the six parameters completely describe the spatial position and the direction of motion of the macro-particle relative to the reference orbit, and constitute the complete state of the macro-particle in the six-dimensional phase space. Since the 6-dimensional beam distribution (the beam is composed of a large number of macro-particles) is difficult to effectively visualize, and the 2-dimensional distribution is also obtained in the actual accelerator beam measurement, when the data is post-processed, the 6-dimensional beam distribution is usually projected into the 2-dimensional phase space, and then the related research on the beam dynamics is carried out.
[0031] Further, the embodiment adopts the PIC algorithm to perform the same simulation task using 1024 and 1000000 macro-particles respectively, and projects the beam distribution into four two-dimensional phase spaces to generate 32x32 low-resolution phase space images and 256x256 high-resolution phase space images. Specifically, the same simulation task is performed using 1024 macro-particles and 1000000 macro-particles by using the conventional beam dynamics simulation software. The dynamics simulation containing only 1024 macro-particles can be quickly completed and generate preliminary simulation results conforming to the physical law, but it is difficult to accurately describe the beam evolution due to the too small number of macro-particles contained. The dynamics simulation containing 1000000 macro-particles can effectively represent the space charge effect between particles and give fine simulation results for error analysis, beam halo evolution research and other tasks. However, due to the large number of macro-particles contained, the operation amount is large, and the simulation time is long. Since the same simulation task is performed using two numbers of macro-particles, the beam distribution at each position of the accelerator is described by 1024 and 1000000 macro-particles respectively. After the beam distribution is given by the simulation software, the beam containing 1024 macro-particles is projected into 、 、 、 four two-dimensional phase spaces to obtain four low-resolution phase space images (4x32x32 pixel matrix) of the phase space distribution; the beam containing 1000000 macro-particles is projected in the same way, and since the number of macro-particles is large, four high-resolution phase space images (4x256x256 pixel matrix) of the phase space distribution can be obtained. Then, the simulation parameters are changed, and the beam dynamics transport simulation software is used for simulation to generate a large number of corresponding beam phase space distributions (4x32x32 pixel matrix and 4x256x256 pixel matrix). Among them, the phase space reflects the relationship between the horizontal position and the angle of the beam; the phase space reflects the relationship between the vertical position and the angle of the beam; the phase space reflects the relationship between the longitudinal position and the momentum dispersion of the beam; Phase space reflects the spatial distribution of the beam in the transverse plane. The first two phase spaces are position-angle phase spaces, the third phase space is the longitudinal dynamic phase space, and the fourth phase space is the transverse real space distribution. The simulation results of the above 1024 macroparticles (low-resolution phase space images) will be used as input to the deep learning algorithm to introduce prior physical knowledge. Subsequently, the deep neural network will further generate refined beam dynamics simulation results (high-resolution phase space images).
[0032] S2. Construct a deep neural network.
[0033] In this embodiment, a deep neural network with residual channel attention mechanism is constructed, and phase space image features and beam physical parameter features are extracted at the same time. Through the physical-visual dual-domain feature fusion mechanism, multi-level pixel rearrangement upsampling technology is used to reconstruct the low-resolution image into a high-precision phase space distribution.
[0034] Furthermore, such as Figure 2 As shown, the high-resolution phase space image is reconstructed using a deep neural network. The specific process is as follows: the aforementioned low-resolution phase space image (4×32×32 pixel matrix) is input into a deep neural network with a Residual Channel Attention (RCAN) mechanism. The image size is then increased from a certain value using the upsampling mechanism of the Pixel Shuffle module. (e.g., 32×32) Upgraded to (e.g., 256×256), corresponding to an expansion of the number of particles to the millions, thereby improving the simulation speed while solving the problem that a small number of macroparticles cannot accurately represent real clusters.
[0035] This invention is based on the existing image super-resolution framework RCAN, but it improves the structure and couples the physical mechanism for particle accelerator simulation tasks, thereby enhancing the stability of network training. The specific implementation process is as follows: First, the input low-resolution phase space image (4×32×32 pixel matrix) is subjected to a logarithmic domain transformation before being input into the deep neural network. This is to compress the dynamic range and suppress the impact of extreme values on model training.
[0036] Secondly, such as Figure 2 As shown, a deep neural network is constructed and trained. The deep neural network consists of three parts: Image feature extraction module: the low-resolution phase space image after logarithmic domain transformation first extracts shallow features through a 3x3 convolution layer, with 64 channels; then sequentially passes through 10 residual groups, each containing 20 residual channel attention blocks (RCAB), each RCAB integrates channel attention mechanism (CA) inside, which can adaptively adjust the feature response strength, thereby improving the modeling ability of spatial distribution features and the physical correlation between different phase planes. After stacking multiple RCABs, high-dimensional image features are obtained, where high-dimensional image features refer to feature representations obtained after layer-by-layer extraction and abstraction of deep convolutional neural network, for example, an input image of 4x32x32 may become 64x32x32 after multiple RCAB models, the high dimension refers to a significant increase in channel dimension, it should be noted that the number of residual groups and the number of channel attention residual blocks are used as examples, and are not limited thereto.
[0037] Physical property feature extraction and fusion module: the physical features of the particle beam are introduced, including beam energy, centroid position, isochromat distribution position, and current, etc. The above-mentioned physical features of the particle beam are first encoded into attribute feature vectors through a fully connected layer (for example, the output of the fully connected layer is 64-dimensional, so the attribute feature vector is a one-dimensional vector containing 64 numerical values), and are copied into a picture size shape (by means of a broadcast method, the original one-dimensional vector of 64 numerical values is broadcast into a shape of 64x32x32), then the image features and the attribute features are spliced and fused in the channel dimension (for example, the image feature shape is 64x32x32, the attribute feature shape is 64x32x32, and the fused shape is 128x32x32), and a convolution fusion layer is used to further extract the deep coupling relationship between the image and the physical properties, forming a joint feature containing rich physical semantics.
[0038] High-resolution image generation module: the joint feature enters the decoder module, and the image size is quickly expanded through the Pixel Shuffle up-sampling operation to restore the 32x32 image to a 256x256 high-resolution image. This module preserves the physical correspondence between the four channels (two-dimensional phase space) to ensure the accuracy of the generated image in terms of spatial structure and physical consistency. Finally, a convolution layer is used to generate a high-resolution phase space image for each channel, corresponding to the fine reconstruction result of the million-level particle distribution, and the output result is mapped and restored. Mapping and restoration, it should be noted that is used for preprocessing is used for inverse transformation, so that the result is consistent with the physical result.
[0039] S3, design multiple physical constraint loss function for error back propagation to train deep neural network, and obtain halo super-resolution network after training.
[0040] In this embodiment, the regular loss of physical guidance is designed, and in the RCAN model training process, the following multi-task loss function is constructed to ensure physical consistency, ensure the consistency of particle number conservation, emittance and matching degree, including: 1) Image-level L1 loss, used to measure the pixel error between the predicted image and the high particle number real image; 2) Particle number conservation term, scaled according to the ratio of the total particle number of the input image to the output image, to ensure the consistency of the total particle number; 3) Regular term of emittance and Twiss parameter, the emittance of the beam, , and other parameters are calculated by statistical integration of two-dimensional density map, and matched with the target physical parameters; 4) Geometric error index term , quantifying the nonlinear error propagation effect between Twiss parameters.
[0041] The specific process of the particle accelerator multi-particle dynamics efficient simulation method based on the physical-AI hybrid method of the present application will be described in detail below through specific embodiments.
[0042] The particle accelerator multi-particle dynamics efficient simulation method based on the physical-AI hybrid method provided in this embodiment includes: I. Generating a data set.
[0043] 1. Introduction to the simulation beam line: The data set of this embodiment is generated by the beam transmission simulation software AVAS, which simulates the evolution process of the beam in the accelerator based on the PIC algorithm. The data set is generated by using AVAS to perform the same error analysis simulation task with 1024 and 1000000 macro particles respectively. When simulating with 1024 and 1000000 macro particles, except for the spatial grid parameters when solving the space charge effect, the rest of the simulation parameters and physical models are completely consistent. The spatial grid parameters when using the PIC algorithm to solve the space charge effect in the simulation are shown in Table 1, wherein, are the number of spatial grid points in three directions, and the spatial grid lengths in three directions are set according to the root-mean-square radius of the beam. The root-mean-square radius of the beam in x , y , z three dimensions is calculated, and the calculation formula is as follows, taking as an example:
[0044] where N is the total number of macroparticles in the bunch, for all macroparticles x the average value of the coordinates. The spatial grid size in three directions , is a parameter set by the user to control the spatial grid size when solving the space charge effect.
[0045] Table 1
[0046] The beam line used in the simulation is the superconducting section of the Accelerator-Driven Subcritical System Superconducting Linear Accelerator 25 MeV Front-End Demonstrator (CAFe). The error analysis task adds random errors to the initial bunch and each element of the accelerator, repeatedly changes the initial bunch distribution, the parameters of the elements, and the translation and rotation errors of the elements, and gives the corresponding simulation results. The error range added to the initial bunch and each element is shown in Table 2: Table 2
[0047] Initial bunch error: beam current: 5 mA ± 2.5 mA (50% variation range); emittance: standard value ± 50% variation; mismatch: 0-50% variation range; initial phase ellipse parameters: α, β, γ each ± 50% variation; element error: solenoid magnetic field strength: standard value ± 1%; solenoid position: translation error of element installation <± 0.5 mm; solenoid rotation: rotation deviation of element installation <± 2 mrad.
[0048] RF cavity voltage: variation within ± 1% of the standard value; RF cavity phase: variation within ± 1° of the standard value; RF cavity position: translation error of element installation <± 1.0 mm; RF cavity rotation: rotation deviation of element installation <± 4 mrad; The data set generated in this way contains different initial bunches, different element parameters and errors.
[0049] 2. Generate a two-dimensional phase diagram (pixel matrix).
[0050] In this embodiment, under the above parameter settings, AVAS is used to perform the same error analysis simulation task with 1024 and 1,000,000 macroparticles, respectively, and the simulation results of the 1024 particles are projected onto the phase space of the 1,000,000 particles. 、 、 、 Four two-dimensional phase spaces, resulting in four low-resolution phase space images of the phase space distribution (4x32x32 pixel matrices), the simulation results of 1000000 particles are projected to , , , Four two-dimensional phase spaces, resulting in four high-resolution phase space images of the phase space distribution (4x256x256 pixel matrices).
[0051] The following is an example of how to generate a phase diagram of a beam bunch in a two-dimensional phase space. First, calculate the center point of the beam bunch in the two-dimensional phase space , the center point is the mean value of the two-dimensional coordinates of all macro-particles in the beam bunch. The calculation formula is as follows:
[0052]
[0053] wherein, is the total number of macro-particles contained in the beam bunch (in the present application, are 1024 and 1000000, respectively). Then generate a two-dimensional grid centered on , the side length of the grid is proportional to the root mean square size of the beam bunch in two dimensions, , the calculation formula of the root mean square size is as follows:
[0054]
[0055] After determining the center and side length of the two-dimensional grid, the distance between adjacent grid points and
[0056]
[0057]
[0058] wherein, is the number of grids.
[0059] The coordinates of the space grid points are denoted as , wherein , are the indices of the two-dimensional grid points, and the value range of each is , there are a total of nodes on the two-dimensional plane (in the present embodiment, the low-resolution phase diagram , the high-resolution phase diagram ).
[0060] The spot distribution of the beam cluster in two-dimensional space is then converted into a density distribution on the grid points in two-dimensional space. Each particle in the beam cluster is assigned to the four adjacent space grids in this step, and a first-order weight is used in the assignment process, as shown in the following formula:
[0061]
[0062]
[0063]
[0064] wherein, is the position coordinate of the macro-particle, and the grid points of the four adjacent space grids are located at , is obtained according to the position coordinate of the macro-particle . After the above conversion, the two-dimensional matrix can be used to describe the distribution of the beam cluster in two-dimensional phase space. Similarly, the beam cluster distribution in , , three two-dimensional phase spaces can be obtained, wherein, the phase space reflects the relationship between the horizontal position of the beam cluster and the angle; the phase space reflects the relationship between the vertical position of the beam cluster and the angle; the phase space reflects the relationship between the longitudinal position of the beam cluster and the momentum dispersion; and the phase space reflects the spatial distribution of the beam cluster in the transverse plane.
[0065] 3. Other beam cluster attributes: introducing the beam physical parameters of the particle beam.
[0066] In this embodiment, for the beam cluster information of each position, in addition to the phase diagram distribution, the following five beam physical parameters (attributes) are calculated together with the phase Figure 1 as the input of the deep neural network, as shown in Table 3: Table 3
[0067] The statistical formula of the above attributes is as follows:
[0068]
[0069]
[0070]
[0071] where, is the total number of macro-particles in the bunch that are not lost, is the kinetic energy of the i-th macro-particle. is the macro-particle weight (how many real protons does each macro-particle represent), is the elementary charge, is the beam frequency.
[0072] 4. Dataset.
[0073] In this embodiment, the evolution of 1120 different bunches in the accelerator is simulated. In each evolution, 576 bunch phase space diagrams are intercepted in the CAFe beam line using an equal interval sampling method.
[0074] II. Designing the deep neural network architecture.
[0075] 1. Network input preprocessing.
[0076] In this embodiment, the log domain transformation is used to stabilize the training: the input 4x32x32 pixel matrix is subjected to a log domain transformation: Input_processed = log(1 + Input_raw) where Input_raw is the original 4x32x32 pixel matrix.
[0077] 2. Image feature extraction.
[0078] In this embodiment, image feature extraction includes: 1) shallow feature extraction: the pre-processed Input_processed is processed through the following network structure to obtain a batch_size, 64, 32x32 output feature map (batch_size is the sample size input to the deep neural network for training or inference at a time), and the specific network structure is: convolution layer: 3x3 convolution kernel, input channel 4, output channel 64; activation function: ReLU; batch normalization: BatchNorm2d.
[0079] 2) deep feature extraction: 10 residual groups are used, and each residual group contains 20 stacked residual channel attention blocks (RCAB), and each RCAB contains: RCAB structure: Conv layer 1: 3x3, 64->64 channels, padding=1; ReLU activation; Conv layer 2: 3x3, 64->64 channels, padding=1; Channel attention module (CA): Adaptive global average pooling: AdaptiveAvgPool2d(1); 1x1 Conv layer 1: 64->4 channels, padding=0; ReLU activation (inplace=True) 1x1 Conv layer 2: 4->64 channels, padding=0; Sigmoid activation; Channel weight multiplication: x*attention_weights; Residual connection: After the above image processing structure through multiple deep layers, the finally obtained feature map is processed through a convolution layer (Conv layer 1: 3x3, 64->64 channels, padding=1) to obtain the final output feature map with a shape of 64, 32x32.
[0080] 3. Physical property feature extraction.
[0081] In this embodiment, key physical parameters (4 different direction phase diagrams, 5 different physical attribute parameters, a total of 20 features) are extracted from the low-resolution phase diagram, processed through a fully connected layer (Fully connected layer 1: 20->64), and a 64-dimensional feature vector is obtained.
[0082] 4. Feature fusion.
[0083] In this embodiment, the phase diagram feature is 64x32x32; the attribute feature is a 64-dimensional vector->64x32x32 (expanded by broadcasting); the fusion method is channel dimension splicing, obtaining a 128x32x32 feature map; the fusion convolution is 1x1 convolution, 128->64 channels, and the final fused joint feature dimension is 64x32x32.
[0084] 5. High-resolution phase diagram generation.
[0085] In this embodiment, the implementation process of high-resolution phase diagram generation is as follows: 8 times up-sampling (32x32->256x256) is realized by using Pixel Shuffle technology: for 8 times up-sampling, 3 consecutive up-sampling operations (2x2x2=8) are required: First up-sampling (32x32->64x64): 3x3 convolution: 64->64x4=256 channels; PixelShuffle(2): 256 channels are rearranged into 64x64x64 channels; ReLU activation.
[0086] Second upsampling (64×64→128×128): 3×3 convolution: 64 → 64×4 = 256 channels; PixelShuffle(2): 256 channels rearranged into 64×128×128 channels; ReLU activation.
[0087] Third upsampling (128×128→256×256): 3×3 convolution: 64 → 64×4 = 256 channels; PixelShuffle(2): 256 channels rearranged into 64×256×256 channels; ReLU activation; final output layer: 3×3 convolution: 64 → 4 channels (generating the final phase space image 4×256×256).
[0088] Post-processing of output: Output_final = exp(Output_network) – 1.
[0089] III. Design the physical guidance loss function.
[0090] 1. Multi-task loss function.
[0091] In this embodiment, the total loss function is a weighted combination:
[0092] Wherein, the weights are set to =0.8, =0.1, =0.1.
[0093] 2. Detailed definitions of each loss item.
[0094] 1) Image-level L1 loss:
[0095] in, For the number of grid cells, To predict pixel values, These are the actual high-resolution pixel values.
[0096] 2) Emissivity loss: by Taking two-dimensional phase space as an example, emittance It can be obtained through the following formula:
[0097] Based on this formula, the emittance of the predicted phase diagram and the true phase diagram can be obtained:
[0098] in, represent , 、 、 four two-dimensional phase spaces, representing the emission of the i th predicted phase map, representing the emission of the i th target phase map.
[0099] 3) Geometric error loss: Take the two-dimensional phase space as an example, the mismatch degree can be obtained by the following formula:
[0100] where,
[0101] where, , and are the differences between the predicted and true Twiss parameters, the predicted and true Twiss parameters , and can be calculated by the following formula.
[0102]
[0103]
[0104]
[0105] Based on the above results, the geometric error is calculated as:
[0106] where, represent , , , four two-dimensional phase spaces, representing the mismatch of the i th target phase map, representing the mismatch of the i th predicted phase map.
[0107] Four, training process.
[0108] 1. Training parameter setting: Optimizer: Adam, learning rate 1e-4; batch size: 96; training rounds: 500 rounds; early stopping strategy: stop if the validation loss does not decrease for 10 consecutive rounds.
[0109] 2. Data set division: Training set: 896 different beam evolution processes in the accelerator (80%). In each simulation process, the beam phase space at 288 positions in the CAFe beam line was intercepted by equal interval sampling. Therefore, the training data contains more than 250,000 sample data.
[0110] Test set: 224 different beam evolution processes in the accelerator (20%), the test data set contains about 65,000 sample data. The loss function change in the training process is shown in Figure 3 , and the loss function tends to converge when the training is to the first hundred rounds. Figure 4 and Figure 5 show the reconstruction effect of the input low-resolution phase space in this example.
[0111] Table 4
[0112] Five, performance evaluation index.
[0113] In this embodiment, the performance evaluation index includes: 1) Image quality index: structural similarity (SSIM): 0.985; correlation index : 0.990; Six, computational efficiency.
[0114] In this embodiment, the beam simulation uses Intel(R) Core(TM) i7-10750H CPU @2.6GHz 6-core 12-thread test, and the deep network calculation time uses NVIDIA RTX3090 test.
[0115] Traditional PIC method: average 2675 seconds; The method of the present application: low particle number simulation 14 seconds + neural network inference 0.02 seconds = 14.02 seconds; Acceleration ratio: about 190 times.
[0116] Table 5
[0117] In summary, the significant performance improvement of the present application makes large-scale beam dynamics simulation possible on ordinary workstations, greatly reducing the dependence on high-performance computing resources.
[0118] Embodiment Two: The above embodiment one provides a particle accelerator multi-particle dynamics efficient simulation method based on a physical-AI hybrid method. Correspondingly, the present embodiment provides a particle accelerator multi-particle dynamics efficient simulation system based on a physical-AI hybrid method. The system provided by the present embodiment can implement the particle accelerator multi-particle dynamics efficient simulation method based on a physical-AI hybrid method of embodiment one. The system can be realized by software, hardware or a combination of software and hardware. For the convenience of description, the system is described in various units in the present embodiment. Of course, the functions of the units can be realized in the same or multiple software and / or hardware in the implementation. For example, the system can include integrated or separate functional modules or functional units to perform the corresponding steps in the methods of embodiment one. Since the system of the present embodiment is basically similar to the method embodiment, the description process of the present embodiment is relatively simple, and the related parts can be referred to the part of the description of embodiment one. The embodiment of the particle accelerator multi-particle dynamics efficient simulation system based on a physical-AI hybrid method provided by the present application is only illustrative.
[0119] Specifically, the present embodiment provides a particle accelerator multi-particle dynamics efficient simulation system based on a physical-AI hybrid method, comprising: a sampling unit configured to sample a small number of macro-particles from the initial macro-particle beam to form a new macro-particle beam; a low-resolution phase space acquisition unit configured to perform multi-particle beam dynamics simulation on the new macro-particle beam using a PIC algorithm, and project the new macro-particle beam distribution onto four two-dimensional phase spaces to generate low-resolution phase space of the four two-dimensional phase spaces; a physical parameter acquisition unit configured to acquire beam physical parameters based on the new macro-particle beam; a high-resolution phase space output unit configured to input the low-resolution phase space and the beam physical parameters into a beam halo super-resolution network to output a high-resolution phase space of each phase space, and realize multi-particle beam dynamics simulation.
[0120] Embodiment Three: The present embodiment provides an electronic device corresponding to the particle accelerator multi-particle dynamics efficient simulation method based on a physical-AI hybrid method provided by the present embodiment one. The electronic device can be an electronic device for a client, such as a mobile phone, a notebook computer, a tablet computer, a desktop computer, etc., to execute the method of embodiment one.
[0121] As Figure 6As shown, the electronic device includes a processor, a memory, a communication interface and a bus, the processor, the memory and the communication interface are connected through the bus to complete the communication between each other. The memory stores a computer program which can run on the processor, and the processor runs the computer program to execute the method of embodiment one, which has similar principles and technical effects with embodiment one, and will not be repeated here. Those skilled in the art can understand that Figure 6 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computing device to which the scheme of the present application is applied. The specific computing device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0122] In a preferred embodiment, the logical instructions in the memory described above can be realized in the form of a software function unit and sold or used as an independent product when used, which can be stored in a computer readable storage medium. Based on such understanding, the technical scheme of the present application essentially or the part that contributes to the prior art or part of the technical scheme can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in various embodiments of the present application. The foregoing storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), optical disc and various program code storage media.
[0123] In a preferred embodiment, the processor can be a central processing unit (CPU), a digital signal processor (DSP) and various types of general-purpose processors, which are not limited here.
[0124] Embodiment four: the embodiment provides a computer readable storage medium storing one or more programs, the one or more programs including computer instructions, the computer instructions when executed by a computer, cause the computer to execute the method provided by the above embodiment one.
[0125] In a preferred embodiment, the computer readable storage medium can be a tangible device that maintains and stores program instructions for execution by an instruction execution system, such as, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any combination thereof. The computer readable storage medium stores computer program instructions, which cause the computer to execute the method provided by the above embodiment one.
[0126] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0127] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0128] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0129] Each of the embodiments in the present specification is described in progressive manner, and the same or similar parts among the embodiments can be mutually referred to. Each of the embodiments focuses on the difference from other embodiments. In the description of the present specification, the description referring to the terms “one preferred embodiment”, “further”, “specifically”, “in this embodiment”, etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the embodiments described in the present specification. The illustrative description of the above terms in the present specification does not necessarily refer to the same embodiment or example. Also, the specific features, structures, materials or characteristics described can be combined in any suitable manner in one or more embodiments or examples. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the present specification and the features of the different embodiments or examples without contradiction.
[0130] It should be pointed out finally that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit the same; and although the present application has been described in detail with reference to the foregoing embodiments, it should be appreciated by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features thereof can be replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for efficient simulation of many-particle dynamics in a particle accelerator, characterized by, The method comprises the following steps: sampling a small number of macro-particles from an initial macro-particle beam to form a new macro-particle beam; performing multi-particle beam hydrodynamic simulation on the new macro-particle beam by using a PIC algorithm, and projecting the distribution of the new macro-particle beam to four two-dimensional phase spaces to generate low-resolution phase diagrams of the four two-dimensional phase spaces; obtaining beam physical parameters based on the new macro-particle beam; inputting the low-resolution phase diagrams and the beam physical parameters into a halo super-resolution network to output high-resolution phase diagrams of each phase space, thereby realizing multi-particle beam hydrodynamic simulation.
2. The particle accelerator multi-particle dynamics high efficiency simulation method of claim 1, wherein, The four two-dimensional phase spaces include a phase space, a phase space, a phase space, a phase space, wherein the phase space reflects the relationship between the horizontal position of the beam and the angle; the phase space reflects the relationship between the vertical position of the beam and the angle; the phase space reflects the relationship between the longitudinal position of the beam and the momentum dispersion; the phase space reflects the spatial distribution of the beam in the transverse plane.
3. The particle accelerator many-particle dynamics high-fidelity simulation method of claim 1, wherein, Each macro-particle is described by 6 coordinates during the beam dynamics simulation where, and are the horizontal position and angle, respectively, and are the vertical position and angle, respectively, and are the longitudinal position and momentum, respectively.
4. The particle accelerator many-particle dynamics high-fidelity simulation method of claim 1, wherein, The halo super-resolution network adopts a deep neural network with a residual channel attention mechanism to extract phase space image features and beam physical parameter features, and through a physical-visual dual-domain feature fusion mechanism, a multi-level pixel rearrangement up-sampling technology is used to reconstruct the low-resolution phase diagrams into high-resolution phase diagrams.
5. The particle accelerator multi-particle dynamics high-fidelity simulation method of claim 4, wherein, The training process of the halo super-resolution network comprises the following steps: using 1024 and 1,000,000 macro-particles to perform the same simulation task by using the PIC algorithm, projecting the macro-particle distribution to four two-dimensional phase spaces to generate low-resolution phase diagrams and high-resolution phase diagrams; using a logarithmic domain transformation on the low-resolution phase diagrams; constructing a deep neural network and training the deep neural network, wherein the deep neural network comprises an image feature extraction module, a physical attribute feature extraction and fusion module, and a high-resolution phase diagram generation module, and wherein: the image feature extraction module: the low-resolution phase diagrams after the logarithmic domain transformation are extracted through a convolution layer to obtain shallow features, and then sequentially pass through a plurality of residual groups, each residual group comprising a plurality of channel attention residual blocks, each channel attention residual block integrating a channel attention mechanism, and after a plurality of channel attention residual blocks are stacked, high-dimensional image features are obtained; the physical attribute feature extraction and fusion module: the beam physical parameters of the particle beam are encoded into attribute features through a fully connected layer, and the high-dimensional image features and the attribute features are spliced and fused in the channel dimension to form joint features containing rich physical semantics; the high-resolution phase diagram generation module: the joint features are expanded in image size through a Pixel Shuffle up-sampling operation, and a high-resolution phase diagram of each channel is generated through a convolution layer, and the high-resolution phase diagram is subjected to inverse logarithmic domain transformation to realize mapping restoration; a multi-physical constraint loss function is designed for error back propagation to train the deep neural network, and the halo super-resolution network is obtained after the training is completed.
6. The particle accelerator multi-particle dynamics high-fidelity simulation method of claim 5, wherein, The multi-physical constraint loss function comprises an image-level L1 loss, a particle number conservation term, an emission degree and Twiss parameter regularization term, and / or a geometric error index term.
7. The particle accelerator multi-particle dynamics high-fidelity simulation method of claim 6, wherein, The total loss function of the physical constraint is wherein, is an image-level loss, emission , is a geometry error loss, , and correspond to the weights of the above losses, respectively.
8. A particle accelerator multi-particle dynamics high efficiency simulation system, characterized in that, The method comprises the following steps: a sampling unit configured to sample a small number of macro-particles from an initial macro-particle beam to form a new macro-particle beam; a low-resolution phase diagram acquisition unit configured to perform multi-particle beam hydrodynamic simulation on the new macro-particle beam by using a PIC algorithm, and project the distribution of the new macro-particle beam to four two-dimensional phase spaces to generate low-resolution phase diagrams of the four two-dimensional phase spaces; a physical parameter acquisition unit configured to obtain beam physical parameters based on the new macro-particle beam; and a halo super-resolution network configured to input the low-resolution phase diagrams and the beam physical parameters to output high-resolution phase diagrams of each phase space, thereby realizing multi-particle beam hydrodynamic simulation. The high-resolution phase space output unit is configured to input the low-resolution phase space and the beam physical parameters into the beam halo super-resolution network, and output a high-resolution phase space of each phase space, so as to realize the multi-particle beam hydrodynamic simulation.
9. An electronic device, comprising: The method comprises the steps of: at least one processor; and a memory connected to the processor in communication; wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor to enable the processor to perform the method according to any one of claims 1-7.
10. A computer-readable storage medium storing one or more programs, the one or more programs comprising instructions for: The one or more programs include computer instructions for causing a computer to perform the method according to any one of claims 1-7. The one or more programs include computer instructions for causing a computer to perform the method according to any one of claims 1-7.
Citation Information
Cited By
Calculation method, device and equipment of accelerator full beam line space charge field and medium
CN122197511A
Method and device for calculating spatial charge field of accelerator full beam line, equipment and medium
CN122197511B