Quantum phase estimation method and device, terminal equipment and storage medium

By combining particle swarm optimization algorithm with Transformer and Mamba modules, particle velocity and parameters are dynamically corrected, solving the accuracy problem of quantum phase estimation in noisy environments and achieving high-precision quantum phase estimation.

CN121503529APending Publication Date: 2026-02-10MEASUREMENT CENT OF GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511716173.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing quantum phase estimation methods assume ideal noise-free conditions, resulting in low phase estimation accuracy in real-world noisy environments.

Method used

An initial particle swarm is constructed using a particle swarm optimization algorithm. The particle velocity and adjustment parameters are dynamically corrected through a trained scheme decision model. The algorithm parameters are adjusted in real time to counteract noise interference. The particle swarm search strategy is optimized by combining Transformer and Mamba modules to improve the phase estimation accuracy.

Benefits of technology

Achieving high-precision quantum phase estimation in real-world noisy environments, the accuracy and stability of phase estimation are improved by dynamically adapting to the noise environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121503529A_ABST
    Figure CN121503529A_ABST
Patent Text Reader

Abstract

The invention discloses a quantum phase estimation method and device, terminal equipment and a storage medium, and relates to the field of quantum computation.The method comprises the steps that the quantum state of a to-be-estimated phase is obtained, an initial particle swarm is constructed through a scheme decision model, and the particle position is used for representing a phase estimation scheme; the phase estimation process is repeatedly executed to obtain a target phase estimation scheme, and then phase estimation is carried out on the quantum state, including the steps of calculating strategy dispersion according to the current particle position, and if convergence occurs, determining the target phase estimation scheme according to the global optimal position; otherwise, updating the particle position and the particle speed; determining a strategy vector of each particle according to the current particle speed, the current adjustment parameter and all historical positions of the particles; and correcting the particle speed and adjusting parameters according to the strategy vector. Through the implementation of the invention, the problem of low phase estimation precision caused by assuming an ideal noiseless condition in the existing quantum phase estimation can be solved, and the estimation precision in an actual noise environment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of quantum computing, and in particular to a quantum phase estimation method, apparatus, terminal device, and storage medium. Background Technology

[0002] With the rapid advancements in quantum computing and quantum sensing, quantum phase estimation has become a crucial task in quantum information processing, playing a vital role in the accuracy and stability of quantum sensors. Quantum phase estimation is an important problem in quantum mechanics, aiming to estimate the phase information of a quantum system by measuring its state. This process is widely used in quantum computing, quantum communication, quantum imaging, and quantum precision measurement. For example, in quantum computing, quantum phase estimation is fundamental to many quantum algorithms. As the applications of quantum sensors expand, the demand for accurate phase estimation continues to grow, especially in the presence of noise in quantum systems, where maintaining high-precision phase estimation has become a significant technical challenge.

[0003] However, in practical applications, quantum systems are inevitably affected by noise, such as Gaussian noise, random telegraph noise, and Poisson noise. This noise significantly impacts the accuracy and stability of quantum phase estimation, causing the estimation results to deviate from the true value. Traditional quantum phase estimation methods typically assume ideal, noise-free conditions, and therefore perform poorly in real-world noisy environments. Summary of the Invention

[0004] This invention provides a quantum phase estimation method, apparatus, terminal device, and storage medium, which can solve the problem of low phase estimation accuracy caused by the assumption of ideal noise-free conditions in existing quantum phase estimation, and improve the estimation accuracy in actual noisy environments.

[0005] An embodiment of the present invention provides a quantum phase estimation method, comprising: Obtain the quantum state of the phase to be estimated; The quantum state of the phase to be estimated is input into the trained scheme decision model so that the scheme decision model can construct an initial particle swarm based on the quantum state of the phase to be estimated, and determine the initial particle position and initial particle velocity of each particle; wherein, each particle position is used to characterize a phase estimation scheme. Repeat the phase estimation process to obtain the target phase estimation scheme; Phase estimation of the quantum state is performed according to the target phase estimation scheme; The phase estimation process includes: calculating the policy dispersion based on the current particle position; determining the target phase estimation scheme based on the global best position among the current particle positions if the policy dispersion converges; otherwise, updating the particle position and particle velocity based on the current particle position, current particle velocity, and current adjustment parameters; determining the particle's policy vector based on the current particle velocity, current adjustment parameters, and all historical positions of the particle for each particle; determining the correction sequence based on the particle's policy vector; parsing the correction sequence to obtain the corrected particle velocity and corrected adjustment parameters; using the updated particle position, corrected particle velocity, and corrected adjustment parameters as the current particle position, current particle velocity, and current adjustment parameters for the next phase estimation process; wherein, the adjustment parameters include individual learning factors, group learning factors, and inertia factors; the initial current adjustment parameters are all preset values; the initial current particle position and current particle velocity are the initial particle position and initial particle velocity, respectively.

[0006] Furthermore, the current adjustment parameters include: the current individual learning factor, the current group learning factor, and the current inertia factor; Update the particle position and particle velocity based on the current particle position, current particle velocity, and current adjustment parameters, including: For each particle, calculate the fitness value of the current particle position and the best position of the historical individual, and compare the fitness value of the current particle position with the fitness value of the best position of the historical individual. If the fitness value of the current particle position is greater than the fitness value of the best position of the historical individual, then update the current particle position to the best position of the current individual. If the fitness value of the current particle position is not greater than the fitness value of the best position of the historical individual, then update the best position of the historical individual to the best position of the current individual. Select the best position of the current individual with the highest fitness value from all particles as the candidate global best position; The fitness value of the candidate global best position is compared with the fitness value of the historical global best position. If the fitness value of the candidate global best position is greater than that of the historical global best position, the candidate global best position is updated to the current global best position. If the fitness value of the candidate global best position is not greater than that of the historical global best position, the historical global best position is updated to the current global best position. Note that the historical individual best position and the historical global best position are empty during the first execution of the phase estimation process. Based on the current particle velocity, the current individual best position, the current global best position, the current individual learning factor, and the current group learning factor, update the particle velocity to obtain the updated particle velocity. Update the particle position based on the current particle position, the updated particle velocity, and the current inertia factor to obtain the updated particle position; The current individual best position and the current global best position are used as the historical individual best position and historical global best position for the next phase estimation process.

