Optimization Methods for Quantum Circuit Sampling

By dynamically estimating the mixed weight of quantum line sampling in quantum computing, the problem of inaccurate number of quantum line sampling is solved, and efficient resource utilization and confidence in the results are achieved.

CN120317392BActive Publication Date: 2025-08-12中电信量子信息科技集团有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510800876.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-16
Publication Date
2025-08-12
Estimated Expiration
2045-06-16

AI Technical Summary

Technical Problem

In quantum computing, the number of sampling times of quantum circuits is manually set by the user, resulting in inaccurate sampling times, affecting the confidence of the result or causing waste of resources.

Method used

By dynamically estimating the mixed weight of quantum line sampling based on the preset number of sampling times and the mixed Gaussian model, we will judge whether the sampling is sufficient, and stop sampling in time to optimize resource utilization.

Benefits of technology

The resource utilization rate of quantum computing is improved, the confidence of the results is ensured, and the waste of computer resources caused by excessive sampling times is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120317392B_ABST
    Figure CN120317392B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for optimizing quantum circuit sampling. The method comprises: sampling a first quantum circuit based on a first preset sampling number to determine the current sampled data. Next, determining the current mixing weight based on the current sampled data, a predetermined first quantum state distribution, and a predetermined second quantum state distribution. Finally, determining whether quantum circuit sampling is complete based on the current mixing weight to optimize quantum circuit sampling. In this way, by fitting the sampled data to a mixed Gaussian model and determining whether sampling is sufficient based on whether the mixing weights converge, sampling can be stopped promptly while ensuring confidence in the results, avoiding wasted quantum computer time due to excessive sampling times and improving resource utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of quantum computing, and more specifically, to an optimization method for quantum circuit sampling. Background Art

[0002] Based on the unique physical properties of quantum bits (qubits), quantum computing demonstrates significant theoretical advantages over classical computing paradigms when addressing specific complex problems. Related technologies sample quantum circuits to obtain information about the probability distribution of quantum states, thereby generating quantum computational results. However, in quantum computing, the number of quantum circuit samplings is typically set by the user, which can lead to inaccurate sampling times and poor sampling results. Summary of the Invention

[0003] The present application provides a method for optimizing quantum circuit sampling.

[0004] An embodiment of the present application provides a method for optimizing quantum circuit sampling, the method comprising:

[0005] Sampling the acquired first quantum circuit based on a first preset sampling number to determine current sampling data;

[0006] Determining a current mixing weight based on the current sampled data, a predetermined first quantum state distribution, and a predetermined second quantum state distribution;

[0007] According to the current mixing weight, it is determined whether the quantum circuit sampling is completed, so as to optimize the quantum circuit sampling.

[0008] In this manner, based on a first preset sampling number, the computer device samples the acquired first quantum circuit and determines the current sampled data. Next, the computer device determines the current mixing weight based on the current sampled data, the predetermined first quantum state distribution, and the second quantum state distribution. Finally, based on the current mixing weight, the computer device determines whether quantum circuit sampling is complete, thereby optimizing quantum circuit sampling. In this way, by fitting the sampled data to a mixture Gaussian model and determining whether sampling is sufficient based on convergence of the mixing weight, sampling can be stopped promptly while ensuring confidence in the results. This avoids wasted quantum computer time due to excessive sampling times and improves resource utilization.

[0009] In certain embodiments, the method further comprises:

[0010] Determining the first quantum state distribution according to a second preset sampling number and a preset second quantum circuit;

[0011] Based on a preset quantum gate, performing bit flipping processing on the second quantum circuit to determine a third quantum circuit;

[0012] The second quantum state distribution is determined according to the second preset sampling number and the third quantum circuit.

[0013] In this way, the computer device determines the first quantum state distribution based on the second preset sampling number and the preset second quantum circuit. Next, based on the preset quantum gate, the computer device performs bit-flipping on the second quantum circuit to determine the third quantum circuit. Finally, the computer device determines the second quantum state distribution based on the second preset sampling number and the third quantum circuit. In this way, through the preset quantum circuit and bit-flipping operation, the two-dimensional Gaussian distributions of the first and second quantum state distributions are obtained and fitted, respectively. This provides precise initial parameters for the mixed Gaussian model after the user submits the circuit. This allows only dynamic optimization of the mixing weight parameters during runtime, thereby reducing fitting complexity and computation time, and improving the accuracy of quantum state probability estimation.

[0014] In some embodiments, determining the first quantum state distribution according to a second preset sampling number and a preset second quantum circuit includes:

[0015] Sampling the second quantum circuit based on the second preset sampling number to determine sampling data of the second quantum circuit;

[0016] determining a mean vector and a covariance matrix of the first quantum state based on the sampled data of the second quantum circuit;

[0017] The first quantum state distribution is determined according to the mean vector and covariance matrix of the first quantum state.

[0018] In this way, based on a second preset sampling number, the computer device samples the second quantum circuit and determines the sampled data of the second quantum circuit. Next, the computer device determines the mean vector and covariance matrix of the first quantum state based on the sampled data of the second quantum circuit. Finally, the computer device determines the distribution of the first quantum state based on the mean vector and covariance matrix of the first quantum state. In this way, by sampling the preset quantum circuit a fixed number of times, the two-dimensional Gaussian distribution parameters of a single quantum state are obtained and fitted. This provides accurate initial parameters for the mixed Gaussian model after the user submits the circuit. This allows only the mixing weight parameters to be dynamically optimized during runtime, thereby reducing fitting complexity and computational time, and improving the accuracy of quantum state probability estimation.

[0019] In some embodiments, the current sampled data includes first sampled sub-data sampled in the current stage, and determining the current mixing weight based on the current sampled data and the predetermined first quantum state distribution and second quantum state distribution includes:

[0020] When sampling the first quantum circuit for the first time, determining a plurality of first posterior probabilities according to the first sampled sub-data, the first quantum state distribution, the second quantum state distribution, and preset initial mixing weights;

[0021] Based on a preset function, the current mixing weight is determined according to a plurality of the first posterior probabilities.

[0022] In this manner, when sampling the first quantum circuit for the first time, the computer device determines multiple first a posteriori probabilities based on the first sampled sub-data, the first quantum state distribution, the second quantum state distribution, and preset initial mixing weights. Next, based on a preset function, the computer device determines current mixing weights based on the multiple first a posteriori probabilities. In this way, by calculating the a posteriori probabilities using the preset initial mixing weights based on the first sampled data and the pre-fitted first and second quantum state distributions, and dynamically updating the mixing weights based on the preset function, iterative optimization of the quantum state probability distribution is achieved.

[0023] In some embodiments, the current sampled data includes first sampled sub-data collected in a current sampling period, and determining the current mixing weight based on the current sampled data and a predetermined first quantum state distribution and a predetermined second quantum state distribution includes:

[0024] In a case where the first quantum circuit is not sampled for the first time, determining a plurality of second posterior probabilities based on the first sampled sub-data, second sampled sub-data accumulated over a historical sampling period, the first quantum state distribution, the second quantum state distribution, and a previous mixing weight;

[0025] Based on a preset function, the current mixing weight is determined according to a plurality of the second posterior probabilities.

[0026] In this manner, when sampling the first quantum circuit for a non-initial time, the computer device determines multiple second a posteriori probabilities based on the first sampled sub-data, the second sampled sub-data accumulated over historical sampling cycles, the first quantum state distribution, the second quantum state distribution, and the previous mixing weights. Next, based on a preset function, the computer device determines the current mixing weights based on the multiple second a posteriori probabilities. Thus, when sampling for a non-initial time, the mixing weights converged at the previous moment are used as the initial parameters for the current iteration. The mixing weights are iteratively updated using the preset function, combining the newly sampled data with the pre-fitted quantum state distribution.

