Measurement method and device of quantum operator, storage medium and program product

By splicing and measuring the quantum operators composed of the tensor product of the Pauli operator, the problem of low execution efficiency of variable component quantum algorithms is solved, and more efficient quantum computing is achieved.

CN119476518AActive Publication Date: 2025-02-18SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 14 Cites 0 Cited by

Patent Information

Application Number
CN202510061949.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-02-18
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

Existing variable component quantum algorithms require repeated calculations for each quantum operator multiple times, resulting in low execution efficiency.

Method used

By splicing the first quantum operator composed of the tensor product of the Pauli operator according to preset rules to obtain the second quantum operator, and measuring the unsplit quantum operators, the respective probability distribution is obtained, and then marginalization is achieved Processing determines the expected value of quantum operators.

Benefits of technology

The number of measured quantum operators is reduced, the number of executions of quantum lines is reduced, and the execution efficiency of variable component quantum algorithms in quantum computers is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476518A_ABST
    Figure CN119476518A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a quantum operator measuring method and device, a storage medium and a program product, and relates to the technical field of quantum.The quantum operator measuring method comprises the steps that first quantum operators, meeting preset conditions, in at least one first quantum operator are spliced to obtain at least one second quantum operator, the first quantum operator is composed of a tensor product of a Fouli operator; measuring the first quantum operator and the second quantum operator which are not spliced to obtain respective corresponding first probability distribution; marginalizing the first probability distribution to obtain second probability distribution corresponding to the at least one first quantum operator, and determining an expected value corresponding to the at least one first quantum operator according to the second probability distribution. By adopting the scheme, the technical problem that the execution efficiency of the variable component sub-algorithm is relatively low due to the fact that the current variable component sub-algorithm needs to repeatedly calculate each quantum operator for multiple times in the related technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of quantum technology, and specifically, to a method and device for measuring a quantum operator, a storage medium, and a program product. Background Art

[0002] Algorithms that use quantum computing frameworks to solve specific problems are called quantum algorithms. Quantum algorithms can achieve acceleration effects relative to classical algorithms when solving certain specific problems. However, quantum computers are indispensable for implementing these algorithms and demonstrating their advantages. Today, quantum algorithms designed for the limited performance of medium-scale noisy quantum (NISQ) devices are developing rapidly, such as variational quantum algorithms and quantum annealing.

[0003] In the related art, the process of variational quantum algorithm is mainly as follows: encode the target problem into an objective function; construct a quantum circuit; measure the output quantum state of the quantum circuit to obtain the measurement result; and update the parameters using a parameter optimizer. In the above quantum measurement process, it is necessary to obtain the expected value of the quantum operator. The expected value of the quantum operator can be obtained by calculating the expected value of each quantum operator in each sampling process, and finally taking the average of the expected values ​​corresponding to each quantum operator as its expected value. In this process, it is necessary to perform the expected value calculation for each quantum operator for the number of sampling times, which requires a large amount of calculation and has a low operating efficiency.

[0004] In the related technology, the current variational quantum algorithm needs to repeat multiple calculations for each quantum operator, resulting in low execution efficiency of the variational quantum algorithm. No effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a quantum operator measurement method and device, a storage medium, and a program product to at least solve the technical problem in the related art that the current variational quantum algorithm needs to repeat multiple calculations for each quantum operator, resulting in low execution efficiency of the variational quantum algorithm.

[0006] According to one embodiment of the present application, a method for measuring a quantum operator is provided, comprising: splicing first quantum operators that meet preset conditions in at least one first quantum operator to obtain at least one second quantum operator, wherein the first quantum operator is composed of a tensor product of Pauli operators; measuring the unspliced ​​first quantum operator and the second quantum operator to obtain respective corresponding first probability distributions, wherein the first probability distribution is used to indicate the state distribution probability of a quantum state on the first quantum operator and the second quantum operator; marginalizing the first probability distribution to obtain respective corresponding second probability distributions of the at least one first quantum operator, and determining respective corresponding expected values ​​of the at least one first quantum operator according to the second probability distribution.

[0007] In an exemplary embodiment, the above-mentioned splicing of the first quantum operators satisfying the preset conditions in at least one first quantum operator to obtain at least one second quantum operator includes: splicing the first quantum operators in the at least one first quantum operator that have a commutation relationship with each other to obtain at least one second quantum operator.

[0008] In an exemplary embodiment, the above-mentioned splicing of first quantum operators that have a commutation relationship with each other in at least one first quantum operator to obtain at least one second quantum operator includes: obtaining a list of to-be-measured, wherein the list of to-be-measured is used to place the first quantum operator and the second quantum operator; traversing at least one first quantum operator, and performing the following operations on each first quantum operator as a quantum operator to be placed: using a first quantum operator or a second quantum operator that has a commutation relationship with the first quantum operator or the second quantum operator currently placed in the list of to-be-measured as the quantum operator to be spliced; splicing the quantum operator to be placed with the quantum operator to be spliced ​​to obtain a second quantum operator, and placing the second quantum operator at a corresponding position of the quantum operator to be spliced ​​in the list of to-be-measured.

[0009] In an exemplary embodiment, the above-mentioned using the first quantum operator or the second quantum operator that has a commutation relationship with the first quantum operator or the second quantum operator currently placed in the list to be measured as the quantum operator to be spliced ​​includes: traversing the first quantum operator and the second quantum operator placed in the list to be measured, and performing the following operations: when the positional relationship between the first quantum operator or the second quantum operator and the quantum operator to be placed does not overlap, using the first quantum operator or the second quantum operator as the quantum operator to be spliced, and stopping the traversal of the list to be measured.

[0010] In an exemplary embodiment, the above-mentioned first quantum operator or second quantum operator having a commutation relationship with the first quantum operator or the second quantum operator currently placed in the list to be measured is used as the quantum operator to be spliced, and further includes: traversing the first quantum operator and the second quantum operator placed in the list to be measured, and performing the following operations: when there is an overlapping part in the position relationship between the first quantum operator or the second quantum operator and the quantum operator to be placed, and the operators corresponding to the overlapping part are the same, the first quantum operator or the second quantum operator is used as the quantum operator to be spliced, and the traversal of the list to be measured is stopped.

[0011] In an exemplary embodiment, the traversing at least one first quantum operator and performing operations on each first quantum operator as a quantum operator to be placed further includes: traversing the first quantum operator and the second quantum operator placed in the list to be measured, and when there is an overlapping part in the position relationship between the first quantum operator or the second quantum operator and the quantum operator to be placed, and the operators corresponding to the overlapping part are different, adding the quantum operator to be placed to the empty position in the list to be measured.

[0012] In an exemplary embodiment, the traversing of at least one first quantum operator and performing an operation on each first quantum operator as a quantum operator to be placed further includes: adding a first first quantum operator of the at least one first quantum operator to an empty position in a list to be measured.

[0013] In an exemplary embodiment, after obtaining the list to be measured, the method further includes: clearing the quantum operators in the list to be measured and establishing an index list, wherein the index list is used to indicate the positions of all first quantum operators in the list to be measured.

[0014] In an exemplary embodiment, the traversing of at least one first quantum operator and performing an operation on each first quantum operator as a quantum operator to be placed further includes: when placing the quantum operator to be placed in a vacant position of the list to be measured, adding first indication information to the index list, wherein the first indication information corresponds to the length of the list to be measured.

[0015] In an exemplary embodiment, the traversing of at least one first quantum operator and performing operations on each first quantum operator as a quantum operator to be placed further includes: when placing the second quantum operator at a position corresponding to the quantum operator to be spliced ​​in the list to be measured, adding second indication information to the index list, wherein the second indication information corresponds to the quantum operator to be spliced.

[0016] In an exemplary embodiment, the above-mentioned measuring the unspliced ​​first quantum operator and the unspliced ​​second quantum operator to obtain the first probability distribution corresponding to each other includes: measuring the quantum bits in the quantum state and the unspliced ​​first quantum operator and the second quantum operator according to corresponding positions to obtain the first probability distribution of the bit string.