[0007] Furthermore, for each particle, a strategy vector is determined based on the current particle velocity, current adjustment parameters, and all historical positions of the particle, including: The Transformer module constructs an input vector based on the current particle velocity, current adjustment parameters, and all historical positions of the particle. Position encoding is performed on the input vector to obtain an encoded vector containing temporal features; Based on the encoding vector, determine the corresponding query vector, key vector, and value vector; By projecting the query vector, key vector, and value vector through several different linear transformations, several attention heads are obtained. By concatenating all attention heads, a policy vector is obtained.

[0008] Furthermore, based on the particle's strategy vector, a correction sequence is determined, including: The Mamba module is used to continuously update the state of the particle's policy vector to obtain a continuously enhanced feature sequence. Transform the particle's strategy vector into a discrete sequence vector; The discrete sequence vector is updated in discrete time to obtain a discrete enhanced feature sequence; The corrected sequence is obtained by scaling the continuous enhanced feature sequence using discrete enhanced feature sequences.

[0009] Furthermore, quantum phase estimation methods also include: During phase estimation, particle velocity is monitored in real time, and if the particle velocity exceeds a preset limit, the particle velocity is cut off to within the preset limit.

[0010] Furthermore, after obtaining the target phase estimation scheme, it also includes: Calculate the Holevo variance of the target phase estimation scheme; The accuracy of quantum phase estimation is evaluated based on the Holevo variance of the target phase estimation scheme.

[0011] Furthermore, the decision-making model for the proposed solution is obtained in the following way: Obtain several simulated quantum states and their actual estimation schemes; Noise is introduced into the simulated quantum state and then subjected to Min-Max normalization to generate a noisy quantum state; the noise includes Gaussian noise and random telegraph noise. Several noisy quantum states and their actual estimation schemes are input into the scheme decision model to be trained, so that the noisy quantum states are used as input and the predicted estimation schemes are used as outputs for iterative training. In each training process, the loss function is calculated based on the predicted estimation scheme and the actual estimation scheme, and the model parameters of the scheme decision model are adjusted based on the loss function until the loss function converges, and the trained scheme decision model is obtained.

[0012] Based on the above method embodiments, the present invention provides corresponding device embodiments, including: a quantum state acquisition module, a particle swarm initialization module, an estimation scheme determination module, and a phase estimation module; The quantum state acquisition module is used to acquire the quantum state of the phase to be estimated. The particle swarm initialization module is used to input the quantum state of the phase to be estimated into the trained scheme decision model, so that the scheme decision model can construct an initial particle swarm based on the quantum state of the phase to be estimated, and determine the initial particle position and initial particle velocity of each particle; wherein, each particle position is used to characterize a phase estimation scheme. The estimation scheme determination module is used to repeatedly execute the phase estimation process to obtain the target phase estimation scheme. The phase estimation process includes: calculating the policy dispersion based on the current particle position; if the policy dispersion converges, determining the target phase estimation scheme based on the global best position among the current particle positions; otherwise, updating the particle position and particle velocity based on the current particle position, current particle velocity, and current adjustment parameters; for each particle, determining the particle's policy vector based on the current particle velocity, current adjustment parameters, and all historical positions of the particle; determining the correction sequence based on the particle's policy vector; parsing the correction sequence to obtain the corrected particle velocity and corrected adjustment parameters; using the updated particle position, corrected particle velocity, and corrected adjustment parameters as the current particle position, current particle velocity, and current adjustment parameters for the next execution of the phase estimation process; wherein, the adjustment parameters include individual learning factors, group learning factors, and inertia factors; the initial current adjustment parameters are all preset values; the initial current particle position and current particle velocity are the initial particle position and initial particle velocity, respectively. The phase estimation module is used to estimate the phase of the quantum state according to the target phase estimation scheme.

[0013] Based on the above method embodiments, the present invention provides a corresponding terminal device embodiment, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the steps of the quantum phase estimation method as described in the present invention.

[0014] Based on the above method embodiments, the present invention provides a corresponding computer-readable storage medium embodiment, including: a stored computer program, which, when the computer program is running, controls the device where the computer-readable storage medium is located to execute the steps of the quantum phase estimation method as described in the present invention.

[0015] Compared with the prior art, the beneficial effects of this embodiment are as follows: This invention obtains the quantum state of the phase to be estimated; inputs the quantum state of the phase to be estimated into a trained scheme decision model, so that the scheme decision model constructs an initial particle swarm based on the quantum state of the phase to be estimated, and determines the initial particle position and initial particle velocity of each particle; wherein, each particle position is used to characterize a phase estimation scheme. The phase estimation process is repeated to obtain the target phase estimation scheme, and then the phase of the quantum state is estimated. Specifically, the phase estimation process includes: calculating the policy dispersion based on the current particle position; if the policy dispersion converges, determining the target phase estimation scheme based on the global best position among the current particle positions; otherwise, updating the particle position and particle velocity based on the current particle position, current particle velocity, and current adjustment parameters; for each particle, determining the particle's policy vector based on the current particle velocity, current adjustment parameters, and all historical positions of the particle, the policy vector integrating noise features and particle search experience; determining a correction sequence based on the particle's policy vector to make the parameter correction more consistent with the current noise environment; analyzing the correction sequence to obtain the corrected particle velocity and corrected adjustment parameters, and then adjusting the algorithm parameters in real time to counteract the interference of noise on phase estimation and improve the accuracy of phase estimation; using the updated particle position, corrected particle velocity, and corrected adjustment parameters as the current particle position, current particle velocity, and current adjustment parameters for the next phase estimation process, the particle swarm continuously moves in the search space, gradually approaching the optimal control phase, thereby achieving high-precision estimation of the unknown quantum phase.