[0027] In some embodiments, determining whether the quantum circuit sampling is completed based on the current mixing weight to optimize the quantum circuit sampling includes:

[0028] Determining a mixing weight set according to the current mixing weight;

[0029] According to the current convergence status of the hybrid weight set, it is determined whether the quantum circuit sampling is completed, so as to optimize the quantum circuit sampling.

[0030] In this way, the computer device determines a set of mixing weights based on the current mixing weights. Next, the computer device determines whether quantum circuit sampling is complete based on the current convergence of the mixing weight set, thereby optimizing quantum circuit sampling. This allows for dynamic judgment of quantum circuit sampling adequacy by monitoring the convergence of the mixing weight set in real time, avoiding inaccurate probability estimates due to undersampling or wasted quantum computer time due to oversampling.

[0031] In certain embodiments, the method further comprises:

[0032] Confirming that the hybrid weight set has converged if a change rate of a preset number of consecutive hybrid weights in the hybrid weight set is less than or equal to a preset change rate threshold;

[0033] When the change rates of a preset number of consecutive mixing weights in the mixing weight set are greater than the preset change rate threshold, it is determined that the mixing weight set has not converged.

[0034] In this way, if the rate of change of a preset number of consecutive mixing weights in the mixing weight set is less than or equal to a preset rate of change threshold, the computer device confirms that the mixing weight set has converged. Next, if the rate of change of a preset number of consecutive mixing weights in the mixing weight set is greater than a preset rate of change threshold, the computer device confirms that the mixing weight set has not converged. In this way, by setting the preset rate of change threshold and the continuous observation window, the degree of convergence of the Gaussian mixture model parameters is quantified, achieving automated judgment of the adequacy of quantum circuit sampling.

[0035] In some embodiments, determining whether quantum circuit sampling is completed based on the current convergence status of the hybrid weight set includes:

[0036] When it is confirmed that the hybrid weight set has converged, it is determined that the quantum circuit sampling is completed.

[0037] Once the hybrid weight set converges, the computer determines that quantum circuit sampling is complete. This indicates that the current sampled data is sufficiently stable to describe the probability distribution of the quantum state, allowing the computer to terminate sampling promptly, avoiding the potential waste of machine time associated with traditional manual sampling.

[0038] In some embodiments, determining whether quantum circuit sampling is completed based on the current convergence status of the hybrid weight set includes:

[0039] When confirming that the hybrid weight set has not converged, confirming that the quantum circuit sampling is not completed;

[0040] When it is confirmed that the quantum circuit sampling is not completed, sampling the obtained first quantum circuit based on the first preset sampling number of times to determine next sampling data;

[0041] Determining a next mixing weight according to the next sampling data, the first quantum state distribution, the second quantum state distribution, and the current mixing weight;

[0042] The mixing weight set is updated according to the next mixing weight until the change rate of a preset number of consecutive mixing weights in the mixing weight set is less than or equal to the preset change rate threshold.

[0043] In this way, when it is confirmed that the mixed weight set has not converged, the computer device confirms that the quantum circuit sampling is not completed. Then, when it is confirmed that the quantum circuit sampling is not completed, based on the first preset sampling number, the computer device samples the acquired first quantum circuit and determines the next sampling data. Then, the computer device determines the next mixed weight based on the next sampling data, the first quantum state distribution, the second quantum state distribution and the current mixed weight. Finally, the computer device updates the mixed weight set according to the next mixed weight until the rate of change of a preset number of continuous mixed weights in the mixed weight set is less than or equal to the preset change rate threshold. In this way, by continuously monitoring the convergence state of the mixed weight set, a new round of sampling is actively triggered when the preset threshold is not met, thereby ensuring the stability and accuracy of the quantum state probability estimation and avoiding unreliable statistical results due to insufficient sampling.

[0044] In some embodiments, the next sampled data includes third sampled sub-data collected in a next sampling period, and determining the next mixing weight based on the next sampled data, the first quantum state distribution, the second quantum state distribution, and the current mixing weight includes:

[0045] Determining a plurality of third posterior probabilities based on the second sampled sub-data accumulated over a historical sampling period, the third sampled sub-data, the first quantum state distribution, the second quantum state distribution, and the current mixing weight;

[0046] Based on a preset function, the next mixing weight is determined according to a plurality of the third posterior probabilities.

[0047] In this way, the computer device determines multiple third posterior probabilities based on the second sampled sub-data accumulated over the historical sampling period, the third sampled sub-data, the first quantum state distribution, the second quantum state distribution, and the current mixing weights. Next, based on a preset function, the computer device determines the next mixing weight based on the multiple third posterior probabilities. In this way, by introducing the new second sampled sub-data and the pre-fitted first and second quantum state distributions, calculating the posterior probabilities in combination with the current mixing weights, and updating the mixing weights based on the preset function, an iterative approximation of the quantum state probability distribution is achieved, ensuring that the model parameters after each iteration are closer to the true distribution, thereby improving estimation accuracy.

[0048] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become obvious from the description below, or will be learned through practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0050] Figure 1 This is one of the flow charts of the optimization method for quantum circuit sampling according to the embodiment of the present application;

[0051] Figure 2 Schematic diagram of the distribution of sampling points on the IQ plane according to an embodiment of the present application;

[0052] Figure 3 Schematic diagram of statistical fitting of 0-state sampling points in an embodiment of the present application;

[0053] Figure 4 1 is a statistical fitting diagram of a sampling point in state 1 according to an embodiment of the present application;

[0054] Figure 5 This is the second flow chart of the optimization method for quantum circuit sampling according to the embodiment of the present application;

[0055] Figure 6 This is the third flow chart of the optimization method for quantum circuit sampling according to the embodiment of the present application;

[0056] Figure 7 This is the fourth flow chart of the optimization method for quantum circuit sampling according to the embodiment of the present application;

[0057] Figure 8 This is the fifth flow chart of the optimization method for quantum circuit sampling according to the embodiment of the present application;

[0058] Figure 9 This is the sixth flow chart of the optimization method for quantum circuit sampling according to the embodiment of the present application;

[0059] Figure 10 This is the seventh flow chart of the optimization method for quantum circuit sampling according to the embodiment of the present application;

[0060] Figure 11 This is the eighth flow chart of the optimization method for quantum circuit sampling according to the embodiment of the present application;

[0061] Figure 12 This is a schematic diagram of the changing trend of the 0-state weight in the embodiment of the present application;

[0062] Figure 13 This is the ninth flow chart of the optimization method for quantum circuit sampling according to the embodiment of the present application;

[0063] Figure 14 This is the tenth flow chart of the optimization method for quantum circuit sampling according to the embodiment of the present application;

[0064] Figure 15 It is a complete flow chart of the optimization method of quantum circuit sampling according to the embodiment of the present application. DETAILED DESCRIPTION

[0065] The embodiments of the present application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and should not be understood as limiting the embodiments of the present application.

[0066] Based on the unique physical properties of quantum bits - quantum superposition and quantum entanglement, quantum computing has shown significant theoretical advantages over classical computing paradigms in dealing with specific complex problems. Unlike classical bits that can only represent two discrete states, 0 or 1, a single quantum bit can be in and Quantum computing can process arbitrary superpositions of qubits, while entanglement between multiple qubits can form high-dimensional correlated states, giving quantum computing a natural ability to process information in parallel. In classical computing, many complex problems, such as prime factorization of large integers, have computational complexity that increases exponentially with the value, making it difficult for classical computers to solve them within a reasonable time. However, quantum computing, with its unique physical properties, demonstrates great potential in solving prime factorization problems.

