Storage ring beam transverse phase measurement method and related device

By combining a beam position monitor and the K-value of a quadrupole magnet, and employing a beam phase prediction model based on a dynamic optical transfer attention module and a standard timing characteristic path module, a fast and non-invasive storage ring beam transverse phase measurement was achieved. This solves the problems of long measurement time and low accuracy in existing technologies, and improves measurement efficiency and accuracy.

CN122017928APending Publication Date: 2026-05-12UNIV OF SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
UNIV OF SCI & TECH OF CHINA
Filing Date
2026-01-04
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing technologies for measuring the transverse phase of storage ring beams suffer from problems such as long measurement time, significant interference with accelerator operation, low measurement accuracy, and complex data analysis. In particular, the response matrix method and the loop-by-loop beam position monitoring method each have their own shortcomings.

Method used

Using beam trajectory values ​​and quadrupole magnet K values ​​acquired by a beam position monitor, rapid and non-invasive measurements are performed using numerical gradient methods and beam phase prediction models. By combining physical context features and temporal dependence features, a dynamic optical transfer attention module and a standard temporal feature path module are constructed to achieve accurate prediction of the transverse phase.

Benefits of technology

It achieves rapid, non-invasive transverse phase measurement of storage ring beams, with good practicality and robustness, avoids external excitation interference, and improves measurement efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122017928A_ABST
    Figure CN122017928A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a storage ring beam transverse phase measurement method and a related device, and the method comprises the steps: obtaining beam orbit values collected by a beam position monitor (BPM) in real time and a quadrupole magnet K value provided by an accelerator control system, and the beam orbit values comprise a horizontal beam orbit value and a vertical beam orbit value; the gradient of the beam track value is calculated through a numerical gradient method, the physical track angle value of the beam track is obtained, and the physical track angle value comprises a horizontal beam track angle value and a vertical beam track angle value; constructing an input vector according to the horizontal beam track value, the horizontal beam track angle value, the vertical beam track value, the vertical beam track angle value and the K value; and inputting the input vector into the beam phase prediction model to obtain a transverse phase value at each beam position monitor. According to the embodiment of the invention, the method can achieve the quick and non-invasive transverse phase measurement, and is good in practicality and robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of accelerator beam parameter measurement technology, and in particular to a method and related apparatus for measuring the transverse phase of a storage ring beam. Background Technology

[0002] The transverse phase of the storage ring beam is a key parameter describing the transverse (horizontal or vertical) motion of the electron beam cluster within the storage ring. It plays a crucial role in machine operation: First, in terms of linear dynamics, it is a key tool for diagnosing and correcting linear lattice design deviations and magnet errors, enabling high-precision beamline correction through accurate measurement. Second, given that nonlinear dynamic characteristics are jointly determined by the linear lattice function and the hexapod magnet, the precise distribution of the transverse phase directly constrains the setting and control of nonlinear effects. Therefore, rapid and accurate measurement of the transverse phase is essential for achieving precise beamline correction, effectively optimizing beam size and emittance, and laying a solid foundation for subsequent nonlinear dynamics analysis and tuning.

[0003] For transverse phase measurements, two main methods are employed: the response matrix method and the turn-by-turn (TBT) method. The response matrix method offers high measurement accuracy, but its measurement process interferes with accelerator operation, is time-consuming, and is prone to overfitting. In contrast, the TBT method enables non-invasive measurements with short measurement times, but typically requires external excitation of the beam, the amplitude of which is difficult to control precisely, and transverse coupling effects can interfere with the measurement results. Furthermore, this method is highly sensitive to the resolution of the beam position monitor, and the data analysis process is complex. Summary of the Invention

[0004] This application provides a method and related apparatus for measuring the transverse phase of a storage ring beam. It uses the beam trajectory collected by a beam position monitor to measure the transverse phase of the storage ring beam, which can achieve rapid and non-invasive measurement of the transverse phase of the storage ring beam and has good practicality and robustness.