[0016] In summary, this invention combines particle swarm optimization algorithm to dynamically correct particle velocity and adjust parameters, enabling the quantum phase estimation process to adapt to actual noise environments and dynamically cancel noise interference. This solves the problem of low phase estimation accuracy caused by the assumption of ideal noise-free conditions in existing quantum phase estimation, and improves the estimation accuracy in actual noise environments. Attached Figure Description

[0017] Figure 1 This is a schematic flowchart of a quantum phase estimation method provided in an embodiment of the present invention; Figure 2 This is a flowchart of the processing of the Transformer module provided in an embodiment of the present invention; Figure 3This is another schematic diagram of the quantum phase estimation method provided in one embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a quantum phase estimation device provided in an embodiment of the present invention. Detailed Implementation

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

[0019] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.

[0020] like Figure 1 As shown, in order to address the problem of low phase estimation accuracy caused by the assumption of an ideal, noise-free condition in existing quantum phase estimation, an embodiment of the present invention provides a quantum phase estimation method, which includes at least the following steps: Step S101: Obtain the quantum state of the phase to be estimated; For step S101, in a quantum sensing or computing scenario, the quantum sensor interacts with an external physical field to encode external field parameters (such as field strength and frequency) into complex phases of quantum state probability amplitudes, forming a quantum state with a phase to be estimated.

[0021] It should be noted that quantum measurement can only obtain the square of the probability amplitude (i.e., the probability distribution), and cannot directly extract the information implicit in the complex phase.

[0022] Step S201: Input the quantum state of the phase to be estimated into the trained scheme decision model so that the scheme decision model can construct an initial particle swarm based on the quantum state of the phase to be estimated and determine the initial particle position and initial particle velocity of each particle; wherein, each particle position is used to characterize a phase estimation scheme. For step S201, the quantum state of the phase to be estimated is used as the input signal and input into the trained scheme decision model. Inside the scheme decision model, a particle swarm is constructed based on the particle swarm optimization (PSO) algorithm. Each particle is assigned an initial position representing the candidate estimation scheme and an initial velocity that determines the search direction. Specifically: ; in, Represents particles In the A dimensional position vector, Represents particles In the 3D velocity vector Indices representing particle indices Indicates the index of the feature dimension.

[0023] Next, the particle swarm is initialized, including position and velocity initialization. For position initialization, the initial positions of the particles are randomly generated in the search space, with a range of [missing information]. For velocity initialization, the initial velocity of the particles is randomly generated within a certain range to ensure that the particles have sufficient exploration capabilities.

