Quantum operator measurement method and device, 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.

CN119476518BActive Publication Date: 2025-05-20SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510061949.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-05-20
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 the expected value of the quantum operator is determined through marginalization processing.

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 CN119476518B_ABST
    Figure CN119476518B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method and device for measuring a quantum operator, a storage medium and a program product, which relates to the field of quantum technology, including: splicing at least one first quantum operator that satisfies a preset condition 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 ​​to obtain the first probability distribution corresponding to each; marginalizing the first probability distribution to obtain the second probability distribution corresponding to each of the at least one first quantum operator, and determining the expected value corresponding to each of the at least one first quantum operator according to the second probability distribution. The above scheme is adopted to solve the technical problem in the related technology 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.
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 technologies, and more specifically, to a method and apparatus for measuring a quantum operator, a storage medium, and a program product. Background Art

[0002] An algorithm that uses a quantum computing framework to solve specific problems is called a quantum algorithm, and the quantum algorithm can achieve an acceleration effect relative to a classical algorithm when solving certain specific problems. However, to implement these algorithms and demonstrate their advantages, a quantum computer is indispensable. Nowadays, quantum algorithms designed for the limited performance of medium-scale noisy quantum (NISQ) devices are rapidly developing, such as variational quantum algorithms, quantum annealing, etc.

[0003] In the related art, the process of the variational quantum algorithm is mainly as follows: encoding the target problem into a target function; constructing a quantum circuit; measuring the output quantum state of the quantum circuit to obtain a measurement result; and updating the parameters using a parameter optimizer. In the above quantum measurement process, the expected value of the quantum operator needs to be obtained. Obtaining the expected value of the quantum operator can be to calculate the expected value of each quantum operator in each sampling process, and finally taking the mean of the expected values corresponding to each quantum operator as its expected value. In this process, it is necessary to perform the calculation of the expected value of the sampling times for each quantum operator, and the calculation amount is large and the operation efficiency is low.

[0004] In view of the technical problem in the related art that the current variational quantum algorithm needs to repeat the calculation 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 method and apparatus for measuring a quantum operator, a storage medium, and a program product, so as to at least solve the technical problem in the related art that the current variational quantum algorithm needs to repeat the calculation for each quantum operator, resulting in low execution efficiency of the variational quantum algorithm.

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

[0007] In an exemplary embodiment, the above-mentioned splicing of first quantum operators that meet a preset condition among at least one first quantum operator to obtain at least one second quantum operator includes: splicing first quantum operators that have a commutation relationship with each other among at least one first quantum operator 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 among at least one first quantum operator to obtain at least one second quantum operator includes: obtaining a list of measurements to be made, where the list of measurements to be made is used to place the first quantum operators and the second quantum operators; traversing at least one first quantum operator, and performing the following operations for each first quantum operator as the quantum operator to be placed: taking the first quantum operator or the second quantum operator that has a commutation relationship with the currently placed first quantum operator or second quantum operator in the list of measurements to be made 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 the corresponding position of the quantum operator to be spliced in the list of measurements to be made.

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

[0010] In an exemplary embodiment, for the first or second quantum operator having a commutation relation among the first or second quantum operators currently placed in the list of observables to be measured, as the quantum operator to be spliced, it further includes: traversing the first and second quantum operators placed in the list of observables to be measured, and performing the following operations: when there is an overlapping part in the positional relationship between the first or second quantum operator and the quantum operator to be placed, and the operators corresponding to the overlapping part of the positions are the same, taking the first or second quantum operator as the quantum operator to be spliced, and stopping the traversal of the list of observables to be measured.

[0011] In an exemplary embodiment, for the above-mentioned traversing at least one first quantum operator and performing operations with each first quantum operator as the quantum operator to be placed, it further includes: traversing the first and second quantum operators placed in the list of observables to be measured. When there is an overlapping part in the positional relationship between the first or second quantum operator and the quantum operator to be placed, and the operators corresponding to the overlapping part of the positions are different, adding the quantum operator to be placed to the empty position in the list of observables to be measured.

[0012] In an exemplary embodiment, for the above-mentioned traversing at least one first quantum operator and performing operations with each first quantum operator as the quantum operator to be placed, it further includes: adding the first first quantum operator among the at least one first quantum operators to the empty position in the list of observables to be measured.

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

[0014] In an exemplary embodiment, for the above-mentioned traversing at least one first quantum operator and performing operations with each first quantum operator as the quantum operator to be placed, it further includes: when placing the quantum operator to be placed in the empty position in the list of observables to be measured, adding first indication information to the index list, where the first indication information corresponds to the length of the list of observables to be measured.

[0015] In an exemplary embodiment, for the above-mentioned traversing at least one first quantum operator and performing operations with each first quantum operator as the quantum operator to be placed, it further includes: when placing the second quantum operator at the position corresponding to the quantum operator to be spliced in the list of observables to be measured, adding second indication information to the index list, where the second indication information corresponds to the quantum operator to be spliced.

[0016] In an exemplary embodiment, the above measurement of the unspliced first quantum operator and second quantum operator to obtain their respective corresponding first probability distributions includes: measuring the qubits in the quantum state and the unspliced first quantum operator and second quantum operator according to the corresponding positions to obtain the first probability distribution of the bit strings.

[0017] In an exemplary embodiment, before the above measurement of the qubits in the quantum state and the unspliced first quantum operator and second quantum operator according to the corresponding positions, it includes: passing the qubits corresponding to the X basis and Y basis in the quantum state through single-bit rotation gates to obtain an updated quantum state.