[0017] In an exemplary embodiment, before measuring the quantum bits in the quantum state and the unjoined first quantum operator and the second quantum operator according to corresponding positions, the method includes: passing the quantum bits in the quantum state corresponding to the X basis and the Y basis through a single-bit rotation gate to obtain an updated quantum state.

[0018] In an exemplary embodiment, marginalizing the first probability distribution to obtain the second probability distribution corresponding to at least one first quantum operator includes: determining the corresponding first quantum operator in the second quantum operator; and summing the probability values ​​except the first quantum operator to obtain the second probability distribution corresponding to the first quantum operator.

[0019] In an exemplary embodiment, determining the expected value corresponding to at least one first quantum operator according to the second probability distribution includes: performing weighted summation of the second probability distribution and the corresponding eigenvalue corresponding to the first quantum operator to obtain the expected value corresponding to the first quantum operator.

[0020] In an exemplary embodiment, after determining the expectation value corresponding to at least one first quantum operator according to the second probability distribution, the method further includes: linearly combining the expectation values ​​corresponding to the first quantum operators to obtain the expectation value of the Hamiltonian corresponding to the quantum state.

[0021] In an exemplary embodiment, after obtaining the expected value of the Hamiltonian corresponding to the quantum state, the method further includes: updating the parameters of the quantum circuit using the expected value of the Hamiltonian, and obtaining the updated quantum state using the quantum circuit after the parameter update, until the objective function value corresponding to the quantum state meets a preset threshold.

[0022] According to another embodiment of the present application, a quantum operator measurement device is provided, including: a splicing module, used to splice first quantum operators that meet preset conditions in at least one first quantum operator to obtain at least one second quantum operator, wherein the first quantum operator is composed of a tensor product of Pauli operators; a measurement module, used to measure the unspliced ​​first quantum operator and the second quantum operator to obtain their respective corresponding first probability distributions, wherein the first probability distribution is used to indicate the state distribution probability of the quantum state on the first quantum operator and the second quantum operator; an expected value calculation module, used to marginalize the first probability distribution to obtain the second probability distribution corresponding to the at least one first quantum operator, and determine the expected value corresponding to the at least one first quantum operator according to the second probability distribution.

[0023] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0024] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0025] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0026] Through the present application, at least one first quantum operator that meets the preset conditions is spliced ​​to obtain at least one second quantum operator, wherein the first quantum operator is composed of the tensor product of Pauli operators; the unspliced ​​first quantum operator and the second quantum operator are measured to obtain the first probability distribution corresponding to each, wherein the first probability distribution is used to indicate the state distribution probability of the quantum state on the first quantum operator and the second quantum operator; the first probability distribution is marginalized to obtain the second probability distribution corresponding to each of the at least one first quantum operator, and the expected value corresponding to each of the at least one first quantum operator is determined according to the second probability distribution. The first quantum operator composed of the tensor product of Pauli operators can be spliced ​​according to the preset rules to obtain the second quantum operator to reduce the number of measured quantum operators. When using quantum states, quantum circuits and the first quantum operator and the second quantum operator for measurement, the measurement result of the spliced ​​second quantum operator can be obtained through the quantum circuit, and the obtained first probability distribution is marginalized in the computer to obtain the corresponding second probability distribution, so as to reduce the number of executions of the quantum circuit in the measurement process through the cooperation of traditional computers and quantum computers. This solves the technical problem that the current variational quantum algorithm needs to repeat multiple calculations for each quantum operator, resulting in low execution efficiency of the variational quantum algorithm. This improves the execution efficiency of the variational quantum algorithm in quantum computers. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 is a hardware structure block diagram of an optional quantum operator measurement method according to an embodiment of the present application;

[0028] Figure 2 is a flow chart of an optional quantum operator measurement method according to an embodiment of the present application;

[0029] Figure 3is a schematic diagram of an optional quantum operator measurement method according to an embodiment of the present application;

[0030] Figure 4 is a schematic diagram of another optional quantum operator measurement method according to an embodiment of the present application;

[0031] Figure 5 is a schematic diagram of an optional method for measuring quantum operators with overlapping positions according to an embodiment of the present application;

[0032] Figure 6 is a schematic diagram of another optional quantum operator measurement method according to an embodiment of the present application;

[0033] Figure 7 is a schematic diagram of an optional state of a quantum bit according to an embodiment of the present application;

[0034] Figure 8 It is a structural block diagram of an optional quantum operator measurement device according to an embodiment of the present application. DETAILED DESCRIPTION