[0067] In related technical fields, it is often necessary to perform repeated sampling operations on quantum circuits to obtain information about the probability distribution of quantum states and, in turn, derive the results of quantum computations. This is because the measurement results of qubits are probabilistic. A single measurement can only cause the quantum state to collapse to a certain state (such as 0 or 1), which cannot reflect the complete probability distribution of the quantum state. Therefore, multiple sampling statistics are required to approximate the true distribution. For example, in quantum chemistry simulations, a large number of sampling statistics are required to calculate the occupation probabilities of different quantum states in order to accurately calculate the energy levels of molecules and chemical reaction pathways.

[0068] However, in current quantum computing scenarios, the number of sampling times for quantum circuits is usually set manually by the user, a method with significant flaws. Users often need to rely on experience to estimate the number of sampling times, but due to the complexity of quantum algorithms, it is difficult for users to know the exact number of sampling times required in advance. If the number of sampling times is set too low, the probability distribution obtained by statistics may deviate significantly from the true distribution, resulting in a lack of confidence in the results and an inability to meet experimental requirements. For example, in quantum error correction experiments, insufficient sampling times may distort the bit error rate statistics and make it impossible to accurately evaluate the performance of the error correction code. If the number of sampling times is set too high, it will cause a serious waste of quantum computer time, especially in the current situation where quantum computing resources are scarce and costly. This not only increases the user's usage cost, but also reduces the overall resource utilization of the quantum computer, delaying the execution progress of other user tasks.

[0069] Based on the above questions, please refer to Figure 1 , an embodiment of the present application provides a method for optimizing quantum circuit sampling, the method comprising:

[0070] 01: Based on the first preset sampling number, sample the acquired first quantum circuit to determine the current sampling data;

[0071] 02: Determine the current mixing weight based on the current sampling data, the predetermined first quantum state distribution and the second quantum state distribution;

[0072] 03: According to the current mixing weight, determine whether the quantum circuit sampling is completed to optimize the quantum circuit sampling.

[0073] The embodiments of the present application also provide a computer device including a memory and a processor. The optimization method for quantum circuit sampling of the embodiments of the present application can be implemented by the computer device of the embodiments of the present application. Specifically, the memory stores a computer program, and the processor is used to split the currently acquired target quantum computing task during the process of processing the quantum computing task to determine the current time slice task. The processor is also used to determine the task type and priority of the current time slice task based on the configuration information of the target quantum computing task. The processor is also used to determine the current task processing sequence based on the task type, priority, and current time slice task. The processor is also used to execute the process according to the current task processing sequence.

[0074] The embodiments of the present application also provide a task processing device. The quantum circuit sampling optimization method of the embodiments of the present application can be implemented by the task processing device of the embodiments of the present application. Specifically, the quantum circuit simulation device includes a determination module. The determination module is used to split the currently acquired target quantum computing task during the processing of the quantum computing task and determine the current time slice task. The determination module is also used to determine the task type and priority of the current time slice task based on the configuration information of the target quantum computing task. The determination module is also used to determine the current task processing sequence based on the task type, priority, and current time slice task. The process is then executed according to the current task processing sequence.

[0075] Specifically, quantum computing is a new computing paradigm that uses the principles of quantum mechanics to process information. By leveraging the unique properties of quantum bits (qubits), such as superposition and entanglement, it achieves problem-solving capabilities far exceeding those of classical computers. The essence of quantum computing is to design computational models based on the physical laws of quantum mechanics (such as superposition and entanglement), rather than classical binary logic.

[0076] A superposition state refers to a state in which a single quantum bit can be in and The superposition state (such as ), breaking through the limitations of classical bits "either 0 or 1", so that n quantum bits can simultaneously represent possible states to achieve parallel computing.

[0077] An entangled state refers to an entangled state in which multiple quantum bits can form a strong correlation. The measurement of one bit will instantly affect the state of other entangled bits. This "non-locality" can greatly reduce the computational redundancy of complex problems.

[0078] A quantum system refers to a physical object or set governed by the rules of quantum mechanics, such as the spin or polarization of an electron, the spin or polarization of a photon, etc.

[0079] Mathematically, the complex vector that describes the state of all quantum bits in a quantum system is called the quantum state vector, which is usually written as The length of the quantum state vector is (n is the number of quantum bits), each element represents the amplitude (complex number) of the corresponding quantum ground state (hereinafter referred to as the ground state), and its squared modulus is the measurement probability of the ground state. The mathematical expression of the quantum state vector is: , , ,in, is the i-th element of the quantum state vector, corresponding to the ground state Amplitude of the ground state is a subset of the quantum state vector, that is, the ground state is a specific quantum state with the lowest energy, and the quantum state vector covers all possible states. For example, assuming that the number of quantum bits in the quantum system D is 2, then the ground state includes 、 、 and , and set 、 、 and The corresponding amplitude Both , the quantum state vector is .

[0080] Quantum measurement is a fundamental operation in quantum mechanics, used to extract classical information from a quantum state. Its core characteristic is that it causes the quantum state to collapse to the ground state corresponding to the measurement result. Quantum measurement has the following characteristics: 1. After measurement, the quantum state vector irreversibly collapses to a certain ground state, such as After collapse, it will only become 、 、 and 2. The probability of different ground states appearing is determined by the amplitude corresponding to the ground state. 3. After collapsing to a certain ground state, the ground state is the result of quantum measurement.

[0081] Quantum sampling refers to the process of generating a series of classical results that conform to the probability distribution of a quantum measurement, typically achieved through multiple independent measurements. Quantum sampling is essentially a collection of the results of multiple quantum measurements, relying on the probabilistic rules of a single measurement. The difference is that quantum measurements are single results, while quantum sampling is a statistical distribution.

[0082] Mathematically, the complex vector that describes the state of all quantum bits in a quantum system is called the quantum state vector, which is usually written as The length of the quantum state vector is (n is the number of quantum bits), each element represents the amplitude (complex number) of the corresponding quantum ground state (hereinafter referred to as the ground state), and its squared modulus is the measurement probability of the ground state. The mathematical expression of the quantum state vector is: , , ,in, is the i-th element of the quantum state vector, corresponding to the ground state Amplitude of the ground state is a subset of the quantum state vector, that is, the ground state is a specific quantum state with the lowest energy, and the quantum state vector covers all possible states. For example, assuming that the number of quantum bits in the quantum system D is 2, then the ground state includes 、 、 and , and set 、 、 and The corresponding amplitude Both , the quantum state vector is .

[0083] A quantum circuit is a sequence of operations consisting of quantum gates that are used to perform controlled transformations of quantum states to achieve computational goals.

[0084] Quantum gates refer to the basic operating units in quantum computing. They are mathematical operations that perform specific transformations on the state of quantum bits. In essence, they are unitary transformations acting on quantum states, satisfying reversibility and probability conservation. They are used to construct quantum circuits to implement the logical functions of quantum algorithms.

[0085] A qubit is the basic unit of information used to encode data in quantum computing. It can be understood as the quantum equivalent of the classical bit used by traditional computers to encode information in binary form. While a classical bit can only represent 0 or 1, a qubit can describe the probability distribution of states 0 and 1 using probability amplitudes α and β.

[0086] The first preset sampling count refers to a small number of pre-set sampling times after the user submits a quantum circuit, which is used to initiate the iterative estimation process of the mixing weights. During each iteration, the quantum circuit is sampled based on the first preset sampling count, gradually accumulating data to update the model parameters until the quantum circuit is sampled. This achieves the goal of "both ensuring confidence in the sampling results and reducing the total number of sampling times." Using the first preset sampling count to sample the quantum circuit avoids the waste of resources caused by excessive initial sampling data, while providing sufficient data for mixing weight estimation.