[0018] In an exemplary embodiment, the above marginalization of the first probability distribution to obtain the second probability distribution corresponding to each of at least one first quantum operator includes: determining the corresponding first quantum operator in the second quantum operator; summing the probability values except for the first quantum operator to obtain the second probability distribution corresponding to the first quantum operator.

[0019] In an exemplary embodiment, the above determination of the expectation value corresponding to each of at least one first quantum operator according to the second probability distribution includes: performing a weighted sum of the second probability distribution corresponding to the first quantum operator and the corresponding eigenvalue to obtain the expectation value corresponding to the first quantum operator.

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

[0021] In an exemplary embodiment, after the above obtaining of the expectation value of the Hamiltonian corresponding to the quantum state, it includes: updating the parameters of the quantum circuit using the expectation value of the Hamiltonian, and obtaining an updated quantum state using the quantum circuit with updated parameters until the objective function value corresponding to the quantum state satisfies a preset threshold.

[0022] According to another embodiment of the present application, there is provided a measurement device for quantum operators, including: a splicing module, configured to splice at least one first quantum operator that meets a preset condition among at least one first quantum operator to obtain at least one second quantum operator, where the first quantum operator is composed of a tensor product of Pauli operators; a measurement module, configured to measure the unspliced first quantum operator and second quantum operator to obtain their respective corresponding first probability distributions, where 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, configured to marginalize the first probability distribution to obtain the second probability distribution corresponding to each of at least one first quantum operator, and determine the expectation value corresponding to each of 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 further provided. A computer program is stored in the computer-readable storage medium. Wherein, the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0024] According to another embodiment of the present application, an electronic device is further provided, including a memory and a processor. A computer program is stored in the memory. 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 further provided, including a computer program. The steps of the methods in the various embodiments of the present application are implemented when the computer program is executed by a processor.

[0026] Through the present application, at least one second quantum operator is obtained by splicing first quantum operators that meet preset conditions among at least one first quantum operator. Wherein, the first quantum operator is composed of a tensor product of Pauli operators; the un-spliced first quantum operators and the second quantum operators are measured 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; 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 expectation 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 a preset rule to obtain a second quantum operator, so as to reduce the number of quantum operators to be measured. When measuring using a quantum state, a quantum circuit, a first quantum operator, and a second quantum operator, 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 a computer to obtain the corresponding second probability distribution, so as to cooperate with a traditional computer and a quantum computer to reduce the number of executions of the quantum circuit during the measurement process. It solves the technical problem that the current variational quantum algorithm needs to repeatedly calculate each quantum operator multiple times, resulting in a low execution efficiency of the variational quantum algorithm. The execution efficiency of the variational quantum algorithm in a quantum computer is improved. Description of the Drawings

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

[0028] Figure 2 is a flowchart of an optional method for measuring a quantum operator according to an embodiment of the present application;

[0029] Figure 3Schematic diagram of an optional method for measuring a quantum operator according to an embodiment of the present application;

[0030] Figure 4 Schematic diagram of another optional method for measuring a quantum operator according to an embodiment of the present application;

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

[0032] Figure 6 Schematic diagram of yet another optional method for measuring a quantum operator according to an embodiment of the present application;

[0033] Figure 7 Schematic diagram of an optional state of a qubit according to an embodiment of the present application;

[0034] Figure 8 Structural block diagram of an optional measurement device for a quantum operator according to an embodiment of the present application. Detailed implementation manners

[0035] In the following, embodiments of the present application will be described in detail with reference to the accompanying drawings and in conjunction with embodiments.

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

[0037] The method embodiments provided in the embodiments of the present application can be executed on a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 Hardware structural block diagram of an optional method for measuring a quantum operator according to an embodiment of the present application. As Figure 1 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 (as Figure 1 shown, taking this target program as an example of a program that can perform quantum operations). The above-mentioned 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-based human-computer interaction operations on different information. The processor is used to generate an interaction instruction in response to the above-mentioned 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 and the expected value corresponding to the quantum operator.

[0038] As Figure 1As shown, in the terminal device 102, step S102 is executed to splice the first quantum operators that meet the preset conditions among at least one first quantum operator to obtain at least one second quantum operator, where 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 their respective corresponding first probability distributions, where 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 steps S110 and S112 to marginalize the first probability distribution to obtain the second probability distribution corresponding to each of at least one first quantum operator, and determine the expected value corresponding to each of at least one first quantum operator according to the second probability distribution.

[0039] Optionally, in this embodiment, the above terminal device 102 may be a terminal device configured with a target program, and may include but are not limited to at least one of the following: mobile phone (such as Android mobile phone, iOS mobile phone, etc.), laptop computer, tablet computer, handheld computer, MID (Mobile Internet Devices), PAD, desktop computer, smart TV, etc. The quantum computer 110 may be a device that executes quantum algorithms and quantum computing tasks, and it can perform a large number of quantum operator measurements. It can implement basic quantum rotation gates and has the ability to jointly read the qubit states. The quantum computer 110 may be the entire system composed of a quantum chip and measurement and control equipment in a laboratory, or it may be the operation interface of a real quantum machine. The above is only an example, and this embodiment does not make any limitation thereto.

[0040] Through this application, at least one second quantum operator is obtained by splicing first quantum operators that meet preset conditions among at least one first quantum operator, where the first quantum operator is composed of a tensor product of Pauli operators; the unspliced first quantum operators and the second quantum operators are measured to obtain their respective corresponding first probability distributions, where 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 at least one first quantum operator, and the expectation value corresponding to each of 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 a preset rule to obtain a second quantum operator, so as to reduce the number of quantum operators to be measured. When measuring using a quantum state, a quantum circuit, a first quantum operator, and a second quantum operator, 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 a computer to obtain the corresponding second probability distribution, so as to cooperate with a traditional computer and a quantum computer to reduce the number of executions of the quantum circuit during the measurement process. It solves the technical problem that the current variational quantum algorithm needs to repeat calculations for each quantum operator multiple times, resulting in a low execution efficiency of the variational quantum algorithm. The execution efficiency of the variational quantum algorithm in a quantum computer is improved.