[0035] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0036] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0037] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 is a hardware structure block diagram of an optional quantum operator measurement method of an embodiment of the present application. Figure 1 As shown, the measurement system of the quantum operator may include but is not limited to a terminal device 102 and a quantum computer 110. The terminal device 102 runs a target program (such as Figure 1 As shown, the target program is a program that can perform quantum operations. The terminal device 102 includes a display 108, a processor 106 and a memory 104. The display 108 can be used to display quantum measurement results, etc., and is also used to provide a human-computer interaction interface to receive touch human-computer interaction operations for different information. The processor is used to generate an interaction instruction in response to the human-computer interaction operation, and send the interaction instruction to the quantum computer 110 to obtain a first probability distribution. The memory is used to store data such as the second probability distribution corresponding to the quantum operator displayed by the running client, the expected value corresponding to the quantum operator, etc.

[0038] like Figure 1As shown, step S102 is executed in the terminal device 102, and the first quantum operators that meet the preset conditions in at least one first quantum operator are spliced ​​to obtain at least one second quantum operator, wherein the first quantum operator is composed of the tensor product of Pauli operators; then step S104 is executed, and the terminal device 102 sends the first quantum operator and the second quantum operator to the quantum computer 110. In step S104, the communication between the CPU and the quantum computer can be completed by using interface hardware, such as a classical-quantum converter to convert classical signals into quantum signals. In the quantum computer 110, step S106 can be executed to measure the unspliced ​​first quantum operator and the second quantum operator to obtain the first probability distributions corresponding to each, wherein the first probability distribution is used to indicate the state distribution probability of the quantum state on the first quantum operator and the second quantum operator; and step S108 is executed to send the first probability distribution to the terminal device 102. Then the terminal device 102 executes step S110 and step S112 to marginalize the first probability distribution to obtain a second probability distribution corresponding to each of the at least one first quantum operators, and determines the expected value corresponding to each of the at least one first quantum operators according to the second probability distribution.

[0039] Optionally, in this embodiment, the terminal device 102 may be a terminal device configured with a target program, and may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, etc. The quantum computer 110 may be a device that performs quantum algorithms and quantum computing tasks, and it may perform a large number of quantum operator measurements. It may implement a basic quantum revolving gate and has the ability to jointly read the bit state. The quantum computer 110 may be a whole system consisting of a quantum chip and a measurement and control device in a laboratory, or it may be a quantum real machine operation interface. The above is only an example, and this is not limited in this embodiment.

[0040] Through the present application, at least one first quantum operator that meets the preset conditions is spliced ​​to obtain at least one second quantum operator, wherein the first quantum operator is composed of the tensor product of Pauli operators; the unspliced ​​first quantum operator and the second quantum operator are measured to obtain the first probability distribution corresponding to each, wherein the first probability distribution is used to indicate the state distribution probability of the quantum state on the first quantum operator and the second quantum operator; the first probability distribution is marginalized to obtain the second probability distribution corresponding to each of the at least one first quantum operator, and the expected value corresponding to each of the at least one first quantum operator is determined according to the second probability distribution. The first quantum operator composed of the tensor product of Pauli operators can be spliced ​​according to the preset rules to obtain the second quantum operator to reduce the number of measured quantum operators. When using quantum states, quantum circuits and the first quantum operator and the second quantum operator for measurement, the measurement result of the spliced ​​second quantum operator can be obtained through the quantum circuit, and the obtained first probability distribution is marginalized in the computer to obtain the corresponding second probability distribution, so as to reduce the number of executions of the quantum circuit in the measurement process through the cooperation of traditional computers and quantum computers. This solves the technical problem that the current variational quantum algorithm needs to repeat multiple calculations for each quantum operator, resulting in low execution efficiency of the variational quantum algorithm. This improves the execution efficiency of the variational quantum algorithm in quantum computers.

[0041] In this embodiment, a method for measuring a quantum operator is provided. Figure 2 is a flow chart of an optional quantum operator measurement method according to an embodiment of the present application, such as Figure 2 As shown, the measurement method of the quantum operator includes:

[0042] Step S202, splicing the first quantum operators satisfying preset conditions in at least one first quantum operator to obtain at least one second quantum operator, wherein the first quantum operator is composed of a tensor product of Pauli operators;

[0043] It should be noted that quantum operators can be viewed as linear mappings from linear space V to M. The simplest quantum operation is the identity operator (denoted as I). Applying the identity operation to any quantum state results in the state itself.

[0044] It should be noted that the first quantum operator and the second quantum operator can be Pauli strings. The first quantum operator and the second quantum operator can be an operator composed of multiple Pauli operators, which can be composed of the tensor product of Pauli operators and represented by the Pauli operators and the bit space (position) on which they act. For example, "Z1 X2 Y3" can be represented as , where Z1 represents the Z operator of the first qubit, X2 represents the X operator of the second qubit, and Y3 represents the Y operator of the third qubit. I is the unit operator, and the matrix representation of the Pauli operator can be as follows:

[0045]

[0046]

[0047]

[0048] In an optional implementation, the first quantum operators that meet the preset conditions can be spliced ​​to obtain the second quantum operator. The first quantum operators can be spliced ​​together to splice the Pauli operators that act on different bit spaces, such as splicing the first quantum operators "X0 Y2" and "X1 Z3" to obtain the second quantum operator "X0 X1 Y2 Z3".

[0049] Step S204, measuring the unjoined first quantum operator and the second quantum operator to obtain respective corresponding first probability distributions, wherein the first probability distribution is used to indicate the state distribution probability of the quantum state on the first quantum operator and the second quantum operator;

[0050] It should be noted that step S204 can be executed in a quantum computer.

[0051] In an optional embodiment, in the quantum system being measured, a specific quantum state needs to be prepared, which can be a quantum state obtained after the initial state undergoes a quantum operation. Then, the quantum operator to be measured for the quantum state is determined, and the unspliced ​​first quantum operator and the second quantum operator can be traversed to determine the measurement results of the quantum state on each quantum operator. The measurement causes the quantum state to collapse to a certain eigenstate of the quantum operator and obtains a random result. For each quantum bit in the quantum state, the measurement result usually has two possibilities: 0 or 1. Repeat the measurement process multiple times, and each measurement may obtain a different bit string. Due to the linearity of the quantum state and the randomness of the measurement, the distribution of these bit strings will reflect the probability distribution of the quantum state. By statistically analyzing the results of multiple measurements, the probability of each possible bit string occurring can be estimated as the first probability distribution.

[0052] Step S206: marginalize the first probability distribution to obtain a second probability distribution corresponding to each of the at least one first quantum operators, and determine an expected value corresponding to each of the at least one first quantum operators according to the second probability distribution.

[0053] It should be noted that there is a probability distribution corresponding to the first quantum operator in the first probability distribution, and there is also a probability distribution corresponding to the second quantum operator. The second quantum operator is obtained by splicing at least two first quantum operators. Therefore, the first probability distribution corresponding to the second quantum operator is a joint probability distribution, which can be the joint probability of two or more quantum operators. It needs to be marginalized to obtain the probability distribution of a single quantum operator.

[0054] In an optional embodiment, after determining the second probability distribution corresponding to each of the first quantum operators, the respective expected values ​​can be determined according to the corresponding bit string and the second probability distribution. The specific process of solving the expected value will be described in detail below and will not be repeated here.

[0055] Through the present application, at least one first quantum operator that meets the preset conditions is spliced ​​to obtain at least one second quantum operator, wherein the first quantum operator is composed of the tensor product of Pauli operators; the unspliced ​​first quantum operator and the second quantum operator are measured to obtain the first probability distribution corresponding to each, wherein the first probability distribution is used to indicate the state distribution probability of the quantum state on the first quantum operator and the second quantum operator; the first probability distribution is marginalized to obtain the second probability distribution corresponding to each of the at least one first quantum operator, and the expected value corresponding to each of the at least one first quantum operator is determined according to the second probability distribution. The first quantum operator composed of the tensor product of Pauli operators can be spliced ​​according to the preset rules to obtain the second quantum operator to reduce the number of measured quantum operators. When using quantum states, quantum circuits and the first quantum operator and the second quantum operator for measurement, the measurement result of the spliced ​​second quantum operator can be obtained through the quantum circuit, and the obtained first probability distribution is marginalized in the computer to obtain the corresponding second probability distribution, so as to reduce the number of executions of the quantum circuit in the measurement process through the cooperation of traditional computers and quantum computers. This solves the technical problem that the current variational quantum algorithm needs to repeat multiple calculations for each quantum operator, resulting in low execution efficiency of the variational quantum algorithm. This improves the execution efficiency of the variational quantum algorithm in quantum computers.

[0056] In an optional embodiment, the step of splicing the first quantum operators satisfying a preset condition in at least one first quantum operator to obtain at least one second quantum operator includes: splicing the first quantum operators in the at least one first quantum operator that have a commutation relationship with each other to obtain at least one second quantum operator.

[0057] In an optional embodiment, the first quantum operators that have a commutation relationship can be measured under the same measurement basis. After measuring a first quantum operator, the eigenstate to which the system state collapses is also a certain eigenstate of another first quantum operator, so that the measurement result of the second first quantum operator can be known without actually measuring it. If two quantum operators A and B satisfy the commutation relationship AB=BA, it can be said that the two first quantum operators have a commutation relationship with each other. The first quantum operators that have a commutation relationship with each other are spliced ​​to obtain a second quantum operator, and the second quantum operator can be measured to achieve a combined measurement of the spliced ​​first quantum operators.

[0058] Through the above-mentioned implementation mode of the present application, before measuring the first quantum operator, the first quantum operators that satisfy the commutation relationship are spliced ​​to obtain the second quantum operator, so that the spliced ​​first quantum operators can be combined and measured by measuring the second quantum operator, so as to reduce the number of Pauli operators that need to be measured, thereby reducing the number of executions of the quantum circuit and improving the measurement efficiency.

[0059] In an optional embodiment, the above-mentioned splicing of first quantum operators that have a commutation relationship with each other in at least one first quantum operator to obtain at least one second quantum operator includes: obtaining a list of to-be-measured, wherein the list of to-be-measured is used to place the first quantum operator and the second quantum operator; traversing at least one first quantum operator, and performing the following operations on each first quantum operator as a quantum operator to be placed: using a first quantum operator or a second quantum operator that has a commutation relationship with the first quantum operator or the second quantum operator currently placed in the list of to-be-measured as the quantum operator to be spliced; splicing the quantum operator to be placed with the quantum operator to be spliced ​​to obtain a second quantum operator, and placing the second quantum operator at a corresponding position of the quantum operator to be spliced ​​in the list of to-be-measured.

[0060] In an optional implementation, a list to be measured may be obtained to place the first quantum operator or the second quantum operator, so as to determine the measurement order of the first quantum operator or the second quantum operator. For example, a measurement basis list (measure_basis) may be set.

[0061] In an optional implementation, the first quantum operators may be traversed one by one, and each first quantum operator may be used as a quantum operator to be placed. The position of the quantum operator to be placed in the list to be measured is determined, and whether there is a quantum operator to be spliced ​​that has a commutation relationship with the quantum operator to be placed is judged according to the placement order of the list to be measured.

[0062] Figure 3 is a schematic diagram of an optional quantum operator measurement method according to an embodiment of the present application; Figure 3 As shown, the list to be measured can be a list of fixed length (such as length n) or variable length (such as current length n). The first quantum operator or the second quantum operator can be placed in the list to be measured. It can be determined whether the quantum operators stored in the list to be measured 302 have quantum operators to be spliced ​​that have a commutation relationship with the quantum operators to be placed 304. The determination can be made one by one in the order of the list to be measured, such as Figure 3As shown, the quantum operator in position 1 and the quantum operator in position 3 in the list to be measured 302 both have a commutation relationship with the quantum operator to be placed 304. In the process of traversing the list, if it is determined that the quantum operator in position 1 has a commutation relationship, it can be used as the quantum operator to be spliced, and the quantum operator to be placed 304 and the quantum operator to be spliced ​​are spliced ​​to obtain a second quantum operator, which is placed in position 1. The traversal is stopped without judging the subsequent positions.

[0063] Through the above implementation of the present application, by setting the list of measurements to be measured, it is possible to make an orderly judgment on whether the first quantum operator has a first quantum operator or a second quantum operator with a commutation relationship, thereby avoiding repeated judgment or missed judgment, and improving the accuracy of merging quantum operators.

[0064] In an optional embodiment, the above-mentioned using the first quantum operator or the second quantum operator that has a commutation relationship with the first quantum operator or the second quantum operator currently placed in the list to be measured as the quantum operator to be spliced ​​includes: traversing the first quantum operator and the second quantum operator placed in the list to be measured, and performing the following operations: when the positional relationship between the first quantum operator or the second quantum operator and the quantum operator to be placed does not overlap, using the first quantum operator or the second quantum operator as the quantum operator to be spliced, and stopping the traversal of the list to be measured.

[0065] In an optional implementation, it can be determined whether the first quantum operator or the second quantum operator in the list to be measured does not overlap with the position of the bit space acted upon by the quantum operator to be placed, that is, it can be determined whether there is an intersection between the quantum operator at the current position and the quantum operator to be placed. If the intersection is empty, it can be regarded that the positions of their bit spaces do not overlap.

[0066] Figure 4 is a schematic diagram of another optional quantum operator measurement method according to an embodiment of the present application; Figure 4 As shown, the positions of the bit spaces acted on by the quantum operator 404 "X1 Z4" to be placed and the quantum operator "X0 Y2 Z3" in position 0 in the list 402 to be measured do not overlap, and their intersection is empty. It can be considered that there is a commutation relationship, and the quantum operator 404 to be placed and the quantum operator "X0 Y2 Z3" in position 0 can be spliced ​​to obtain the second quantum operator "X0 X1 Y2 Z3 Z4" and placed at position 0.

[0067] Through the above implementation of the present application, when judging whether there is a commutation relationship between two quantum operators, it is possible to directly judge whether the positions of the bit spaces acted upon by the two quantum operators overlap. If they do not overlap, it is directly determined that there is a commutation relationship, thereby speeding up the determination of the commutation relationship before splicing and improving the measurement efficiency of quantum operators.

[0068] In an optional embodiment, the above-mentioned using the first quantum operator or the second quantum operator that has a commutation relationship with the first quantum operator or the second quantum operator currently placed in the list to be measured as the quantum operator to be spliced, further includes: traversing the first quantum operator and the second quantum operator placed in the list to be measured, and performing the following operations: when there is an overlapping part in the position relationship between the first quantum operator or the second quantum operator and the quantum operator to be placed, and the operators corresponding to the overlapping part are the same, using the first quantum operator or the second quantum operator as the quantum operator to be spliced, and stopping the traversal of the list to be measured.

[0069] In an optional implementation, it can be determined whether the first quantum operator or the second quantum operator in the list to be measured does not overlap with the position of the bit space where the quantum operator is to be placed. If there is overlap, it can be determined whether the Pauli operators of the overlapping part are the same. Figure 5 is a schematic diagram of an optional method for measuring quantum operators with overlapping positions according to an embodiment of the present application; Figure 5 As shown, there is an overlapped position between the quantum operator 504 "Y1 Z2 Z3" to be placed and the quantum operator "X0 Y1 Z2" in position 1 in the list 502 to be measured (the quantum bit at the action 1 position and the quantum bit at the action 2 position overlap), and the Pauli operators at the overlapped positions are the same. It can be considered that there is a commutation relationship, and the quantum operator 504 to be placed can be spliced ​​with the quantum operator "X0 Y1 Z2" in position 1 to obtain the second quantum operator "X0Y1 Z2 Z3" and place it in position 1.

[0070] Through the above implementation of the present application, when judging whether there is a commutation relationship between two quantum operators, it is possible to directly judge whether the positions of the bit spaces acted upon by the two quantum operators overlap. In the case of overlap, if some of the operators are the same, it is directly determined that there is a commutation relationship, thereby speeding up the determination of the commutation relationship before splicing and improving the measurement efficiency of the quantum operators.

[0071] In an optional embodiment, the traversing at least one first quantum operator and performing operations on each first quantum operator as a quantum operator to be placed further includes: traversing the first quantum operator and the second quantum operator placed in the list to be measured, and when there is an overlapping part in the position relationship between the first quantum operator or the second quantum operator and the quantum operator to be placed, and the operators corresponding to the overlapping part are different, adding the quantum operator to be placed to the empty position in the list to be measured.

[0072] In an optional implementation, it can be determined whether the first quantum operator or the second quantum operator in the list to be measured does not overlap with the position of the bit space where the quantum operator is to be placed. If there is overlap, it can be determined whether the Pauli operators of the overlapped parts are the same. If they are not the same, it is considered that there is no commutation relationship. Figure 6 is a schematic diagram of another optional quantum operator measurement method according to an embodiment of the present application; Figure 6 As shown, the quantum operator to be placed 604 "Y2 X3 X4" traverses the quantum operators in the list to be measured 602. In the case where there is no quantum operator with a commutation relationship, the quantum operator to be placed 604 can be placed in the empty position of the list to be measured 602, as shown in FIG. Figure 6 The n+1 position in .

[0073] In an optional implementation, the traversing of at least one first quantum operator and performing an operation on each first quantum operator as a quantum operator to be placed further includes: adding a first first quantum operator of the at least one first quantum operator to an empty position in the list to be measured.

[0074] In an optional implementation, when there is no quantum operator in the list to be measured, the first quantum operator may be directly placed at an empty position, such as position 0.

[0075] Through the above implementation of the present application, when there is no quantum operator or no quantum operator with a commutation relation in the list to be measured, it can be directly added to the empty position to wait for the subsequent judgment of the commutation relation of the quantum operator, thereby improving the accuracy of quantum operator measurement.

[0076] In an optional implementation, after obtaining the list to be measured, the method further includes: clearing the quantum operators in the list to be measured and establishing an index list, wherein the index list is used to indicate the positions of all first quantum operators in the list to be measured.

[0077] In an optional implementation, after obtaining the list of to-be-measured, it is necessary to initialize it and clear it to an empty list. In the process of quantum operator splicing, the quantum operators in the list of to-be-measured and the measurement results are in a one-to-one correspondence, but because there are spliced ​​quantum operators in the list, the first quantum operator and the measurement result are not in a one-to-one correspondence. In order to calculate the expected value of the quantum operator from the measurement result, it is necessary to record the correspondence between the measurement result and the quantum operator in the list of to-be-measured. Therefore, an index list is established to indicate the position of all first quantum operators in the list of to-be-measured.

[0078] Through the above implementation of the present application, by establishing an index list to indicate the positions of all first quantum operators in the list to be measured, the corresponding relationship between the measurement results and the quantum operators in the list to be measured can be recorded, so that after obtaining the joint result, the expected values ​​corresponding to all first quantum operators can be obtained, thereby improving the accuracy of the subsequent measurement results corresponding to the first quantum operators.

[0079] In an optional implementation, the traversing of at least one first quantum operator and performing an operation on each first quantum operator as a quantum operator to be placed further includes: when placing the quantum operator to be placed in a vacant position in the list to be measured, adding first indication information to the index list, wherein the first indication information corresponds to the length of the list to be measured.

[0080] In an optional implementation, when there is no quantum operator or no quantum operator in a commutative relationship in the list to be measured, the first quantum operator can be directly added to the empty position. In this case, the first indication information can be directly added to the index list. The first indication information can be the length of the current list to be measured minus 1, so that the position is determined by the first indication information.

[0081] Through the above implementation of the present application, the position of the first quantum operator added to the vacancy can be determined by the first indication information, so that the measurement result is subsequently made to correspond to the first quantum operator, thereby improving the accuracy of the calculated expected value.

[0082] In an optional embodiment, the traversal of at least one first quantum operator and the execution of an operation on each first quantum operator as a quantum operator to be placed further include: when placing the second quantum operator at a position corresponding to the quantum operator to be spliced ​​in the list to be measured, adding second indication information to the index list, wherein the second indication information corresponds to the quantum operator to be spliced.

[0083] In an optional implementation, when judging whether there is a commutation relationship between two quantum operators, it is possible to directly judge whether the positions of the bit spaces acted on by the two quantum operators overlap. In the case of non-overlapping, it is directly determined that there is a commutation relationship; in the case of overlap, if some of the operators are the same, it is directly determined that there is a commutation relationship. In the case of a commutation relationship, the first quantum operator is spliced ​​with the quantum operator in the list to be measured to obtain the second quantum operator. In this case, the position of the quantum operator to be spliced ​​in the list to be measured can be used as the second indication information of the first quantum operator to indicate the position of the quantum operator to be placed.

[0084] Through the above implementation of the present application, the position of the spliced ​​first quantum operator can be determined through the second indication information, so that after the joint measurement result is obtained later, multiple quantum operators corresponding to the joint measurement result can be determined, so as to improve the accuracy of the subsequent calculation of the expected value of the quantum operator.

[0085] In an optional embodiment, the above-mentioned measuring the unspliced ​​first quantum operator and the unspliced ​​second quantum operator to obtain the respective corresponding first probability distributions includes: measuring the quantum bits in the quantum state and the unspliced ​​first quantum operator and the second quantum operator according to corresponding positions to obtain the first probability distribution of the bit string.

[0086] In an optional embodiment, before measuring the quantum bits in the quantum state and the unspliced ​​first quantum operator and the second quantum operator according to the corresponding positions, the method includes: passing the quantum bits corresponding to the X basis and the Y basis in the quantum state through a single-bit rotation gate to obtain an updated quantum state.

[0087] Figure 7 is a schematic diagram of an optional quantum bit state according to an embodiment of the present application; Figure 7 As shown, the quantum bit v can be realized and A linear combination of two states. The geometric representation can be expressed as Figure 7 As shown, Figure 7 It can be a Bloch sphere coordinate system to describe the state of the quantum bit. When measuring in the Z basis, the eigenstate of the Z basis is and , which can correspond to the eigenvalues ​​+1 and -1 respectively, without any additional operations on the qubit. However, when measuring on the X basis and Y basis, the qubit needs to be rotated to the corresponding measurement basis. For example, when measuring on the X basis, the qubit needs to be rotated using the Ry (-π / 2) gate to measure on the X basis. When measuring on the Y basis, the qubit needs to be rotated using the Rx (π / 2) gate to measure on the Y basis.

[0088] In one example, the quantum bit in the quantum state and the unconnected first quantum operator and the second quantum operator are measured according to the corresponding position. When the quantum operator is "X0 Y1 Z3", it can be used The quantum state is measured. In fact, a four-qubit system is operated, and each qubit is measured on a different Pauli operator basis. Applied to the first qubit, applied to the second qubit, and the unit operator I applied to the third qubit, Applied to the fourth qubit. The measurement result of each qubit can be 0 or 1. The first probability distribution can represent the probability distribution of all possible bit string combinations, for example, the probability of the bit string "0101" is the probability of measuring the first qubit to get 0, the second to get 1, the third to get 0, and the fourth to get 1.

[0089] Through the above implementation of the present application, after the revolving door is used, measurement is performed to obtain the corresponding probability distribution, so that the second probability distribution can be obtained by using the first probability distribution in the subsequent step, thereby achieving the measurement of the expected value of the quantum operator.

[0090] Through the above-mentioned implementation mode of the present application, quantum operators with commutation relations can be spliced ​​before passing through the single-bit rotary gate, and when rotating using the single-bit rotary gate, the number of times the quantum bit passes through the single-bit rotary gate can be reduced. For example, when measuring "X0 Y1 Z2" and "Y1 Z2 Z3", when splicing is not performed, the quantum bit needs to pass through the Rx and Ry gates when measuring "X0 Y1 Z2", and pass through the Rx gate when measuring "Y1 Z2 Z3". After splicing, when it is necessary to measure "X0 Y1 Z2 Z3", it only needs to pass through the Rx and Ry gates during each sampling process, and does not need to pass through the Rx gate twice. The number of quantum circuits executed when measuring the expected value of the quantum operator is reduced, and the execution efficiency is improved.

[0091] In an optional embodiment, marginalizing the first probability distribution to obtain the second probability distribution corresponding to at least one first quantum operator includes: determining the corresponding first quantum operator in the second quantum operator; and summing the probability values ​​​​except the first quantum operator to obtain the second probability distribution corresponding to the first quantum operator.

[0092] In an optional embodiment, if the first probability distribution is obtained by measuring the second quantum operator, then the first probability distribution needs to be marginalized. If the second quantum operator is obtained by concatenating the first quantum operator "X0 Y2" and "X1 Z3", then when solving the second probability distribution of the first quantum operator "X0 Y2", it can be obtained by summing all possible values ​​of the first quantum operator "X1 Z3". When solving the second probability distribution of the first quantum operator "X1 Z3", it can be obtained by summing all possible values ​​of the first quantum operator "X0 Y2".

[0093] In an optional implementation, the position of the quantum operator corresponding to the first probability distribution in the list to be measured can be obtained, and the number of indexes corresponding to the position can be determined in the index list. When there are multiple indexes indicating the position, it can be determined that the first probability distribution is measured by the second quantum operator, and it can be determined based on the index list which first quantum operators are spliced ​​together to obtain the second quantum operator.

[0094] Through the above implementation of the present application, after obtaining the first probability distribution, the first probability distribution corresponding to the spliced ​​second quantum operators can be marginalized to obtain the second probability distribution corresponding to each first quantum operator, so as to facilitate the subsequent measurement of the expected value of each first quantum operator.

[0095] In an optional embodiment, determining the expected value corresponding to at least one first quantum operator according to the second probability distribution includes: performing weighted summation of the second probability distribution and the corresponding eigenvalue corresponding to the first quantum operator to obtain the expected value corresponding to the first quantum operator.

[0096] In an optional embodiment, if the first quantum operator is "X0 Y1 Z2", and the bit string "101" is obtained by measurement, the probability is p 101 , then the contribution to the X basis is (-1), the contribution to the Y basis is (+1), and the contribution to the Z basis is (-1). The contribution of this bit string to the expectation value of the first quantum operator is (-1)×(+1)×(-1)×p 101 The contribution of all bit strings to the expected value is determined using the second probability distribution corresponding to the first quantum operator to obtain the expected value corresponding to the first quantum operator.

[0097] Through the above implementation of the present application, the expected value corresponding to the first quantum operator can be determined according to the first quantum operator and the corresponding second probability distribution. In the process, the second probability distribution corresponding to the first quantum operator can be determined using an index list to improve the accuracy of the measurement.

[0098] In an optional embodiment, after determining the expected value corresponding to at least one first quantum operator according to the second probability distribution, the method further includes: linearly combining the expected values ​​corresponding to the first quantum operators to obtain the expected value of the Hamiltonian corresponding to the quantum state.

[0099] In an optional implementation, the Hamiltonian may be a linear combination of the first quantum operator, and the expectation value of the quantum state under the system Hamiltonian is the energy of the quantum state in this system.

[0100] In an optional embodiment, after obtaining the expected value of the Hamiltonian corresponding to the quantum state, the method further includes: updating the parameters of the quantum circuit using the expected value of the Hamiltonian, and obtaining an updated quantum state using the quantum circuit after the parameter update, until the objective function value corresponding to the quantum state meets a preset threshold.

[0101] It should be noted that many operators correspond to the manifestation of physical quantities, while the expected value reflects the specific value of the physical quantity corresponding to the current state. For example, the expected value of a quantum state under the system Hamiltonian is the energy of this quantum state under this system. It is called the expected value because the superposition of quantum states appears on the corresponding eigenstate with corresponding probability. And each eigenstate has a corresponding value. The expected value is the average of all superposition components.

[0102] It should be noted that if measurements can be made under the operator eigenstates, the probability distribution can be obtained by sampling, and then the expected value can be obtained by combining the Hamiltonian eigenvalue. However, in practice, the eigenvalue information of the Hamiltonian is unknown. The Hamiltonians usually encountered are linear combinations of Pauli operator tensor products. The expected value of each Pauli operator tensor product can be measured, and then the linear combination is used to obtain the final expected value.

[0103] It should be noted that in general, measurements are based on calculations. and Carry out, that is, the eigenstate of Z. Since the Hamiltonian expanded as the direct product of the Pauli matrix also has X, Y, a basis transformation is required. So that the expected value of the transformed quantum state in the Z direction is equal to the required result. Through the implementation method of the application, the first quantum operator composed of the tensor product of the Pauli operator can be spliced ​​according to the preset rules to obtain the second quantum operator, so as to reduce the number of measured quantum operators. When using the quantum state, quantum circuit and the first quantum operator and the second quantum operator for measurement, the measurement result of the spliced ​​second quantum operator can be obtained through the quantum circuit, and the obtained first probability distribution is marginalized in the computer to obtain the corresponding second probability distribution, so as to reduce the number of executions of the quantum circuit during the measurement process through the cooperation of traditional computers and quantum computers. It solves the technical problem that the current variational quantum algorithm needs to repeat multiple calculations for each quantum operator, resulting in low execution efficiency of the variational quantum algorithm. It improves the execution efficiency of the variational quantum algorithm in quantum computers.

[0104] In an optional implementation, the technical problem to be solved can be encoded as an objective function O. This converts the search for the optimal solution to the target problem into an optimization problem. Generally, the smaller (or larger) the value of the objective function, the closer the target problem is to the optimal solution. Then construct a quantum circuit U (θ), which is the final model for solving the target problem. When the value of θ makes the objective function reach a minimum (or maximum), the quantum circuit model U (θ) becomes a quantum machine learning model that can solve the target problem. In the process of calculating the objective function, quantum measurements are required to measure the output quantum state of the quantum circuit, obtain classical measurement results, and calculate the objective function O. Then use a classical parameter optimizer to update the parameters.

[0105] Quantum operations are parallel, so quantum computing has advantages in terms of setting up the simulation and obtaining the loss function. The idea of ​​the variational quantum algorithm is to replace these processes with quantum computers in the hope of demonstrating quantum advantages, while the parameter optimization part is still implemented by more suitable classical computers.

[0106] Quantum information is hidden in the quantum state. To obtain classical results, the quantum state must be measured. For each measurement, the result can only be one of the measurement bases, so quantum measurement is not a unitary transformation. However, information stored in the quantum state can be obtained through quantum measurement. In the process of using quantum measurement to obtain the loss function, the quantum state will collapse to a certain measurement basis for each measurement. To obtain more detailed information, multiple sampling is usually required. Therefore, the number of samplings determines the sampling accuracy. The sampling accuracy is usually determined by the problem.

[0107] Through the present application, at least one first quantum operator that meets the preset conditions is spliced ​​to obtain at least one second quantum operator, wherein the first quantum operator is composed of the tensor product of Pauli operators; the unspliced ​​first quantum operator and the second quantum operator are measured to obtain the first probability distribution corresponding to each, wherein the first probability distribution is used to indicate the state distribution probability of the quantum state on the first quantum operator and the second quantum operator; the first probability distribution is marginalized to obtain the second probability distribution corresponding to each of the at least one first quantum operator, and the expected value corresponding to each of the at least one first quantum operator is determined according to the second probability distribution. The first quantum operator composed of the tensor product of Pauli operators can be spliced ​​according to the preset rules to obtain the second quantum operator to reduce the number of measured quantum operators. When using quantum states, quantum circuits and the first quantum operator and the second quantum operator for measurement, the measurement result of the spliced ​​second quantum operator can be obtained through the quantum circuit, and the obtained first probability distribution is marginalized in the computer to obtain the corresponding second probability distribution, so as to reduce the number of executions of the quantum circuit in the measurement process through the cooperation of traditional computers and quantum computers. This solves the technical problem that the current variational quantum algorithm needs to repeat multiple calculations for each quantum operator, resulting in low execution efficiency of the variational quantum algorithm. This improves the execution efficiency of the variational quantum algorithm in quantum computers. The greater the number of sampling times, the more obvious the efficiency improvement compared with the effects of related technologies.

[0108] In an optional embodiment, the above-mentioned quantum operator measurement method can be applied to simulate quantum chemical systems, such as solving the ground state and excited state energy of molecules, or to the fields of multi-body physical system simulation, numerical calculation, etc.

[0109] In an optional implementation, the ground state of the quantum system can be solved. The orbital positions of the electrons of the hydrogen atom are different, and the energy of the atom is also different. The hydrogen atom can be regarded as a quantum system. Assuming that the Hamiltonian of the quantum system is H, it is hoped to obtain a parameterized quantum circuit model. After inputting the initial state in the quantum circuit model, the ground state of the hydrogen molecule is output. The problem can be encoded as the objective function ,in, is the output state of the quantum circuit. The objective function O represents the quantum system in the quantum state The smaller the value, the lower the energy. The closer it is to the ground state of the quantum system. We can start with a random quantum circuit parameter and minimize the objective function O by updating the parameters, and finally obtain the optimal circuit model. The output of this quantum circuit corresponds to the ground state.

[0110] In an optional embodiment, it can be applied in the scenario of multi-body physical system simulation. In the field of multi-body physics, in addition to solving the ground state, the variational quantum algorithm can also be used to solve the excited state. Based on the characteristics that the Hamiltonian is a Hermitian operator and the eigenstates are mutually orthogonal, after obtaining the ground state, the lowest energy point, that is, the first excited state, can be found in its orthogonal control. Based on the characteristic that the unitary transformation maintains the inner product of the quantum state, some orthogonal quantum states can be prepared first, and then the assumed circuits are acted on these quantum states and the linear combination of these mutually orthogonal assumed corresponding energies is used as the loss function, and several eigenstates of the lowest energy levels can be obtained through optimization. In the field of many-body physics, the application of variational quantum algorithms also includes simulating molecular vibrations, nuclear vibrations, linear responses, and molecular dynamics processes.

[0111] In an optional implementation, it can be applied in the context of numerical calculation. Mathematically, solving the ground state problem of the Hamiltonian of a multi-body physical system is to solve the problem of the minimum eigenvalue and eigenvector of the Hermitian matrix. Based on this, the variational quantum algorithm can also be applied to numerical calculation tasks. Based on the characteristic that the singular vectors of the matrix are mutually orthogonal, the pseudo-sets of the left and right singular vectors can be prepared respectively, and the largest singular values ​​of the matrix can be obtained by optimization, so as to perform principal component analysis on the matrix. Solving equations is also one of the most common applications in numerical calculations. By converting the equation solving problem into an optimization problem, the variational quantum algorithm can solve it. Based on the easy verification of differential equations, pseudo-sets can be prepared and some expected values ​​of the Hamiltonian can be selected as pseudo-sets of the solution to the equation, and the pseudo-set curve can be optimized to satisfy the equation as much as possible.

[0112] Through the above-mentioned implementation mode of the present application, the CPU can be used to splice the first quantum operator with a commutation relationship in the computer to obtain the second quantum operator. The first quantum operator and the second quantum operator can be stored in the list to be measured, and the index list can be used to store the indication information. In a quantum computer, when using the QPU to measure the expected value of the quantum operator, only one quantum circuit needs to be executed for the second quantum operator during each sampling process, and the quantum circuit does not need to be executed for all the first quantum operators, which reduces the number of quantum circuits executed when measuring the quantum operator and improves the execution efficiency. And by using the index list and the list to be measured, the joint probability distribution of the second quantum operator can be indicated, and the CPU can be used for marginalization processing to obtain the expected value corresponding to each first quantum operator. The accuracy of the quantum operator measurement is guaranteed.

[0113] Quantum computers can be NISQ devices, which have a moderate number of qubits, typically between 50 and a few hundred. This number of qubits is neither sufficient to achieve full quantum error correction nor can it be effectively simulated by current classical computers. Qubits and quantum gate operations in NISQ devices are often affected by noise, which can come from a variety of factors such as environmental interference, equipment imperfections, and operational errors. Noise can lead to loss of quantum information and errors in quantum operations, thus limiting the accuracy and reliability of quantum algorithms. To overcome the effects of noise and errors, quantum algorithms on NISQ devices are typically quantum-classical hybrid algorithms that combine the advantages of quantum and classical computing. These algorithms perform quantum operations on a quantum processor and then use classical computers for optimization and error handling.

[0114] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, or by hardware, but in many cases the former is a better implementation method. Based on this understanding, the computer software product is stored in a storage medium (such as ROM / RAM, disk, CD), including several instructions to enable a terminal device (which can be a computer, server, or network device, etc.) or a system (a combination of a computer and a quantum computer) to execute the methods described in each embodiment of the present application.

[0115] In this embodiment, a device for measuring quantum operators is also provided, which is used to implement the above embodiments and preferred implementations, and will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0116] Figure 8 is a block diagram of an optional quantum operator measurement device according to an embodiment of the present application, which is applied to a host, such as Figure 8 As shown, the device comprises:

[0117] A splicing module 82, used for splicing the first quantum operator satisfying a preset condition in at least one first quantum operator to obtain at least one second quantum operator, wherein the first quantum operator is composed of a tensor product of Pauli operators;

[0118] A measuring module 84 is used to measure the unjoined first quantum operator and the second quantum operator to obtain respective corresponding first probability distributions, wherein the first probability distribution is used to indicate the state distribution probability of the quantum state on the first quantum operator and the second quantum operator;

[0119] The expectation value calculation module 86 is used to marginalize the first probability distribution to obtain a second probability distribution corresponding to each of the at least one first quantum operators, and determine the expectation value corresponding to each of the at least one first quantum operators according to the second probability distribution.

[0120] Through the present application, at least one first quantum operator that meets the preset conditions is spliced ​​to obtain at least one second quantum operator, wherein the first quantum operator is composed of the tensor product of Pauli operators; the unspliced ​​first quantum operator and the second quantum operator are measured to obtain the first probability distribution corresponding to each, wherein the first probability distribution is used to indicate the state distribution probability of the quantum state on the first quantum operator and the second quantum operator; the first probability distribution is marginalized to obtain the second probability distribution corresponding to each of the at least one first quantum operator, and the expected value corresponding to each of the at least one first quantum operator is determined according to the second probability distribution. The first quantum operator composed of the tensor product of Pauli operators can be spliced ​​according to the preset rules to obtain the second quantum operator to reduce the number of measured quantum operators. When using quantum states, quantum circuits and the first quantum operator and the second quantum operator for measurement, the measurement result of the spliced ​​second quantum operator can be obtained through the quantum circuit, and the obtained first probability distribution is marginalized in the computer to obtain the corresponding second probability distribution, so as to reduce the number of executions of the quantum circuit in the measurement process through the cooperation of traditional computers and quantum computers. This solves the technical problem that the current variational quantum algorithm needs to repeat multiple calculations for each quantum operator, resulting in low execution efficiency of the variational quantum algorithm. This improves the execution efficiency of the variational quantum algorithm in quantum computers.