[0024] In this invention, the value of the particle position represents a phase estimation scheme for an unknown phase. Each phase estimation scheme includes: a relevant reference value for controlling the phase, selection parameters of the measurement basis, and a preset estimation mapping rule. The relevant reference value for controlling the phase is used to adjust the phase reference of the measurement base to form interference with the phase to be estimated; the selection parameter of the measurement base is used to select the calculation base ( , (or Fourier basis, or more complex projection directions); estimation mapping rules, used to map detector click events to phase estimates in functional form. At least one distinct data item exists between different phase estimation schemes.

[0025] Indicative, for example: Phase estimation scheme 1 may include the following: setting the relevant reference value for controlling the phase to 0.25π to adjust the phase reference of the measurement base; selecting the calculation base using the parameters for selecting the measurement base. , This allows the quantum state to be projected and measured under this basis; the mapping rule is estimated using the inverse cosine solution method, that is, through the measurement results... Frequency of occurrence ,according to The corresponding phase estimate is calculated using this method. For example, by performing 500 measurements on the quantum state under this scheme, the following results are obtained. =0.72, then the quantum phase can be estimated to be approximately 0.46π.

[0026] Phase estimation scheme 2 may include the following: setting the relevant reference value for controlling the phase to 0.5π; selecting Fourier basis parameters for the measurement basis. This is used to enhance sensitivity to specific phase components; the estimation mapping rule adopts a linear mapping method based on projection probability, through the measurement results. probability of occurrence Estimate the phase, for example according to Calculate the phase value. If the measurement result is... =0.31, then the phase estimate is approximately 0.62π.

[0027] Phase estimation scheme 3 can be a scheme automatically searched during the particle swarm optimization iteration process, and its control phase reference value can be taken as 0.37π; the selection parameters of the measurement basis can be determined by the policy vector, for example, selecting the Y-direction measurement basis. The mapping rule can be estimated using the arctangent calculation method. The phase is estimated, where and These represent the probabilities of occurrence for the two types of measurement results, respectively. For example, when the measured... =0.55、 When π = 0.45, the phase estimate can be obtained as approximately 0.12π.

[0028] As the iteration proceeds, the particle swarm moves continuously in the search space, gradually approaching the optimal control phase, thereby achieving a high-precision estimate of the unknown quantum phase.

[0029] Step S202: Repeat the phase estimation process to obtain the target phase estimation scheme. The phase estimation process includes: calculating the policy dispersion based on the current particle position; if the policy dispersion converges, determining the target phase estimation scheme based on the global best position among the current particle positions; otherwise, updating the particle position and particle velocity based on the current particle position, current particle velocity, and current adjustment parameters; for each particle, determining the particle's policy vector based on the current particle velocity, current adjustment parameters, and all historical positions of the particle; determining the correction sequence based on the particle's policy vector; parsing the correction sequence to obtain the corrected particle velocity and corrected adjustment parameters; using the updated particle position, corrected particle velocity, and corrected adjustment parameters as the current particle position, current particle velocity, and current adjustment parameters for the next execution of the phase estimation process; wherein, the adjustment parameters include individual learning factors, group learning factors, and inertia factors; the initial current adjustment parameters are all preset values; the initial current particle position and current particle velocity are the initial particle position and initial particle velocity, respectively.

[0030] In a preferred embodiment, the current adjustment parameters include: the current individual learning factor, the current group learning factor, and the current inertia factor; Update the particle position and particle velocity based on the current particle position, current particle velocity, and current adjustment parameters, including: For each particle, calculate the fitness value of the current particle position and the best position of the historical individual, and compare the fitness value of the current particle position with the fitness value of the best position of the historical individual. If the fitness value of the current particle position is greater than the fitness value of the best position of the historical individual, then update the current particle position to the best position of the current individual. If the fitness value of the current particle position is not greater than the fitness value of the best position of the historical individual, then update the best position of the historical individual to the best position of the current individual. Select the best position of the current individual with the highest fitness value from all particles as the candidate global best position; The fitness value of the candidate global best position is compared with the fitness value of the historical global best position. If the fitness value of the candidate global best position is greater than that of the historical global best position, the candidate global best position is updated to the current global best position. If the fitness value of the candidate global best position is not greater than that of the historical global best position, the historical global best position is updated to the current global best position. Note that the historical individual best position and the historical global best position are empty during the first execution of the phase estimation process. Based on the current particle velocity, the current individual best position, the current global best position, the current individual learning factor, and the current group learning factor, update the particle velocity to obtain the updated particle velocity. Update the particle position based on the current particle position, the updated particle velocity, and the current inertia factor to obtain the updated particle position; The current individual best position and the current global best position are used as the historical individual best position and historical global best position for the next phase estimation process.

[0031] In a preferred embodiment, for each particle, a strategy vector is determined based on the current particle velocity, the current adjustment parameters, and all historical positions of the particle, including: The Transformer module constructs an input vector based on the current particle velocity, current adjustment parameters, and all historical positions of the particle. Position encoding is performed on the input vector to obtain an encoded vector containing temporal features; Based on the encoding vector, determine the corresponding query vector, key vector, and value vector; By projecting the query vector, key vector, and value vector through several different linear transformations, several attention heads are obtained. By concatenating all attention heads, a policy vector is obtained.

[0032] In a preferred embodiment, determining the correction sequence based on the particle's policy vector includes: The Mamba module is used to continuously update the state of the particle's policy vector to obtain a continuously enhanced feature sequence. Transform the particle's strategy vector into a discrete sequence vector; The discrete sequence vector is updated in discrete time to obtain a discrete enhanced feature sequence; The corrected sequence is obtained by scaling the continuous enhanced feature sequence using discrete enhanced feature sequences.

[0033] For step S202, within the scheme decision model, during each iteration, for each particle... Based on the estimated strategy corresponding to the current particle position, quantum measurement is performed to calculate the position variance of all particles in each dimension. The average of the variances in all dimensions is then used to obtain the strategy dispersion.

[0034] To determine whether the strategy dispersion has converged, the strategy dispersion is a quantitative indicator of the uniformity of particle swarm distribution. If the strategy dispersion has converged, it means that the swarm has found a better search direction. At this time, the candidate solution represented by the global best position in the current particle position is used as the target phase estimation scheme.

[0035] If the strategy dispersion does not converge, it indicates that the particles are relatively dispersed in the search space, and the swarm is still extensively exploring potential phase estimation schemes. In this case, for each particle, the fitness function is used to calculate the fitness of each particle's current position, resulting in the particle's fitness value. In this embodiment, the reciprocal of the Holevo variance is used as the fitness function. The Holevo variance is a key indicator for measuring the accuracy of quantum phase estimation; the smaller the value, the higher the estimation accuracy. Taking the reciprocal, a larger fitness value indicates a better phase estimation scheme corresponding to the particle's current position.

[0036] Subsequently, the fitness value of the current particle position is compared with the fitness value of the historical best position to iteratively update the particle's optimal solution. If the fitness value of the current particle position is greater than that of the historical best position, the particle position is updated to the current best position; if the fitness value of the current particle position is less than or equal to that of the historical best position, it indicates that the phase estimation scheme of the historical best position is better, and the historical best position is updated to the current best position, continuing to serve as the reference benchmark for subsequent iterations of the particle. In this way, each particle can continuously optimize its local optimum during the exploration process.

[0037] Next, from all the current individual best positions of all particles, the position with the highest fitness value is selected as the candidate global best position. The fitness value of this candidate global best position is compared with the fitness value of the historical global best position to achieve iterative updates of the global optimal solution. If the fitness value of the candidate global best position is greater than that of the historical global best position, the candidate global best position is updated to the current global best position. If the fitness value of the candidate global best position is less than or equal to that of the historical global best position, it indicates that the phase estimation scheme of the historical global best position is still better, and the historical global best position is updated to the current global best position, continuing to serve as the global reference for subsequent iterations of the particle swarm.

[0038] It should be noted that during the first execution of the phase estimation process, since the particle swarm has not yet carried out iterative exploration, the historical individual best position and the historical global best position are both empty.

[0039] Based on the current particle velocity, the current individual best position, the current global best position, the current individual learning factor, and the current group learning factor, the particle velocity is updated using the following formula to obtain the updated particle velocity: ; in, Represents particles In the In the nth iteration Dimensional speed, Represents particles In the In the nth iteration Dimensional speed, Represents particles The individual's optimal position Represents particles The global optimal position Represents particles In the In the nth iteration The position of the dimension This represents the individual learning factor, used to control the weights by which particles move closer to their optimal position. This represents the group learning factor, used to control the weights by which particles move closer to the globally optimal position. and These are random numbers uniformly distributed within the range [0,1], used to increase the randomness of the algorithm.

[0040] Based on the current particle position, the updated particle velocity, and the current inertia factor, the particle position is updated using the following formula to obtain the updated particle position: ; in, Represents particles In the In the nth iteration The position of the dimension This represents the inertia factor, used to control the degree to which the particle velocity, after being corrected, affects the position update.

[0041] It should be noted that during the first execution of the phase estimation process, the individual learning factor, the group learning factor, and the inertia factor are all preset values.

[0042] Specifically, the individual learning factor controls the weight of particles moving closer to their optimal positions, and its value is usually between 0.5 and 1.0. In this embodiment, the individual learning factor is set to 0.8. A larger individual learning factor value will cause particles to be too scattered and difficult to converge to the global optimum; a smaller individual learning factor will cause the global optimum to be over-dependent, reduce diversity, and thus increase the risk of getting trapped in local optima. The swarm learning factor controls the weight of particles moving toward the global optimum, and its value is usually between 0.5 and 1.0. In this embodiment, the swarm learning factor is set to 0.8. A larger swarm learning factor may converge to a local optimum too early, reducing the global search capability; a smaller swarm learning factor may lead to a slower convergence speed, or even fail to find the global optimum effectively. The inertia factor controls the inertia of a particle and affects how much the particle retains its current velocity in the next step. The value is usually between 0.1 and 1.0. In this embodiment, the inertia factor is set to 0.8. A larger inertia factor helps to avoid getting trapped in local optima, but may lead to a slower convergence speed. A smaller inertia factor will make the algorithm converge faster, but may increase the risk of getting trapped in local optima.

[0043] The current individual best position and the current global best position are used as the historical individual best position and historical global best position for the next phase estimation process.

[0044] Next, the position / velocity update strategy of the particle swarm optimization algorithm is optimized through the Transformer module, thereby capturing long-term dependencies in the input data and adaptively estimating the quantum phase from a global perspective. Specifically: like Figure 2The diagram shows the processing flow of the Transformer module. The current particle velocity, current adjustment parameters, and all historical positions of the particle are used as input vectors and fed into the Transformer module. The Transformer module mainly consists of four parts: the input end, the encoder, the decoder, and the output end. To address the issue of the order of the input data element sequence, the input vector needs to be positionally encoded before being fed into the encoder, resulting in an encoded vector. The purpose of this encoding is to resolve the issue of the input element sequence order and provide markers for multi-head parallel computation and concatenation. Specifically, odd-numbered positions are cosine encoded, and even-numbered positions are sine encoded. The formula used for encoding is as follows: ; ; in, Indicates the position of a word in the input sequence. Indicates the location The input vector at position 1 Dimension value, Indicates the location The input vector at position 1 Dimension value, This represents the dimension of the Transformer module. It is the dimension index of the vector.

[0045] The encoder part mainly consists of It consists of several coding layers, and each layer is exactly the same. Similarly, the corresponding encoder is also composed of... It consists of identical decoding layers. The encoder receives the encoded vector. Using the three training matrices obtained during the training process , and For the encoding vector respectively Perform matrix multiplication to obtain the query vector. Key vector Sum value vector The calculation formula is as follows: ; pass , Matrix multiplication followed by standardization using an exponential normalization function, and then the standardized values ​​are compared with vectors. Perform a dot product operation to obtain the attention weights of the input vector: ; in, This represents the attention mechanism function. Represents the exponential normalization function, This represents the length of the key vector.

[0046] use Different linear transformations on the query vector Key vector Sum value vector Projection is performed, and the results obtained under different attention mechanisms are linearly combined through a linear layer and then concatenated to obtain the output value, as shown in the following expression: ; ; in, , and Let represent the training matrix under the attention mechanism, respectively. This indicates a splicing operation. Indicates the first Results under an attention mechanism This represents the final output of the multi-head attention mechanism.

[0047] In the decoder, the input matrix and From the The output of an encoder, the input matrix Output from multi-head attention; with the same number of decoders and encoders, after... After one decoder, the decoder outputs a policy vector.

[0048] Furthermore, the particle position / velocity update strategy optimized by Transformer is evaluated using the Mamba module, and further classification and optimization are performed based on this evaluation, thereby making the particle swarm optimization algorithm converge faster and have better fitness. Specifically: Mamba is a state-space model (SSM) built upon a more modern structured SSM suitable for deep learning, sharing similarities with the classic RNN architecture. The Transformer module is responsible for extracting global features from the current particle velocity, current adjustment parameters, and the historical state of the PSO, outputting the policy vector for each particle. Mamba takes the Transformer's output as the input sequence, performs temporal smoothing and state prediction, and generates outputs for adjusting the PSO control parameters and velocity correction.

[0049] In this invention, the Transformer module outputs a set of particle policy vectors in time-series format. When this output enters a Mamba module, it participates in two ways: firstly, as an external input in continuous time. First, it directly drives the state update of Mamba, resulting in a continuously enhanced feature sequence; second, it transforms it into a discrete sequence vector. That is, the discretized representation of the same vector under state-space modeling.

[0050] It should be noted that, and These are not two different inputs, but rather two equivalent forms of the Transformer output at different computational stages in Mamba.

[0051] For the Mamba model, there are four parameters (Δ, A, B, C), which do not change with the input (i.e., are independent of the input). These parameters control the following two stages, for the continuous stage: ; ; in, This indicates that the input sequence of the Mamba module in continuous time is derived from the output of the Transformer module, i.e., the particle policy vector sequence optimized by the self-attention mechanism. This represents the hidden state of the Mamba module over continuous time, and is a compressed representation of the system's historical information. This indicates the hidden state of the Mamba module after updates over a continuous period of time. This represents the continuous-time output sequence of the Mamba module, i.e., the continuously enhanced feature sequence. In this invention, the continuously enhanced feature sequence is the result after smoothing and prediction using a state-space model. The state transition matrix determines the hidden state. How to evolve on its own Represents the input matrix, controlling external inputs. How to influence changes in the hidden state This represents the output matrix, used to store the hidden states. Mapping to output ; To enable Mamba modules to adapt to discretized data and processing methods, fixed formulas are used. and , will continuous parameters Convert to discrete parameters .in, This is a discretization rule, and multiple rules can be used to achieve this transformation.

[0052] In the parameters are Transform into Then, computation can be performed using two methods: linear recursion or global convolution. In this invention, the convolution mode allows for efficient parallel processing, while switching to the recurrent mode enables efficient autoregressive inference.

[0053] For the discrete stage: ; ; ; in, This represents the input sequence of the Mamba module in discrete time. This represents the hidden state of a Mamba module in discrete time. This represents the output sequence of the Mamba module in discrete time, i.e., the discrete augmented feature sequence. and This represents the discretized state transition matrix and input matrix. This represents the convolution kernel of the system. When the system is linear and time-invariant, its output can be obtained by performing a global convolution operation between the input sequence and this kernel, thus enabling efficient parallel computation. It is the index of the convolution kernel.

[0054] Enhanced feature sequences through discrete methods The amplitude benchmark for continuously enhanced feature sequences Perform local scale adjustments, i.e. The corrected sequence is obtained.

[0055] The modified sequence is mapped according to a preset dimension to obtain the modified particle velocity, modified individual learning factor, modified group learning factor, and modified inertia factor.

[0056] The updated particle position, corrected particle velocity, corrected individual learning factor, corrected group learning factor, and corrected inertia factor are used as the current particle position, current particle velocity, current individual learning factor, current group learning factor, and current inertia factor for the next phase estimation process. By continuously iterating the phase estimation process, the particle swarm can continuously adjust its state based on the optimization results of the previous round in each iteration, constantly approaching the optimal estimation scheme, and ensuring that the accuracy of phase estimation gradually improves with each iteration.

[0057] Finally, when the policy dispersion converges, the current global best position is used as the final target phase estimation scheme.

[0058] In a preferred embodiment, during the phase estimation process, the particle velocity is monitored in real time, and if the particle velocity exceeds a preset limit value, the particle velocity is cut off to within the preset limit value.

[0059] In one embodiment of the present invention, in the particle swarm algorithm, there is also a velocity limit for the particles in the particle swarm. The particle velocity is monitored in real time, and if the particle velocity exceeds a preset limit value, the particle velocity is cut off within the preset limit value. This effectively avoids the failure of phase estimation due to excessive velocity, which would cause the particles to leave the reasonable solution space. The specific constraint formula is as follows: ; in, Represents particles In the Dimensional speed, This indicates the preset limit value.

[0060] In a preferred embodiment, after obtaining the target phase estimation scheme, the method further includes: Calculate the Holevo variance of the target phase estimation scheme; The accuracy of quantum phase estimation is evaluated based on the Holevo variance of the target phase estimation scheme.

[0061] In one embodiment of the present invention, the Holevo variance of the target phase estimation scheme is calculated using the following formula to evaluate the accuracy of the optimized quantum phase estimation: ; ; in, Holevo variance represents the variance used to quantify the uncertainty in phase estimation. It is trace operation. It is a quantum measurement operator. The measurement rules, determined by the final strategy, include controlling the phase, choosing the measurement basis, and estimating the mapping method. Once the final strategy is determined, the corresponding measurement process can be represented as a set of elements, with each measurement result corresponding to a measurement operator. The density matrix of a quantum system. Let represent the probability of the k-th quantum state. This represents the k-th specific quantum state that the system may be in during the m-th simulation.

[0062] Taking the reciprocal of the Holevo variance yields the accuracy of the quantum phase estimate. : ; in, It represents the accuracy of quantum phase estimation and is used to characterize the quality of the quantum phase estimation strategy represented by the particle. The larger the value, the more sensitive the strategy is to phase information, and the better the estimation accuracy.

[0063] In a preferred embodiment, the decision model is obtained in the following manner: Obtain several simulated quantum states and their actual estimation schemes; Noise is introduced into the simulated quantum state and then subjected to Min-Max normalization to generate a noisy quantum state; the noise includes Gaussian noise and random telegraph noise. Several noisy quantum states and their actual estimation schemes are input into the scheme decision model to be trained, so that the noisy quantum states are used as input and the predicted estimation schemes are used as outputs for iterative training. In each training process, the loss function is calculated based on the predicted estimation scheme and the actual estimation scheme, and the model parameters of the scheme decision model are adjusted based on the loss function until the loss function converges, and the trained scheme decision model is obtained.

[0064] In one embodiment of the present invention, the virtual preparation module of the quantum simulation platform Qiskit is used to generate an initial photon state containing unknown phase information. Specifically, the initial qubit is prepared into a superposition state through a Hadamard gate in a quantum circuit, and then an unknown phase to be estimated is introduced into a path to obtain the quantum state.

[0065] The quantum state formula is: ; in, and These are complex coefficients, representing the amplitude and phase of the quantum state. For phase and quantum state of photons, and It is the reference state of a single-photon qubit.

[0066] Noise, including Gaussian noise and random telegraph noise, is introduced into the photon state. After the noise is introduced, Min-Max normalization is used to generate a noisy quantum state.

[0067] The formula for Gaussian noise is: ; in, These are observations obtained during the quantum phase estimation process. It is the true value of the target quantum phase. It is the standard deviation of noise.

[0068] The formula for random telegraph noise is: ; in, These are noisy observations in quantum phase estimation. It is the true value of the target quantum phase. It is the standard deviation of noise. This represents the transition probability of random telegraph noise. This indicates the transition amplitude of random telegraph noise.

[0069] The phase formula with noise is: ; in, It is a noisy phase. It is the phase that should be measured in the m-th simulation.

[0070] The formula for a noisy quantum state is: ; in, It is the noisy quantum state obtained during the m-th observation.

[0071] Several noisy quantum states The actual phase estimation scheme is input into the decision-making model to be trained. Based on the current parameters, the model outputs a predicted phase estimation scheme. In each training round, the difference between the predicted and actual estimation schemes is compared. Specifically, the mean squared error of the phase estimates obtained from these two schemes is calculated to quantify the deviation between the predicted and actual results. Subsequently, based on the feedback from the loss function, optimization algorithms such as backpropagation are used to adjust the key parameters of the model, such as the weight matrix of the Transformer module and the state update coefficients of the Mamba module, to minimize the loss value. Iterative training continues until the loss function value stabilizes or the maximum number of iterations is reached, at which point training terminates, and the final decision-making model is output. A well-trained decision-making model can still output a reliable phase estimation scheme even under noise interference.

[0072] Step S301: Perform phase estimation on the quantum state according to the target phase estimation scheme.

[0073] For step S301, according to the target phase estimation scheme determined in step S202, including the target reference value for controlling the phase, the target selection parameters of the measurement basis, and the target estimation mapping rule, a phase extraction operation is performed on the quantum state of the phase to be estimated to obtain high-precision phase information.

[0074] With high-precision phase estimation, ultra-high-precision detection of physical quantities such as magnetic fields and gravitational fields can be achieved in quantum sensing; in quantum computing, it can provide key basis for phase calibration of quantum gate operations; and in quantum communication, it can support phase synchronization and security assurance of protocols such as quantum key distribution.

[0075] like Figure 3 As shown, this invention fully leverages the advantages of deep learning in feature extraction, modeling, and optimization by combining Transformer, Mamba, and particle swarm optimization algorithms. Through the self-attention mechanism of Transformer, global dependencies in the input data are captured, optimizing the nonlinearity problem in quantum phase estimation. After optimizing the particle swarm position and velocity update strategy, the Mamba architecture is further introduced for evaluation and adjustment, dynamically optimizing the learning factor and inertia factor from a global perspective, thereby improving the algorithm's convergence efficiency and optimization performance.

[0076] In summary, this invention combines deep learning with global optimization algorithms, effectively improving the performance of quantum phase estimation in complex environments, especially showing significant advantages under noise interference, and providing important technical support for applications in quantum sensors, quantum communication, and quantum imaging.

[0077] like Figure 4 As shown, based on the above method embodiments, corresponding apparatus embodiments are provided; One embodiment of the present invention provides a quantum phase estimation device, including: a quantum state acquisition module, a particle swarm initialization module, an estimation scheme determination module, and a phase estimation module; The quantum state acquisition module is used to acquire the quantum state of the phase to be estimated. The particle swarm initialization module is used to input the quantum state of the phase to be estimated into the trained scheme decision model, so that the scheme decision model can construct an initial particle swarm based on the quantum state of the phase to be estimated, and determine the initial particle position and initial particle velocity of each particle; wherein, each particle position is used to characterize a phase estimation scheme. The estimation scheme determination module is used to repeatedly execute the phase estimation process to obtain the target phase estimation scheme. The phase estimation process includes: calculating the policy dispersion based on the current particle position; if the policy dispersion converges, determining the target phase estimation scheme based on the global best position among the current particle positions; otherwise, updating the particle position and particle velocity based on the current particle position, current particle velocity, and current adjustment parameters; for each particle, determining the particle's policy vector based on the current particle velocity, current adjustment parameters, and all historical positions of the particle; determining the correction sequence based on the particle's policy vector; parsing the correction sequence to obtain the corrected particle velocity and corrected adjustment parameters; using the updated particle position, corrected particle velocity, and corrected adjustment parameters as the current particle position, current particle velocity, and current adjustment parameters for the next execution of the phase estimation process; wherein, the adjustment parameters include individual learning factors, group learning factors, and inertia factors; the initial current adjustment parameters are all preset values; the initial current particle position and current particle velocity are the initial particle position and initial particle velocity, respectively. The phase estimation module is used to estimate the phase of the quantum state according to the target phase estimation scheme.

[0078] It is understood that the above-described device embodiments correspond to the method embodiments of the present invention, and can implement the quantum phase estimation method provided by any of the above-described method embodiments of the present invention.

[0079] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0080] Based on the above embodiments of the quantum phase estimation method, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the quantum phase estimation method of any embodiment of the present invention.