[0041] In this embodiment, a method for measuring a quantum operator is provided. Figure 2 It is a flowchart of an optional method for measuring a quantum operator according to an embodiment of the present application, as Figure 2 shown. The method for measuring a quantum operator includes:

[0042] Step S202, at least one second quantum operator is obtained by splicing first quantum operators that meet preset conditions among at least one first quantum operator, where the first quantum operator is composed of a tensor product of Pauli operators;

[0043] It should be noted that a quantum operator can be regarded as a linear mapping from a linear space V to M. The simplest quantum operation is the identity operator (denoted as I). Applying the identity operation to any quantum state, the result is still 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 a tensor product of Pauli operators and is represented by a Pauli operator and the qubit space (position) on which it acts. 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 identity operator, and the matrix representation of the Pauli operator can be as follows:

[0045]

[0046]

[0047]

[0048] In an alternative embodiment, the first quantum operators that meet the preset conditions can be concatenated to obtain a second quantum operator. By concatenating the first quantum operators, Pauli operators acting on different qubit spaces can be concatenated together. For example, by concatenating the first quantum operators "X0 Y2" and "X1 Z3", the second quantum operator "X0 X1 Y2 Z3" can be obtained.

[0049] Step S204: Measure the unconcatenated first quantum operator and the second quantum operator to obtain their respective corresponding first probability distributions, where 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 alternative embodiment, in the quantum system to be measured, a specific quantum state needs to be prepared, which can be a quantum state obtained after quantum operations on the initial state. Then, determine the quantum operators to be measured for the quantum state. The unconcatenated first quantum operator and the second quantum operator can be traversed to determine the measurement results of the quantum state on each quantum operator. Measurement will cause the quantum state to collapse to an eigenstate of the quantum operator and randomly obtain a result. For each qubit in the quantum state, there are usually two possible measurement results: 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 appearing can be estimated as the first probability distribution.

[0052] Step S206: Marginalize the first probability distribution to obtain the second probability distribution corresponding to each of at least one first quantum operator, and determine the expectation value corresponding to each of at least one first quantum operator according to the second probability distribution.

[0053] It should be noted that in the first probability distribution, there is a probability distribution corresponding to the first quantum operator and a probability distribution corresponding to the second quantum operator. The second quantum operator is obtained by concatenating 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 alternative embodiment, after determining the second probability distribution corresponding to each first quantum operator, the respective expected values can be determined according to the corresponding bit strings and the second probability distribution. The specific process of solving the expected value will be described in detail below and will not be elaborated here.

[0055] Through the present application, at least one second quantum operator is obtained by splicing first quantum operators that meet a preset condition among at least one first quantum operator, where the first quantum operator is composed of a tensor product of Pauli operators; the first probability distribution corresponding to each of the unspliced first quantum operators and the second quantum operator is obtained by measurement, where 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 at least one first quantum operator, and the respective expected values of at least one first quantum operator are determined according to the second probability distribution. The first quantum operator composed of the tensor product of Pauli operators can be spliced according to a preset rule to obtain a second quantum operator, so as to reduce the number of quantum operators to be measured. When measuring using a quantum state, a quantum circuit, a first quantum operator, and a second quantum operator, the measurement result of the spliced second quantum operator can be obtained through the quantum circuit, and the obtained first probability distribution can be marginalized in a computer to obtain the corresponding second probability distribution, so as to cooperate with a traditional computer and a quantum computer to reduce the number of executions of the quantum circuit during the measurement process. The technical problem that the current variational quantum algorithm needs to repeatedly calculate each quantum operator multiple times, resulting in a low execution efficiency of the variational quantum algorithm, is solved. The execution efficiency of the variational quantum algorithm in a quantum computer is improved.

[0056] In an alternative embodiment, the obtaining of at least one second quantum operator by splicing first quantum operators that meet a preset condition among at least one first quantum operator includes: splicing first quantum operators that have a commutation relationship with each other among at least one first quantum operator to obtain at least one second quantum operator.

[0057] In an alternative embodiment, first quantum operators with a commutation relationship can be measured in the same measurement basis. After measuring one first quantum operator, the eigenstate to which the system state collapses is also a definite eigenstate of the other first quantum operator, so that the measurement result of the second first quantum operator can be known without actually performing the measurement. If two quantum operators A and B satisfy the commutation relationship AB = BA, then it can be shown that the two first quantum operators have a commutation relationship with each other. Splicing first quantum operators that have a commutation relationship with each other to obtain a second quantum operator can measure the second quantum operator to achieve a combined measurement of the spliced first quantum operators.

[0058] Through the above embodiments of the present application, before measuring the first quantum operator, the first quantum operators that satisfy the commutation relation are spliced to obtain a second quantum operator, so that measuring the second quantum operator can perform a combined measurement on the spliced first quantum operators, thereby reducing the number of Pauli operators to be measured, reducing the number of executions of the quantum circuit, and improving the measurement efficiency.

[0059] In an alternative embodiment, splicing the first quantum operators that have a commutation relation with each other among at least one first quantum operator to obtain at least one second quantum operator includes: obtaining a list of measurements to be made, where the list of measurements to be made is used to place the first quantum operators and the second quantum operators; traversing at least one first quantum operator, and performing the following operations on each first quantum operator as the quantum operator to be placed: taking the first quantum operator or the second quantum operator that has a commutation relation with the currently placed first quantum operator or second quantum operator in the list of measurements to be made 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 the position corresponding to the quantum operator to be spliced in the list of measurements to be made.