[0121] Optionally, the splicing module 82 is further used to: splice the first quantum operators that have a commutation relationship with each other in at least one first quantum operator to obtain at least one second quantum operator.

[0122] Optionally, the above-mentioned splicing of first quantum operators that have a commutation relationship with each other in at least one first quantum operator to obtain at least one second quantum operator includes: obtaining a list to be measured, wherein the list to be measured is used to place the first quantum operator and the second quantum operator; traversing at least one first quantum operator, and performing the following operations on each first quantum operator as the quantum operator to be placed: using the first quantum operator or the second quantum operator that has a commutation relationship with the first quantum operator or the second quantum operator currently placed in the list to be measured as the quantum operator to be spliced; splicing the quantum operator to be placed and the quantum operator to be spliced ​​to obtain a second quantum operator, and placing the second quantum operator at the corresponding position of the quantum operator to be spliced ​​in the list to be measured.

[0123] Optionally, the above-mentioned using the first quantum operator or the second quantum operator having a commutation relationship with the first quantum operator or the second quantum operator currently placed in the list to be measured as the quantum operator to be spliced ​​includes: traversing the first quantum operator and the second quantum operator placed in the list to be measured, and performing the following operations: when the positional relationship between the first quantum operator or the second quantum operator and the quantum operator to be placed does not overlap, using the first quantum operator or the second quantum operator as the quantum operator to be spliced, and stopping the traversal of the list to be measured.