[0005] A first aspect of this application provides a method for measuring the transverse phase of a storage ring beam, the method comprising: The beam trajectory value is acquired in real time by the beam position monitor and the quadrupole magnet K value provided by the accelerator control system. The beam trajectory value includes the horizontal beam trajectory value and the vertical beam trajectory value. The gradient of the beam trajectory value is calculated by the numerical gradient method to obtain the physical trajectory angle value of the beam trajectory, which includes the horizontal beam trajectory angle value and the vertical beam trajectory angle value. An input vector is constructed based on the horizontal beam trajectory value, the horizontal beam trajectory angle value, the vertical beam trajectory value, the vertical beam trajectory angle value, and the K value; The input vector is fed into the beam phase prediction model to obtain the lateral phase value at each beam position monitor. The lateral phase value includes a horizontal lateral phase value and a vertical lateral phase value. The beam phase prediction model includes a dynamic optical transfer attention module, a standard temporal feature path module, a feature fusion and pooling module, and a predictor module. The dynamic optical transfer attention module is used to explicitly simulate the physical transfer process of the beam in phase space and output physical context features based on the input vector. The standard temporal feature path module is used to capture implicit, non-physically intuitive patterns in the data and output temporal dependent features based on the input vector. The feature fusion and pooling module is used to construct a context vector based on the physical context features and the temporal dependent features. The predictor module is used to predict the lateral phase value at the beam position monitor based on the context vector.

[0006] Optionally, the step of outputting physical context features based on the input vector includes: A value vector is determined based on the horizontal beam trajectory value, the horizontal beam trajectory angle value, the vertical beam trajectory value, and the vertical beam trajectory angle value in the input vector. A query vector and a key vector are also determined based on the horizontal beam trajectory value, the horizontal beam trajectory angle value, the vertical beam trajectory value, the vertical beam trajectory angle value, and the K value in the input vector. The value vector is used to represent phase space information. A dynamic transfer matrix is ​​determined based on the query vector and the key vector. The dynamic transfer matrix is ​​used to represent the phase space transfer relationship between any two beam position monitors. The contribution vector propagating from any one of the beam position monitor positions to another beam position monitor position is calculated based on the dynamic transfer matrix and the value vector. The contribution vectors propagating from the positions of all beam position monitors in the accelerator Lattice model are summed to obtain the sum vector of contributions propagating from the positions of all beam position monitors to the position of the target beam position monitor. The sum vector of contributions is the physical context feature.

[0007] Optionally, the step of outputting temporal dependency features based on the input vector includes: The low-dimensional input vector is mapped to the high-dimensional input vector through a fully connected layer; Periodic positional encoding is performed on the high-dimensional input vector to obtain a high-dimensional input vector including the positional encoding; Temporally dependent features are obtained by capturing non-physical, implicit patterns in a high-dimensional input vector, including the positional encoding, through a one-dimensional convolutional neural network.

[0008] Optionally, constructing the context vector based on the physical context features and the temporal dependency features includes: The physical context features and the temporal dependency features are concatenated along the channel dimension to obtain the fused features; Enhanced features are obtained by strengthening the dependencies between different locations in the fused features using a multi-head attention network. The enhanced features are regularized by discarding layers to obtain regularized features; The regularized features are compressed using a global average pooling layer to obtain a context vector.

[0009] Optionally, before inputting the input vector into the beam phase prediction model, the method further includes: Construct a first training dataset that only allows errors in the K value of the quadrupole magnet, a second training dataset that only allows errors in the correction magnet, and a test dataset that allows errors in both the K value of the quadrupole magnet and the correction magnet. Each of the first training dataset, the second training dataset, and the test dataset includes multiple data pairs, and each data pair consists of the applied K value of the quadrupole magnet, the calculated orbital error value, and the lateral phase value. The beam phase prediction model is trained based on the first training dataset and the second training dataset; The trained beam phase prediction model is tested using the test dataset to obtain the beam phase prediction model that has passed the test.

[0010] Optionally, the construction of a first training dataset that only allows errors in the K value of the quadrupole magnet includes: The sampling dimension of the Latin hypercube sampler is determined based on the number of quadrupole magnets. The quadrupole magnet is sampled using a Latin hypercube sampler of the sampling dimension to generate K-value error samples that follow a uniform distribution. The K-value error samples that follow a uniform distribution are transformed into K-value error samples that follow a preset normal distribution using the inverse cumulative distribution function; Construct an accelerator Lattice model and add the K-value error samples that follow a preset normal distribution to the accelerator Lattice model; Calculate the orbital error and lateral phase values ​​of the Lattice model of the accelerator.

[0011] Optionally, the beam phase prediction model further includes a K-value inverter, which is used to perform a physical inversion based on the context vector to obtain the predicted K value of the quadrupole magnet.