[0060] In an alternative embodiment, a list of measurements to be made can be obtained to place the first quantum operators or the second quantum operators, so as to determine the measurement order of the first quantum operators or the second quantum operators. For example, a measurement basis list (measure_basis) can be set.

[0061] In an alternative embodiment, the first quantum operators can be traversed one by one, and each first quantum operator is used as the quantum operator to be placed. Determine the position of the quantum operator to be placed in the list of measurements to be made, and judge whether there is a quantum operator to be spliced that has a commutation relation with the quantum operator to be placed according to the placement order of the list of measurements to be made.

[0062] Figure 3 is a schematic diagram of an alternative method for measuring a quantum operator according to an embodiment of the present application; as Figure 3 shown, the list of measurements to be made can be a list with a fixed length (such as a length of n) or a variable length (such as the current length of n). The first quantum operators or the second quantum operators can be placed in the list of measurements to be made. It can be judged whether the quantum operators stored in the list of measurements to be made 302 have quantum operators to be spliced that have a commutation relation with the quantum operator to be placed 304, and the judgment can be made one by one according to the order of the list of measurements to be made, as Figure 3As shown, the quantum operators at position 1 and position 3 in the list to be measured 302 both have a commutation relationship with the quantum operator to be placed 304. During the process of traversing the list, when it is determined that the quantum operator at position 1 has a commutation relationship, it can be used as the quantum operator to be spliced. The quantum operator to be placed 304 is spliced with the quantum operator to be spliced to obtain a second quantum operator, which is placed at position 1. Then the traversal is stopped, and there is no need to judge the subsequent positions.

[0063] Through the above implementation manners of the present application, by setting the list to be measured, an orderly judgment can be made on whether there is a first quantum operator or a second quantum operator having a commutation relationship with the first quantum operator, avoiding situations such as repeated judgment or missed judgment, and improving the accuracy of combining quantum operators.

[0064] In an alternative implementation manner, the above-mentioned first quantum operator or second quantum operator having a commutation relationship in the first quantum operator or second quantum operator currently placed in the list to be measured is used as the quantum operator to be spliced, including: 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, 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.

[0065] In an alternative implementation manner, it can be judged whether the positions of the bit spaces where the first quantum operator or the second quantum operator in the list to be measured acts on the quantum operator to be placed do not overlap, that is, it can be judged 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 alternative measurement method of quantum operators according to an embodiment of the present application; as Figure 4 shown, the positions of the bit spaces where the quantum operator to be placed 404 "X1 Z4" acts on the quantum operator "X0 Y2 Z3" at position 0 in the list to be measured 402 do not overlap, and their intersection is empty. It can be considered that there is a commutation relationship. The quantum operator to be placed 404 can be spliced with the quantum operator "X0 Y2 Z3" at position 0 to obtain a second quantum operator "X0 X1 Y2 Z3 Z4" and place it at position 0.

[0067] Through the above implementation manners 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 where the two quantum operators act overlap. In the case of non-overlap, it is directly determined that there is a commutation relationship, which speeds up the determination speed of the commutation relationship before splicing and improves the measurement efficiency of quantum operators.

[0068] In an alternative embodiment, for the first or second quantum operator having a commutation relation among the first or second quantum operators currently placed in the list of quantities to be measured, which is used as the quantum operator to be spliced, the method further includes: traversing the first and second quantum operators placed in the list of quantities to be measured, and performing the following operations: when there is an overlapping part in the positional relationship between the first or second quantum operator and the quantum operator to be placed, and the corresponding operators at the overlapping part of the positions are the same, taking the first or second quantum operator as the quantum operator to be spliced, and stopping the traversal of the list of quantities to be measured.

[0069] In an alternative embodiment, it is possible to determine whether the positions of the first or second quantum operator in the list of quantities to be measured and the qubit space on which the quantum operator to be placed acts do not overlap. When there is an overlapping position, it is possible to determine whether the Pauli operators at the overlapping part of the positions are the same. Figure 5 It is a schematic diagram of an alternative method for measuring quantum operators with overlapping positions according to an embodiment of the present application; as Figure 5 shown, there is an overlapping position (overlapping at the qubits acting on position 1 and the qubits acting on position 2) between the quantum operator "Y1 Z2 Z3" of the quantum operator 504 to be placed and the quantum operator "X0 Y1 Z2" at position 1 in the list of quantities to be measured 502, and the Pauli operators at the overlapping position are the same. It can be considered that there is a commutation relation. The quantum operator 504 to be placed can be spliced with the quantum operator "X0 Y1 Z2" at position 1 to obtain the second quantum operator "X0Y1 Z2 Z3" and place it at position 1.

[0070] Through the above embodiments of the present application, when determining whether there is a commutation relation between two quantum operators, it is possible to directly determine whether the positions of the qubit spaces on which the two quantum operators act overlap. In the case of overlap, if the partial operators are the same, it is directly determined that there is a commutation relation, which speeds up the determination speed of the commutation relation before splicing and improves the measurement efficiency of the quantum operator.

[0071] In an alternative embodiment, for the above traversing at least one first quantum operator and performing operations with each first quantum operator as the quantum operator to be placed, the method further includes: traversing the first and second quantum operators placed in the list of quantities to be measured. When there is an overlapping part in the positional relationship between the first or second quantum operator and the quantum operator to be placed, and the corresponding operators at the overlapping part of the positions are different, adding the quantum operator to be placed to the empty position in the list of quantities to be measured.