[0087] The first quantum circuit refers to the target quantum circuit submitted by the user to the quantum computing device, that is, the quantum circuit that needs to be sampled.

[0088] The current sampling data refers to the IQ plane sampling point data obtained after IQ demodulation by performing a measurement operation on the first quantum circuit in each sampling iteration.

[0089] IQ demodulation (In-phase and Quadrature Demodulation) is a signal processing technique primarily used to convert high-frequency modulated signals into low-frequency baseband signals (similar to the demodulation process in classical communications). This involves mapping the quantum bit's state information into measurable electrical signal components through orthogonal decomposition (I and Q paths), allowing for the extraction of information such as the signal's amplitude and phase. In quantum computing, after a quantum bit is measured, a readout pulse carrying quantum state information (such as the probability of being in the 0 or 1 state) is returned to the computer. The computer then processes this signal through IQ demodulation, separating the in-phase component (I value) and the quadrature component (Q value) as the basis for subsequent data analysis.

[0090] See also Figure 2 , Figure 2 The diagram below shows the distribution of sampling points on the IQ plane. The red dots represent the distribution of the 1 state, and the blue dots represent the distribution of the 0 state. The IQ plane sampling point data refers to the two-dimensional data points consisting of the in-phase component I value and the orthogonal component Q value obtained through IQ demodulation after a single sampling of the quantum bit. These data points are distributed on a two-dimensional plane (i.e., the IQ plane) with the I value as the horizontal axis and the Q value as the vertical axis. Each IQ plane sampling point data is represented by a pair of real numbers (I, Q), reflecting the state information of the quantum bit at the time of measurement. Figure 3 and Figure 4 , Figure 3 It is a statistical fitting diagram of the 0-state sampling point. Figure 4 This is a diagram of the statistical fitting of the 1-state sampling points. Since the measurement results of quantum bits are interfered by noise, even for quantum bits in pure 0 or 1 states, their IQ sampling points will not be concentrated on a fixed value, but will fluctuate around the mean.

[0091] The first quantum state distribution refers to the two-dimensional Gaussian distribution of the pure 0 state of the quantum bit measured by the computer equipment during this time period, which is obtained by sampling and fitting the quantum circuit that only contains measurement instructions.

[0092] The second quantum state distribution refers to the two-dimensional Gaussian distribution of the pure 1 state of the quantum bit measured by the computer equipment during this time period, which is obtained by sampling and fitting the quantum circuit that only contains measurement instructions.

[0093] The current mixing weight is the probability weight of the quantum bit in state 0 and state 1 obtained by dynamic estimation during the iterative sampling process. If the weight of state 0 is w, the weight of state 1 is 1-w.

[0094] The current task processing sequence refers to the task execution order list generated based on the task type, priority, and time slice split results.

[0095] A process refers to the entire life cycle of a quantum computing task, including scheduling, execution, interruption, and recovery.

[0096] First, after the user submits the first quantum circuit, the circuit is sampled according to a pre-set first sampling number, and the sampling point data of the IQ plane (i.e., the current sampling data) is obtained through IQ demodulation as the input data of the current iteration.

[0097] Next, the computer device uses the first quantum state distribution (0-state Gaussian distribution) and the second quantum state distribution (1-state Gaussian distribution) pre-fitted in the preprocessing stage to convert the current sampling data.

[0098] Finally, according to the current mixing weight, it is determined whether the quantum circuit sampling is completed to optimize the quantum circuit sampling.

[0099] In summary, in the quantum circuit sampling optimization method provided in the embodiments of the present application, based on a first preset sampling number, the computer device samples the acquired first quantum circuit and determines the current sampling data. Next, the computer device determines the current mixing weight based on the current sampling data, the predetermined first quantum state distribution, and the second quantum state distribution. Finally, the computer device determines whether the quantum circuit sampling is complete based on the current mixing weight to optimize the quantum circuit sampling. In this way, by fitting the sampled data with a mixed Gaussian model and judging whether the sampling is sufficient based on whether the mixing weight converges, sampling can be stopped in a timely manner while ensuring the confidence of the results, avoiding the waste of quantum computer time due to excessive sampling times and improving resource utilization.

[0100] See also Figure 5 In certain embodiments, the method further comprises:

[0101] 04: Determine the first quantum state distribution according to the second preset sampling number and the preset second quantum circuit;

[0102] 05: Based on the preset quantum gate, perform bit flipping on the second quantum circuit to determine the third quantum circuit;

[0103] 06: Determine the second quantum state distribution based on the second preset sampling number and the third quantum circuit.

[0104] In certain embodiments, the determination module is further configured to determine the first quantum state distribution based on a second preset number of sampling times and a preset second quantum circuit; perform bit-flipping processing on the second quantum circuit based on a preset quantum gate to determine a third quantum circuit; and determine the second quantum state distribution based on the second preset number of sampling times and the third quantum circuit.

[0105] In certain embodiments, the processor is further configured to determine a first quantum state distribution based on a second preset number of sampling times and a preset second quantum circuit; perform bit-flipping processing on the second quantum circuit based on a preset quantum gate to determine a third quantum circuit; and determine a second quantum state distribution based on the second preset number of sampling times and the third quantum circuit.

[0106] Specifically, the second preset sampling number refers to a fixed sampling number used to fit the qubit pure state distribution during the preprocessing phase. It should be noted that the second preset sampling number is typically large. In some embodiments, the second preset sampling number is set to 10,000 times.

[0107] The second quantum circuit refers to the quantum circuit used to measure the pure zero-state distribution of quantum bits in the preprocessing stage. It only contains measurement instructions and no other quantum gate operations. The initial state of the quantum bits in the second quantum circuit is zero (default state), and the circuit function is to directly read the IQ value distribution of the zero state. Figure 6 , Figure 6 Schematic diagram of the second quantum circuit.

[0108] The preset quantum gate refers to the X-gate, also known as the quantum NOT gate, which is used to flip a quantum bit from state 0 to state 1. Through the operation of the X-gate, a quantum bit can be flipped from state 0 to state 1.

[0109] The third quantum circuit refers to the quantum circuit used to measure the distribution of pure 1 states of quantum bits in the preprocessing stage. It is composed of the second quantum circuit with an X gate added. Figure 7 , Figure 7 Schematic diagram of the third quantum circuit.

[0110] First, the second quantum circuit is repeatedly run according to a second preset sampling number, the quantum bits are measured, and the first quantum state distribution is determined.

[0111] Then, based on the second quantum circuit, an X gate is placed in front to form a third quantum circuit, so as to perform bit flipping processing on the quantum bits in the second quantum circuit and determine the third quantum circuit.

[0112] Finally, the third quantum circuit is repeatedly run according to the second preset sampling number, the quantum bits are measured, and the first quantum state distribution is determined.

[0113] In this way, the computer device determines the first quantum state distribution based on the second preset sampling number and the preset second quantum circuit. Next, based on the preset quantum gate, the computer device performs bit-flipping on the second quantum circuit to determine the third quantum circuit. Finally, the computer device determines the second quantum state distribution based on the second preset sampling number and the third quantum circuit. In this way, through the preset quantum circuit and bit-flipping operation, the two-dimensional Gaussian distributions of the first and second quantum state distributions are obtained and fitted, respectively. This provides precise initial parameters for the mixed Gaussian model after the user submits the circuit. This allows only dynamic optimization of the mixing weight parameters during runtime, thereby reducing fitting complexity and computation time, and improving the accuracy of quantum state probability estimation.

[0114] See also Figure 6 In some embodiments, step 04 (determining the first quantum state distribution according to the second preset sampling number and the preset second quantum circuit) includes:

[0115] 041: Sampling the second quantum circuit based on a second preset sampling number to determine sampling data of the second quantum circuit;

[0116] 042: Determine the mean vector and covariance matrix of the first quantum state based on the sampling data of the second quantum circuit;

[0117] 043: Determine the distribution of the first quantum state based on the mean vector and covariance matrix of the first quantum state.

[0118] In certain embodiments, the determination module further samples the second quantum circuit based on a second predetermined number of sampling times to determine sampled data of the second quantum circuit, determines a mean vector and a covariance matrix of the first quantum state based on the sampled data of the second quantum circuit, and determines a distribution of the first quantum state based on the mean vector and the covariance matrix of the first quantum state.

[0119] In certain embodiments, the processor further samples the second quantum circuit based on a second predetermined number of sampling times to determine sampled data of the second quantum circuit, determines a mean vector and a covariance matrix of the first quantum state based on the sampled data of the second quantum circuit, and determines a distribution of the first quantum state based on the mean vector and the covariance matrix of the first quantum state.

[0120] Specifically, the sampled data for the second quantum circuit refers to the set of two-dimensional data points in the IQ plane obtained through IQ demodulation after sampling the preset second quantum circuit (which only contains measurement instructions and is used to measure the initial 0 state of the qubit). Each data point consists of the value of the in-phase component I and the value of the orthogonal component Q. The sampled data for the second quantum circuit reflects the distribution of measurement results when the qubit is in the pure 0 state.

[0121] It should be noted that quantum computers are limited by the physical environment and technological level, and there is inevitable noise, which will interfere with the state stability of quantum bits and cause the measurement results to deviate from the ideal value. Therefore, even the measurement results of pure states will not be concentrated at a fixed point, but will be a two-dimensional Gaussian distribution centered on the mean. For example, see Figure 2 Ideally, the pure-state IQ value should be a fixed point (such as I=1, Q=0), but in actual measurement, it will fluctuate due to noise, forming a "clustered" distribution centered on the mean.

[0122] The mean vector of the first quantum state refers to the mean parameter of the two-dimensional Gaussian distribution obtained after statistical analysis of the sampling data of the second quantum circuit. It is used to describe the center position (also called the average position) of the measurement result of the 0-state quantum bit on the IQ plane and is recorded as ,in, is the mean value of I in the 0 state, is the mean Q value of the 0 state.

[0123] The covariance matrix of the first quantum state refers to the covariance parameter of the two-dimensional Gaussian distribution obtained after statistical analysis of the sampled data of the second quantum circuit. It is used to describe the discrete degree and correlation of the measurement results of the 0-state quantum bit on the IQ plane, and is recorded as ,in, is the variance of I value, is the Q value variance, is the correlation coefficient between I value and Q value in the 0 state.

[0124] In this way, according to the mean vector of the first quantum state and the covariance matrix of the first quantum state obtained by the above calculation, a Gaussian model is constructed to obtain the distribution of the first quantum state .

[0125] Similarly, the first quantum state distribution can also be obtained according to the above process, except that the sampling data of the second quantum circuit is changed to the sampling data of the third quantum circuit. It will not be repeated here.

[0126] In this way, based on a second preset sampling number, the computer device samples the second quantum circuit and determines the sampled data of the second quantum circuit. Next, the computer device determines the mean vector and covariance matrix of the first quantum state based on the sampled data of the second quantum circuit. Finally, the computer device determines the distribution of the first quantum state based on the mean vector and covariance matrix of the first quantum state. In this way, by sampling the preset quantum circuit a fixed number of times, the two-dimensional Gaussian distribution parameters of a single quantum state are obtained and fitted. This provides accurate initial parameters for the mixed Gaussian model after the user submits the circuit. This allows only the mixing weight parameters to be dynamically optimized during runtime, thereby reducing fitting complexity and computational time, and improving the accuracy of quantum state probability estimation.

[0127] See also Figure 7 In some embodiments, the current sampled data includes first sampled sub-data obtained by sampling in the current stage. Step 02 (determining the current mixing weight based on the current sampled data and the predetermined first quantum state distribution and second quantum state distribution) includes:

[0128] 021: When sampling the first quantum circuit for the first time, determining a plurality of first posterior probabilities according to the first sampled sub-data, the first quantum state distribution, the second quantum state distribution, and the preset initial mixing weights;

[0129] 022: Based on a preset function and multiple first posterior probabilities, determine the current mixing weight.

[0130] In certain embodiments, the determination module is further configured to, when sampling the first quantum circuit for the first time, determine a plurality of first a posteriori probabilities based on the first sampled sub-data, the first quantum state distribution, the second quantum state distribution, and preset initial mixing weights, and to determine a current mixing weight based on the plurality of first a posteriori probabilities based on a preset function.

[0131] In certain embodiments, the processor is further configured to, when sampling the first quantum circuit for the first time, determine a plurality of first a posteriori probabilities based on the first sampled sub-data, the first quantum state distribution, the second quantum state distribution, and preset initial mixing weights, and to determine a current mixing weight based on the plurality of first a posteriori probabilities based on a preset function.

[0132] Specifically, the first sampling sub-data is the IQ plane sampling point data newly collected in the current sampling period after the user submits the first quantum circuit.

[0133] The preset initial mixing weight refers to the initial mixing weight value set for the Gaussian mixture model at the first iteration, which is used to start the iteration process of the EM algorithm. In some embodiments, the preset initial mixing weight is usually set to =0.5,1- =0.5.

[0134] The EM algorithm refers to a statistical machine learning method for estimating model parameters in the presence of hidden variables. It can estimate the parameters of the mixed Gaussian model, thereby dynamically judging whether the quantum circuit sampling is sufficient. In the optimization method for quantum circuit sampling provided in the embodiment of the present application, the sampling result of the quantum bit superposition state is described by a mixed Gaussian model of the first quantum state and the second quantum state. The EM algorithm is required to estimate the mixing weight parameters of the mixed Gaussian model, thereby dynamically judging whether the quantum circuit sampling is sufficient.

[0135] The first posterior probability refers to the conditional probability that, for each sampling point, after the first sampling, the point belongs to the 0 state or the 1 state, calculated through the E step of the EM algorithm based on the current model parameters (including the first quantum state distribution parameter, the second quantum state distribution parameter, and the preset initial mixing weight).

[0136] The preset function refers to the objective function used to update the mixing weights in the M step of the EM algorithm, usually the log-likelihood function, and the mixing weights are optimized by maximizing this function.

[0137] When sampling the first quantum circuit for the first time, for each sampling point , use Bayesian theorem to calculate the first posterior probability that the sampling point belongs to state 0, that is ,in, represents the hidden variable corresponding to the sampling point (0 state or 1 state), Represents the two-dimensional Gaussian distribution probability density function of the 0 state corresponding to the sampling point, Represents the two-dimensional Gaussian distribution probability density function of the 1 state corresponding to the sampling point.

[0138] Then, by maximizing the log-likelihood function, the updated mixing weights are obtained , as the current mixing weight. In some embodiments, the mathematical expression is obtained by performing weighted average calculation on the posterior probability: In this way, the initial state of the mixed Gaussian model is quickly established through a small amount of initial sampling and pre-fitting parameters, avoiding the slow convergence caused by random initialization. In addition, the first updated mixed weights As the initial parameters for the next round of sampling, it gradually approaches the true probability distribution until the convergence conditions are met, thereby transforming the "adequacy of quantum circuit sampling" into the "stability of the mixing weight parameters of the mixed Gaussian model" problem.