[0081] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.

[0082] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0083] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting various parts of the terminal device via various interfaces and lines.

[0084] Based on the above-described method embodiments, another embodiment is provided: another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the quantum phase estimation method described in any of the above-described method embodiments of the present invention.

[0085] The modules / units integrated into the quantum phase estimation device / terminal device, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0086] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A quantum phase estimation method, characterized in that, include: Obtain the quantum state of the phase to be estimated; The quantum state of the phase to be estimated is input into the trained scheme decision model, so that the scheme decision model constructs an initial particle swarm based on the quantum state of the phase to be estimated, and determines the initial particle position and initial particle velocity of each particle; wherein, each particle position is used to characterize a phase estimation scheme. Repeat the phase estimation process to obtain the target phase estimation scheme; Phase estimation of the quantum state is performed according to the target phase estimation scheme; The phase estimation process includes: calculating the policy dispersion based on the current particle position; if the policy dispersion converges, determining the target phase estimation scheme based on the global best position among the current particle positions; otherwise, updating the particle position and particle velocity based on the current particle position, current particle velocity, and current adjustment parameters; for each particle, determining the particle's policy vector based on the current particle velocity, current adjustment parameters, and all historical positions of the particle; determining a correction sequence based on the particle's policy vector; parsing the correction sequence to obtain the corrected particle velocity and corrected adjustment parameters; using the updated particle position, corrected particle velocity, and corrected adjustment parameters as the current particle position, current particle velocity, and current adjustment parameters for the next execution of the phase estimation process; wherein, the adjustment parameters include individual learning factors, group learning factors, and inertia factors; the initial current adjustment parameters are all preset values; the initial current particle position and current particle velocity are the initial particle position and initial particle velocity, respectively.