[0012] Optionally, the total cost function of the beam phase prediction model includes an empirical risk loss term, an invariant risk penalty term, an information bottleneck penalty term, and a K-value inversion penalty term. The empirical risk loss term is determined based on the predicted and calculated transverse phase values. The invariant risk penalty term is determined based on the gradient norm of the penalty loss function with respect to the virtual scalar product. The information bottleneck penalty term is determined based on the variance of the context vector. The K-value inversion penalty term is determined based on the K-value of the applied quadrupole magnet and the predicted K-value of the quadrupole magnet.

[0013] A second aspect of this application provides a storage ring beam transverse phase measurement device, the device comprising: The data acquisition unit is used to acquire the beam trajectory value collected in real time by the beam position monitor and the quadrupole magnet K value provided by the accelerator control system. The beam trajectory value includes the horizontal beam trajectory value and the vertical beam trajectory value. The data preprocessing unit is used to calculate the gradient of the beam trajectory value using a numerical gradient method to obtain the physical trajectory angle value of the beam trajectory, which includes a horizontal beam trajectory angle value and a vertical beam trajectory angle value; and to construct an input vector based on the horizontal beam trajectory value, the horizontal beam trajectory angle value, the vertical beam trajectory value, the vertical beam trajectory angle value, and the K value. A phase prediction unit is used to input the input vector into the beam phase prediction model to obtain the lateral phase value at each beam position monitor. The lateral phase value includes a horizontal lateral phase value and a vertical lateral phase value. The beam phase prediction model includes a dynamic optical transfer attention module, a standard temporal feature path module, a feature fusion and pooling module, and a predictor module. The dynamic optical transfer attention module is used to explicitly simulate the physical transfer process of the beam in phase space and output physical context features based on the input vector. The standard temporal feature path module is used to capture implicit, non-physically intuitive patterns in the data and output temporal dependent features based on the input vector. The feature fusion and pooling module is used to construct a context vector based on the physical context features and the temporal dependent features. The predictor module is used to predict the lateral phase value at the beam position monitor based on the context vector.

[0014] A third aspect of this application provides an electronic device, including: a processor and a memory; The processor is connected to a memory, wherein the memory is used to store computer programs and the processor is used to invoke the computer programs to execute the methods as described in the first aspect of the embodiments of this application.

[0015] A fourth aspect of this application provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, perform the method as described in the first aspect of this application.

[0016] This application predicts the transverse phase of the storage ring beam using a beam phase prediction model. The model takes beam trajectory data from a single acquisition and the K-value of the quadrupole magnet as input, enabling rapid, non-invasive full-ring phase measurement. To ensure high robustness and generalization ability, the prediction model combines physical context features and temporal dependency features, allowing it to explicitly simulate the physical propagation process of the beam in phase space while capturing implicit, non-physically intuitive patterns in the data. Furthermore, the model constructs a training environment with separated physical error sources and applies a composite cost function (including an invariant risk penalty term and a K-value inversion penalty term) to force the learning of physically invariant laws across environments and decouple different physical effects. This approach demonstrates good practicality and robustness. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A schematic flowchart of a storage ring beam transverse phase measurement method according to an embodiment of this application is shown; Figure 2 A schematic diagram of the structure of a storage ring beam transverse phase measurement device provided in one embodiment of this application is shown; Figure 3 A schematic diagram of the structure of a computer device provided in one embodiment of this application is shown. Detailed Implementation

[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0020] Currently, the measurement of the transverse phase of the beam mainly employs two methods: the response matrix method and the turn-by-turn beam position monitoring (TBT) method.

[0021] The response matrix method derives the quadrupole magnet error model in the accelerator lattice by measuring the orbital response caused by each correction magnet. This error model is then incorporated into the theoretical lattice, and the phase is recalculated using optical simulation software (such as MADX or AT). The measurement steps include: (1) applying known horizontal and vertical perturbations to each correction magnet sequentially; (2) recording the beam orbit response after each correction magnet excitation on all beam position monitors; (3) comparing the measured orbital response with the theoretical orbital response matrix to obtain the deviation of the orbital response. This deviation is linearly related to the magnetic field error. By fitting this linear relationship using numerical methods (such as singular value decomposition), an optimal quadrupole error distribution model can be obtained to interpret the measured orbital response data; (4) incorporating the fitted error model into the accelerator lattice and recalculating the phase using simulation software.