[0072] In an alternative embodiment, it is possible to determine whether the position of the first quantum operator or the second quantum operator in the list of quantum operators to be measured does not coincide with the qubit space on which the quantum operator to be placed acts. In the case where there is a position coincidence, it is possible to determine whether the Pauli operators in the position coincidence part are the same. In the case where they are not the same, it is considered that there is no commutation relation. Figure 6 is a schematic diagram of another alternative method for measuring a quantum operator according to an embodiment of the present application; as Figure 6 shown, the quantum operator to be placed 604 “Y2 X3 X4” traverses the quantum operators in the list of quantum operators to be measured 602. In the case of quantum operators without a commutation relation, the quantum operator to be placed 604 can be placed in the empty position in the list of quantum operators to be measured 602, as Figure 6 the n + 1 position in.

[0073] In an alternative embodiment, the above traversing at least one first quantum operator and performing operations on each first quantum operator as the quantum operator to be placed further includes: adding the first first quantum operator in the at least one first quantum operator to the empty position in the list of quantum operators to be measured.

[0074] In an alternative embodiment, in the case where there is no quantum operator in the list of quantum operators to be measured, the first quantum operator can be directly placed in the empty position, and can be placed at position 0.

[0075] Through the above embodiments of the present application, in the case where there is no quantum operator or no quantum operator with a commutation relation in the list of quantum operators 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. The accuracy of quantum operator measurement is improved.

[0076] In an alternative embodiment, after obtaining the list of quantum operators to be measured, it includes: clearing the quantum operators in the list of quantum operators to be measured and establishing an index list, where the index list is used to indicate the positions of all first quantum operators in the list of quantum operators to be measured.

[0077] In an alternative embodiment, after obtaining the list of quantum operators to be measured, it needs to be initialized and cleared to an empty list. In the process of quantum operator splicing, the quantum operators in the list of quantum operators to be measured and the measurement results are in a one-to-one correspondence relationship, but because there are quantum operators obtained by splicing in the list, therefore, the first quantum operator and the measurement result are not in a one-to-one correspondence relationship. In order to calculate the expectation value of the quantum operator from the measurement result, it is necessary to record the correspondence relationship between the measurement result and the quantum operator in the list of quantum operators to be measured. Therefore, an index list is established to indicate the positions of all first quantum operators in the list of quantum operators to be measured.

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

[0079] In an alternative embodiment, the above traversing at least one first quantum operator and performing operations on each first quantum operator as the quantum operator to be placed further includes: when placing the quantum operator to be placed in the empty position of the list of quantum operators to be measured, adding first indication information to the index list, where the first indication information corresponds to the length of the list of quantum operators to be measured.

[0080] In an alternative embodiment, when there is no quantum operator or no commuting quantum operator in the list of quantum operators to be measured, the first quantum operator can be directly added to the empty position. At this time, the first indication information can be directly added to the index list, and the first indication information can be the length of the current list of quantum operators to be measured minus 1 to determine the position through the first indication information.

[0081] Through the above embodiments of the present application, the position of the first quantum operator added to the empty position can be determined through the first indication information, so that the measurement result corresponds to the first quantum operator subsequently, improving the accuracy of calculating the expected value.

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

[0083] In an alternative embodiment, 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 on which the two quantum operators act coincide. In the case of non - coincidence, it is directly determined that there is a commutation relationship; in the case of coincidence, if some of the operators are the same, it is directly determined that there is a commutation relationship. In the case of having a commutation relationship, the first quantum operator and the quantum operator in the list of quantum operators to be measured are spliced to obtain the second quantum operator. In this case, the position of the quantum operator to be spliced in the list of quantum operators 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 embodiments of the present application, the position of the first quantum operator after splicing can be determined by the second indication information, so that after obtaining the joint measurement result subsequently, the multiple quantum operators corresponding to the joint measurement result can be determined, thereby improving the accuracy of calculating the expectation value of the quantum operator subsequently.

[0085] In an alternative embodiment, the obtaining of the respective corresponding first probability distributions by measuring the unspliced first quantum operator and second quantum operator includes: measuring the qubits in the quantum state and the unspliced first quantum operator and second quantum operator according to the corresponding positions to obtain the first probability distribution of the bit strings.

[0086] In an alternative embodiment, before the qubits in the quantum state are measured with the unspliced first quantum operator and second quantum operator according to the corresponding positions, it includes: passing the qubits corresponding to the X basis and Y basis in the quantum state through single-qubit rotation gates to obtain an updated quantum state.

[0087] Figure 7 is a schematic diagram of the state of an alternative qubit according to an embodiment of the present application; as Figure 7 shown, the qubit v can achieve and a linear combination of two states. The geometric representation can be as Figure 7 shown, Figure 7 which can be the Bloch sphere coordinate system to describe the state of the qubit. When measuring in the Z basis, since the eigenstates of the Z basis are and , which can correspond to the eigenvalues +1 and -1 respectively, no additional operation needs to be performed on the qubit. However, when measuring in the X basis and Y basis, the qubit needs to be rotated to the corresponding measurement basis. For example, when measuring in the X basis, the Ry(-π / 2) gate needs to be used to rotate the qubit for measurement in the X basis. When measuring in the Y basis, the Rx(π / 2) gate needs to be used to rotate the qubit for measurement in the Y basis.

[0088] In one example, when measuring the qubits in the quantum state and the unspliced first quantum operator and second quantum operator according to the corresponding positions, in the case where the quantum operator is "X0 Y1 Z3", can be used to measure the quantum state. In fact, it is operating on a four-qubit system, and each qubit is measured based on a different Pauli operator. Apply to the first qubit, to the second qubit, the identity operator I 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 combinations of bit strings. For example, the probability of the bit string "0101" is the probability of measuring 0 for the first qubit, 1 for the second, 0 for the third, and 1 for the fourth.