2. The quantum phase estimation method according to claim 1, characterized in that, The current adjustment parameters include: the current individual learning factor, the current group learning factor, and the current inertia factor; The step of updating the particle position and particle velocity based on the current particle position, current particle velocity, and current adjustment parameters includes: For each particle, calculate the fitness value of the current particle position and the best position of the historical individual, and compare the fitness value of the current particle position with the fitness value of the best position of the historical individual. If the fitness value of the current particle position is greater than the fitness value of the best position of the historical individual, then update the current particle position to the best position of the current individual. If the fitness value of the current particle position is not greater than the fitness value of the best position of the historical individual, then update the best position of the historical individual to the best position of the current individual. Select the best position of the current individual with the highest fitness value from all particles as the candidate global best position; The fitness value of the candidate global best position is compared with the fitness value of the historical global best position. If the fitness value of the candidate global best position is greater than that of the historical global best position, the candidate global best position is updated to the current global best position. If the fitness value of the candidate global best position is not greater than that of the historical global best position, the historical global best position is updated to the current global best position. Note that the historical individual best position and the historical global best position are empty during the first execution of the phase estimation process. Based on the current particle velocity, the current individual best position, the current global best position, the current individual learning factor, and the current group learning factor, update the particle velocity to obtain the updated particle velocity. Update the particle position based on the current particle position, the updated particle velocity, and the current inertia factor to obtain the updated particle position; The current individual best position and the current global best position are used as the historical individual best position and historical global best position for the next phase estimation process.