[0022] The TBT method induces free transverse oscillation of the beam through a brief excitation (such as a pulsed magnet). The BPM records its displacement over multiple accelerator cycles, forming TBT data. By performing a Fourier transform on this data, the main harmonic spectral line corresponding to the betatron oscillation frequency can be extracted, and its phase reflects the phase of the beam at that BPM. The phase difference of the spectral lines between different BPMs is the phase difference of that segment. The measurement steps include: (1) applying a short perturbation to the particle beam through a pulsed magnet to induce free oscillation, with the excitation amplitude generally controlled below millimeters; (2) synchronously recording the position changes of the particle beam over multiple cycles at each BPM to form circumferential measurement data of the transverse position; (3) normalizing the original position data to reduce the influence of optical functions on the amplitude and improve the stability of phase calculation; (4) performing a fast Fourier transform on the TBT data of each BPM to extract the spectral line at the main tuning frequency and read its phase information; (5) obtaining the phase difference of the beam segment by comparing the phase difference of the spectral lines corresponding to the two BPMs.

[0023] The response matrix method offers high measurement accuracy, but its measurement process interferes with accelerator operation, is time-consuming, and is prone to overfitting. In contrast, the TBT method enables non-invasive measurements with short measurement times, but typically requires external excitation of the beam, the excitation amplitude is difficult to control precisely, and lateral coupling effects can interfere with the measurement results. Furthermore, this method is highly sensitive to the resolution of the beam position monitor, and the data analysis process is complex.

[0024] To address the aforementioned technical problems, this application provides a storage ring beam transverse phase measurement method and related apparatus, which can achieve rapid, non-invasive transverse phase measurement and has good practicality and robustness.

[0025] Please refer to Figure 1 This illustration shows a flowchart of a storage ring beam transverse phase measurement method according to an embodiment of this application. The method can be applied to a computer device, which refers to an electronic device with data computing and processing capabilities. The method may include the following steps: Step 101: Obtain the beam trajectory value collected in real time by the beam position monitor and the quadrupole magnet K value provided by the accelerator control system. The beam trajectory value includes the horizontal beam trajectory value and the vertical beam trajectory value.

[0026] Step 102: Calculate the gradient of the beam trajectory value using the numerical gradient method to obtain the physical trajectory angle value of the beam trajectory, which includes the horizontal beam trajectory angle value and the vertical beam trajectory angle value.

[0027] For example, the formula for calculating the physical orbit angle value of the beam orbit is as follows: ,in The physical orbital angle of the beam trajectory. For beam orbit, Coordinates (origin at the storage ring injection point). Beam trajectory. It can be decomposed into horizontal beam orbits and vertical beam orbit Similarly, physical orbital angle It can also be decomposed into the horizontal beam trajectory angle. and vertical beam trajectory angle .

[0028] Step 103: Construct an input vector based on the horizontal beam trajectory value, the horizontal beam trajectory angle value, the vertical beam trajectory value, the vertical beam trajectory angle value, and the K value.

[0029] For example, the input vector can include the five feature channels mentioned above. If the number of samples and the number of BPMs are added, its shape can be represented as (N, m, 5), where N is the number of samples in the batch training, m is the sequence length or the number of BPMs, and 5 is the number of feature channels. It should be noted that in application, the number of samples N=1. During training and testing, N is determined based on the batch training data in the training or testing set.

[0030] Step 104: Input the input vector into the beam phase prediction model to obtain the lateral phase value at each beam position monitor. The lateral phase value includes a horizontal lateral phase value and a vertical lateral phase value. The beam phase prediction model includes a dynamic optical transfer attention module, a standard temporal feature path module, a feature fusion and pooling module, and a predictor module. The dynamic optical transfer attention module is used to explicitly simulate the physical transfer process of the beam in phase space and output physical context features based on the input vector. The standard temporal feature path module is used to capture implicit, non-physically intuitive patterns in the data and output temporal dependent features based on the input vector. The feature fusion and pooling module is used to construct a context vector based on the physical context features and the temporal dependent features. The predictor module is used to predict the lateral phase value at the beam position monitor based on the context vector.