[0139] In this manner, when sampling the first quantum circuit for the first time, the computer device determines multiple first a posteriori probabilities based on the first sampled sub-data, the first quantum state distribution, the second quantum state distribution, and preset initial mixing weights. Next, based on a preset function, the computer device determines current mixing weights based on the multiple first a posteriori probabilities. In this way, by calculating the a posteriori probabilities using the preset initial mixing weights based on the first sampled data and the pre-fitted first and second quantum state distributions, and dynamically updating the mixing weights based on the preset function, iterative optimization of the quantum state probability distribution is achieved.

[0140] See also Figure 8 In some embodiments, the current sampled data includes first sampled sub-data collected in the current sampling period. Step 02 (determining the current mixing weight based on the current sampled data and the predetermined first quantum state distribution and second quantum state distribution) includes:

[0141] 023: When sampling the first quantum circuit is not the first time, determining a plurality of second posterior probabilities based on the first sampling sub-data, the second sampling sub-data accumulated in the historical sampling period, the first quantum state distribution, the second quantum state distribution, and the previous mixing weight;

[0142] 024: Based on a preset function and multiple second posterior probabilities, determine the current mixing weight.

[0143] In certain embodiments, the determination module is further configured to determine, when this is not the first time sampling the first quantum circuit, a plurality of second a posteriori probabilities based on the first sampled sub-data, second sampled sub-data accumulated over historical sampling periods, the first quantum state distribution, the second quantum state distribution, and a previous mixing weight, and to determine, based on a preset function, a current mixing weight based on the plurality of second a posteriori probabilities.

[0144] In certain embodiments, the processor is further configured to, when sampling the first quantum circuit is not the first time, determine a plurality of second a posteriori probabilities based on the first sampled sub-data, second sampled sub-data accumulated over historical sampling periods, the first quantum state distribution, the second quantum state distribution, and a previous mixing weight, and determine a current mixing weight based on the plurality of second a posteriori probabilities based on a preset function.

[0145] Specifically, the historical sampling period refers to all sampling stages before the current period (including the first sampling and intermediate iteration periods).

[0146] The second sampling sub-data refers to the data accumulated from all sampling points in the historical cycle (i.e., the first sampling data + the newly added data in the intermediate rounds). When sampling is not the first time, the parameter estimation should be based on the entire set of historical accumulated data and the current newly added data to ensure that the hybrid weight update is based on more comprehensive information.

[0147] The previous mixing weight refers to the mixing weight value obtained in the last iteration of the historical sampling period, which serves as the initial parameter of the EM algorithm in the current round.

[0148] The second a posteriori probability refers to the conditional probability of each sampling point belonging to state 0 or 1, calculated for all sampling points during non-initial sampling, based on the current model parameters (first quantum state distribution parameters, second quantum state distribution parameters, and the previous mixing weight). This differs from the first a posteriori probability in that the first a posteriori probability is based only on the first sampling data, while the second a posteriori probability is based on the entire set of historical accumulated data and the current newly added data. The first a posteriori probability uses the preset initial mixing weight, while the second a posteriori probability uses the previous mixing weight.

[0149] Each iteration only adds a small number of sampling points (e.g., hundreds of times) rather than resampling the entire data set to avoid wasting resources. For example, the initial sampling is 500 times, and each subsequent round adds 500 times, gradually increasing the total data volume until convergence.

[0150] It should be noted that the calculation process of the second posterior probability and the current mixing weight is similar to the calculation process of the first sampling mentioned above. Only the corresponding parameters are modified, which will not be repeated here.

[0151] In this manner, when sampling the first quantum circuit for a non-initial time, the computer device determines multiple second a posteriori probabilities based on the first sampled sub-data, the second sampled sub-data accumulated over historical sampling cycles, the first quantum state distribution, the second quantum state distribution, and the previous mixing weights. Next, based on a preset function, the computer device determines the current mixing weights based on the multiple second a posteriori probabilities. Thus, when sampling for a non-initial time, the mixing weights converged at the previous moment are used as the initial parameters for the current iteration. The mixing weights are iteratively updated using the preset function, combining the newly sampled data with the pre-fitted quantum state distribution.

[0152] See also Figure 9 In some embodiments, step 03 (determining whether quantum circuit sampling is completed based on the current mixing weight to optimize quantum circuit sampling) includes:

[0153] 031: Determine the mixing weight set based on the current mixing weight;

[0154] 032: Determine whether quantum circuit sampling is completed based on the current convergence status of the hybrid weight set to optimize quantum circuit sampling.

[0155] In some embodiments, the determination module is further configured to determine a mixing weight set based on the current mixing weights, and determine whether quantum circuit sampling is completed based on the current convergence of the mixing weight set, so as to optimize quantum circuit sampling.

[0156] In some embodiments, the processor is further configured to determine a mixing weight set based on the current mixing weights, and determine whether quantum circuit sampling is completed based on the current convergence of the mixing weight set, so as to optimize quantum circuit sampling.