3. The quantum phase estimation method according to claim 1, characterized in that, For each particle, a policy vector is determined based on its current velocity, current adjustment parameters, and all its historical positions, including: The Transformer module constructs an input vector based on the current particle velocity, current adjustment parameters, and all historical positions of the particle. The input vector is positionally encoded to obtain an encoded vector containing temporal features; Based on the encoded vector, determine the corresponding query vector, key vector, and value vector; By projecting the query vector, key vector, and value vector through several different linear transformations, several attention heads are obtained. By concatenating all attention heads, a policy vector is obtained.

4. The quantum phase estimation method according to claim 3, characterized in that, Based on the particle's policy vector, determine the correction sequence, including: The Mamba module is used to continuously update the state of the particle's policy vector to obtain a continuously enhanced feature sequence. Transform the particle's strategy vector into a discrete sequence vector; The discrete sequence vector is updated in discrete time to obtain a discrete enhanced feature sequence; The corrected sequence is obtained by scaling the continuous enhanced feature sequence using discrete enhanced feature sequences.

5. The quantum phase estimation method according to claim 1, characterized in that, Also includes: During phase estimation, particle velocity is monitored in real time, and if the particle velocity exceeds a preset limit, the particle velocity is cut off to within the preset limit.

6. The quantum phase estimation method according to claim 1, characterized in that, After obtaining the target phase estimation scheme, the following is also included: Calculate the Holevo variance of the target phase estimation scheme; The accuracy of quantum phase estimation is evaluated based on the Holevo variance of the target phase estimation scheme.