[0031] Specifically, the step of outputting physical context features based on the input vector includes: A value vector is determined based on the horizontal beam trajectory value, the horizontal beam trajectory angle value, the vertical beam trajectory value, and the vertical beam trajectory angle value in the input vector. A query vector and a key vector are also determined based on the horizontal beam trajectory value, the horizontal beam trajectory angle value, the vertical beam trajectory value, the vertical beam trajectory angle value, and the K value in the input vector. The value vector is used to represent phase space information. A dynamic transfer matrix is ​​determined based on the query vector and the key vector. The dynamic transfer matrix is ​​used to represent the phase space transfer relationship between any two beam position monitors. The contribution vector propagating from any one of the beam position monitor positions to another beam position monitor position is calculated based on the dynamic transfer matrix and the value vector. The contribution vectors propagating from the positions of all beam position monitors in the accelerator Lattice model are summed to obtain the sum vector of contributions propagating from the positions of all beam position monitors to the position of the target beam position monitor. The sum vector of contributions is the physical context feature.

[0032] The value vector V can be directly determined from slices of the input vector, for example, Query vector Q and key vector (Using handwritten characters to distinguish the K value of a quadrupole magnet) Each input vector can be projected onto a separate fully connected projection layer to determine its value.

[0033] For any two BPMs (i and j), a 4x4 transfer matrix can be dynamically learned using a transfer matrix generator. The matrix is ​​composed of and The decision is made jointly. Among them, the Transfer Matrix Generator (TMG) is a specially designed small neural network module whose goal is to dynamically generate a linear or approximately linear transfer matrix from input data (such as beam state, device parameters, or environmental conditions) to describe the propagation behavior of particle beams in accelerator elements (such as magnets, drift segments, quadrupoles, etc.).

[0034] For BPM(j), the contribution vector propagated from any BPM(i) is calculated using the following formula: Therefore, for all BPMs, we have , This represents the sum vector of contributions from all BPM propagations, which is the physical context feature.

[0035] Specifically, the step of outputting temporal dependency features based on the input vector includes: The low-dimensional input vector is mapped to the high-dimensional input vector through a fully connected layer; Periodic positional encoding is performed on the high-dimensional input vector to obtain a high-dimensional input vector including the positional encoding; Temporally dependent features are obtained by capturing non-physical, implicit patterns in a high-dimensional input vector, including the positional encoding, through a one-dimensional convolutional neural network.

[0036] Specifically, constructing the context vector based on the physical context features and the temporal dependency features includes: The physical context features and the temporal dependency features are concatenated along the channel dimension to obtain the fused features; Enhanced features are obtained by strengthening the dependencies between different locations in the fused features using a multi-head attention network. The enhanced features are regularized by discarding layers to obtain regularized features; The regularized features are compressed using a global average pooling layer to obtain a context vector.

[0037] Among them, the physical context features are 4-dimensional, and the temporal dependency features have dimensions such as... This indicates that the dimension of the fused feature obtained after concatenating along the channel dimension is... Multi-head attention networks will first... Split into Each head has a dimension of [number]. Then, based on the query vector Q and the key vector... The scores are calculated, and the weights are summed with the value vector V. Finally, the multiple heads are concatenated and projected back to the original dimension, thereby enhancing the dependency between different positions in the fused features.

[0038] In this context, regularizing the augmented features using dropout refers to temporarily setting some elements of the augmented features to zero with probability p, while the remaining elements are typically scaled proportionally (e.g., divided by 1). (p), to keep the expectation unchanged, where the probability p is preset and the specific value is not limited.

[0039] Among them, the dimension of the regularization feature remains 1. If we add the number of training samples and the number of BPMs, its shape can be represented as (N, m, ..., ...) The regularized features are compressed using a global average pooling layer, which means taking the average value along m. The final shape of the context vector is then... In the process of applying the model, N=1.

[0040] The predictor module consists of a fully connected layer with ReLU activation function, a Dropout layer, and a fully connected layer with Linear activation function, and finally outputs 2*m lateral phase values ​​(m horizontal lateral phase values ​​and m vertical lateral phase values) corresponding to m beam position monitors.

[0041] As can be seen in the embodiments of this application, firstly, in terms of measurement methods, existing technologies such as the response matrix method involve exciting the correction iron one by one and measuring the orbital response. This method is time-consuming and significantly disturbs the beam. Another method, such as the loop-by-loop beam position monitoring method, involves applying external excitation to the beam, but the excitation amplitude is difficult to control precisely and is prone to introducing coupling interference. The technical means of this invention is to directly use the single-loop beam orbital value collected by the acquired beam position monitor and the K value of the quadrupole magnet as input, and directly obtain the full-loop phase through a single model inference. This method does not require any external excitation, realizes non-perturbative measurement, and the time depends only on the model inference (millisecond level), making it extremely efficient. Secondly, a physical sensing dual-path architecture is adopted. Its core technical means is the dynamic optical transfer attention path, which includes a transfer matrix generator that can dynamically learn a 4x4 optical transfer matrix to explicitly simulate the 4-dimensional phase space transfer, enabling the model to have physical prior knowledge. Therefore, the embodiments of this application can realize fast, non-invasive storage ring beam transverse phase measurement, with good practicality and robustness.