[0157] Specifically, the mixing weight set refers to the sequence set of mixing weight values updated by the EM algorithm each time during the iterative process of quantum circuit sampling. For example, the first iteration obtains , the second time , ..., the kth time we get , then the mixed weight set is { , ,…, Since a single weight value cannot reflect the trend, it is necessary to use multiple rounds of data in the mixed weight set to determine whether the convergence condition is met.

[0158] The current convergence status of the mixed weight set refers to the change characteristics of the recent weight values in the set when the mixed weights have not yet fully converged, which is used to determine whether it is close to the convergence state.

[0159] First, during the iteration process of the EM algorithm, the current mixing weight is updated each time and stored in the order of iteration to form a mixing weight set.

[0160] Next, by analyzing the rate of change of weights in the mixed weight set over multiple consecutive rounds, it is determined whether the mixed Gaussian model has converged.

[0161] In this way, the computer device determines a set of mixing weights based on the current mixing weights. Next, the computer device determines whether quantum circuit sampling is complete based on the current convergence of the mixing weight set, thereby optimizing quantum circuit sampling. This allows for dynamic judgment of quantum circuit sampling adequacy by monitoring the convergence of the mixing weight set in real time, avoiding inaccurate probability estimates due to undersampling or wasted quantum computer time due to oversampling.

[0162] See also Figure 10 In certain embodiments, the method further comprises:

[0163] 033: when the change rate of a preset number of consecutive mixing weights in the mixing weight set is less than or equal to a preset change rate threshold, confirming that the mixing weight set has converged;

[0164] 034: When the change rate of a preset number of consecutive mixing weights in the mixing weight set is greater than a preset change rate threshold, it is determined that the mixing weight set has not converged.

[0165] In some embodiments, the determination module is further configured to determine that the mixed weight set has converged if the rate of change of a predetermined number of consecutive mixed weights in the mixed weight set is less than or equal to a predetermined rate of change threshold, and to determine that the mixed weight set has not converged if the rate of change of a predetermined number of consecutive mixed weights in the mixed weight set is greater than the predetermined rate of change threshold.

[0166] In some embodiments, the processor is further configured to determine that the mixed weight set has converged if the rate of change of a predetermined number of consecutive mixed weights in the mixed weight set is less than or equal to a predetermined rate of change threshold, and to determine that the mixed weight set has not converged if the rate of change of a predetermined number of consecutive mixed weights in the mixed weight set is greater than the predetermined rate of change threshold.

[0167] Specifically, the rate of change refers to the absolute or relative difference between the mixed weight values of two adjacent iterations, which is used to measure the fluctuation amplitude of the weight. .

[0168] The preset change rate threshold refers to a critical value used to determine whether the weight change is negligible. When the change rate is less than or equal to the threshold, the weight is considered to be stable. In some embodiments, the preset change rate threshold is a weight difference of 0.001.

[0169] The weight values of the most recent consecutive iterations selected from the mixed weight set are used to evaluate the stability of weight changes. For example, if the preset number is 8, the weight values of the last 8 iterations are selected. , ,…, In this way, by requiring that the weight changes in multiple consecutive rounds are less than the threshold, misjudgments caused by accidental fluctuations are avoided. For example, if the weight change in a certain round suddenly decreases, but then fluctuates greatly in subsequent rounds, the convergence condition is not met. Compared with fixed-number sampling, adaptive stopping can reduce unnecessary machine time consumption. For example, the number of sampling times during convergence in the embodiment is about 6900 times. If the preset fixed number is 10000 times, about 31% of resources can be saved.

[0170] In this way, if the rate of change of a preset number of consecutive mixing weights in the mixing weight set is less than or equal to a preset rate of change threshold, the computer device confirms that the mixing weight set has converged. Next, if the rate of change of a preset number of consecutive mixing weights in the mixing weight set is greater than a preset rate of change threshold, the computer device confirms that the mixing weight set has not converged. In this way, by setting the preset rate of change threshold and the continuous observation window, the degree of convergence of the Gaussian mixture model parameters is quantified, achieving automated judgment of the adequacy of quantum circuit sampling.

[0171] See also Figure 11 In some embodiments, step 032 (determining whether quantum circuit sampling is completed based on the current convergence status of the mixing weight set) includes:

[0172] 0321: After confirming that the hybrid weight set has converged, the quantum circuit sampling is determined to be completed.

[0173] In some embodiments, the determination module is further configured to determine that the quantum circuit sampling is completed when it is confirmed that the mixing weight set has converged.

[0174] In some embodiments, the processor is further configured to determine that quantum circuit sampling is completed when confirming that the mixing weight set has converged.

[0175] Specifically, when the set of mixing weights meets the convergence condition, it is determined that the current sampling data has fully described the true probability distribution of the quantum circuit, and there is no need to continue sampling. At this point, the quantum circuit sampling process ends.

[0176] See also Figure 12 , Figure 12 Figure 1 shows the trend of the weight of the 0-state changing with increasing sampling times. It can be seen that if the weight difference of 0.001 is set as the preset change rate threshold and the preset number of samples is 8, then after about 6900 samples, the model has converged and the quantum circuit sampling is complete. At this point, the weight of the 1-state is equal to 1 minus the weight of the 0-state.

[0177] Once the hybrid weight set converges, the computer determines that quantum circuit sampling is complete. This indicates that the current sampled data is sufficiently stable to describe the probability distribution of the quantum state, allowing the computer to terminate sampling promptly, avoiding the potential waste of machine time associated with traditional manual sampling.

[0178] See also Figure 13 In some embodiments, step 032 (determining whether quantum circuit sampling is completed based on the current convergence status of the mixing weight set) includes:

[0179] 0322: When confirming that the hybrid weight set has not converged, confirm that the quantum circuit sampling is not completed;

[0180] 0323: When it is confirmed that the quantum circuit sampling is not completed, sampling the obtained first quantum circuit based on the first preset sampling number of times to determine the next sampling data;

[0181] 0324: Determine the next mixing weight according to the next sampling data, the first quantum state distribution, the second quantum state distribution and the current mixing weight;

[0182] 0325: Update the mixing weight set according to the next mixing weight until the change rate of a preset number of consecutive mixing weights in the mixing weight set is less than or equal to a preset change rate threshold.

[0183] In certain embodiments, the determination module is further configured to, if it is determined that the mixing weight set has not converged, confirm that quantum circuit sampling is not complete. If it is determined that quantum circuit sampling is not complete, the obtained first quantum circuit is sampled based on a first preset number of sampling times to determine the next sampled data. The determination module is further configured to determine the next mixing weight based on the next sampled data, the first quantum state distribution, the second quantum state distribution, and the current mixing weight. Based on the next mixing weight, the mixing weight set is updated until the rate of change of a preset number of consecutive mixing weights in the mixing weight set is less than or equal to a preset rate of change threshold.

[0184] In certain embodiments, the processor is further configured to, if it is determined that the mixing weight set has not converged, confirm that quantum circuit sampling is not complete. If it is determined that quantum circuit sampling is not complete, sample the acquired first quantum circuit based on a first preset number of sampling times to determine next sampled data. The processor is further configured to determine a next mixing weight based on the next sampled data, the first quantum state distribution, the second quantum state distribution, and the current mixing weight. Based on the next mixing weight, the mixing weight set is updated until the rate of change of a preset number of consecutive mixing weights in the mixing weight set is less than or equal to a preset rate of change threshold.

[0185] Specifically, when the set of mixing weights does not meet the convergence condition, a new round of iterative process of sampling-mixing weight calculation-mixing weight update is triggered until the mixing weights converge.

[0186] That is, based on the rate of change of the mixing weight set, if the current mixing weight set does not meet the convergence condition, it is determined that the current sampling data is insufficient and further sampling is required. Based on the first preset number of sampling times, a new round of sampling is performed on the first quantum circuit to obtain the next sampled data.

[0187] Then, the next mixing weight is calculated using the EM algorithm by combining all historical sampling data (including the previously accumulated second sampling sub-data and the currently added next sampling data), the pre-fitted first quantum state distribution, the second quantum state distribution, and the current mixing weight (the result of the previous iteration).

[0188] Then, the newly obtained next mixing weight is added to the mixing weight set to form a new mixing weight set. , ,…, } is updated to { , ,…, , } until the mixing weights converge.

[0189] In this way, when it is confirmed that the mixed weight set has not converged, the computer device confirms that the quantum circuit sampling is not completed. Then, when it is confirmed that the quantum circuit sampling is not completed, based on the first preset sampling number, the computer device samples the acquired first quantum circuit and determines the next sampling data. Then, the computer device determines the next mixed weight based on the next sampling data, the first quantum state distribution, the second quantum state distribution and the current mixed weight. Finally, the computer device updates the mixed weight set according to the next mixed weight until the rate of change of a preset number of continuous mixed weights in the mixed weight set is less than or equal to the preset change rate threshold. In this way, by continuously monitoring the convergence state of the mixed weight set, a new round of sampling is actively triggered when the preset threshold is not met, thereby ensuring the stability and accuracy of the quantum state probability estimation and avoiding unreliable statistical results due to insufficient sampling.

[0190] See also Figure 14 In some embodiments, the next sampled data includes the third sampled sub-data collected in the next sampling period. Step 0324 (determining the next mixing weight based on the next sampled data, the first quantum state distribution, the second quantum state distribution, and the current mixing weight) includes:

[0191] 03241: Determine multiple third posterior probabilities based on the second sampling sub-data, the third sampling sub-data, the first quantum state distribution, the second quantum state distribution, and the current mixing weight accumulated in the historical sampling period;

[0192] 03242: Based on a preset function and multiple third posterior probabilities, determine the next mixing weight.

[0193] In some embodiments, the confirmation module is further configured to determine a plurality of third posterior probabilities based on the second sampled sub-data, the third sampled sub-data, the first quantum state distribution, the second quantum state distribution, and the current mixing weight accumulated during the historical sampling period, and to determine a next mixing weight based on the plurality of third posterior probabilities based on a preset function.

[0194] In some embodiments, the processor is further configured to determine a plurality of third posterior probabilities based on the second sampled sub-data, the third sampled sub-data, the first quantum state distribution, the second quantum state distribution, and the current mixing weight accumulated during the historical sampling period, and to determine a next mixing weight based on the plurality of third posterior probabilities based on a preset function.

[0195] Specifically, the next sampling period refers to a new round of sampling phase that is started when the hybrid weight set has not converged.