[0124] Optionally, the above-mentioned using the first quantum operator or the second quantum operator that has a commutation relationship with the first quantum operator or the second quantum operator currently placed in the list to be measured as the quantum operator to be spliced, further includes: traversing the first quantum operator and the second quantum operator placed in the list to be measured, and performing the following operations: when there is an overlapping part in the position relationship between the first quantum operator or the second quantum operator and the quantum operator to be placed, and the operators corresponding to the overlapping part are the same, using the first quantum operator or the second quantum operator as the quantum operator to be spliced, and stopping the traversal of the list to be measured.

[0125] Optionally, the traversing at least one first quantum operator and performing operations on each first quantum operator as a quantum operator to be placed further includes: traversing the first quantum operator and the second quantum operator placed in the list to be measured, and when there is an overlapping part in the position relationship between the first quantum operator or the second quantum operator and the quantum operator to be placed, and the operators corresponding to the overlapping part are different, adding the quantum operator to be placed to the empty position in the list to be measured.

[0126] Optionally, the traversing of at least one first quantum operator and performing an operation on each first quantum operator as a quantum operator to be placed further includes: adding a first first quantum operator in the at least one first quantum operator to an empty position in the list to be measured.

[0127] Optionally, after obtaining the list to be measured, the method further includes: clearing the quantum operators in the list to be measured and establishing an index list, wherein the index list is used to indicate the positions of all first quantum operators in the list to be measured.