[0042] In one embodiment provided in this application, before inputting the input vector into the beam phase prediction model, the method further includes: Construct a first training dataset that only allows errors in the K value of the quadrupole magnet, a second training dataset that only allows errors in the correction magnet, and a test dataset that allows errors in both the K value of the quadrupole magnet and the correction magnet. Each of the first training dataset, the second training dataset, and the test dataset includes multiple data pairs, and each data pair consists of the applied K value of the quadrupole magnet, the calculated orbital error value, and the lateral phase value. The beam phase prediction model is trained based on the first training dataset and the second training dataset; The trained beam phase prediction model is tested using the test dataset to obtain the beam phase prediction model that has passed the test.

[0043] Specifically, the construction of the first training dataset, which only allows for errors in the K value of the quadrupole magnet, includes: The sampling dimension of the Latin hypercube sampler is determined based on the number of quadrupole magnets. The quadrupole magnet is sampled using a Latin hypercube sampler of the sampling dimension to generate K-value error samples that follow a uniform distribution. The K-value error samples that follow a uniform distribution are transformed into K-value error samples that follow a preset normal distribution using the inverse cumulative distribution function; Construct an accelerator Lattice model and add the K-value error samples that follow a preset normal distribution to the accelerator Lattice model; Calculate the orbital error and lateral phase values ​​of the Lattice model of the accelerator.

[0044] It should be noted that the generation process for the second training dataset and the test dataset is the same as the generation process for the first training dataset described above, and will not be illustrated in detail here. When continuing to train the model, a zipper-style merging method is used to simultaneously take a batch of training data from both the first and second training datasets at each training step. When testing the model, a batch of test data is taken from the test dataset.

[0045] In the embodiments of this application, the training data is generated using a training dataset with physically separated error sources. First, the Latin Hypercube Sampler (LHS) sampling technique is employed to efficiently cover the high-dimensional space. Second, a training environment with physically separated error sources is deliberately constructed, providing the necessary preconditions for subsequent decoupled training. This decoupling strategy enables the model to shift its ability from overfitting the training data to learning the underlying causal mechanisms. The model is guided to grasp the true causal logic of data generation, thus maintaining high-precision predictive performance even when faced with test data not present in the training set.

[0046] Furthermore, the beam phase prediction model also includes a K-value inverter, which is used to perform physical inversion based on the context vector to obtain the predicted K value of the quadrupole magnet.

[0047] The K-value inverter consists of a fully connected layer with ReLU activation function, a Dropout layer, and a fully connected layer with Linear activation function, ultimately outputting the K values ​​of m quadrupole magnets.

[0048] It should be noted that the K-value inverter is only used to apply the KIL penalty term during the training phase and is not necessary during model application and testing, and can be discarded.

[0049] In one embodiment provided in this application, the total cost function of the beam phase prediction model includes an empirical risk loss term, an invariant risk penalty term, an information bottleneck penalty term, and a K-value inversion penalty term. The empirical risk loss term is determined based on the predicted and calculated transverse phase values. The invariant risk penalty term is determined based on the gradient norm of the penalty loss function with respect to the virtual scalar product. The information bottleneck penalty term is determined based on the variance of the context vector. The K-value inversion penalty term is determined based on the K-value of the applied quadrupole magnet and the predicted K-value of the quadrupole magnet.

[0050] For example, the total cost function is: , in, For experience-based risk loss items, For constant risk penalty items, Information bottleneck penalty items and The penalty term for K-value inversion.

[0051] Among them, the constant risk penalty item The model is forced to learn invariant patterns across the first and second training datasets to find a solution optimal for all environments. The total invariant risk penalty term is the average of the penalties for the two environments (first and second training datasets). The weights of this term are determined by... control.

[0052] Among them, information bottleneck penalty items Auxiliary constant risk penalty item This prompts the model to generate a simpler representation and suppresses spurious associations. The penalty term acts directly on the high-dimensional context vector. It is achieved by calculating the variance of this context vector and averaging it across two environments (the first and second training datasets). The weights of this term are determined by... control.