[0089] Through the above embodiments of the present application, after the rotation gate acts, measurements are performed to obtain the corresponding probability distribution, so as to subsequently obtain the second probability distribution using the first probability distribution. Realize the measurement of the expectation value of the quantum operator.

[0090] Through the above embodiments of the present application, before passing through the single-bit rotation gate, quantum operators with commutation relations can be spliced. When using the single-bit rotation gate for rotation, the number of times the qubit passes through the single-bit rotation gate can be reduced. For example, when measuring "X0 Y1 Z2" and "Y1 Z2 Z3", without splicing, during measurement, when measuring "X0 Y1 Z2", the qubit needs to pass through the Rx and Ry gates, and when measuring "Y1 Z2 Z3", it needs to pass through the Rx gate. After splicing, when measuring "X0 Y1 Z2 Z3", during each sampling process, it only needs to pass through the Rx and Ry gates and does not need to pass through the Rx gate twice. Reduce the number of times of the quantum circuit executed when measuring the expectation value of the quantum operator, and improve the execution efficiency.

[0091] In an alternative embodiment, the marginalizing the first probability distribution to obtain the second probability distribution corresponding to each of at least one first quantum operator includes: determining the first quantum operator corresponding to the second quantum operator; summing the probability values other than the first quantum operator to obtain the second probability distribution corresponding to the first quantum operator.

[0092] In an alternative 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 splicing the first quantum operators "X0 Y2" and "X1 Z3", then when solving for 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 for 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 alternative embodiment, the position of the quantum operator corresponding to the first probability distribution in the list of observables to be measured can be obtained, and the number of indices corresponding to this position can be determined in the index list. In the case where there are multiple indices indicating this position, it can be determined that the first probability distribution is obtained by measuring the second quantum operator, and it can be determined from the index list which first quantum operators the second quantum operator is composed of.

[0094] Through the above embodiments of the present application, after obtaining the first probability distribution, the first probability distribution corresponding to the second quantum operator obtained by splicing can be marginalized to obtain the second probability distribution corresponding to each first quantum operator, so as to facilitate the subsequent measurement of the expectation value of each first quantum operator.

[0095] In an alternative embodiment, determining the expectation value corresponding to each of at least one first quantum operator according to the second probability distribution includes: performing a weighted sum of the second probability distribution corresponding to the first quantum operator and the corresponding eigenvalue to obtain the expectation value corresponding to the first quantum operator.

[0096] In an alternative embodiment, if the first quantum operator is "X0 Y1 Z2", and the bit string "101" is obtained by measurement with a probability of 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 contributions of all bit strings to the expectation value are determined using the second probability distribution corresponding to the first quantum operator to obtain the expectation value corresponding to the first quantum operator.

[0097] Through the above embodiments of the present application, the expectation value corresponding to the first quantum operator can be determined according to the first quantum operator and the corresponding second probability distribution. During the process, the index list can be used to determine the second probability distribution corresponding to the first quantum operator to improve the accuracy of the measurement.

[0098] In an alternative embodiment, after determining the expectation value corresponding to each of at least one first quantum operator according to the second probability distribution, it includes: performing a linear combination of the expectation values corresponding to each of the first quantum operators to obtain the expectation value of the Hamiltonian corresponding to the quantum state.

[0099] In an alternative embodiment, the Hamiltonian can be a linear combination of the first quantum operators, and the expectation value of the quantum state under the system Hamiltonian is the energy of this quantum state in this system.

[0100] In an alternative embodiment, after obtaining the expectation value of the Hamiltonian corresponding to the quantum state, the method includes: updating the parameters of the quantum circuit using the expectation value of the Hamiltonian, and obtaining an updated quantum state using the quantum circuit with updated parameters 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, and the expectation value reflects the specific value of the physical quantity corresponding to the current state. For example, the expectation value of a quantum state under the system Hamiltonian is the energy of this quantum state in such a system. The reason it is called the expectation value is due to the superposition property of the quantum state, which appears in the corresponding eigenstates with corresponding probabilities. And each eigenstate has a corresponding value. The expectation value is the average of all superposition components.

[0102] It should be noted that if measurements can be made in the eigenstates of the operator, the probability distribution can be obtained through sampling, and then the expectation value can be obtained in combination with the eigenvalues of the Hamiltonian. However, in the actual process, the eigeninformation of the Hamiltonian is unknown. The Hamiltonians usually encountered are linear combinations of tensor products of Pauli operators. The expectation values of each tensor product of Pauli operators can be measured, and then the final expectation value can be obtained through linear combination.

[0103] It should be noted that in general, measurements are based on the computational basis and are performed, that is, the eigenstates of Z. Since the Hamiltonian expanded as a direct product of Pauli matrices also contains X and Y, a basis transformation is required. To make the expectation value of the transformed quantum state in the Z direction equal to the required result. Through the embodiments of the application, the first quantum operator composed of the tensor product of Pauli operators can be spliced according to a preset rule to obtain a second quantum operator, so as to reduce the number of quantum operators to be measured. When measuring using the quantum state, the quantum circuit, the first quantum operator, and the second quantum operator, the measurement result of the spliced second quantum operator can be obtained through the quantum circuit, and the obtained first probability distribution can be 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 a traditional computer and a quantum computer. This solves the technical problem that the current variational quantum algorithm needs to repeatedly calculate each quantum operator multiple times, resulting in a low execution efficiency of the variational quantum algorithm. It improves the execution efficiency of the variational quantum algorithm in a quantum computer.