[0196] The third sampling sub-data refers to the IQ plane sampling point data newly collected in the next sampling period.

[0197] The current mixed weight refers to the mixed weight value obtained in the last iteration of the historical sampling period (such as the weight of the kth iteration , as the initial parameters of the EM algorithm in the next cycle, reflecting the parameter inheritance.

[0198] The third posterior probability refers to the probability of the next mixing weight being calculated for all sampling points (including the second sampling sub-data accumulated historically and the third sampling sub-data newly added in the next sampling stage), according to the current model parameters (the first quantum state distribution parameter, the second quantum state distribution parameter, and the current mixing weight). , calculate the conditional probability of each point belonging to state 0 or state 1.

[0199] In this way, the computer device determines multiple third posterior probabilities based on the second and third sampling sub-data, the first and second quantum state distributions, and the current mixing weights accumulated over the historical sampling period. Next, based on a preset function, the computer device determines the next mixing weight based on the multiple third posterior probabilities. In this way, by introducing the new second sampling sub-data and the pre-fitted first and second quantum state distributions, calculating the posterior probabilities in combination with the current mixing weights, and updating the mixing weights based on the preset function, an iterative approximation of the quantum state probability distribution is achieved, ensuring that the model parameters after each iteration are closer to the true distribution and improving estimation accuracy.

[0200] The following is a complete example to illustrate the optimization method of quantum circuit sampling provided by the embodiment of this application. Figure 15 , Figure 15 This is a schematic diagram of the complete process flow for the quantum circuit sampling optimization method. The quantum circuit sampling optimization method can be divided into two phases: a preprocessing phase and a runtime optimization phase. The goal of the preprocessing phase is to pre-fit the IQ value distributions of the qubit pure 0 state (i.e., the first quantum state) and pure 1 state (i.e., the second quantum state). This provides accurate initial parameters for the Gaussian mixture model during runtime, reducing the difficulty and computational complexity of the fitting process. It should be noted that due to the inherent properties of quantum computers (such as hardware noise fluctuations and qubit state drift), the first and second quantum state distributions obtained during the preprocessing phase may no longer be applicable. Therefore, the preprocessing process must be re-executed at predetermined intervals to update the IQ value distribution parameters for the first and second quantum states.

[0201] During the runtime optimization phase, after the user submits a quantum circuit, dynamic sampling is performed based on the quantum circuit submitted by the user, and the mixed Gaussian model is iterated using the EM algorithm to estimate the mixing weight. The number of sampling times is adaptively determined by judging the convergence of the mixing weight, thus saving machine time while ensuring confidence.

[0202] The present application also provides a computer-readable storage medium containing a computer program. When the computer program is executed by one or more processors, the one or more processors execute the method of the present application.

[0203] It is understood that a computer program includes computer program code. The computer program code may be in source code form, object code form, executable file, or some intermediate form. Computer-readable storage media may include any entity or device capable of carrying computer program code, recording media, USB flash drives, removable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution media.

[0204] In the description of this specification, the descriptions with reference to the terms "particularly", "further", "particularly", "understandably", etc. are intended to mean that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic expressions of the above terms are not intended to refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.

[0205] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.

[0206] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A quantum circuit sampling optimization method, characterized in that: The method comprises: Sampling the acquired first quantum circuit based on a first preset sampling number to determine current sampling data; Determining a current mixing weight based on the current sampling data and a predetermined first quantum state distribution and a second quantum state distribution, wherein the first quantum state distribution and the second quantum state distribution are different quantum state distributions, and the current mixing weight is a probability weight of the quantum bit estimated to be in the first quantum state distribution and the second quantum state distribution during the sampling process; Determining whether the quantum circuit sampling is completed according to the current mixing weight to optimize the quantum circuit sampling; The determining, based on the current mixing weight, whether the quantum circuit sampling is completed to optimize the quantum circuit sampling includes: Determining a mixing weight set according to the current mixing weight; According to the current convergence status of the hybrid weight set, it is determined whether the quantum circuit sampling is completed, so as to optimize the quantum circuit sampling.

2. The method according to claim 1, characterized in that The method further comprises: Determining the first quantum state distribution according to a second preset sampling number and a preset second quantum circuit; Based on a preset quantum gate, performing bit flipping processing on the second quantum circuit to determine a third quantum circuit; The second quantum state distribution is determined according to the second preset sampling number and the third quantum circuit.

3. The method according to claim 2, characterized in that The determining the first quantum state distribution according to the second preset sampling number and the preset second quantum circuit includes: Sampling the second quantum circuit based on the second preset sampling number to determine sampling data of the second quantum circuit; determining a mean vector and a covariance matrix of the first quantum state based on the sampled data of the second quantum circuit; The first quantum state distribution is determined according to the mean vector and covariance matrix of the first quantum state.

4. The method according to claim 1, wherein The current sampled data includes first sampled sub-data sampled in the current stage, and determining the current mixing weight according to the current sampled data and the predetermined first quantum state distribution and second quantum state distribution includes: When sampling the first quantum circuit for the first time, determining a plurality of first posterior probabilities according to the first sampled sub-data, the first quantum state distribution, the second quantum state distribution, and preset initial mixing weights; Based on a preset function, the current mixing weight is determined according to a plurality of the first posterior probabilities.

5. The method according to claim 1, wherein The current sampled data includes first sampled sub-data collected in a current sampling period, and determining the current mixing weight according to the current sampled data and a predetermined first quantum state distribution and a predetermined second quantum state distribution includes: In a case where the first quantum circuit is not sampled for the first time, determining a plurality of second posterior probabilities based on the first sampled sub-data, second sampled sub-data accumulated over a historical sampling period, the first quantum state distribution, the second quantum state distribution, and a previous mixing weight; Based on a preset function, the current mixing weight is determined according to a plurality of the second posterior probabilities.

6. The method according to claim 1, characterized in that The method further comprises: Confirming that the hybrid weight set has converged if a change rate of a preset number of consecutive hybrid weights in the hybrid weight set is less than or equal to a preset change rate threshold; When the change rates of a preset number of consecutive mixing weights in the mixing weight set are greater than the preset change rate threshold, it is determined that the mixing weight set has not converged.

7. The method according to claim 6, characterized in that The step of determining whether quantum circuit sampling is completed according to a current convergence status of the hybrid weight set includes: When it is confirmed that the hybrid weight set converges, it is determined that the quantum circuit sampling is completed.

8. The method according to claim 6, characterized in that The step of determining whether quantum circuit sampling is completed according to a current convergence status of the hybrid weight set includes: When confirming that the hybrid weight set has not converged, confirming that the quantum circuit sampling is not completed; When it is confirmed that the quantum circuit sampling is not completed, sampling the obtained first quantum circuit based on the first preset sampling number of times to determine next sampling data; Determining a next mixing weight according to the next sampling data, the first quantum state distribution, the second quantum state distribution, and the current mixing weight; The mixing weight set is updated according to the next mixing weight until the change rate of a preset number of consecutive mixing weights in the mixing weight set is less than or equal to the preset change rate threshold.

9. The method according to claim 8, characterized in that The next sampling data includes third sampling sub-data collected in a next sampling period, and determining a next mixing weight according to the next sampling data, the first quantum state distribution, the second quantum state distribution, and the current mixing weight includes: Determining a plurality of third posterior probabilities based on the second sampled sub-data accumulated over a historical sampling period, the third sampled sub-data, the first quantum state distribution, the second quantum state distribution, and the current mixing weight; Based on a preset function, the next mixing weight is determined according to a plurality of the third posterior probabilities.

Citation Information

Patent Citations

  • Quantum measurement method and device and computing equipment

    CN114861928A

  • Quantum circuit sampling method and device

    CN119692491A