[0053] Among them, the K-value inversion penalty term The K-value is calculated using the predicted K-value of the quadrupole magnet predicted by the K-value inverter and the K-value of the quadrupole magnet applied in the training set, for example, the mean square error between the two. This is used to force the model to decouple physical effects and distinguish the two main sources of phase. The weight of this term is determined by... control.

[0054] Figure 2 A schematic diagram of a storage ring beam transverse phase measurement device according to an embodiment of this application is shown. The device includes: Data acquisition unit 201 is used to acquire the beam trajectory value collected in real time by the beam position monitor and the quadrupole magnet K value provided by the accelerator control system. The beam trajectory value includes the horizontal beam trajectory value and the vertical beam trajectory value. The data preprocessing unit 202 is used to calculate the gradient of the beam trajectory value using a numerical gradient method to obtain the physical trajectory angle value of the beam trajectory, the physical trajectory angle value including the horizontal beam trajectory angle value and the vertical beam trajectory angle value; and to construct an input vector based on the horizontal beam trajectory value, the horizontal beam trajectory angle value, the vertical beam trajectory value, the vertical beam trajectory angle value and the K value. Phase prediction unit 203 is used to input the input vector into the beam phase prediction model to obtain the lateral phase value at each beam position monitor. The lateral phase value includes a horizontal lateral phase value and a vertical lateral phase value. The beam phase prediction model includes a dynamic optical transfer attention module, a standard temporal feature path module, a feature fusion and pooling module, and a predictor module. The dynamic optical transfer attention module is used to explicitly simulate the physical transfer process of the beam in phase space and output physical context features based on the input vector. The standard temporal feature path module is used to capture implicit, non-physically intuitive patterns in the data and output temporal dependent features based on the input vector. The feature fusion and pooling module is used to construct a context vector based on the physical context features and the temporal dependent features. The predictor module is used to predict the lateral phase value at the beam position monitor based on the context vector.

[0055] Figure 3 A schematic diagram of the structure of a computer device provided in one embodiment of this application is shown, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the function of the computer system of the storage ring beam transverse phase measurement method in any of the above embodiments.

[0056] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer, causes the computer to perform the functions of the computer system of the storage ring beam transverse phase measurement method in any of the above embodiments.

[0057] This application also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the functions of the computer system of the storage ring beam transverse phase measurement method in any of the above embodiments.

[0058] It is understood that the specific examples in this application are only intended to help those skilled in the art better understand the implementation methods of this application, and are not intended to limit the scope of the invention.

[0059] It is understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not limit the implementation process of the embodiments of this application in any way.

[0060] It is understood that the various implementation methods described in this application can be implemented individually or in combination, and the implementation methods in this application are not limited in this respect.

[0061] Unless otherwise stated, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The term "and / or" as used in this application includes any and all combinations of one or more of the associated listed items. The singular forms "a," "the," and "the" as used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0062] It is understood that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by the integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0063] It is understood that the memory in the embodiments of this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Specifically, non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM). It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0064] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0065] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the aforementioned method implementations, and will not be repeated here.

[0066] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0067] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0068] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0069] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0070] The above are merely specific embodiments of this application, but the scope of protection of this invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this invention should be determined by the scope of the claims.

Claims

1. A method for measuring the transverse phase of a storage ring beam, characterized in that, The method includes: The beam trajectory value is acquired in real time by the beam position monitor and the quadrupole magnet K value provided by the accelerator control system. The beam trajectory value includes the horizontal beam trajectory value and the vertical beam trajectory value. The gradient of the beam trajectory value is calculated by the numerical gradient method to obtain the physical trajectory angle value of the beam trajectory, which includes the horizontal beam trajectory angle value and the vertical beam trajectory angle value. An input vector is constructed based on the horizontal beam trajectory value, the horizontal beam trajectory angle value, the vertical beam trajectory value, the vertical beam trajectory angle value, and the K value; The input vector is fed into the beam phase prediction model to obtain the lateral phase value at each beam position monitor. The lateral phase value includes a horizontal lateral phase value and a vertical lateral phase value. The beam phase prediction model includes a dynamic optical transfer attention module, a standard temporal feature path module, a feature fusion and pooling module, and a predictor module. The dynamic optical transfer attention module is used to explicitly simulate the physical transfer process of the beam in phase space and output physical context features based on the input vector. The standard temporal feature path module is used to capture implicit, non-physically intuitive patterns in the data and output temporal dependent features based on the input vector. The feature fusion and pooling module is used to construct a context vector based on the physical context features and the temporal dependent features. The predictor module is used to predict the lateral phase value at the beam position monitor based on the context vector.