[0104] In an alternative embodiment, the technical problem to be solved can be encoded as an objective function O. This transforms 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, a quantum circuit U(θ) is constructed. The quantum circuit is the final model for solving the target problem. When the value of θ makes the objective function reach its minimum (or maximum), the quantum circuit model U(θ) becomes a quantum machine learning model that can solve the target problem. During the calculation of the objective function, quantum measurement is required. The output quantum state of the quantum circuit is measured to obtain a classical measurement result, and the objective function O is calculated. Then, a classical parameter optimizer is used to update the parameters.

[0105] Quantum operations have the characteristic of parallelism. Therefore, quantum computing has more advantages in terms of quantum state preparation and loss function acquisition. The idea of variational quantum algorithms is to replace these processes with those executed by a quantum computer in the hope of demonstrating quantum advantage, while the parameter optimization part is still implemented by a more suitable classical computer.

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

[0107] Through this application, at least one second quantum operator is obtained by splicing first quantum operators that meet preset conditions among at least one first quantum operator, where the first quantum operator is composed of the tensor product of Pauli operators; the unspliced first quantum operators and the second quantum operators are measured to obtain their respective corresponding first probability distributions, where 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 at least one first quantum operator, and the expectation value corresponding to each of 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 a preset rule to obtain a second quantum operator, so as to reduce the number of quantum operators to be measured. When measuring using a quantum state, a quantum circuit, the first quantum operator, and the second quantum operator, 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 a computer to obtain the corresponding second probability distribution, so as to cooperate with a traditional computer and a quantum computer to reduce the number of executions of the quantum circuit during the measurement process. It solves the technical problem that the current variational quantum algorithm needs to repeatedly calculate each quantum operator, resulting in a low execution efficiency of the variational quantum algorithm. The execution efficiency of the variational quantum algorithm in the quantum computer is improved. The larger the number of samplings, compared with the effects of related technologies, the more obvious the efficiency improvement.

[0108] In an alternative embodiment, the above measurement method of the quantum operator can be applied to simulate a quantum chemical system, such as the solution of the ground state and excited state energies of a molecule. Or for the simulation of many-body physical systems, numerical calculations and other fields.

[0109] In an alternative embodiment, the ground state of a quantum system can be solved. The orbital positions of the electrons in a 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 this quantum system is H, it is desired to obtain a parameterized quantum circuit model. After inputting the initial state into the quantum circuit model, the ground state of the hydrogen molecule is output. The problem can be encoded as an objective function , where is the output state of the quantum circuit. The objective function O represents the energy of the quantum system in the quantum state , the smaller the value, the lower the energy, and the closer it is to the ground state of the quantum system. Starting from a random quantum circuit parameter, the objective function O can be minimized by updating the parameter, and finally the optimal circuit model is obtained. The output of this quantum circuit corresponds to the ground state.

[0110] In an alternative embodiment, it can be applied in the scenario of many-body physical system simulation. In the field of many-body physics, in addition to solving the ground state, variational quantum algorithms can also be used to solve the excited states. Based on the fact that the Hamiltonian is a Hermitian operator and its eigenstates are mutually orthogonal, after obtaining the ground state, the lowest energy point, i.e., the first excited state, can be found in its orthogonal subspace. Based on the property that unitary transformations preserve the inner product of quantum states, some orthogonal quantum states can be prepared first, and then the ansatz circuit is applied to these quantum states and the linear combination of the energies corresponding to these mutually orthogonal ansatzes is used as the loss function. By optimization, several eigenstates of the lowest energy levels can be obtained. In the field of many-body physics, the applications of variational quantum algorithms also include simulating molecular vibrations, nuclear vibrations, linear responses, and molecular dynamics processes, etc.

[0111] In an alternative embodiment, it can be applied in the scenario of numerical calculation. Mathematically, solving the ground state problem of the Hamiltonian of a many-body physical system is equivalent to solving the problem of the smallest eigenvalue and eigenvector of a Hermitian matrix. Based on this, variational quantum algorithms can be applied to numerical calculation tasks. Based on the property that the singular vectors of a matrix are mutually orthogonal, the ansatzes of the left and right singular vectors can be prepared separately, and the largest several singular values of the matrix can be obtained through optimization, so as to perform principal component analysis on the matrix. Solving equations is also one of the most common applications in numerical calculation. By transforming the equation-solving problem into an optimization problem, variational quantum algorithms can solve it. Based on the property that differential equations are easy to verify, ansatzes can be prepared and the expected values of some Hamiltonians can be selected as the ansatzes of the equation solutions. By optimization, the ansatz curves can be made to satisfy the equation as much as possible.

[0112] Through the above embodiments of the present application, the CPU can be used to splice the first quantum operators with commutation relations in a computer to obtain the second quantum operator. The first quantum operator and the second quantum operator can be stored in the measurement list, 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 a quantum operator, in each sampling process, for the second quantum operator, only one quantum circuit needs to be executed, and it is not necessary to execute all the quantum circuits for the first quantum operator, which reduces the number of quantum circuits executed when measuring the quantum operator and improves the execution efficiency. Moreover, by cooperating with the index list and the measurement list, the joint probability distribution of the second quantum operator can be indicated, and marginalization processing can be performed using the CPU to obtain the expected value corresponding to each first quantum operator. This ensures the accuracy of quantum operator measurement.