[0128] Optionally, the traversing of at least one first quantum operator and performing an operation on each first quantum operator as a quantum operator to be placed further includes: when placing the quantum operator to be placed in a vacant position of the list to be measured, adding first indication information to the index list, wherein the first indication information corresponds to the length of the list to be measured.

[0129] Optionally, the traversing of at least one first quantum operator and performing operations on each first quantum operator as a quantum operator to be placed further includes: when the second quantum operator is placed at a position corresponding to the quantum operator to be spliced ​​in the list to be measured, adding second indication information to the index list, wherein the second indication information corresponds to the quantum operator to be spliced.

[0130] Optionally, the measurement module 84 is further used to measure the quantum bits in the quantum state and the unconnected first quantum operator and the second quantum operator according to corresponding positions to obtain a first probability distribution of the bit string.

[0131] Optionally, before measuring the quantum bits in the quantum state and the unspliced ​​first quantum operator and the second quantum operator according to corresponding positions, the method further includes: passing the quantum bits in the quantum state corresponding to the X basis and the Y basis through a single-bit rotation gate to obtain an updated quantum state.

[0132] Optionally, the above-mentioned expectation value calculation module 86 is further used to: determine the first quantum operator corresponding to the second quantum operator; and sum the probability values ​​​​except the first quantum operator to obtain a second probability distribution corresponding to the first quantum operator.

[0133] Optionally, the above-mentioned expected value calculation module 86 is further used to: perform weighted summation of the second probability distribution corresponding to the first quantum operator and the corresponding eigenvalue to obtain the expected value corresponding to the first quantum operator.

[0134] Optionally, after determining the expected value corresponding to at least one first quantum operator according to the second probability distribution, the method further includes: linearly combining the expected values ​​corresponding to the first quantum operators to obtain the expected value of the Hamiltonian corresponding to the quantum state.