2. The method according to claim 1, characterized in that, The step of outputting physical context features based on the input vector includes: A value vector is determined based on the horizontal beam trajectory value, the horizontal beam trajectory angle value, the vertical beam trajectory value, and the vertical beam trajectory angle value in the input vector. A query vector and a key vector are also determined based on the horizontal beam trajectory value, the horizontal beam trajectory angle value, the vertical beam trajectory value, the vertical beam trajectory angle value, and the K value in the input vector. The value vector is used to represent phase space information. A dynamic transfer matrix is ​​determined based on the query vector and the key vector. The dynamic transfer matrix is ​​used to represent the phase space transfer relationship between any two beam position monitors. The contribution vector propagating from any one of the beam position monitor positions to another beam position monitor position is calculated based on the dynamic transfer matrix and the value vector. The contribution vectors propagating from the positions of all beam position monitors in the accelerator Lattice model are summed to obtain the sum vector of contributions propagating from the positions of all beam position monitors to the position of the target beam position monitor. The sum vector of contributions is the physical context feature.

3. The method according to claim 1, characterized in that, The step of outputting temporal dependency features based on the input vector includes: The low-dimensional input vector is mapped to the high-dimensional input vector through a fully connected layer; Periodic positional encoding is performed on the high-dimensional input vector to obtain a high-dimensional input vector including the positional encoding; Temporally dependent features are obtained by capturing non-physical, implicit patterns in a high-dimensional input vector, including the positional encoding, through a one-dimensional convolutional neural network.

4. The method according to claim 1, characterized in that, The step of constructing a context vector based on the physical context features and the temporal dependency features includes: The physical context features and the temporal dependency features are concatenated along the channel dimension to obtain the fused features; Enhanced features are obtained by strengthening the dependencies between different locations in the fused features using a multi-head attention network. The enhanced features are regularized by discarding layers to obtain regularized features; The regularized features are compressed using a global average pooling layer to obtain a context vector.

5. The method according to claim 1, characterized in that, Before inputting the input vector into the beam phase prediction model, the method further includes: Construct a first training dataset that only allows errors in the K value of the quadrupole magnet, a second training dataset that only allows errors in the correction magnet, and a test dataset that allows errors in both the K value of the quadrupole magnet and the correction magnet. Each of the first training dataset, the second training dataset, and the test dataset includes multiple data pairs, and each data pair consists of the applied K value of the quadrupole magnet, the calculated orbital error value, and the lateral phase value. The beam phase prediction model is trained based on the first training dataset and the second training dataset; The trained beam phase prediction model is tested using the test dataset to obtain the beam phase prediction model that has passed the test.

6. The method according to claim 5, characterized in that, The construction of the first training dataset, which only allows for errors in the K value of the quadrupole magnet, includes: The sampling dimension of the Latin hypercube sampler is determined based on the number of quadrupole magnets. The quadrupole magnet is sampled using a Latin hypercube sampler of the sampling dimension to generate K-value error samples that follow a uniform distribution. The K-value error samples that follow a uniform distribution are transformed into K-value error samples that follow a preset normal distribution using the inverse cumulative distribution function; Construct an accelerator Lattice model and add the K-value error samples that follow a preset normal distribution to the accelerator Lattice model; Calculate the orbital error and lateral phase values ​​of the Lattice model of the accelerator.

7. The method according to claim 6, characterized in that, The beam phase prediction model also includes a K-value inverter, which is used to perform physical inversion based on the context vector to obtain the predicted K value of the quadrupole magnet.

8. The method according to claim 7, characterized in that, The total cost function of the beam phase prediction model includes an empirical risk loss term, an invariant risk penalty term, an information bottleneck penalty term, and a K-value inversion penalty term. The empirical risk loss term is determined based on the predicted and calculated transverse phase values. The invariant risk penalty term is determined based on the gradient norm of the penalty loss function with respect to the virtual scalar product. The information bottleneck penalty term is determined based on the variance of the context vector. The K-value inversion penalty term is determined based on the K-value of the applied quadrupole magnet and the predicted K-value of the quadrupole magnet.

9. An electronic device, characterized in that, include: Processor and memory; The processor is connected to a memory, wherein the memory is used to store a computer program, and the processor is used to invoke the computer program to perform the method as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, perform the method as described in any one of claims 1-8.