A method and device for simulating multi-particle beam transmission with adaptive weights
By adaptively weighting and sampling macro-particle bunches to generate candidate bunches, the balance problem between computational efficiency and accuracy in existing multi-particle simulation algorithms is solved, and efficient simulation of beam transport in accelerators is achieved.
Patent Information
- Application Number
- CN202511005531.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-07-22
AI Technical Summary
Existing multi-particle beam simulation algorithms have difficulty achieving a balance between computational efficiency and accuracy, especially in high-current proton/heavy ion accelerators. Nonlinear space charge effects lead to beam loss, and large-scale simulations are time-consuming, limiting their widespread use in practical applications.
By dividing the macro-particle bunches and configuring adaptive weights to form multiple groups of macro-particles, and sampling based on density distribution characteristics, candidate bunches are generated to replace the original macro-particle bunches for simulation, reducing the number of macro-particles and improving the calculation speed.
It achieves accurate description of the beam transmission process with a smaller number of macroparticles, improves simulation speed and computational efficiency, and adapts to the beam characteristics in the accelerator, especially the evolution process of the beam halo.
Smart Images

Figure CN120509273B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of particle accelerators, and in particular to a method and device for simulating multi-particle beam transmission with adaptive weights. Background Art
[0002] Particle accelerator beam dynamics simulation methods can simulate and analyze the physical behavior of the beam during accelerator transmission, achieving multiple key functions: effectively controlling beam losses, optimizing accelerator design and operating parameters, and improving beam quality, thereby significantly enhancing the overall performance and stability of the accelerator. Furthermore, they can predict results before actual experiments, preventing safety hazards that may arise from improper settings. Furthermore, these simulation tools help researchers gain a deeper understanding of the fundamental operating principles and physical mechanisms of accelerators. Beam dynamics simulation software plays a vital role in modern accelerator scientific research and applications.
[0003] Two main approaches are used to simulate beam dynamics in accelerators: envelope simulation and multi-particle simulation. During the accelerator design phase, envelope simulation, due to its high simulation speed, is used to quickly match beam parameters to accelerator parameters. However, this approach struggles to accurately simulate beam transport within the accelerator. In contrast, multi-particle simulation provides more accurate results, but at a significantly higher computational resource cost. In high-intensity proton / heavy ion accelerators, the nonlinear space charge effect generated by the interaction between charged particles significantly impacts beam dynamics simulations. This effect can lead to a variety of phenomena, including beam emittance growth, halo formation, and even beam loss in severe cases. To further investigate these nonlinear effects, current beam dynamics simulation programs, such as TraceWin, IMPACT, PyORBIT, and BEAMPATH, widely employ particle-in-cell (PIC) algorithms for large-scale multi-particle simulations.
[0004] However, large-scale multi-particle simulations face computational efficiency challenges, especially when simulating a large number of particles. The computational process is extremely time-consuming, limiting their widespread use in practical applications. Computationally intensive tasks such as error analysis, failure compensation, and beam halo research require not only extensive computing resources but also long simulation times. Furthermore, the rapid application of machine learning techniques in the accelerator field has further exacerbated this challenge with the demand for large-scale, high-quality training datasets.
[0005] In summary, current mainstream algorithms struggle to achieve an ideal balance between simulation accuracy and computational speed for large-scale multi-particle simulations. Therefore, further research is needed into the characteristics of high-intensity proton / heavy ion beams, optimizing existing multi-particle simulation algorithms and increasing their computational speed. This will provide reliable core algorithms for computationally intensive scenarios such as error analysis, failure compensation, and large-scale dataset generation. Summary of the Invention
[0006] In order to solve the above technical problems, an embodiment of the present invention provides a multi-particle beam transport simulation method with adaptive weights, comprising:
[0007] Divide the macro particle bunch to be processed into multiple groups of macro particles;
[0008] According to the density distribution characteristics of the macro particle bunch, a relative weight is configured for each group of the macro particles. The relative weights of the macro particles in the same group are the same, and the relative weights of the macro particles in different groups are different. The closer the groups of macro particles are to the center of the macro particle bunch, the greater the corresponding relative weight. The maximum value of the relative weight is a preset value.
[0009] Sampling each group of macro particles according to the relative weight of each group of macro particles to obtain corresponding sampling results;
[0010] Determining the weight of each macro particle in each sampling result in combination with the relative weight of the macro particles in each sampling result;
[0011] Determining similarities between a candidate bunch and the macro-particle bunch in different dimensions, the candidate bunch being formed by a collection of sampling results configured with weights of the macro-particles;
[0012] In the case where the similarity satisfies a beam dynamics simulation condition, determining the candidate bunch as a new macro particle bunch;
[0013] The new macro particle bunch is used to replace the macro particle bunch to perform multi-particle beam dynamics simulation to describe the evolution process of beam transmission in the accelerator.
[0014] In one embodiment, sampling each group of macro particles is performed in combination with the relative weight of each group of macro particles to obtain corresponding sampling results, including:
[0015] The number of macroparticles to be extracted from each group of macroparticles is determined based on the relative weight of each group of macroparticles, at least with the constraint that the density distribution of the macroparticles involved in the plurality of sampling results is consistent with the density distribution of the macroparticles in the macroparticle bunch;
[0016] Each group of macro particles is sampled based on the number of macro particles required to be extracted from each group to obtain the corresponding sampling result.
[0017] In one embodiment, sampling each group of macro particles in combination with the relative weight of each group of macro particles to obtain corresponding sampling results includes:
[0018] Each group of macro particles is sampled based on the relative weight of each group of macro particles and the following formula to obtain the corresponding sampling result:
[0019]
[0020] Among them, the N sp is the total number of macro particles in the preset multiple sampling results, n s is the number of groups of macro particles, i For the i Group macro particles, N si For the i The number of macro particles extracted by the group macro particle, Rw i is the relative weight of each group of macro particles.
[0021] In one embodiment, determining the weight of each macro particle in each sampling result by combining the relative weights of the macro particles in each sampling result includes:
[0022] The weight of each of the macro particles in the macro particle bunch is determined as the initial weight w 0, the initial weights of the macro particles are the same;
[0023] Determine the relative weight of each of the macro particles Rw j ;
[0024] Determine the total number of macro particles in the plurality of sampling results N sp ;
[0025] Based on the initial weight, relative weight and total number of macro particles, the weight of each macro particle in each sampling result is calculated using the following formula:
[0026]
[0027] described j For the j macro particles, the w j For the j The weight of the macro particles, Nis the total number of macro particles, w 0 is the initial weight of the macro particle.
[0028] In one embodiment, determining the similarity between the candidate bunch and the macro particle bunch in different dimensions includes:
[0029] determining a mismatch between the candidate bunch and the macro particle bunch;
[0030] determining similarity of charge distributions of the candidate bunch and the macro particle bunch on a spatial grid;
[0031] The similarity between the candidate bunch and the macro particle bunch in terms of beam halo parameters is determined.
[0032] In one embodiment, determining the mismatch between the candidate bunch and the macro particle bunch includes:
[0033] The mismatch between the candidate bunch and the macro particle bunch is determined based on the following formula: M i :
[0034]
[0035] , α 、 β 、 γ is the Twiss parameter of the candidate bunch, α 0. β 0. γ 0 is the Twiss parameter of the macro particle bunch, 、 、 is the difference in Twiss parameters.
[0036] In one embodiment, determining the similarity of charge distributions of the candidate bunch and the macro particle bunch on a spatial grid includes:
[0037] The charges of the candidate bunches and the macroparticle bunches are distributed to the spatial grid according to the weights of the specified order. The weights of the specified order include first-order weights. In the three-dimensional spatial grid, under the first-order weights, the charge of each macroparticle is distributed to the adjacent eight spatial grid points. The first-order weights are obtained based on the following formula:
[0038]
[0039] Among them, the ρ i,j,k ρ i+1,j,k ρ i,j+1,k ρ i+1,j+1,k ρ i,j,k+1 ρ i+1,j,k+1 ρ i,j+1,k+1 ρ i+1,j+1,k+1 Represent the amount of charge assigned to the 8 spatial grid points near the macro particle, x 、 y 、 z is the position coordinate of the macro particle, and the grid points of the space grid are located at X i , Y j , Z k , , is the spacing of spatial grid points in three directions, i , j , k According to the position coordinates of the macro particles x 、 y 、 z get, ρ c is the charge density of the uniformly distributed space grid;
[0040] The normalized absolute error between the charge amount of the candidate bunch and the charge amount of the macro particle bunch on the spatial grid is calculated based on the charge distribution of the candidate bunch and the macro particle bunch on the spatial grid. The normalized absolute error is obtained based on the following formula:
[0041]
[0042] described NAE is the normalized absolute error, i , j , k is the index of the spatial grid, A is the three-dimensional matrix corresponding to the charge distribution of the candidate bunch on the spatial grid, and B is the three-dimensional matrix corresponding to the charge distribution of the macro particle bunch on the spatial grid.
[0043] In one embodiment, determining the similarity between the candidate bunch and the macro particle bunch in terms of beam halo parameters includes:
[0044] determining the beam halo parameters of the candidate bunch;
[0045] determining beam halo parameters of the macro particle bunch;
[0046] The relative deviation between the beam halo parameters of the candidate bunch and the macro particle bunch is determined based on the following formula:RD :
[0047]
[0048] described H x 、 H y 、 H z The candidate bunch is x 、 y 、 z The beam halo parameter in the direction, H x0 、 H y0 、 H z0 For the macro particle bunch x 、 y 、 z The beam halo parameter in the direction.
[0049] In one embodiment, when the similarity satisfies a beam dynamics simulation condition, determining the candidate bunch as a new macro particle bunch includes:
[0050] Determining the similarity between the candidate bunch and the macro particle bunch in terms of fitness, spatial grid charge distribution, and beam halo parameters;
[0051] In the case where the similarity satisfies a beam dynamics simulation condition, determining the candidate bunch as a new macro particle bunch; or
[0052] Based on multiple sampling and weight configuration, a plurality of candidate bunches are obtained;
[0053] Determining the similarity between each candidate bunch and the macro particle bunch in terms of fitness, spatial grid charge distribution, and beam halo parameters;
[0054] The target candidate bunch with the highest similarity and satisfying the beam dynamics simulation conditions is determined as the new macro particle bunch.
[0055] Another embodiment of the present invention also provides a multi-particle beam transport simulation device with adaptive weights, comprising:
[0056] A division module is used to divide the macro particle bunch to be processed into multiple groups of macro particles;
[0057] a configuration module for configuring relative weights for each group of the macro particles according to the density distribution characteristics of the macro particle bunch, wherein the relative weights of the macro particles in the same group are the same, and the relative weights of the macro particles in different groups are different; the closer the groups of macro particles are to the center of the macro particle bunch, the greater the corresponding relative weights; and a maximum value of the relative weights is a preset value;
[0058] A sampling module, configured to sample each group of macro particles in combination with the relative weight of each group of macro particles to obtain corresponding sampling results;
[0059] Determining the weight of each macro particle in each sampling result in combination with the relative weight of the macro particles in each sampling result;
[0060] A first determining module, configured to determine the weight of each macro particle in each sampling result in combination with the relative weight of the macro particles in each sampling result;
[0061] a second determining module, configured to determine similarities between a candidate bunch and the macro particle bunch in different dimensions, the candidate bunch being formed by a set of sampling results configured with weights of the macro particles;
[0062] a third determining module, configured to determine, when the similarity satisfies a beam dynamics simulation condition, that the candidate bunch is a new macro particle bunch;
[0063] The simulation module is used to use the new macro particle bunch to replace the macro particle bunch to perform multi-particle beam dynamics simulation to describe the evolution process of beam transmission in the accelerator.
[0064] Other features and advantages of the present application will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present application. The purposes and other advantages of the present application can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.
[0065] The technical solution of the present application is further described in detail below through the accompanying drawings and examples. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0067] Figure 1Schematic diagram of the distribution of Gaussian distributed bunches in the accelerator in the xy phase space in the existing scheme.
[0068] Figure 2 Schematic diagram of the relationship between the particle density of the Gaussian distributed bunch in the accelerator and the normalized radius of the bunch in the existing scheme.
[0069] Figure 3 Schematic diagram of the flow of the adaptive weighted multi-particle beam transport simulation method in an embodiment of the present invention.
[0070] Figure 4 Schematic diagram of the flow of the adaptively weighted multi-particle beam transport simulation method in an application embodiment of the present invention.
[0071] Figure 5 This is a visualization result diagram of the present invention in which the macro particles in the macro particle cluster are divided into 5 groups according to their distance from the cluster center.
[0072] Figure 6 1 is a graph showing the relative weight distribution of candidate bunches and the corresponding macro particle number distribution in one embodiment of the present invention.
[0073] Figure 7 Schematic diagram of the relationship between the space grid and macro particles when calculating the space charge effect in an embodiment of the present invention.
[0074] Figure 8 Schematic diagram of the distribution of macro particle bunches and candidate bunches in an application embodiment of the present invention.
[0075] Figure 9 This is a visual comparison diagram of the simulation results of the original bunch and the adaptively weighted bunch in the multi-particle simulation in an embodiment of the present invention.
[0076] Figure 10 Schematic diagram of the distribution of relative weights, number of particles and total relative weights of each group in a cluster according to an embodiment of the present invention.
[0077] Figure 11 4 is a structural block diagram of a multi-particle beam transmission simulation device with adaptive weights in an embodiment of the present invention. DETAILED DESCRIPTION
[0078] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings, but are not intended to limit the present invention.
[0079] It should be understood that various modifications may be made to the embodiments disclosed herein. Therefore, the following description should not be considered as limiting, but merely as an example of an embodiment. Other modifications within the scope of the present disclosure will occur to those skilled in the art.
[0080] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the general description of the present disclosure given above and the detailed description of the embodiments given below, serve to explain the principles of the present disclosure.
[0081] These and other characteristics of the invention will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.
[0082] It should also be understood that although the invention has been described with reference to certain specific examples, those skilled in the art will be able to realize many other equivalent forms of the invention that have the characteristics recited in the claims and are therefore within the scope of protection defined thereby.
[0083] The above and other aspects, features and advantages of the present disclosure will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.
[0084] Specific embodiments of the present disclosure will be described hereinafter with reference to the accompanying drawings; however, it should be understood that the disclosed embodiments are merely examples of the present disclosure, which may be implemented in a variety of ways. Well-known and / or repetitive functions and structures are not described in detail to avoid obscuring the present disclosure with unnecessary or redundant detail. Therefore, the specific structural and functional details disclosed herein are not intended to be limiting, but rather serve merely as a basis and representative basis for the claims to teach those skilled in the art to variously employ the present disclosure with substantially any suitable detailed structure.
[0085] This description may use the phrases "in one embodiment," "in another embodiment," "in a further embodiment," or "in other embodiments," each of which may refer to one or more of the same or different embodiments according to the present disclosure.
[0086] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
[0087] To describe the evolution of beam propagation, particle motion tracking is necessary. A commonly used multi-particle tracking method is the PIC method, which is widely used in fields such as free electron lasers, space plasmas, and laser-plasma interactions. In accelerators, the PIC algorithm is widely used to account for the effects of nonlinear space charge effects. The particles used in the PIC algorithm are called macroparticles, each representing many real particles in similar states.
[0088] In current accelerator beam dynamics simulations, all macroparticles are assigned the same weight. For example, if 100,000 macroparticles are used to simulate a bunch containing 100 million real charged particles, each macroparticle represents 1,000 real particles. The phase diagram of a common bunch in xy space is as follows: Figure 1As shown in the figure, the characteristics of the beam in the linear proton / heavy ion accelerator are different from those of ordinary plasma. The particle density at the center of the bunch is much higher than that at the edge of the bunch, as shown in the figure. Figure 2 As shown, Figure 2 (a) shows the radial density distribution of the bunch, where the horizontal axis is the ratio of the radius to the RMS radius of the bunch, and the vertical axis is the particle density. It can be seen that the density at the center of the bunch is much higher than the density at the edge. In order to show this change more clearly, the vertical axis is compressed using the log function to obtain Figure 2 (b) shows that the particle density spans five orders of magnitude from the bunch center to the bunch edge. Therefore, if each macroparticle has equal weight, the vast majority of macroparticles are concentrated in the bunch center. However, in beam dynamics simulations, the motion of particles at the bunch edge (the beam halo) is of greater interest (because particles at the bunch edge are more likely to be lost), and the evolution of the beam halo is also more complex.
[0089] In order to describe the evolution of beam halo more accurately, traditional algorithms can only significantly increase the total number of macroparticles in the simulation. Figure 3 As shown, an embodiment of the present invention provides a multi-particle beam transport simulation method with adaptive weights, comprising:
[0090] S1: Divide the macro particle bunch to be processed into multiple groups of macro particles;
[0091] S2: assigning relative weights to each group of macroparticles according to the density distribution characteristics of the macroparticle bunch. The macroparticles in the same group have the same relative weight, while the macroparticles in different groups have different relative weights. The closer the groups of macroparticles are to the center of the macroparticle bunch, the greater the corresponding relative weights. The maximum value of the relative weights is a preset value.
[0092] S3: sampling each group of macro particles based on the relative weight of each group of macro particles to obtain corresponding sampling results;
[0093] S4: Determine the weight of each macro particle in each sampling result in combination with the relative weight of the macro particle in each sampling result;
[0094] S5: determining similarities between a candidate bunch and the macro particle bunch in different dimensions, the candidate bunch being formed by a set of sampling results configured with weights of the macro particles;
[0095] S6: if the similarity satisfies a beam dynamics simulation condition, determining the candidate bunch as a new macro particle bunch;
[0096] S7: Using the new macro particle bunch to replace the macro particle bunch to perform multi-particle beam dynamics simulation to describe the evolution process of beam transmission in the accelerator.
[0097] The method described in the above embodiment is to group the original macroparticle bunches to form multiple groups of macroparticles, then sample each group of macroparticles and configure weights for the adaptability of the macroparticles in the sampling results, so that the macroparticles obtained by the weighted sampling can form a candidate bunch. The number of macroparticles in this candidate bunch is smaller than that of the original macroparticle bunch. If the candidate bunch can also fully describe the evolution of beam transport in the accelerator, then the candidate bunch can be used to implement simulation. To determine whether the candidate bunch can be used for simulation, this embodiment will determine the similarity between the candidate bunch and the macroparticle bunch in different dimensions. If the similarity meets the beam dynamics simulation conditions, then it can be considered that the candidate bunch can replace the original macroparticle bunch for simulation. At this time, the system will determine the candidate bunch as a new macroparticle bunch and use it to replace the original macroparticle bunch.
[0098] For example, the application process of the method described in this embodiment can be summarized as follows: Figure 4 As shown, firstly, the original bunch of macro particles with the same weight (denoted as bunch 0) grouping. Then different numbers of macro particles are sampled from each group and assigned different weights. The sampled macro particles form a new bunch with adaptive weights (denoted as bunch w ). In subsequent multi-particle simulations, the new bunch is used instead of the original one. Because the new bunch incorporates new variable weights, it can be described using fewer macroparticles than the original one. This reduction in the number of macroparticles significantly increases simulation speed.
[0099] This method enables detailed simulation of beam dynamics using a smaller number of macroparticles. Compared to traditional multi-particle simulation algorithms, this method better matches the characteristics of accelerator beams, requires less computation, and is faster.
[0100] In one embodiment, sampling each group of macro particles in combination with the relative weight of each group of macro particles to obtain corresponding sampling results includes:
[0101] S301: determining the number of macro particles to be extracted from each group of macro particles, based on at least a constraint that the density distribution of the macro particles involved in the plurality of sampling results is consistent with the density distribution of the macro particles in the macro particle bunch, and combining the relative weight of each group of macro particles;
[0102] S302: Sampling each group of macro particles based on the number of macro particles required to be extracted from each group to obtain the corresponding sampling result.
[0103] For example, each particle in the bunch is represented by a six-dimensional coordinate ( x, p x , y, p y , z, p z ) description, the bunch is divided according to the distance between each macro particle and the bunch center. First, the RMS radius of the bunch in each of the six directions is calculated using the following formula:
[0104]
[0105]
[0106]
[0107]
[0108]
[0109]
[0110] in N is the total number of macro particles in the initial macro particle bunch, For the i The six-dimensional coordinates of a macroparticle, are the six-dimensional coordinates of all macroparticles Then calculate the relative distance of each macro particle to the bunch. L , the calculation formula is as follows:
[0111]
[0112] All macro particles in the bunch are divided into L i The values of are sorted from small to large, and then evenly grouped from front to back. For example, if the number of macro particles in the bunch is 1,000,000 and divided into 5 groups, then the macro particles ranked 1 to 200,000 are the first group, the macro particles ranked 200,001 to 400,000 are the second group, and so on. After the initial macro particle bunches are grouped in the six-dimensional space according to the above method, they are projected into the xy two-dimensional bunch phase space as follows Figure 5 As shown. It can be seen that after the above process, the initial bunch of macro particles with the same weight ( bunch 0) is divided into 5 groups from inside to outside.
[0113] Furthermore, sampling each group of macro particles in combination with the relative weight of each group of macro particles to obtain corresponding sampling results includes:
[0114] S303: Sampling each group of macro particles according to the relative weight of each group of macro particles and the following formula to obtain the corresponding sampling result:
[0115]
[0116] Among them, the N sp is the total number of macro particles in the preset multiple sampling results, n s is the number of groups of macro particles, i For the i Group macro particles, N si For the i The number of macro particles extracted by the group macro particle, Rw i is the relative weight of each group of macro particles.
[0117] Before calculating the weights, it is necessary to first determine the relative weights of each group of macro particles. bunch 0) After the grouping is completed, some macro particles are extracted from each group of macro particles and assigned different weights to form a new bunch (i.e., candidate bunch, denoted as bunch w ).from bunch 0th i The relative weight of the macro particles extracted from the group macro particles is recorded as Rw i , the first group of macro particles extracted (the particles at the center of the bunch) are assigned the highest relative weight ( Rw max ), the Rw max The relative weight of each group is gradually reduced from the center of the bunch to the edge of the bunch. The change of relative weight is consistent with the characteristics of high density at the center of the bunch and low density at the edge, which can make bunch w The macro particles in the cluster are more evenly distributed in the cluster space, so that fewer macro particles can accurately describe the cluster characteristics. Similarly, the weight of each macro particle must also meet the above characteristics. In this embodiment, bunch The number of 0 groups is recorded as n s , then i The relative weight of the macro particles in the group Rw i for:
[0118]
[0119] described Rw stepis the common ratio, that is, the step size of the relative weight decrease. The first group is the maximum relative weight set Rw max The relative weight of each subsequent group is the weight of the previous group divided by step That is, the relative weight of the latter group of macro particles is based on the relative weight of the former group of macro particles divided by the common ratio, calculated using the above formula step This ensures that the relative weight of the last group drops to 1. For example n s =5, max =10, then from The relative weights of the macroparticles extracted from the five groups of macroparticles with a value of 0 can be given by the two formulas above: [10, 5.62, 3.16, 1.78, 1]. In this example, a linear and exponential reduction of the relative weights were compared. The results showed that exponential reduction (as shown in the formula above) can achieve a more uniform distribution of macroparticles within the bunch space.
[0120] The total number of macro particles in 0 is recorded as N , w The total number of macro particles in is recorded as N sp . Then from Randomly select from each group of macro particles 0 N si The relative weight is i Macro particles, a total of N sp Macroparticles w ,in N si For 0 in i The number of macro particles extracted from the group of macro particles. In order to ensure that the sampling is carried out under the condition of relative weight changes w and To maintain a consistent density distribution, the sum of the relative weights of each group of macro particles extracted must be equal, that is, ,in , for i In addition, the total number of macro particles extracted is N sp ,Right now Under the above two constraints, we can solve 0 in iThe number of macro particles randomly selected from the group of macro particles N si for:
[0121]
[0122] From the above formula, we can see that the sum of the weights of each group of macro particles extracted is the above constant C , and the total number of macro particles extracted is N sp That is, the number of macro particles extracted from each group of macro particles calculated according to the above formula can meet the above-mentioned limit requirements.
[0123] Furthermore, assuming that N =1000000, N sp =250000, n s =20, max = 30, the number of sampled particles and relative weights set by the above algorithm for each group of macro particles are as follows: shown. The dashed line in the figure represents the number of macroparticles in each group when 250,000 macroparticles are evenly distributed into 20 groups. It can be seen that the macroparticles in the bunches generated by the adaptive weighting strategy tend to be more distributed at the edges of the bunches than in the original bunches. In other words, introducing different weights for each group of macroparticles to help describe the density variations in the real bunch can solve the problem of most macroparticles being concentrated in the center of the bunch, resulting in a lack of description of the beam halo.
[0124] Determining the weight of each macro particle in each sampling result by combining the relative weight of the macro particles in each sampling result includes:
[0125] S401: Determine the weight of each macro particle in the macro particle bunch as the initial weight w 0, the initial weights of the macro particles are the same;
[0126] S402: Determine the relative weight of each macro particle j ;
[0127] S403: Determine the total number of macro particles in the plurality of sampling results N sp ;
[0128] S404: Based on the initial weight, relative weight, and total number of macro particles, the weight of each macro particle in each sampling result is calculated using the following formula:
[0129]
[0130] described j For the j macro particles, the w j For the j The weight of the macro particles, N is the total number of macro particles, w 0 is the initial weight of the macro particle.
[0131] This embodiment proposes a method that adaptively assigns weights to each macroparticle, ensuring that each macroparticle has an appropriate weight. The weight of each macroparticle indicates how many real particles it represents. The larger the macroparticle weight, the fewer macroparticles are used in multi-particle transport simulations, reducing the computational complexity. Specifically, this embodiment assigns higher weights to macroparticles located in the center of the bunch, meaning that each macroparticle represents more real particles, reducing the number of macroparticles used to describe the bunch center. Given a fixed total number of macroparticles, more macroparticles are used to describe the evolution of particles at the bunch edge, a region of particular interest in multi-particle transport simulations. In practice, because the particle density at the bunch center is much higher than at the bunch edge, even with higher weights in the center, there are still sufficient macroparticles to describe the bunch center. Therefore, this strategy of adaptively assigning macroparticle weights based on distance from the bunch center can better match the beam characteristics of linear proton / heavy ion accelerators. The essence of this method is to introduce new variables (weights) when using multi-particle bunches to describe real bunches, thereby reducing the number of macroparticles required to accurately describe the real bunch.
[0132] In this embodiment, each macro particle in the candidate bunch is calculated j Weight w j The formula used is as follows:
[0133]
[0134] The weight of the macro particles in the macro particle bunch is determined as the initial weight, which is recorded as w 0.
[0135] When calculating the above weights, you only need to set N sp ( N sp < N )and max , we can use the above formula from 0 (inclusive N macro particles with equal weights) Nsp The candidate bunch is obtained by using adaptively weighted macro particles w .
[0136] In practical applications, random sampling is used to obtain w For the original bunch The replacement effect of 0 also has a certain randomness, sometimes the replacement effect is very good, sometimes it is not so good. In order to avoid this randomness, we should ensure that the new macro particle bunch is finally formed. w right The replacement effect of 0 is good. It is necessary to repeatedly sample and configure weights to generate multiple candidate bunches, and then verify each candidate bunch. Finally, the candidate bunch with the best replacement effect is selected as the new macro particle bunch for simulation to reduce the fluctuation caused by randomness.
[0137] When verifying the generated candidate bunch, determining the similarity between the candidate bunch and the macro particle bunch in different dimensions includes:
[0138] S501: Determine the mismatch between the candidate bunch and the macro particle bunch;
[0139] S502: Determine the similarity of charge distribution between the candidate bunch and the macro particle bunch on the spatial grid;
[0140] S503: Determine the similarity between the candidate bunch and the macro particle bunch in terms of beam halo parameters.
[0141] That is, in this embodiment, the multi-dimensional verification of the similarity between the candidate bunch and the macro particle bunch is specifically performed in three dimensions: mismatch degree, charge distribution on the spatial grid, and beam halo parameters.
[0142] Specifically, determining the mismatch between the candidate bunch and the macro particle bunch includes:
[0143] S504: Determine the mismatch between the candidate bunch and the macro particle bunch based on the following formula: M i :
[0144]
[0145] , α 、 β 、 is the Twiss parameter of the candidate bunch, α 0. β 0. 0 is the Twiss parameter of the macro particle bunch, 、 、 is the difference in Twiss parameters.
[0146] The mismatch degree in this embodiment is recorded as M i After all the mismatches corresponding to the candidate bunches are calculated, the mismatches are sorted to determine the candidate bunches whose mismatches meet the requirements and can be used to verify the charge distribution of the grid space in the next step. Alternatively, all candidate bunches can be verified for charge distribution on the grid space. The serial numbers of the candidate bunches are recorded as i , i Representative i candidate clusters.
[0147] Furthermore, determining the similarity of charge distribution between the candidate bunch and the macro particle bunch on the spatial grid includes:
[0148] S505: Distribute the charges of the candidate bunches and the macroparticle bunches to the spatial grid according to the weights of the specified order. The weights of the specified order include first-order weights. In the three-dimensional spatial grid, under the first-order weights, the charge of each macroparticle is distributed to eight adjacent spatial grid points. The first-order weights are obtained based on the following formula:
[0149]
[0150] Among them, the i,j,k i+1,j,k i,j+1,k i+1,j+1,k i,j,k+1 i+1,j,k+1 i,j+1,k+1 i+1,j+1,k+1 Represent the amount of charge assigned to the 8 spatial grid points near the macro particle, x 、 y 、 z is the position coordinate of the macro particle, and the grid points of the space grid are located at X i , Y j , Z k , , is the spacing of spatial grid points in three directions, i , j ,k According to the position coordinates of the macro particles x 、 y 、 z get, c is the charge density of the uniformly distributed space grid;
[0151] S506: Calculate the normalized absolute error between the charge amount of the candidate bunch and the charge amount of the macro particle bunch on the spatial grid according to the charge distribution of the candidate bunch and the macro particle bunch on the spatial grid. The normalized absolute error Based on the following formula:
[0152]
[0153] described i , j , k is the index of the spatial grid, A is the three-dimensional matrix corresponding to the charge distribution of the sampling result on the spatial grid, and B is the three-dimensional matrix corresponding to the charge distribution of the macro particle bunch on the spatial grid.
[0154] For example, in the calculation of the space charge effect, the charges of the particles in the bunch need to be distributed to the space grid according to the weights, and then the space charge field can be calculated based on the charge on the space grid (the relationship between the space grid and the bunch is as follows As shown, the three-dimensional spatial grid is evenly distributed in the area where the bunch is located). Therefore, it is necessary to distribute the charges of multiple candidate bunches to the same number of spatial grids; the macro particles in the macro particle bunch are also distributed to the same spatial grid, and the normalized absolute error of the charge on the spatial grid of each candidate bunch and the spatial grid of the macro particle bunch is calculated. The candidate bunches are sorted according to their normalized absolute errors to determine the candidate bunches whose absolute errors meet the requirements and can be used for the next step of verifying the beam halo parameters, or all candidate bunches can be checked for beam halo parameters. In this embodiment, the sorting sequence of the absolute errors of the multiple candidate bunches is recorded as i .
[0155] Specifically, in this embodiment, the charge of each particle in the candidate bunch and the macro particle bunch is distributed to the spatial grid according to the weight using the first-order weight formula, that is, the specified order is first-order, of course, it can also be other orders, the specific order is not fixed. In this embodiment, the charge of each macro particle is distributed to the adjacent 8 spatial grid points, and the first-order weight formula is as described above. c is the charge density of the uniformly distributed space grid, and the charge density is calculated as follows:
[0156] , q is the charge of a single macroparticle.
[0157] Furthermore, determining the similarity between the candidate bunch formed by the sampling results configured with the weights and the macro particle bunch in terms of beam halo parameters includes:
[0158] S507: Determine the beam halo parameters of the candidate bunch;
[0159] S508: Determine the beam halo parameters of the macro particle bunch;
[0160] S509: Determine the relative deviation between the beam halo parameters of the candidate bunch and the macro particle bunch based on the following formula:
[0161]
[0162] described H x 、 H y 、 H z The candidate bunch is x 、 y 、 z The beam halo parameter in the direction, H x0 、 H y0 、 H z0 For the macro particle bunch x 、 y 、 z The beam halo parameter in the direction.
[0163] For example, the transport simulation in this embodiment is a multi-particle transport simulation. An important application of this transport simulation is to study the evolution of the beam halo. Therefore, in this embodiment, the beam halo parameters of each candidate bunch and the beam halo parameters of the macroparticle bunch are calculated, and then the relative deviation of the beam halo parameters of two different types of bunches is calculated. , when applied, the relative deviations of multiple candidate bunches can be sorted, and the sorting sequence number of the relative deviation of each candidate bunch is i The calculation formula of the relative deviation is shown above. The beam halo parameter H i The calculation formula is:
[0164]
[0165] Among them x , y , z Direction, (p i , q i ) are respectively i The position and momentum of each candidate bunch.
[0166] After completing the verification of the above three dimensions, the system will screen out the best candidate bunch based on the verification results. If the similarity meets the beam dynamics simulation conditions, the candidate bunch is determined to be a new macro particle bunch, including:
[0167] S601: Determine the similarity between the candidate bunch and the macro particle bunch in terms of mismatch, spatial grid charge distribution, and beam halo parameters;
[0168] S602: If the similarity satisfies a beam dynamics simulation condition, determining the candidate bunch as a new macro particle bunch;
[0169] Alternatively, a new macroparticle bunch can be obtained by another method as follows:
[0170] S603: obtaining a plurality of candidate bunches based on multiple samplings and weight configurations;
[0171] S604: Determine the similarity between each candidate bunch and the macro particle bunch in terms of fitness, spatial grid charge distribution, and beam halo parameters;
[0172] S605: Determine the target candidate bunch with the highest similarity and meeting the beam dynamics simulation conditions as the new macro particle bunch.
[0173] For example, calculate each w Sum of serial numbers , and select i smallest w The initial bunch is obtained by the adaptive weighted sampling method. The physical significance of the above process is to measure the mismatch, spatial grid charge distribution and beam halo parameters. w and 0, and comprehensively consider these three aspects, select 0 closest w (i.e. the best replacement effect w ) as the final result of sampling. (a)-(d) show 0 phase space distribution, (e)-(h) show w The phase space distribution of 0 contains 1,000,000 macro particles, w Contains only 250,000 macro particles. w and 0, we can know the phase space distribution obtained by the method in this embodiment. w Only one-fourth of the number of macro particles in the original bunch is used to achieve a description effect that is basically consistent with the original bunch.
[0174] For the initial bunches in current multi-particle simulation algorithms, where each particle has equal weight, the new bunches obtained by weighting and sampling using the methods described in the above embodiments can better match the characteristics of the bunches in the accelerator, allowing the use of fewer macroparticles to describe the evolution of beam transport in the accelerator. In multi-particle simulations, the amount of computation required is generally proportional to the number of macroparticles. Reducing the number of macroparticles can significantly increase the speed of multi-particle simulations.
[0175] In order to better illustrate the process and technical effects of the solution of this application, the following is an explanation with reference to specific application examples:
[0176] First, perform physical modeling of the accelerator:
[0177] The beam is generated by the ion source at the far left of CAFe, and then the beam passes through the low energy transfer line (LEBT) and enters the radio frequency quadrupole accelerator (RFQ). In the RFQ, the low energy beam is simultaneously focused laterally, bunched longitudinally, and accelerated longitudinally. After leaving the RFQ, the bunch enters the medium energy transfer line (MEBT), where it is further bunched and then enters the radio frequency superconducting cavity. The radio frequency superconducting cavity is mainly used to increase the energy of the bunch. When the bunch reaches the designed energy, it enters the high energy transfer line (HEBT). The secondary iron of the HEBT can deflect the bunch in different directions to achieve different tasks. The superconducting section of CAFe contains four cryostats (Cryomodule 1-4). The first three cryostats each contain 6 solenoids and 6 radio frequency cavities, and the last group of cryostats contains 5 solenoids and 5 radio frequency cavities, totaling 23 solenoids and 23 radio frequency cavities. The initial bunch used in the AVAS simulation is generated by the Twiss parameters of the RFQ exit bunch. The initial bunch consists of N six-dimensional macro particles ( x y z For accelerator modeling, the arrangement and size of the accelerator components in the program selected in this embodiment are consistent with those of a real accelerator. The electromagnetic fields in each component are calculated and given (three-dimensional electromagnetic field distribution) using the electromagnetic simulation software CST. The simulation boundaries are set according to the aperture of each component.
[0178] Then set the simulation parameters:
[0179] Multi-particle simulation is mainly used for error analysis of accelerators to evaluate accelerator design. The initial bunch energy at the superconducting section entrance is 2.1 MeV, the current intensity is 5 mA, and the frequency of the beam is After the transmission through the CAFe superconducting segment, the energy of the bunch is increased to about 17 MeV. The time step of the program in the simulation In the specific transmission simulation experiment, this embodiment uses three groups of initial bunches with different macro particle numbers for simulation and compares the final simulation results. The three groups of initial bunches are as follows:
[0180] 1. Original bunch, which contains 1,000,000 macro particles of equal weight.
[0181] 2. According to the algorithm proposed in this application, an initial bunch of 500,000 adaptive weighted macro particles is extracted. The parameters of the algorithm sampling, the total number of particles N s = 500000, maximum relative weight max =4, number of groups n s =85.
[0182] 3. According to the algorithm proposed in this application, an initial bunch of 250,000 adaptive weighted macro particles is extracted. The parameters of the algorithm sampling, the total number of particles N s =250000, maximum relative weight max =30, number of groups n s =20.
[0183] Finally, the evaluation and verification of the adaptive weighted multi-particle simulation algorithm is carried out:
[0184] like The figure shows the results of three different groups of initial bunches, including the distribution of the exit bunches in different two-dimensional phase spaces, as given by three sets of numerical simulations. The first set of results (a)-(d) are simulation results for an initial bunch of 1,000,000 macroparticles with equal weights; the second set of results (e)-(h) are simulation results for an initial bunch of macroparticles with 500,000 adaptive weights; and the third set of results (i)-(l) are simulation results for an initial bunch of macroparticles with 250,000 adaptive weights. A comparison of the phase diagrams shows that using the method in this embodiment to replace the initial bunch of 1,000,000 macroparticles in the traditional simulation with initial bunches of 500,000 and 250,000 adaptive weights, respectively, results in essentially identical simulation results. This demonstrates that, through adaptive weighting, the method in this embodiment can achieve simulation results close to those of the traditional simulation algorithm using only half or even a quarter of the number of macroparticles used in the traditional algorithm, significantly reducing the simulation time of the multi-particle simulation algorithm. The distribution of relative weights and the corresponding number of macroparticles in a bunch containing 250,000 adaptively weighted macroparticles are presented. Here, the original bunch is divided into 20 groups, from which different numbers of macroparticles are sampled and assigned different relative weights to form new bunches. First, it can be seen that the sum of the relative weights of the 20 groups of macroparticles in the new bunch is essentially the same, consistent with the previous theoretical analysis. This ensures that the density distribution of the sampled bunch is consistent with that of the original bunch. Secondly, the 20th group (the outermost macroparticles) samples 42,150 macroparticles, while the total number of macroparticles in the original bunch is 50,000, resulting in a sampling rate of 84.3%. This is why the algorithm in this embodiment can accurately describe edge information even with only 1 / 4 of the macroparticles. Furthermore, because the density in the center of the bunch is very high and contains the majority of macroparticles, even with a lower sampling rate (>2.8%), there is still a sufficient number of macroparticles to describe the center of the bunch.
[0185] like As shown, another embodiment of the present invention also provides a multi-particle beam transport simulation device with adaptive weights, comprising:
[0186] A division module is used to divide the macro particle bunch to be processed into multiple groups of macro particles;
[0187] a configuration module for configuring relative weights for each group of the macro particles according to the density distribution characteristics of the macro particle bunch, wherein the relative weights of the macro particles in the same group are the same, and the relative weights of the macro particles in different groups are different; the closer the groups of macro particles are to the center of the macro particle bunch, the greater the corresponding relative weights; and a maximum value of the relative weights is a preset value;
[0188] A sampling module, configured to sample each group of macro particles in combination with the relative weight of each group of macro particles to obtain corresponding sampling results;
[0189] A first determining module, configured to determine the weight of each macro particle in each sampling result in combination with the relative weight of the macro particles in each sampling result;
[0190] a second determining module, configured to determine similarities between a candidate bunch and the macro particle bunch in different dimensions, the candidate bunch being formed by a set of sampling results configured with weights of the macro particles;
[0191] a third determining module, configured to determine, when the similarity satisfies a beam dynamics simulation condition, that the candidate bunch is a new macro particle bunch;
[0192] The simulation module is used to use the new macro particle bunch to replace the macro particle bunch to perform multi-particle beam dynamics simulation to describe the evolution process of beam transmission in the accelerator.
[0193] In one embodiment, sampling each group of macro particles in combination with the relative weight of each group of macro particles to obtain corresponding sampling results includes:
[0194] The number of macroparticles to be extracted from each group of macroparticles is determined based on the relative weight of each group of macroparticles, at least with the constraint that the density distribution of the macroparticles involved in the plurality of sampling results is consistent with the density distribution of the macroparticles in the macroparticle bunch;
[0195] Each group of macro particles is sampled based on the number of macro particles required to be extracted from each group to obtain the corresponding sampling result.
[0196] In one embodiment, sampling each group of macro particles in combination with the relative weight of each group of macro particles to obtain corresponding sampling results includes:
[0197] Each group of macro particles is sampled based on the relative weight of each group of macro particles and the following formula to obtain the corresponding sampling result:
[0198]
[0199] Among them, the N sp is the total number of macro particles in the preset multiple sampling results, n s is the number of groups of macro particles, i For the i Group macro particles, N si For the i The number of macro particles extracted by the group macro particle, i is the relative weight of each group of macro particles.
[0200] In one embodiment, determining the weight of each macro particle in each sampling result by combining the relative weights of the macro particles in each sampling result includes:
[0201] The weight of each of the macro particles in the macro particle bunch is determined as the initial weight w 0, the initial weights of the macro particles are the same;
[0202] Determine the relative weight of each of the macro particles j ;
[0203] Determine the total number of macro particles in the plurality of sampling results N sp ;
[0204] Based on the initial weight, relative weight and total number of macro particles, the weight of each macro particle in each sampling result is calculated using the following formula:
[0205]
[0206] described j is the th macro particle, w j For the j The weight of the macro particles, N is the total number of macro particles, w 0 is the initial weight of the macro particle.
[0207] In one embodiment, determining the similarity between the candidate bunch and the macro particle bunch in different dimensions includes:
[0208] determining a mismatch between the candidate bunch and the macro particle bunch;
[0209] determining similarity of charge distributions of the candidate bunch and the macro particle bunch on a spatial grid;
[0210] The similarity between the candidate bunch and the macro particle bunch in terms of beam halo parameters is determined.
[0211] In one embodiment, determining the mismatch between the candidate bunch and the macro particle bunch includes:
[0212] The mismatch between the candidate bunch and the macro particle bunch is determined based on the following formula: M i :
[0213]
[0214] , α 、 β 、 is the Twiss parameter of the candidate bunch, α 0. β 0. 0 is the Twiss parameter of the macro particle bunch, 、 、 is the difference in Twiss parameters.
[0215] In one embodiment, the similarity of charge distribution between the candidate bunch and the macro particle bunch on a spatial grid includes:
[0216] The charges of each candidate bunch and macroparticle bunch are distributed to the spatial grid according to the weight of the specified order. The weight of the specified order includes a first-order weight. In the three-dimensional spatial grid, under the first-order weight, the charge of each macroparticle is distributed to the adjacent 8 spatial grid points. The first-order weight is obtained based on the following formula:
[0217]
[0218] Among them, the i,j,k i+1,j,k i,j+1,k i+1,j+1,k i,j,k+1 i+1,j,k+1 i,j+1,k+1 i+1,j+1,k+1 Represent the amount of charge assigned to the 8 spatial grid points near the macro particle, x 、 y 、 z is the position coordinate of the macro particle, and the grid points of the space grid are located at X i , Y j , Z k , , is the spacing of spatial grid points in three directions, i , j , k According to the position coordinates of the macro particles x 、 y 、 z get, c is the charge density of the uniformly distributed space grid;
[0219] The normalized absolute error between the charge amount of the candidate bunch and the charge amount of the macro particle bunch on the spatial grid is calculated based on the charge distribution of the candidate bunch and the macro particle bunch on the spatial grid. The normalized absolute error is obtained based on the following formula:
[0220]
[0221] described is the normalized absolute error, i , j , k is the index of the spatial grid, A is the three-dimensional matrix corresponding to the charge distribution of the candidate bunch on the spatial grid, and B is the three-dimensional matrix corresponding to the charge distribution of the macro particle bunch on the spatial grid.
[0222] In one embodiment, determining the similarity between the candidate bunch and the macro particle bunch in terms of beam halo parameters includes:
[0223] determining the beam halo parameters of the candidate bunch;
[0224] determining beam halo parameters of the macro particle bunch;
[0225] The relative deviation between the halo parameters of the candidate bunch and the macro particle bunch is determined based on the following formula:
[0226]
[0227] described H x 、 H y 、 H z The candidate bunch is x 、 y 、 z The beam halo parameter in the direction, H x0 、 H y0 、 H z0 For the macro particle bunch x 、 y 、 z The beam halo parameter in the direction.
[0228] In one embodiment, when the similarity satisfies a beam dynamics simulation condition, determining the candidate bunch as a new macro particle bunch includes:
[0229] Determining the similarity between the candidate bunch and the macro particle bunch in terms of fitness, spatial grid charge distribution, and beam halo parameters;
[0230] In the case where the similarity satisfies a beam dynamics simulation condition, determining the candidate bunch as a new macro particle bunch; or
[0231] Based on multiple sampling and weight configuration, a plurality of candidate bunches are obtained;
[0232] Determining the similarity between each candidate bunch and the macro particle bunch in terms of fitness, spatial grid charge distribution, and beam halo parameters;
[0233] The target candidate bunch with the highest similarity and satisfying the beam dynamics simulation conditions is determined as the new macro particle bunch.
[0234] Another embodiment of the present invention further provides an electronic device, including:
[0235] one or more processors;
[0236] a memory configured to store one or more programs;
[0237] When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the adaptive weighted multi-particle beam transport simulation method as described above.
[0238] Furthermore, an embodiment of the present invention provides a storage medium storing a computer program that, when executed by a processor, implements the aforementioned method for simulating multi-particle beam transport with adaptive weights. It should be understood that each of the solutions in this embodiment has the corresponding technical effects of the aforementioned method embodiments and will not be further elaborated here.
[0239] Furthermore, an embodiment of the present invention also provides a computer program product, which is tangibly stored on a computer-readable medium and includes computer-readable instructions, which, when executed, enable at least one processor to perform a multi-particle beam transport simulation method with adaptive weights such as the one in the embodiment described above.
[0240] It should be noted that the computer storage medium of the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. Computer-readable media may include, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage medium, a magnetic storage medium, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. In the present invention, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program configured for use by or in conjunction with an instruction execution system, system, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, antenna, optical cable, RF, or any suitable combination thereof.
[0241] Furthermore, those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage) containing computer-usable program code.
[0242] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of protection of the present application is limited to these examples. In line with the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of different aspects of one or more embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
Claims
1. A multi-particle beam transport simulation method with adaptive weights, characterized in that: include: Divide the macro particle bunch to be processed into multiple groups of macro particles; According to the density distribution characteristics of the macro particle bunch, a relative weight is configured for each group of the macro particles. The relative weights of the macro particles in the same group are the same, and the relative weights of the macro particles in different groups are different. The closer the groups of macro particles are to the center of the macro particle bunch, the greater the corresponding relative weight. The maximum value of the relative weight is a preset value. Sampling each group of macro particles according to the relative weight of each group of macro particles to obtain corresponding sampling results; Determining the weight of each macro particle in each sampling result in combination with the relative weight of the macro particles in each sampling result; Determining similarities between a candidate bunch and the macro-particle bunch in different dimensions, the candidate bunch being formed by a set of sampling results configured with weights of the macro-particles; In the case where the similarity satisfies a beam dynamics simulation condition, determining the candidate bunch as a new macro particle bunch; The new macro particle bunch is used to replace the macro particle bunch to perform multi-particle beam dynamics simulation to describe the evolution process of beam transmission in the accelerator.
2. The adaptive weighted multi-particle beam transport simulation method according to claim 1, characterized in that: Sampling each group of macro particles in combination with the relative weight of each group of macro particles to obtain corresponding sampling results, including: The number of macroparticles to be extracted from each group of macroparticles is determined based on the relative weight of each group of macroparticles, at least with the constraint that the density distribution of the macroparticles involved in the plurality of sampling results is consistent with the density distribution of the macroparticles in the macroparticle bunch; Each group of macro particles is sampled based on the number of macro particles required to be extracted from each group to obtain the corresponding sampling result.
3. The adaptive weighted multi-particle beam transport simulation method according to claim 1 or 2, characterized in that: The step of sampling each group of macro particles in combination with the relative weight of each group of macro particles to obtain corresponding sampling results includes: Each group of macro particles is sampled based on the relative weight of each group of macro particles and the following formula to obtain the corresponding sampling result: Among them, the N sp is the total number of macro particles in the preset multiple sampling results, n s is the number of groups of macro particles, i For the i Group macro particles, N si For the i The number of macro particles extracted by the group macro particle, R i is the relative weight of each group of macro particles.
4. The adaptive weighted multi-particle beam transport simulation method according to claim 1, characterized in that: Determining the weight of each macro particle in each sampling result by combining the relative weight of the macro particles in each sampling result includes: The weight of each of the macro particles in the macro particle bunch is determined as the initial weight w 0, the initial weights of the macro particles are the same; Determine the relative weight of each of the macro particles R j ; Determine the total number of macro particles in the plurality of sampling results N sp ; Based on the initial weight, relative weight and total number of macro particles, the weight of each macro particle in each sampling result is calculated using the following formula: described j For the j macro particles, the w j For the j The weight of the macro particles, N is the total number of macro particles, w 0 is the initial weight of the macro particle.
5. The adaptive weighted multi-particle beam transport simulation method according to claim 1, characterized in that: Determining the similarity between the candidate bunch and the macro particle bunch in different dimensions includes: determining a mismatch between the candidate bunch and the macro particle bunch; determining similarity of charge distributions of the candidate bunch and the macro particle bunch on a spatial grid; The similarity between the candidate bunch and the macro particle bunch in terms of beam halo parameters is determined.
6. The adaptive weighted multi-particle beam transport simulation method according to claim 5, characterized in that: The determining of the mismatch degree between the candidate bunch and the macro particle bunch comprises: The mismatch between the candidate bunch and the macro particle bunch is determined based on the following formula: M i : , α 、 β 、 γ is the Twiss parameter of the candidate bunch, α 0. β 0. γ 0 is the Twiss parameter of the macro particle bunch, 、 、 is the difference in Twiss parameters.
7. The adaptive weighted multi-particle beam transport simulation method according to claim 5, characterized in that: Determining the similarity of charge distribution between the candidate bunch and the macro particle bunch on a spatial grid includes: The charges of the candidate bunches and the macroparticle bunches are distributed to the spatial grid according to the weights of the specified order. The weights of the specified order include first-order weights. In the three-dimensional spatial grid, under the first-order weights, the charge of each macroparticle is distributed to the adjacent eight spatial grid points. The first-order weights are obtained based on the following formula: Among them, the ρ i,j,k , ρ i+1,j,k , ρ i,j+1,k , ρ i+1,j+1,k , ρ i,j,k+1 , ρ i+1,j,k+1 , ρ i,j+1,k+1 , ρ i+1,j+1,k+1 Represent the amount of charge assigned to the 8 spatial grid points near the macro particle, x 、 y 、 z is the position coordinate of the macro particle, and the grid points of the space grid are located at X i , Y j , Z k , , is the spacing of spatial grid points in three directions, i , j , k According to the position coordinates of the macro particles x 、 y 、 z get, ρ c is the charge density of the uniformly distributed space grid; The normalized absolute error between the charge amount of the candidate bunch and the charge amount of the macro particle bunch on the spatial grid is calculated based on the charge distribution of the candidate bunch and the macro particle bunch on the spatial grid. The normalized absolute error is obtained based on the following formula: described NAE is the normalized absolute error, i , j , k is the index of the spatial grid, A is the three-dimensional matrix corresponding to the charge distribution of the candidate bunch on the spatial grid, and B is the three-dimensional matrix corresponding to the charge distribution of the macro particle bunch on the spatial grid.
8. The adaptive weighted multi-particle beam transport simulation method according to claim 5, characterized in that: Determining the similarity between the candidate bunch and the macro particle bunch in beam halo parameters includes: determining the beam halo parameters of the candidate bunch; determining beam halo parameters of the macro particle bunch; The relative deviation between the beam halo parameters of the candidate bunch and the macro particle bunch is determined based on the following formula: RD : described H x 、 H y 、 H z The candidate bunch is x 、 y 、 z The beam halo parameter in the direction, H x0 、 H y0 、 H z0 For the macro particle bunch x 、 y 、 z The beam halo parameter in the direction.
9. The adaptive weighted multi-particle beam transport simulation method according to claim 5, characterized in that: When the similarity satisfies a beam dynamics simulation condition, determining the candidate bunch as a new macro particle bunch includes: Determining the similarity between the candidate bunch and the macro particle bunch in terms of fitness, spatial grid charge distribution, and beam halo parameters; In the case where the similarity satisfies a beam dynamics simulation condition, determining the candidate bunch as a new macro particle bunch; or Based on multiple sampling and weight configuration, a plurality of candidate bunches are obtained; Determining the similarity between each candidate bunch and the macro particle bunch in terms of fitness, spatial grid charge distribution, and beam halo parameters; The target candidate bunch with the highest similarity and satisfying the beam dynamics simulation conditions is determined as the new macro particle bunch.
10. A multi-particle beam transport simulation device with adaptive weights, characterized in that: include: A division module is used to divide the macro particle bunch to be processed into multiple groups of macro particles; a configuration module for configuring relative weights for each group of the macro particles according to the density distribution characteristics of the macro particle bunch, wherein the relative weights of the macro particles in the same group are the same, and the relative weights of the macro particles in different groups are different; the closer the groups of macro particles are to the center of the macro particle bunch, the greater the corresponding relative weights; and a maximum value of the relative weights is a preset value; A sampling module, configured to sample each group of macro particles in combination with the relative weight of each group of macro particles to obtain corresponding sampling results; A first determining module, configured to determine the weight of each macro particle in each sampling result in combination with the relative weight of the macro particles in each sampling result; a second determining module, configured to determine similarities between a candidate bunch and the macro particle bunch in different dimensions, the candidate bunch being formed by a set of sampling results configured with weights of the macro particles; a third determining module, configured to determine, when the similarity satisfies a beam dynamics simulation condition, that the candidate bunch is a new macro particle bunch; The simulation module is used to use the new macro particle bunch to replace the macro particle bunch to perform multi-particle beam dynamics simulation to describe the evolution process of beam transmission in the accelerator.
Citation Information
Patent Citations
Accelerator charged particle beam current compression device and method
CN114501768A
Relativistic charged particle beam long-distance transmission numerical calculation method and system
CN115828027A