[0113] A quantum computer can be a NISQ device with a medium number of qubits, usually between 50 and several hundred. The number of qubits at this scale is neither sufficient to achieve full quantum error correction nor beyond the range that current classical computers can effectively simulate. Qubits and quantum gate operations in NISQ devices are usually affected by noise, which may come from various factors such as environmental interference, device imperfections, and operation errors. Noise can lead to the 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 usually quantum-classical hybrid algorithms, which combine the advantages of quantum computing and classical computing. These algorithms perform quantum operations on a quantum processor and then use a classical computer for optimization and error handling.

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

[0115] In this embodiment, a measurement device for quantum operators is also provided. This device is used to implement the above embodiments and preferred embodiments, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation by hardware, or a combination of software and hardware is also possible and contemplated.

[0116] Figure 8 is a structural block diagram of an optional measurement device for quantum operators according to an embodiment of the present application, applied to a host, such as Figure 8 shown. The device includes:

[0117] A splicing module 82, configured to splice 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, where the first quantum operator is composed of a tensor product of Pauli operators;

[0118] A measurement module 84, configured to measure the unspliced first quantum operator and the second quantum operator to obtain their respective corresponding first probability distributions, where 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] An expected value calculation module 86 is configured to marginalize the first probability distribution to obtain a second probability distribution corresponding to each of at least one first quantum operator, and determine the expected value corresponding to each of at least one first quantum operator according to the second probability distribution.

[0120] Through the present application, at least one second quantum operator is obtained by splicing first quantum operators that meet a preset condition among at least one first quantum operator, where the first quantum operator is composed of a tensor product of Pauli operators; the first probability distribution corresponding to each of the unspliced first quantum operator and the second quantum operator is obtained by measurement, where 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 at least one first quantum operator, and the expected value corresponding to each of 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 a preset rule to obtain a second quantum operator, so as to reduce the number of quantum operators to be measured. When measuring using a quantum state, a quantum circuit, the first quantum operator, and the second quantum operator, 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 a computer to obtain the corresponding second probability distribution, so as to reduce the number of executions of the quantum circuit during the measurement process by cooperating a traditional computer and a quantum computer. The technical problem that the current variational quantum algorithm needs to repeatedly calculate each quantum operator multiple times, resulting in a low execution efficiency of the variational quantum algorithm, is solved. The execution efficiency of the variational quantum algorithm in a quantum computer is improved.

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

[0122] Optionally, the above splicing of first quantum operators that have a commutation relationship with each other among at least one first quantum operator to obtain at least one second quantum operator includes: obtaining a list of measurements to be made, where the list of measurements to be made 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: regarding the first quantum operator or the second quantum operator that has a commutation relationship with the currently placed first quantum operator or the second quantum operator in the list of measurements to be made 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 position corresponding to the quantum operator to be spliced in the list of measurements to be made.

[0123] Optionally, 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 list of quantities to be measured is used as the quantum operator to be spliced, including: traversing the first quantum operator and the second quantum operator placed in the list of quantities 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 of quantities to be measured.

[0124] Optionally, 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 list of quantities 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 of quantities 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 has an overlapping part, and the operators corresponding to the overlapping part of the positions 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 of quantities to be measured.

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

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

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

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

[0129] Optionally, the above-mentioned traversing of at least one first quantum operator and performing operations on each first quantum operator as the quantum operator to be placed further includes: in the case of placing the second quantum operator at the corresponding position of the quantum operator to be spliced in the list to be measured, adding second indication information to the index list, where the second indication information corresponds to the quantum operator to be spliced.

[0130] Optionally, the above-mentioned measurement module 84 is further configured to: measure the qubits in the quantum state and the unspliced first and second quantum operators according to the corresponding positions to obtain the first probability distribution of the bit string.

[0131] Optionally, before the above-mentioned measurement of the qubits in the quantum state and the unspliced first and second quantum operators according to the corresponding positions, it includes: passing the qubits corresponding to the X basis and the Y basis in the quantum state through single-qubit rotation gates to obtain an updated quantum state.

[0132] Optionally, the above-mentioned expected value calculation module 86 is further configured to: determine the corresponding first quantum operator in the second quantum operator; sum the probability values except the first quantum operator to obtain the second probability distribution corresponding to the first quantum operator.

[0133] Optionally, the above-mentioned expected value calculation module 86 is further configured to: perform a weighted sum 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 values corresponding to each of the at least one first quantum operator according to the second probability distribution, it includes: linearly combining the expected values corresponding to each of 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, it 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 with updated parameters until the objective function value corresponding to the quantum state satisfies a preset threshold.

[0136] It should be noted that the above-mentioned various 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-mentioned modules are all located in the same processor; or, the above-mentioned various modules are separately located in different processors in any combination form. For example, the above-mentioned splicing module and expected value calculation module are in one processor, and the measurement module is in one processor.

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

[0138] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs such as USB flash drives, read-only memory (ROM for short), random access memory (RAM for short), mobile hard disks, magnetic disks, or optical discs.

[0139] An embodiment of the present application also provides an electronic device, including a memory and a processor. 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 above electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0141] An embodiment of the present application also provides a computer program product, including a non-volatile computer-readable storage medium. 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 methods in various embodiments of the present application are implemented.

[0142] Specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be repeated here.

[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-purpose 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 program codes executable by the 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 than here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module to implement. In this way, the present application is not limited to any specific combination of hardware and software.

[0144] The above are only the preferred embodiments of the present application and are not used to limit the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the principle 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 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, and the preset condition is that two of the first quantum operators are in a commutative relationship; 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 list to be measured 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 list to be measured.

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 according to 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 satisfies 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, and the preset condition is that two of the first quantum operators are in a commutative relationship; 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

  • Method for determining quantum interference and related equipment

    CN116957090A

  • Quantum computing method and device

    CN118195016A