[0135] Optionally, after obtaining the expected value of the Hamiltonian corresponding to the quantum state, the method further includes: updating the parameters of the quantum circuit using the expected value of the Hamiltonian, and obtaining an updated quantum state using the quantum circuit after the parameter update, until the objective function value corresponding to the quantum state meets a preset threshold.

[0136] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination. For example, the above splicing module and the expected value calculation module are in one processor, and the measurement module is in another processor.

[0137] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0138] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0139] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0140] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0141] An embodiment of the present application further provides a computer program product, comprising a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program product, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0142] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0143] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0144] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for measuring a quantum operator, characterized in that: The method comprises: splicing at least one first quantum operator that satisfies a preset condition among at least one first quantum operator to obtain at least one second quantum operator, wherein the first quantum operator is composed of a tensor product of Pauli operators; Measuring the first quantum operator and the second quantum operator that are not spliced ​​together to obtain first probability distributions corresponding to each of them, wherein the first probability distribution is used to indicate the state distribution probability of the quantum state on the first quantum operator and the second quantum operator; The first probability distribution is marginalized to obtain a second probability distribution corresponding to each of the at least one first quantum operators, and the expected value corresponding to each of the at least one first quantum operators is determined according to the second probability distribution.

2. The method according to claim 1, characterized in that The step of splicing at least one first quantum operator that satisfies a preset condition in at least one first quantum operator to obtain at least one second quantum operator comprises: The at least one second quantum operator is obtained by splicing the first quantum operators that have a commutation relationship with each other in the at least one first quantum operator.

3. The method according to claim 2, characterized in that The step of splicing the at least one first quantum operator that has a commutation relationship with each other to obtain the at least one second quantum operator comprises: Acquire a list of items to be measured, wherein the list of items to be measured is used to place the first quantum operator and the second quantum operator; Traverse the at least one first quantum operator, and perform the following operations on each of the first quantum operators as a quantum operator to be placed: Using the first quantum operator or the second quantum operator having a commutation relationship among the first quantum operator or the second quantum operator currently placed in the to-be-measured list as the quantum operator to be spliced; The quantum operator to be placed is concatenated with the quantum operator to be spliced ​​to obtain the second quantum operator, and the second quantum operator is placed at the position corresponding to the quantum operator to be concatenated in the list to be measured.

4. The method according to claim 3, characterized in that The step of using the first quantum operator or the second quantum operator having a commutation relationship with the first quantum operator or the second quantum operator currently placed in the to-be-measured list as the quantum operator to be spliced ​​comprises: The first quantum operator and the second quantum operator placed in the list to be measured are traversed, and the following operations are performed: When the position relationship between the first quantum operator or the second quantum operator and the quantum operator to be placed does not overlap, the first quantum operator or the second quantum operator is used as the quantum operator to be spliced, and the traversal of the list to be measured is stopped.

5. The method according to claim 3, characterized in that: The step of using the first quantum operator or the second quantum operator having a commutation relationship with the first quantum operator or the second quantum operator currently placed in the list to be measured as the quantum operator to be spliced ​​further includes: The first quantum operator and the second quantum operator placed in the list to be measured are traversed, and the following operations are performed: When there is an overlapping part in the position relationship between the first quantum operator or the second quantum operator and the quantum operator to be placed, and the operators corresponding to the overlapping part are the same, the first quantum operator or the second quantum operator is used as the quantum operator to be spliced, and the traversal of the list to be measured is stopped.

6. The method according to claim 3, characterized in that The traversing the at least one first quantum operator and performing an operation on each of the first quantum operators as a quantum operator to be placed further includes: The first quantum operator and the second quantum operator placed in the list to be measured are traversed, and when there is an overlapping part in the position relationship between the first quantum operator or the second quantum operator and the quantum operator to be placed, and the operators corresponding to the overlapping part are different, the quantum operator to be placed is added to the empty position in the list to be measured.

7. The method according to claim 3, characterized in that The traversing the at least one first quantum operator and performing an operation on each of the first quantum operators as a quantum operator to be placed further includes: A first one of the at least one first quantum operator is added to an empty position in the list to be measured.

8. The method according to any one of claims 3 to 7, characterized in that After obtaining the list to be measured, the method includes: The quantum operators in the to-be-measured list are cleared, and an index list is established, wherein the index list is used to indicate the positions of all the first quantum operators in the to-be-measured list.

9. The method according to claim 8, characterized in that The traversing the at least one first quantum operator and performing an operation on each of the first quantum operators as a quantum operator to be placed further includes: In the case where the quantum operator to be placed is placed in a vacant position of the list to be measured, first indication information is added to the index list, wherein the first indication information corresponds to the length of the list to be measured.

10. The method according to claim 8, characterized in that The traversing the at least one first quantum operator and performing an operation on each of the first quantum operators as a quantum operator to be placed further includes: In the case where the second quantum operator is placed at a position corresponding to the quantum operator to be spliced ​​in the list to be measured, second indication information is added to the index list, wherein the second indication information corresponds to the quantum operator to be spliced.

11. The method according to claim 1, characterized in that: The measuring the first quantum operator and the second quantum operator which are not spliced ​​together to obtain the first probability distributions corresponding to each of them includes: The quantum bits in the quantum state and the unspliced ​​first quantum operator and the second quantum operator are measured at corresponding positions to obtain the first probability distribution of the bit string.

12. The method according to claim 11, characterized in that Before measuring the quantum bit in the quantum state and the unjoined first quantum operator and the second quantum operator according to corresponding positions, the method comprises: The quantum bits corresponding to the X basis and the Y basis in the quantum state are passed through a single-bit rotation gate to obtain an updated quantum state.

13. The method according to claim 1, characterized in that The step of marginalizing the first probability distribution to obtain a second probability distribution corresponding to each of the at least one first quantum operators comprises: determining the first quantum operator corresponding to the second quantum operator; The probability values ​​excluding the first quantum operator are summed to obtain the second probability distribution corresponding to the first quantum operator.

14. The method according to claim 1, characterized in that Determining the expected value corresponding to each of the at least one first quantum operators according to the second probability distribution includes: The expected value corresponding to the first quantum operator is obtained by weighted summing the second probability distribution and the corresponding eigenvalue corresponding to the first quantum operator.

15. The method according to claim 1, characterized in that After determining the expected value corresponding to each of the at least one first quantum operators according to the second probability distribution, the method further comprises: The expectation values ​​corresponding to the first quantum operators are linearly combined to obtain the expectation value of the Hamiltonian corresponding to the quantum state.

16. The method according to claim 15, characterized in that After obtaining the expected value of the Hamiltonian corresponding to the quantum state, the method further comprises: The parameters of the quantum circuit are updated using the expected value of the Hamiltonian, and an updated quantum state is obtained using the quantum circuit after the parameter update, until the objective function value corresponding to the quantum state meets a preset threshold.

17. A device for measuring a quantum operator, characterized in that: The device comprises: A splicing module, used for splicing at least one first quantum operator that meets a preset condition in at least one first quantum operator to obtain at least one second quantum operator, wherein the first quantum operator is composed of a tensor product of Pauli operators; A measurement module, used to measure the first quantum operator and the second quantum operator that are not spliced ​​together to obtain first probability distributions corresponding to each of them, wherein the first probability distribution is used to indicate the state distribution probability of the quantum state on the first quantum operator and the second quantum operator; An expectation value calculation module is used to marginalize the first probability distribution to obtain a second probability distribution corresponding to each of the at least one first quantum operators, and determine the expectation value corresponding to each of the at least one first quantum operators according to the second probability distribution.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method according to any one of claims 1 to 16 when executed by a processor.

19. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 16 are implemented.

20. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 16 are implemented.

Citation Information

Patent Citations

  • Quantum computer performance determination method and device, electronic equipment and medium

    CN115329972A

  • Information processing method and device based on quantum system, electronic equipment and medium

    CN116502721A

  • Method for determining quantum interference and related equipment

    CN116957090A

  • Multi-body ground state quantum fidelity acquisition method, terminal and readable storage medium

    CN117575035A

  • Method for measuring Hamiltonian expected value of physical system and related device

    CN117634622A