7. The quantum phase estimation method according to claim 4, characterized in that, The decision-making model for the proposed solution is obtained in the following way: Obtain several simulated quantum states and their actual estimation schemes; Noise is introduced into the simulated quantum state and then subjected to Min-Max normalization to generate a noisy quantum state; the noise includes Gaussian noise and random telegraph noise. Several noisy quantum states and their actual estimation schemes are input into the scheme decision model to be trained, so that the noisy quantum states are used as input and the predicted estimation schemes are used as outputs for iterative training. In each training process, the loss function is calculated based on the predicted estimation scheme and the actual estimation scheme, and the model parameters of the scheme decision model are adjusted based on the loss function until the loss function converges, and the trained scheme decision model is obtained.

8. A quantum phase estimation method, characterized in that, include: Quantum state acquisition module, particle swarm initialization module, estimation scheme determination module, and phase estimation module; The quantum state acquisition module is used to acquire the quantum state of the phase to be estimated; The particle swarm initialization module is used to input the quantum state of the phase to be estimated into the trained scheme decision model, so that the scheme decision model can construct an initial particle swarm based on the quantum state of the phase to be estimated, and determine the initial particle position and initial particle velocity of each particle; wherein, each particle position is used to characterize a phase estimation scheme. The estimation scheme determination module is used to repeatedly execute the phase estimation process to obtain a target phase estimation scheme. The phase estimation process includes: calculating the policy dispersion based on the current particle position; if the policy dispersion converges, determining the target phase estimation scheme based on the global best position among the current particle positions; otherwise, updating the particle position and particle velocity based on the current particle position, current particle velocity, and current adjustment parameters; for each particle, determining the particle's policy vector based on the current particle velocity, current adjustment parameters, and all historical positions of the particle; determining a correction sequence based on the particle's policy vector; parsing the correction sequence to obtain the corrected particle velocity and corrected adjustment parameters; using the updated particle position, corrected particle velocity, and corrected adjustment parameters as the current particle position, current particle velocity, and current adjustment parameters for the next execution of the phase estimation process; wherein, the adjustment parameters include individual learning factors, group learning factors, and inertia factors; the initial current adjustment parameters are all preset values; the initial current particle position and current particle velocity are the initial particle position and initial particle velocity, respectively. The phase estimation module is used to estimate the phase of the quantum state according to the target phase estimation scheme.

9. A terminal device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the quantum phase estimation method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the quantum phase estimation method as described in any one of claims 1-7.