Quantum operation processing method, device, equipment and storage medium
By constructing a target directed acyclic graph and linear programming methods, the starting time of the quantum circuit is optimized, the quantum circuit optimization problem under the influence of noise in medium-scale quantum computers is solved, and conflicts between quantum operations are avoided and errors are reduced.
Patent Information
- Application Number
- CN202310194827.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2043-02-28
AI Technical Summary
In the era of medium-scale noisy quantum computers, how to effectively use quantum computers to solve practical problems at higher noise levels, especially how to optimize quantum circuits to reduce operational errors.
By constructing a target directed acyclic graph, the correctness limiting rules and crosstalk conflict rules between quantum operations are determined, and the linear programming method is used to obtain the target starting time of quantum operations to achieve optimization and conflict avoidance of quantum circuits.
Without affecting the correctness of the quantum circuit, it can effectively avoid crosstalk conflicts between quantum operations, reduce operating errors, and improve the performance of the quantum circuit.
Smart Images

Figure CN116258207B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to the field of quantum chips, quantum measurement and control technology. Background Art
[0002] Quantum computing is a new computing paradigm that can effectively solve certain problems that classical computers cannot solve effectively, that is, it has quantum advantages and therefore has very broad application prospects. Currently, in the era of noisy intermediate-scale quantum (NISQ), one of the main challenges is how to use quantum computers to solve practical problems at a high noise level. One of the main directions to achieve this challenge is the optimization of quantum circuits. Summary of the invention
[0003] The present disclosure provides a processing method, apparatus, device and storage medium for quantum operations.
[0004] According to one aspect of the present disclosure, a method for processing quantum operations is provided, comprising:
[0005] Determine a target directed acyclic graph corresponding to the quantum circuit to be arranged, wherein the target directed acyclic graph uses each quantum operation of the N quantum operations contained in the quantum circuit as a node, and the directed solid line edge between nodes contained in the target directed acyclic graph represents one of the following: a sequential relationship between two quantum operations that need to meet the correctness constraint rule among the N quantum operations, and a sequential relationship between two quantum operations that need to handle crosstalk conflicts among the N quantum operations;
[0006] Based on the directed solid line edges contained in the target directed acyclic graph, a target linear constraint condition is obtained, wherein the target linear constraint condition is used to constrain the following information: the start time of each quantum operation between two quantum operations that need to meet the correctness constraint rule among the N quantum operations, and the start time of each quantum operation between two quantum operations that have crosstalk conflicts among the N quantum operations;
[0007] When the start time of the quantum operation is used as a parameter to be processed, the target start time of each quantum operation in the N quantum operations is obtained by using the target linear constraint condition.
[0008] According to another aspect of the present disclosure, there is provided a quantum operation processing device, comprising:
[0009] A processing unit is used to determine a target directed acyclic graph corresponding to the quantum circuit to be arranged, wherein the target directed acyclic graph uses each quantum operation of the N quantum operations contained in the quantum circuit as a node, and the directed solid line edge between nodes contained in the target directed acyclic graph represents one of the following: a sequential relationship between two quantum operations that need to meet the correctness constraint rule among the N quantum operations, and a sequential relationship between two quantum operations that need to handle crosstalk conflicts among the N quantum operations; based on the directed solid line edge contained in the target directed acyclic graph, a target linear constraint condition is obtained, wherein the target linear constraint condition is used to constrain the following information: a start time of each quantum operation between two quantum operations that need to meet the correctness constraint rule among the N quantum operations, and a start time of each quantum operation between two quantum operations that have crosstalk conflicts among the N quantum operations; when the start time of the quantum operation is used as a parameter to be processed, the target start time of each quantum operation in the N quantum operations is obtained by using the target linear constraint condition;
[0010] An output unit is used to output a target start time of each quantum operation in the N quantum operations.
[0011] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0012] at least one processor; and
[0013] a memory communicatively connected to the at least one processor; wherein,
[0014] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of any embodiment of the present disclosure.
[0015] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method according to any embodiment of the present disclosure.
[0016] According to another aspect of the present disclosure, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method according to any one of the embodiments of the present disclosure is implemented.
[0017] In this way, the disclosed scheme obtains the target linear constraint condition through the target directed acyclic graph, and then obtains the target start time of each quantum operation in the quantum circuit; thus, a feasible scheme is provided for realizing the arrangement of quantum circuits; and, under the premise of not affecting the correctness of the quantum circuits, crosstalk conflicts between quantum operations can be effectively avoided.
[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0020] Figure 1 This is a schematic flow chart of a method for processing quantum operations according to an embodiment of the present application. Figure 1 ;
[0021] FIG2(a) and FIG2(b) are schematic diagrams showing the effects of quantum circuit optimization before and after optimization in an example according to an embodiment of the present application;
[0022] Figure 3 is a schematic flow chart 2 of a method for processing quantum operations according to an embodiment of the present application;
[0023] Figure 4(a) to Figure 4(e) It is a schematic diagram of a process of obtaining a target directed acyclic graph according to an embodiment of the present application;
[0024] Figure 5 It is a schematic diagram of the implementation flow of a processing method for quantum operation according to an embodiment of the present disclosure in a specific embodiment;
[0025] Figure 6 is a schematic diagram of the structure of a processing device for quantum operations according to an embodiment of the present disclosure;
[0026] Figure 7 The block diagram is a block diagram of an electronic device used to implement the quantum operation processing method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0028] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The term "at least one" in this article means any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C. The terms "first" and "second" in this article refer to multiple similar technical terms and distinguish them. They do not mean to limit the order or to limit them to only two. For example, the first feature and the second feature refer to two types / two features. The first feature can be one or more, and the second feature can also be one or more.
[0029] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the specific embodiments below. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present disclosure.
[0030] Quantum computing is a new computing paradigm that can effectively solve certain problems that cannot be effectively solved by classical computers, that is, it has quantum advantages and has very broad application prospects. However, the capabilities of quantum computers that are actually realized physically today are very limited, and there is still a certain distance from large-scale general-purpose quantum computers. The quantum computers that are currently realized physically are medium-scale noisy quantum computers. This era is called the Noisy Intermediate-Scale Quantum (NISQ) era. In the NISQ era, one of the main challenges is how to use quantum computers to solve practical problems at higher noise levels. One of the main directions to achieve this challenge is the optimization of quantum circuits.
[0031] The following is an explanation of the basic concepts required for the disclosed solution:
[0032] (I) Quantum Circuits
[0033] Quantum circuits are mainly composed of quantum operations (such as quantum logic gates and quantum measurements), and quantum operations can be used to implement basic operations on quantum bits. Based on this, quantum circuits can be used to write relevant quantum algorithms. Here, the performance of quantum circuit execution will directly affect the actual effect of quantum algorithms. Therefore, quantum circuits need to be optimized to reduce operational errors.
[0034] The arrangement of quantum operations in quantum circuits is an important direction for quantum circuit optimization. Here, the arrangement of quantum operations refers to the purpose of rearranging quantum operations by changing the quantum operations themselves or the positions of quantum operations without affecting the correctness of the results of quantum circuit operation, so as to avoid crosstalk errors (i.e., crosstalk conflicts) and suppress decoherence errors of quantum circuits. It should be pointed out that since the duration of each quantum operation is known, changing the position of the quantum operation can be specifically changing the starting time of the quantum operation.
[0035] (ii) Principles for optimizing quantum circuits, including correctness restriction rules, crosstalk conflict restriction rules, and decoherence errors.
[0036] (1) Correctness restriction rules
[0037] In actual scenarios, if the quantum bits acted on by two quantum operations contain the same quantum bits, the order of the two quantum operations containing the same quantum bits must be determined to ensure the correctness of the quantum circuit. The disclosed scheme is called the correctness constraint rule, which is one of the principles followed in optimizing quantum circuits.
[0038] (2) Crosstalk conflict limitation rules
[0039] Other principles that can be followed in optimizing quantum circuits include crosstalk conflict restrictions. Due to the limitations of quantum chips, there are certain conflicts between certain quantum operations in quantum circuits. For example, certain quantum operations will have large errors when they are activated at the same time, which can be called crosstalk errors. Therefore, these quantum operations with crosstalk errors cannot be used at the same time. In other words, the overlap of the operation time of these quantum operations is avoided. Here, the operation time of a quantum operation refers to the time period from the start time to the end time of the quantum operation. Based on this, the disclosed solution calls the restriction that certain quantum operations in quantum circuits cannot overlap in operation time due to the existence of crosstalk errors a crosstalk conflict restriction.
[0040] (3) Decoherence Error
[0041] The arrangement of quantum operations in quantum circuits will also affect the decoherence errors of quantum circuits. Decoherence errors cause the quantum state to deviate from the original quantum state over time, which is called decoherence errors, making the calculation results no longer reliable. For example, for a superconducting quantum bit, the initial quantum state is |1>. At this time, a perfect measurement is performed, and the probability of measuring 1 is 100%. After a period of time, due to the existence of decoherence errors, even if a perfect measurement is performed, there is a certain probability of getting 0, making the measurement result no longer reliable. Decoherence errors increase with time, so decoherence errors should be suppressed as much as possible in the process of arranging quantum operation positions.
[0042] Based on this, the present disclosure proposes a quantum operation arrangement method based on linear programming to realize the arrangement of quantum operations in quantum circuits.
[0043] Specifically, Figure 1 This is a schematic flow chart of a method for processing quantum operations according to an embodiment of the present application. Figure 1 The method may optionally be applied to a classical computing device, such as a personal computer, a server, a server cluster, or other electronic device with classical computing capabilities. Further, the method includes at least part of the following contents. Specifically, Figure 1 As shown, including:
[0044] Step S101: Determine the target directed acyclic graph corresponding to the quantum circuit to be arranged.
[0045] Here, the target directed acyclic graph takes each quantum operation of the N quantum operations contained in the quantum circuit as a node, and the directed solid line edge between nodes contained in the target directed acyclic graph represents one of the following: the order relationship between two quantum operations in the N quantum operations that need to meet the correctness constraint rule, and the order relationship between two quantum operations in the N quantum operations that need to handle crosstalk conflicts.
[0046] Step S102: Obtain target linear constraints based on the directed solid edges included in the target directed acyclic graph.
[0047] Here, the target linear constraint condition is used to constrain the following information: the start time of each quantum operation between two quantum operations that need to meet the correctness constraint rule among the N quantum operations, and the start time of each quantum operation between two quantum operations that have crosstalk conflicts among the N quantum operations. Here, N is a positive integer greater than or equal to 2.
[0048] Step S103: When the start time of the quantum operation is used as a parameter to be processed, the target linear constraint condition is used to obtain the target start time of each quantum operation in the N quantum operations.
[0049] In this way, the disclosed solution obtains the target linear constraint condition through the target directed acyclic graph, and then obtains the target start time of each quantum operation in the quantum circuit; thus, a feasible solution is provided for realizing the arrangement of quantum circuits; and, under the premise of not affecting the correctness of the quantum circuits, crosstalk conflicts between quantum operations can be effectively avoided.
[0050] In a specific example, the quantum circuit is mainly composed of quantum operations (such as quantum logic gates and quantum measurements) and quantum bits. Here, the quantum operations in the quantum circuit act on the quantum bits in the quantum circuit to achieve basic operations on the quantum bits.
[0051] In a specific example, the order relationship between the two quantum operations that need to meet the correctness restriction rule described above can be specifically: the order relationship between two quantum operations containing the same quantum bits. That is to say, when the quantum bits acted on by the two quantum operations in the quantum circuit are at least partially the same, at this time, in order to meet the correctness restriction rule, the order between the two quantum operations in the quantum circuit needs to be determined, that is, the two need to have an order relationship. In other words, in the two quantum operations that need to have an order relationship due to the correctness restriction rule, the quantum bits acted on by different quantum operations are at least partially the same.
[0052] For example, a quantum circuit includes quantum bit Q1, quantum bit Q2 and quantum bit Q3, and quantum operations 1 to 4; moreover, quantum operation 1 acts on quantum bit Q1, quantum operation 2 acts on quantum bit Q2, quantum operation 3 acts on quantum bit Q1 and quantum bit Q2, and quantum operation 4 acts on quantum bit Q3. At this time, the two quantum operations that need to meet the correctness restriction rules are: quantum operation 1 and quantum operation 3 (both contain the same quantum bit Q1), and quantum operation 2 and quantum operation 3 (both contain the same quantum bit Q2).
[0053] Furthermore, a target directed acyclic graph is constructed with quantum operations 1 to 4 as nodes. At this time, if quantum operation 1 needs to be completed before quantum operation 3, there is a directed solid line edge between quantum operation 1 and quantum operation 3, and similarly, if quantum operation 3 needs to be completed before quantum operation 2, there is a directed solid line edge between quantum operation 3 and quantum operation 2, and it points to quantum operation 2.
[0054] Furthermore, if there is a crosstalk conflict between quantum operation 1 and quantum operation 4, at this time, there is a directed solid line edge between quantum operation 1 and quantum operation 4, and the specific direction of the directed solid line edge is: from quantum operation 1 to quantum operation 4, or, quantum operation 4 to quantum operation 1.
[0055] Further, after obtaining the target directed acyclic graph corresponding to the quantum circuit, the target linear constraint condition is determined based on the target directed acyclic graph. At this time, the target linear constraint condition is used to constrain the start time of quantum operation 1 and quantum operation 3 to ensure that quantum operation 1 is completed before quantum operation 3. At the same time, the start time of quantum operation 2 and quantum operation 3 is constrained to ensure that quantum operation 3 is completed before quantum operation 2; and the target linear constraint condition is also used to constrain the start time of quantum operation 1 and quantum operation 4 to avoid crosstalk conflicts between quantum operation 1 and quantum operation 4.
[0056] Furthermore, after obtaining the above-mentioned target linear constraint condition, the start time of each quantum operation can be used as the parameter to be solved, and the target linear constraint condition can be used as the total constraint condition to solve the target start time of each quantum operation in quantum operation 1 to quantum operation 4.
[0057] In a specific example of the disclosed solution, after obtaining the target start time of each quantum operation, the quantum operations in the quantum circuit can be rearranged, so that a new quantum circuit is obtained, and the new quantum circuit can effectively comply with the correctness restriction rules and the crosstalk conflict restriction rules. Specifically, after obtaining the target start time of each quantum operation in the N quantum operations, the method further includes: arranging the N quantum operations based on the target start time of each quantum operation in the N quantum operations to obtain the arranged quantum circuit. In this way, the optimization of the quantum circuit is achieved, and the new quantum circuit obtained after optimization can effectively reduce operation errors.
[0058] It should be noted that for a certain quantum circuit, the disclosed solution will not change the quantum operation itself during the optimization of the quantum operation, but will rearrange the quantum operations in the quantum circuit. Therefore, the quantum operation arrangement scheme provided by the disclosed solution is more efficient and convenient, and has a lower threshold for use.
[0059] In this way, the disclosed solution realizes the arrangement of quantum operations through the target start time of quantum operations, thereby optimizing quantum circuits. In this way, the arrangement of quantum operations provided by the disclosed solution is more efficient, convenient, and has a lower threshold for use.
[0060] For example, as shown in FIG2(a), the quantum circuit is composed of quantum bits and quantum operations, wherein, in the order of the quantum operations, the quantum circuit specifically includes:
[0061] At the first moment, a single-qubit gate S1 acting on qubit Q1 and a single-qubit gate S2 acting on qubit Q2 need to be operated simultaneously;
[0062] A single-qubit gate S3 acting on qubit Q2 that needs to be operated at the second moment;
[0063] A two-qubit gate D acting on qubit Q2 and qubit Q3 that needs to be operated at the third moment;
[0064] At the fourth moment, quantum measurement 1 acting on quantum bit Q1, quantum measurement 2 acting on quantum bit Q2, and quantum measurement 3 acting on quantum bit Q3 need to be performed simultaneously.
[0065] Based on this, it can be seen that the above-mentioned single-qubit gate S1 and quantum measurement 1 contain the same qubit Q1; single-qubit gate S2, single-qubit gate S3, two-qubit gate D and quantum measurement 2, the four (can also be called any two of the four) contain the same qubit Q2; two-qubit gate D and quantum measurement 3, contain the same qubit Q3, based on this, the order relationship between the two quantum operations that meet the correctness constraint rules can be determined; further, there is a crosstalk conflict between the two-qubit gate D and the single-qubit gate S1, based on this, the order relationship between the two quantum operations that need to deal with the crosstalk conflict can be determined, so, based on the above order relationship, the target directed acyclic graph corresponding to the quantum circuit shown in Figure 2(a) can be determined.
[0066] Furthermore, based on the target directed acyclic graph, the target linear constraint condition is obtained, and then the target linear constraint condition that satisfies the correctness restriction rule and the crosstalk conflict restriction rule is used to solve the start time of each quantum operation, so as to obtain the target start time of each quantum operation, and then based on the obtained target start time, the quantum operations in the quantum circuit are rearranged to obtain the quantum circuit shown in Figure 2(b). Specifically, the rearranged quantum circuit, according to the order of action of the quantum operations, specifically includes:
[0067] The single-qubit gate S2 acting on qubit Q2 that needs to be operated at the first moment;
[0068] At the second moment, the single-qubit gate S1 acting on the qubit Q1 and the single-qubit gate S3 acting on the qubit Q2 need to be operated simultaneously;
[0069] A two-qubit gate D acting on qubit Q2 and qubit Q3 that needs to be operated at the third moment;
[0070] At the fourth moment, quantum measurement 1 acting on quantum bit Q1, quantum measurement 2 acting on quantum bit Q2, and quantum measurement 3 acting on quantum bit Q3 need to be performed simultaneously.
[0071] In this way, without changing the quantum operation itself, the optimization of the quantum circuit is achieved, thereby effectively reducing the operational errors of the quantum circuit.
[0072] In a specific example of the disclosed solution, the target linear constraint condition is obtained based on at least one of the following of each quantum operation between two quantum operations that need to have a sequential relationship: the start time of the quantum operation, and the duration of the quantum operation acting on the quantum bit.
[0073] It should be noted that the two quantum operations described in this example that need to have an order relationship include: two quantum operations that need to satisfy the correctness restriction rule and thus need to have an order relationship, and two quantum operations that need to handle crosstalk conflicts and thus need to have an order relationship. In this way, the target linear constraint condition satisfies both the correctness restriction rule and the crosstalk conflict restriction rule.
[0074] For example, in a specific example, the quantum circuit includes N quantum operations, and two quantum operations that need to have a sequential relationship among the N quantum operations are quantum operations g and i and quantum operation g j , at this time, the target linear constraint condition may at least include:
[0075] s i +d i ≤s j ; or j +d j ≤s i ;
[0076] Here, the s i Denotes the quantum operation g i The starting time, the d i Denotes the quantum operation g i The duration, s j Denotes the quantum operation g j The starting time of the operation, i, j (i≠j) are both positive integers greater than or equal to 1 and less than or equal to N, and N is a positive integer greater than or equal to 2.
[0077] Alternatively, in another specific example, the quantum circuit includes N quantum operations, and two quantum operations that need to have a sequential relationship among the N quantum operations are quantum operations g and i and quantum operation g j For example, in this example, the target linear constraint condition may at least include:
[0078] |s j -s i |≥Δ;
[0079] Wherein, Δ is a preset threshold value, which may be an empirical value, for example, it may be determined based on the maximum duration of all quantum operations in the N quantum operations, such as Δ is greater than or equal to max{d 1 ,d 2 ,…,d N} real number; here, the s i Denotes the quantum operation g i The starting time, the d i Denotes the quantum operation g i The duration, s j Denotes the quantum operation g j The starting time of , wherein i, j (i≠j) are both positive integers greater than or equal to 1 and less than or equal to N.
[0080] In this way, the disclosed solution effectively ensures that the quantum circuit satisfies both the correctness restriction rules and the crosstalk conflict restriction rules through the target linear constraint conditions, thus laying the foundation for realizing the reasonable arrangement of quantum operations.
[0081] In a specific example of the disclosed solution, the target directed acyclic graph can be obtained in the following manner; specifically, the target directed acyclic graph is obtained as follows:
[0082] Taking each quantum operation of the N quantum operations as a node, establishing a directed solid line edge according to the order relationship between two quantum operations that need to meet the correctness restriction rule, and constructing an initial directed acyclic graph corresponding to the quantum circuit; wherein the directed solid line edge in the initial directed acyclic graph is used to indicate the execution order of the two quantum operations corresponding to itself;
[0083] Between two quantum operations with crosstalk conflicts, a bidirectional dashed edge is established to obtain an initial directed acyclic graph including bidirectional dashed edges and directed solid edges;
[0084] Select one of the bidirectional dashed edges as the target direction, and change the bidirectional dashed edge into a directed solid edge based on the target direction;
[0085] When all bidirectional dashed edges are changed into directed solid edges, the target directed acyclic graph is obtained.
[0086] For example, after determining the quantum circuit, it is necessary to first create an initial directed acyclic graph. The creation method is as follows: create nodes, that is, take each quantum operation in the quantum circuit as a node. At this time, the number of nodes in the directed acyclic graph is the same as the number of quantum operations in the quantum circuit. For example, for a quantum circuit containing N quantum operations, it is necessary to create N nodes. At this time, each node corresponds to a quantum operation; further, create directed solid edges: if there are two quantum operations in the quantum circuit, and the order relationship between the two needs to be satisfied, for example, one of the quantum operations, such as quantum operation g i , must be completed before another quantum operation, such as in quantum operation g j Before the completion, a directed solid line edge is created between two quantum operations that need to have an order relationship. The directed solid line edge can be used to indicate the order relationship. Specifically, in the quantum operation g i With the quantum operation g j Create a quantum operation g i Pointing to quantum operation g j A directed solid line edge, which is unidirectional, that is, a unidirectional arrow.
[0087] Furthermore, a bidirectional dashed edge is created: If there are two quantum operations in the quantum circuit and there is a crosstalk conflict between the two quantum operations, then the order relationship between the two quantum operations must also be satisfied. For example, if the quantum operation g in the quantum circuit k and quantum operation g l There is a crosstalk conflict between the two. At this time, in the quantum operation g k and quantum operation g l Create a bidirectional dashed edge with a bidirectional arrow between them, which represents both the quantum operation g k can point to the quantum operation g l , which also represents the quantum operation g l can point to the quantum operation g k .
[0088] Furthermore, the dotted edges are solidified: one of the directions in the bidirectional dotted edges is selected as the target direction to solidify the bidirectional dotted edges to ensure that all the target directed acyclic graphs are directed solid edges. This lays the foundation for the subsequent target linear constraints based on the target directed acyclic graph that satisfy both the correctness restriction rules and the crosstalk conflict restriction rules.
[0089] Finally, when all bidirectional dashed edges are changed to directed solid edges, the target directed acyclic graph containing directed solid edges can be obtained.
[0090] It should be pointed out that the order relationship between two quantum operations that need to meet the correctness restriction rules depends on the configuration of the quantum circuit. The two quantum operations that need to deal with crosstalk conflicts depend on the actual situation of the quantum chip to be executed in the quantum circuit. In other words, when the configuration of the quantum circuit is determined, it can be determined which quantum operations in the quantum circuit need to meet the correctness restriction rules and their specific execution order. When the quantum chip that executes the quantum circuit is determined, it can be determined which quantum operations in the quantum circuit have crosstalk conflicts.
[0091] In this way, the disclosed scheme provides a method for constructing a target directed acyclic graph. The target directed acyclic graph constructed based on this method can satisfy both the correctness restriction rules and the crosstalk conflict restriction rules. This lays the foundation for the subsequent effective optimization of quantum circuits and the effective reduction of quantum circuit operation errors.
[0092] Furthermore, in a specific example, the target direction can be selected from the bidirectional dotted edge in the following manner; specifically, the above-described selection of one of the directions in the bidirectional dotted edge as the target direction specifically includes: selecting one of the directions in the bidirectional dotted edge as the target direction without forming a closed loop.
[0093] It should be noted that there cannot be a closed loop in the target directed acyclic graph created by the disclosed solution. Here, a closed loop means: a quantum operation passes through one or more directed solid edges and then returns to the quantum operation. For example, there is a quantum operation g i Through one or more directed real edges to the quantum operation g j path, and there exists a quantum operation g j Through one or more directed real edges to the quantum operation g i path, thus, a quantum operation g i In quantum operation g j Before completing the quantum operation g j The logical contradiction is then completed, so there is no closed loop in the target directed acyclic graph obtained by the disclosed solution.
[0094] In this way, based on the principle that a closed loop cannot be formed, selecting one of the directions in the bidirectional dotted edge as the target direction can effectively avoid logical contradictions, and further, on the basis of effectively resolving the crosstalk conflicts between quantum operations, lays the foundation for effectively improving processing efficiency and reducing processing complexity.
[0095] Further, in a specific example, based on a preset strategy, a target direction may be selected from the bidirectional dashed edge under the condition that no closed loop is formed; specifically, the above-mentioned selecting one direction from the bidirectional dashed edge as the target direction under the condition that no closed loop is formed specifically includes:
[0096] Based on a preset strategy, a target direction is selected from the two directions of the bidirectional dotted edge; wherein, the preset strategy is: a node with a larger total number of reachable nodes points to a node with a smaller total number of reachable nodes; the total number of reachable nodes represents the number of other nodes that the current node can reach via the directed solid edge.
[0097] Here, the specific instructions can be found below Figure 4(b) to Figure 4(d) The relevant instructions will not be repeated here.
[0098] In this way, the crosstalk conflicts between quantum operations are effectively resolved, laying the foundation for effectively improving processing efficiency and reducing processing complexity.
[0099] In a specific example of the disclosed solution, in the process of obtaining the target start time of each quantum operation, an objective function can also be set, and then the objective function is used to constrain the decoherence error of the quantum circuit, so as to minimize the impact of the decoherence error on the quantum circuit. Specifically, Figure 3 FIG2 is a schematic flow chart of a method for processing quantum operations according to an embodiment of the present application. The method can optionally be applied to classical computing devices, such as personal computers, servers, server clusters and other electronic devices with classical computing capabilities.
[0100] It is understandable that the above Figure 1 The relevant contents of the method shown can also be applied to this example, and the relevant contents will not be described in detail in this example.
[0101] Further, the method includes at least part of the following contents. Specifically, Figure 3 As shown, including:
[0102] Step S301: Determine the target directed acyclic graph corresponding to the quantum circuit to be arranged.
[0103] Here, the target directed acyclic graph takes each quantum operation of the N quantum operations contained in the quantum circuit as a node, and the directed solid line edge between nodes contained in the target directed acyclic graph represents one of the following: the order relationship between two quantum operations in the N quantum operations that need to meet the correctness constraint rule, and the order relationship between two quantum operations in the N quantum operations that need to handle crosstalk conflicts.
[0104] Step S302: Obtain target linear constraints based on the directed solid edges contained in the target directed acyclic graph.
[0105] Here, the target linear constraint condition is used to constrain the following information: the start time of each quantum operation between two quantum operations that need to meet the correctness constraint rule among the N quantum operations, and the start time of each quantum operation between two quantum operations that have crosstalk conflicts among the N quantum operations.
[0106] Step S303: Determine the objective function.
[0107] Here, the objective function is used to characterize the decoherence error of the quantum circuit.
[0108] It can be understood that the execution order of the above-mentioned steps of determining the target linear constraint conditions (i.e., step S301 and step S302) and determining the objective function (i.e., step S303) can be swapped. In other words, the disclosed scheme does not limit the execution order of the above-mentioned two steps, as long as the target linear constraint conditions and the objective function are obtained before step S304.
[0109] Step S304: Minimize the objective function with the start time of the quantum operation as the parameter to be processed and with the objective linear constraint condition.
[0110] Here, minimizing the objective function may specifically include: adjusting the start time of the quantum operation under the target linear constraint condition to minimize the objective function.
[0111] Step S305: When it is determined that the preset requirements are met, a target start time of each quantum operation in the N quantum operations is obtained.
[0112] In a specific example, a loop iteration method is used to minimize the objective function. At this time, the preset requirement may be: the difference between the function value of the objective function in the current optimization process and the function value of the objective function in the previous optimization process is less than the preset value, that is, the function value of the objective function reaches convergence. Here, the preset value is an empirical value. Alternatively, the preset requirement may be: the number of iterations reaches a preset number, which may also be an empirical value. In actual scenarios, it can be set according to needs, and the disclosed solution does not limit this.
[0113] In this way, the disclosed scheme constrains decoherence errors by minimizing the objective function, and further avoids decoherence errors on the basis of effectively satisfying the correctness restriction rules and the crosstalk conflict restriction rules, thereby effectively realizing the optimization of the quantum circuit, so that the quantum circuit obtained after the optimization can effectively reduce operation errors.
[0114] In a specific example of the disclosed solution, the objective function can be obtained in the following manner: Specifically, the above-mentioned determination of the objective function (such as Figure 3 The step S303 in the step specifically comprises: determining the operation period of each quantum bit in the quantum circuit, and obtaining the objective function based on the operation periods of all quantum bits in the quantum circuit.
[0115] Here, the operation period of the quantum bit is based on the duration of the quantum operation acting on the quantum bit.
[0116] Thus, the disclosed scheme provides a specific scheme for determining an objective function, through which the decoherence errors of quantum bits are constrained. In this way, on the basis of effectively satisfying the correctness restriction rules and the crosstalk conflict restriction rules, decoherence errors are further avoided, thereby effectively realizing the optimization of the quantum circuit, so that the quantum circuit obtained after the optimization can effectively reduce the operation errors.
[0117] Further, in one example, the operation period of the quantum bit is obtained based on the following two parameters:
[0118] The end time of the last quantum operation among all quantum operations acting on the quantum bit, and the start time of the first quantum operation among all quantum operations acting on the quantum bit.
[0119] For example, for the quantum bit Qn in the quantum circuit, at this time, the last quantum operation among all quantum operations acting on the quantum bit Qn is recorded as quantum operation l Qn , the first quantum operation among all quantum operations acting on quantum bit Qn is recorded as quantum operation f Qn At this time, the operation cycle of the quantum bit Qn can be recorded as O n , its expression can be specifically as follows:
[0120]
[0121] here, Represents quantum operation l Qn The start time, Represents the quantum operation l Qn duration, at this time, That is the quantum operation l Qn The end time of . Denotes the quantum operation f Qn The start time of the .
[0122] Furthermore, the objective function O is:
[0123] O=∑ nO n .
[0124] Here, we continue to use Figure 2(a) as an example. The last quantum operation among all quantum operations acting on quantum bit Q2 is quantum measurement 2, and the first quantum operation among all quantum operations acting on quantum bit Q2 is single-qubit gate S2. At this time, the operation cycle of quantum bit Q2 is
[0125] here, is the starting time of quantum measurement 2, is the duration of quantum measurement 2, is the starting time of the single-qubit gate S2.
[0126] In this way, the disclosed solution determines the objective function through the operation period of the quantum bit, thereby constraining the decoherence error and effectively reducing the operation error of the optimized quantum circuit.
[0127] In addition, in a specific example, the value range of the start time of each quantum operation can also be used as a linear constraint condition, so as to more efficiently solve the target start time of each quantum operation. That is, the target linear constraint condition is also used to constrain the value range of the start time of each quantum operation in the N quantum operations.
[0128] For example, the following linear condition can be used to limit the range of the variable to be solved. Specifically, the sum of the durations of all quantum operations in the quantum circuit is recorded as max = ∑ i d i At this time, assuming that the current time is the starting time, which can be recorded as 0, the latest ending time is (0+max), which can be recorded as max (also referred to as max). The minimum starting time of each quantum operation is the starting point, that is, 0, and the maximum starting time of each quantum operation must be less than the latest ending time, that is, max. Based on this, for any quantum operation in the quantum circuit, such as quantum operation g i For quantum operation g i The start time s i The following relationship needs to be satisfied:
[0129] 0≤s i ≤max-d i
[0130] Among them, the d i >0.
[0131] In addition, it should be noted that after the target directed acyclic graph is obtained based on the above scheme, the target directed acyclic graph can be simplified to remove redundant directed solid edges. For specific instructions, please refer to the relevant descriptions of Figures 4(d) and 4(e) below, which will not be repeated here.
[0132] In summary, the disclosed solution can solve the problem of arranging quantum operations in quantum circuits based on a general linear programming problem (LP). Specifically, the disclosed solution uses a target directed acyclic graph to deal with crosstalk conflict constraints in quantum circuits, and the target directed acyclic graph can also satisfy the correctness constraint rule. Subsequently, a linear constraint condition (that is, the target linear constraint condition described above) is obtained based on the target directed acyclic graph. Finally, the start time of the quantum operation is used as a variable to be solved, and a linear function used to constrain decoherence errors is used as a target function. Then, a preset solver (for example, an LP solver) is used to obtain the target start time of each quantum operation under the optimal conditions of the target function, so as to achieve the arrangement of quantum operations.
[0133] It should be pointed out that for a set of real variables, given some linear constraints (linear expressions using ≥, ≤ and ==), and an objective function and optimization goal of a linear function (the optimization goal refers to making the objective function reach a minimum value or a maximum value, etc.), the LP solver can give a solution that achieves the optimal target value. Therefore, the target start time of each quantum operation obtained by the disclosed solution can achieve the optimal solution.
[0134] The present disclosure is further described in detail below with reference to specific examples; specifically, the present disclosure proposes a quantum operation arrangement method based on linear programming; here, the linear programming means that the constraints are linear constraints, the objective function is a linear function, and the variables to be solved are real numbers, and here, the variables to be solved are specifically the start time of the quantum operation, based on which, the real number can be specifically a non-negative real number.
[0135] Furthermore, the method mainly uses a target directed acyclic graph, which is obtained after adopting a specific strategy to deal with crosstalk conflict restrictions to meet the crosstalk conflict restriction rules. At the same time, the target directed acyclic graph can also meet the correctness restriction rules; then, the target directed acyclic graph is converted into linear constraints, and the linear function is used as the objective function to convert the arrangement problem of quantum operations in the quantum circuit into a linear programming problem LP with linear constraints.
[0136] Specifically, for the input quantum circuit, the disclosed solution uses the target directed acyclic graph obtained after expansion to effectively deal with the crosstalk conflicts between certain quantum operations in the quantum circuit without introducing additional variables, such as integer variables. At the same time, it also effectively ensures that certain quantum operations in the quantum circuit need to meet the requirements of correctness constraints; then, the linear constraints of the quantum circuit are obtained by using the target directed acyclic graph, the start time of the quantum operation in the quantum circuit is used as the variable to be solved, and the linear expression that can measure the decoherence error of the quantum circuit is used as the objective function, and then the LP solver is used to solve the target start time of all quantum operations in the quantum circuit under the optimal conditions of the objective function.
[0137] The following is divided into three parts to introduce the scheme of the present disclosure. The first part introduces the core idea of the scheme of the present disclosure; the second part explains the specific implementation steps of the scheme of the present disclosure; and the third part is an application demonstration to verify the effectiveness of the scheme of the present disclosure.
[0138] Part I: Core Ideas
[0139] Before introducing this section, some relevant basic definitions and concepts are first introduced.
[0140] The quantum circuit described in the disclosed solution is mainly composed of at least two quantum operations; here, the quantum operation includes a quantum logic gate and / or a quantum measurement; and each quantum operation operates on one or more quantum bits. It is understandable that the quantum bits operated by different quantum operations can be the same or different.
[0141] Further, assuming that the quantum circuit includes N quantum operations, in this case, the i-th quantum operation among the N quantum operations can be used i Indicates that, here, N is a positive integer greater than or equal to 2, and i is a positive integer greater than or equal to 1 and less than or equal to N.
[0142] Furthermore, the quantum operation g i Duration available i Indicates that the duration d i is a real number greater than 0. Usually, when the quantum circuit is determined, this term is a known quantity. i The starting time is expressed in s i Indicates that it is the variable to be solved in the disclosed solution; at this time, the quantum operation g i The end time is s i +d i .
[0143] As mentioned above, if the quantum bits acted on by the two quantum operations of the quantum circuit contain the same quantum bits, for example, the quantum operation g iIn the quantum operation g j Before, and in the quantum operation g i and quantum operation g j If the quantum bits being operated have the same quantum bits, then the quantum operation g i It is necessary to perform the quantum operation g j Before, in other words, the quantum operation g i The end time of the quantum operation g j Before the start time, the following relationship needs to be satisfied:
[0144] s i +d i ≤s j Formula (1)
[0145] Among them, the s i Denotes the quantum operation g i The starting time, the d i Denotes the quantum operation g i The duration, s j Denotes the quantum operation g j The start time of the .
[0146] By formula (1), we can ensure that the quantum operation g i and quantum operation g i The order of operations is determined, thereby ensuring the correctness of the quantum circuit. Formula (1) is the linear constraint condition that satisfies the correctness constraint rule, which can also be called the correctness constraint condition.
[0147] Furthermore, for two quantum operations, such as quantum operation g k and quantum operation g l Although the quantum bits operated by the two are not the same, if the quantum operation g k and quantum operation g l If applied simultaneously, a large crosstalk error will occur. Therefore, the quantum operation g k and quantum operation g l , there should be no overlap in operation time, that is, the following relationship needs to be satisfied:
[0148] s k +d k ≤s l or l +d l ≤s k Formula (2)
[0149] Among them, the s k Denotes the quantum operation g k The starting time, the d k Denotes the quantum operation g kThe duration, s l Denotes the quantum operation g l The starting time, the d l Denotes the quantum operation g l duration.
[0150] Here, in order to avoid crosstalk errors, as long as the quantum operation g k and quantum operation g l In practical applications, if the order of operations is not specified, there will be two situations. The first is that in the quantum operation g k In the quantum operation g l Before, and the quantum operation g k and quantum operation g l There should be no overlap in the operation time. At this time, s k +d k ≤s l ; The second is in the quantum operation g l In the quantum operation g k Before, and the quantum operation g k and quantum operation g l There should be no overlap in the operation time. At this time, s l +d l ≤s k .
[0151] Here, the operation time of the quantum operation refers to the time period from the start time to the end time of the quantum operation, which can be represented by the interval between the start time and the end time of the quantum operation, such as [start time, end time]. For example, the quantum operation g k The starting time is s k , the quantum operation g k The duration is d k , then the quantum operation g k The operation time can be specifically expressed as [s k ,s k +d k ].
[0152] The above formula (2) can ensure that the operation times of two quantum operations with crosstalk conflicts do not overlap. The formula (2) is the crosstalk conflict restriction condition.
[0153] It is worth noting that not every two quantum operations in a quantum circuit will have crosstalk conflicts. It depends on the chip structure of the specific quantum chip.
[0154] Furthermore, the disclosed solution uses a target directed acyclic graph to handle crosstalk conflicts, and at the same time, the target directed acyclic graph also satisfies the correctness constraint rule. Specifically, for a determined quantum circuit, first, an initial directed acyclic graph is created, and the creation method includes: creating nodes, that is, each quantum operation in the quantum circuit is used as a node. At this time, the number of nodes in the directed acyclic graph is the same as the number of quantum operations in the quantum circuit; further, creating edges: if there are two quantum operations in the quantum circuit, and the order relationship between the two needs to be satisfied, for example, one of the quantum operations, such as quantum operation g i , must be completed before another quantum operation, such as in quantum operation g j Before the completion, a directed solid line edge is created between two quantum operations that need to have an order relationship. The directed solid line edge can be used to indicate the order relationship. Specifically, in the quantum operation g i With the quantum operation g j Create a quantum operation g i Pointing to quantum operation g j A directed solid line edge, which is unidirectional, that is, a unidirectional arrow.
[0155] Here, all required directed real line edges can be created based on the correctness restriction rules, so as to meet all correctness restriction conditions required by the quantum circuit and obtain an initial directed acyclic graph.
[0156] It should be noted that the initial directed acyclic graph created by the disclosed solution does not have a closed loop. Here, a closed loop means that a quantum operation passes through one or more directed solid edges and then returns to the quantum operation. For example, there is a quantum operation g i Through one or more directed real edges to the quantum operation g j path, and there exists a quantum operation g j Through one or more directed real edges to the quantum operation g i path, thus, a quantum operation g i In quantum operation g j Before completing the quantum operation g j The logical contradiction is then completed, so there is no closed loop in the initial directed acyclic graph obtained by the disclosed solution.
[0157] Secondly, the initial directed acyclic graph that satisfies the correctness constraint rule is expanded. Specifically, the expansion method includes: creating a bidirectional dashed edge, that is, if there are two quantum operations in the quantum circuit, there is a crosstalk conflict between the two quantum operations, at this time, a bidirectional dashed edge is added between the two quantum operations with the crosstalk conflict, that is, the bidirectional dashed edge includes a bidirectional arrow; for example, if the quantum operation g in the quantum circuit k and quantum operation gl There is a crosstalk conflict between them. At this time, in the quantum operation g k and quantum operation g l A double-dashed edge with a double-headed arrow is created between them, which indicates that the quantum operation g k Pointing to quantum operation g l , which also indicates that the quantum operation g l Pointing to quantum operation g k .
[0158] For example, assume that the quantum circuit includes five quantum operations, namely:
[0159] Quantum Operations 0 →Qubit Q0 (indicates that quantum operation g is performed on qubit Q0 0 );
[0160] Quantum Operations 1 →Qubit Q2 (indicates that quantum operation g is performed on qubit Q2) 1 );
[0161] Quantum Operations 2 →Qubit Q0, qubit Q1 (indicates that quantum operation g is performed on qubit Q0 and qubit Q1) 2 );
[0162] Quantum Operations 3 →Qubit Q1 (indicates that quantum operation g is performed on qubit Q1) 3 );
[0163] Quantum Operations 4 →Qubit Q2 (indicates that quantum operation g is performed on qubit Q2) 4 ).
[0164] Furthermore, the following assumptions are made:
[0165] First, suppose the quantum operation g 0 In the quantum operation g 2 Before completion, the quantum operation g 2 In the quantum operation g 3 Before completion, the quantum operation g 1 In the quantum operation g 4 At this time, nodes and directed solid edges can be created based on the above-mentioned method for creating the initial directed acyclic graph to obtain the structure shown in Figure 4(a).
[0166] Second, assuming that the quantum operation g 0 and quantum operation g 1 There is crosstalk conflict between them, and the quantum operation g 0 and quantum operation g4 There is a crosstalk conflict between them. At this time, the initial directed acyclic graph can be expanded to obtain the quantum operation g. 0 and quantum operation g 1 , and the quantum operation g 0 and quantum operation g 4 By adding bidirectional dashed edges between them, we get the structure shown in Figure 4(b).
[0167] It is understandable that the direction of the bidirectional dashed edge is not completely arbitrary, and it is also necessary to satisfy the condition of no closed loop to avoid the logical contradiction mentioned above. Continuing with Figure 4(b) as an example, if the quantum operation g is obtained based on the above strategy 0 and quantum operation g 1 The bidirectional dashed edges between them need to be updated by the quantum operation g 0 Pointing to quantum operation g 1 At the same time, based on the above strategy, we get the quantum operation g 0 and quantum operation g 4 The bidirectional dashed edge between them needs to be updated as the quantum operation g 4 Pointing to quantum operation g 0 If there is a directed solid edge, a closed loop will appear, that is, the "quantum operation g 0 →Quantum operation g 1 →Quantum operation g 4 →Quantum operation g 0 "At this time, the quantum operation g 0 In quantum operation g 4 Before completion, we need to perform quantum operation g 4 After that, a logical contradiction is created. Therefore, this situation needs to be avoided.
[0168] Based on this, the disclosed solution proposes a specific strategy, which can determine the specific direction of the bidirectional dotted edges in the initial directed acyclic graph obtained after expansion according to the total number of reachable nodes of the node (that is, the total number of other nodes that the current node can reach via the directed solid edges); specifically, the strategy is: always select the node with a large total number of reachable nodes to point to the node with a small total number of reachable nodes.
[0169] For example, continuing with Figure 4(b), for the quantum operation g 0 and quantum operation g 1 The bidirectional dashed edge between them, the initial directed acyclic graph obtained after expansion, the quantum operation g 0 The total number of reachable nodes is 2, that is, the quantum operation g 0 The other nodes that can be reached are quantum operations g 2 and quantum operation g 3 , a total of 2. Similarly, the quantum operation g1 The total number of reachable nodes is 1, that is, the quantum operation g 1 The other nodes that can be reached are quantum operations g 4 , a total of 1; based on this, for the quantum operation g 0 and quantum operation g 1 For the bidirectional dashed edge between 0 The total number of reachable nodes is greater than the quantum operation g 1 The total number of reachable nodes, so we choose 0 To the quantum operation g 1 The direction of the quantum operation g 0 To the quantum operation g 1 The bidirectional dashed edges between are updated to directed solid edges, resulting in the structure shown in Figure 4(c). Similarly, for the quantum operation g 0 and quantum operation g 4 The bidirectional dashed edge between them is due to the quantum operation g 0 The total number of reachable nodes (4) is greater than the quantum operation g 4 The total number of reachable nodes (0), so we choose to use the quantum operation g 0 To the quantum operation g 4 The direction of the quantum operation g 0 To the quantum operation g 4 The bidirectional dotted edges between are updated to directed solid edges, and the structure shown in FIG4( d ) is obtained. At this time, the directed acyclic graph shown in FIG4( d ) is the target directed acyclic graph that can at least handle the crosstalk conflict.
[0170] It should be pointed out that when counting other nodes that the current node can reach, since the specific direction of the bidirectional dotted edge has not yet been determined, only the directed solid edges in the initial directed acyclic graph are used to determine other nodes that the current node can reach.
[0171] Furthermore, after obtaining the target directed acyclic graph, further simplification can be performed, such as deleting redundant directed solid edges. For example, taking Figure 4(d) as an example, it can be seen that the quantum operation g 0 Pointing to quantum operation g 4 There are two paths, namely the quantum operation g 0 Directly pointing to the quantum operation g 4 , or, the quantum operation g 0 Through the quantum operation g 1 Pointing to quantum operation g 4 , at this time, a redundant edge can be deleted. For example, based on the correctness constraint rule, the quantum operation g 0 Pointing to quantum operation g 4The directed solid line edge of is a redundant edge, so it is directly deleted to obtain the target directed acyclic graph after redundant processing as shown in Figure 4(e).
[0172] Furthermore, a linear programming method is used to process the simplified target directed acyclic graph. Specifically, each directed solid edge in the simplified target directed acyclic graph is converted into a linear constraint (that is, converted into a correctness constraint), and the start time of each quantum operation in the quantum circuit is used as a variable to be solved, and then the target start time of each quantum operation can be solved using the LP solver.
[0173] For example, as shown in Figure 4(e), the linear constraints corresponding to the target directed acyclic graph include:
[0174] Quantum Operations 0 →Quantum operation g 2 Linear constraints: s 0 +d 0 ≤s 2 ;
[0175] Quantum Operations 2 →Quantum operation g 3 Linear constraints: s 2 +d 2 ≤s 3 ;
[0176] Quantum Operations 0 →Quantum operation g 1 Linear constraints: s 0 +d 0 ≤s 1 ;
[0177] Quantum Operations 1 →Quantum operation g 4 Linear constraints: s 1 +d 1 ≤s 4 .
[0178] Among them, the s 0 Denotes the quantum operation g 0 The starting time, the d 0 Denotes the quantum operation g 0 The duration, s 1 Denotes the quantum operation g 1 The starting time, the d 1 Denotes the quantum operation g 1 The duration, s 2 Denotes the quantum operation g 2 The starting time, the d 2 Denotes the quantum operation g2 The duration, s 3 Denotes the quantum operation g 3 The starting time of s 4 Denotes the quantum operation g 4 The start time of the .
[0179] In order to suppress the decoherence error of the quantum circuit as much as possible, the disclosed solution can also design the objective function based on the principle of suppressing the decoherence error; here, Qn is used to represent the nth quantum bit, which can be recorded as quantum bit Qn, for example, quantum bit Q0 represents the 0th quantum bit. After determining the quantum circuit, the quantum operation acting on each quantum bit can be obtained; among all the quantum operations acting on the quantum bit Qn, the first quantum operation is numbered as f Qn , the number of the last quantum operation is recorded as l Qn , at this time, the quantum operation l Qn End time Subtract the quantum operation f Qn Start time As the operation cycle of the quantum bit Qn, it is recorded as O n ,Right now
[0180]
[0181] Among them, all represents the first quantum operation f among all quantum operations acting on quantum bit Qn Qn The starting time of represents the last quantum operation l among all quantum operations acting on quantum bit Qn Qn The starting time of Represents the last quantum operation l Qn duration.
[0182] Furthermore, since the length of the operation cycle of a quantum bit will affect the decoherence of the quantum bit, the longer the operation cycle of the quantum bit, the greater the decoherence error. Therefore, the disclosed solution takes the sum of the operation time of all quantum bits in the quantum circuit as the objective function O, that is,
[0183] O=∑ n O n Formula (4)
[0184] The objective function O is a linear function. At this time, the optimization goal of the disclosed solution is to find the minimum function value of the objective function under the premise of satisfying the above linear constraints.
[0185] In this example, the following linear condition can also be used to limit the value range of the variable to be solved. Specifically, the sum of the durations of all quantum operations in the quantum circuit is recorded as max=∑ i d i At this time, assuming that the current time is the starting time, which can be recorded as 0, the latest ending time is (0+max), which can be recorded as max (also referred to as max). The minimum starting time of each quantum operation is the starting point, that is, 0. The maximum starting time of each quantum operation must be less than the latest ending time, that is, max. Based on this, for any quantum operation in the quantum circuit, such as quantum operation g i For quantum operation g i The start time s i The following relationship needs to be satisfied:
[0186] 0≤s i ≤max-d i Formula (5)
[0187] Among them, the d i >0.
[0188] It can be understood that when all quantum operations in the quantum circuit are lined up, the start time of any quantum operation is less than max, and the end time is less than or equal to max.
[0189] In summary, for the entire LP problem of the disclosed solution, the starting time s of each quantum operation in the quantum circuit is i As the variable to be solved, formula (5) is used to limit the range of the variable to be solved; at the same time, a target directed acyclic graph similar to that shown in Figure 4(e) is constructed, and based on the target directed acyclic graph, linear constraints that satisfy the correctness restriction rule and the crosstalk restriction rule are obtained, and then the obtained linear constraints are used as the linear constraints of the LP solver, and the objective function O is used as the linear function of the LP solver. In this way, the minimum value of the objective function O is solved by the LP solver, and at the same time, the target start time of each quantum operation in the quantum circuit is obtained.
[0190] Part II: Implementation Steps
[0191] Specifically, the input of this example can be specifically the quantum circuit to be arranged. The output can be specifically the target start time of each quantum operation.
[0192] Specifically, Figure 5 As shown, the core steps of the disclosed solution include:
[0193] Step S501: Calculate max. Specifically, based on the duration {d i}Calculate max, that is, max = ∑i d i .
[0194] Step S502: Establish an initial directed acyclic graph. Specifically, traverse all quantum operations in the quantum circuit to obtain all two quantum operations that need to meet the correctness constraint rule. For example, obtain the quantum operation g that needs to meet the correctness constraint rule. i and quantum operation g j , which can be expressed as (g i ,g j ). At this time, in the quantum operation g that needs to meet the correctness restriction rules i and quantum operation g j Draw a directed solid line edge between them; further, we can also get all the two quantum operations that need to deal with crosstalk conflicts, for example, we get the quantum operation g that needs to deal with crosstalk conflicts k and quantum operation g l , which can be expressed as (g k ,g l ), at this time, in the quantum operation g that needs to deal with crosstalk conflict k and quantum operation g l Draw a double-dashed edge with a double-headed arrow between them.
[0195] Step S503: Process the bidirectional dashed edges according to the specific strategy proposed in the disclosed solution to obtain a target directed acyclic graph containing directed solid edges.
[0196] Here, after processing the bidirectional dashed edges to obtain the target directed acyclic graph, it can be further streamlined to delete redundant directed solid edges.
[0197] Step S504: Set the variables to be solved. Add the variables to be solved for the LP solver, that is, the start time of each quantum operation, which can be recorded as {s i}, according to formula (3) and the max value obtained in step S501, set the value range of the start time of each quantum operation, for example, 0≤s i ≤max-d i .
[0198] Step S505: setting linear constraints based on the obtained target directed acyclic graph. Specifically, setting target linear constraints based on the directed solid edges in the target directed acyclic graph, and using the target linear constraints as linear constraints of the LP solver.
[0199] Step S506: Setting the objective function and optimization target. Specifically, the objective function is set based on the above formula (3) and formula (4), and at the same time, the minimum value of the objective function is set as the optimization target of the LP solver.
[0200] Step S507: Run the LP solver to obtain the target start time of each quantum operation to be solved and the minimum value of the objective function.
[0201] In summary, in order to better realize the arrangement of quantum operations, while suppressing decoherence errors and avoiding conflicts between quantum operations, the disclosed solution proposes a new arrangement scheme, namely a linear programming scheme, which mainly uses the target directed acyclic graph corresponding to the quantum circuit to be arranged to deal with the crosstalk conflict problem without introducing additional variables, such as integer variables. At the same time, the target directed acyclic graph can also be used to meet the correctness restriction rules. Furthermore, on the basis that the variables to be solved only contain the non-negative real number of the start time of the quantum operation, the objective function (which is a linear function) is used to constrain the decoherence error, and then the target start time of each quantum operation is solved. In this way, the arrangement problem of quantum operations is converted into a general linear programming problem, and the effective arrangement of quantum circuits is realized.
[0202] Moreover, since the disclosed solution is converted into a linear programming problem, the time complexity of the solution is low, that is, the time complexity of the polynomial level, so the disclosed solution is efficient. Moreover, as the number of quantum operations increases, the time complexity will only show a polynomial growth.
[0203] It should be noted that some optimization schemes for quantum circuits require changing the quantum operation itself, such as merging some quantum logic gates into an equivalent quantum logic gate. In this case, the optimization of changing the quantum operation itself, such as merging quantum logic gates, etc., can be performed first, and then the disclosed scheme can be used to jointly achieve the optimization of the quantum circuit.
[0204] Part 3: Application Display
[0205] The disclosed solution proposes a method for arranging quantum operations, which can be based on a determined quantum circuit and the duration of each quantum operation {d i}, under the conditions of considering the correctness restriction rules and crosstalk conflict restriction rules of quantum operations, the target start time of each quantum operation is automatically given to realize the arrangement of quantum operations.
[0206] In order to show the advantages of the quantum operation arrangement scheme proposed in the disclosed scheme, a comparison is made with other existing arrangement schemes, wherein other arrangement algorithms refer to first performing the optimal arrangement with the goal of suppressing decoherence errors, and then traversing the quantum operations after the arrangement, and separating the quantum operations with crosstalk conflicts in time. This is an easy-to-think, simple and fast algorithm.
[0207] This application demonstrates the sum of the operation cycles of all quantum bits as a performance indicator. The smaller the value, the better the performance. The specific comparison results are shown in Table 1. Each row in the table represents an experiment, and each experiment randomly generates 10 quantum operations.
[0208] Table 1: Performance comparison of different algorithms (unit: nanoseconds)
[0209] The present disclosure arrangement Other layout algorithms 3529.4 5842.3 2622.5 3796.4 2209.9 3326.7 3168.0 5893.1 2218.3 3582.5
[0210] In addition, the application also counts the execution time of the two solutions. Here, the shorter the execution time, the higher the efficiency. The specific comparison results are shown in Table 2, where each row in Table 2 represents each experiment, and each experiment randomly generates 20 quantum operations.
[0211] Table 2: Comparison of execution time of different algorithms (unit: seconds)
[0212] The present disclosure arrangement Other layout algorithms 0.017 0.017 0.018 0.016 0.017 0.016 0.020 0.018 0.019 0.019
[0213] According to Table 1 and Table 2, it can be seen that in terms of execution performance, the disclosed solution is superior to other existing arrangement solutions; moreover, in terms of execution time, the two are comparable, and this result is also in line with expectations.
[0214] The disclosed solution also provides a quantum operation processing device, such as Figure 6 As shown, including:
[0215] The processing unit 601 is used to determine a target directed acyclic graph corresponding to the quantum circuit to be arranged, wherein the target directed acyclic graph uses each quantum operation of the N quantum operations included in the quantum circuit as a node, and the directed solid line edge between nodes included in the target directed acyclic graph represents one of the following: the order relationship between two quantum operations that need to meet the correctness restriction rule among the N quantum operations, and the order relationship between two quantum operations that need to handle crosstalk conflicts among the N quantum operations; based on the directed solid line edge included in the target directed acyclic graph, a target linear constraint condition is obtained, wherein the target linear constraint condition is used to constrain the following information: the start time of each quantum operation between two quantum operations that need to meet the correctness restriction rule among the N quantum operations, and the start time of each quantum operation between two quantum operations that have crosstalk conflicts among the N quantum operations; N is a positive integer greater than or equal to 2; when the start time of the quantum operation is used as a parameter to be processed, the target linear constraint condition is used to obtain the target start time of each quantum operation in the N quantum operations;
[0216] The output unit 602 is used to output the target start time of each quantum operation in the N quantum operations.
[0217] In a specific example of the disclosed solution, the processing unit 601 is further configured to arrange the N quantum operations based on the target start time of each quantum operation in the N quantum operations to obtain an arranged quantum circuit;
[0218] The output unit 602 is also used to output the arranged quantum circuit.
[0219] In a specific example of the disclosed solution, the target linear constraint condition is obtained based on at least one of the following of each quantum operation between two quantum operations that need to have a sequential relationship: the start time of the quantum operation, and the duration of the quantum operation acting on the quantum bit.
[0220] In a specific example of the disclosed solution, the processing unit 601 is further configured to:
[0221] Taking each quantum operation of the N quantum operations as a node, establishing a directed solid line edge according to the order relationship between two quantum operations that need to meet the correctness restriction rule, and constructing an initial directed acyclic graph corresponding to the quantum circuit; wherein the directed solid line edge in the initial directed acyclic graph is used to indicate the execution order of the two quantum operations corresponding to itself;
[0222] A bidirectional dashed edge is established between two quantum operations with crosstalk conflicts, and an initial directed acyclic graph including bidirectional dashed edges and directed solid edges is obtained;
[0223] Select one of the bidirectional dashed edges as the target direction, and change the bidirectional dashed edge into a directed solid edge based on the target direction;
[0224] When all bidirectional dashed edges are changed into directed solid edges, the target directed acyclic graph is obtained.
[0225] In a specific example of the disclosed solution, the processing unit 601 is specifically configured to:
[0226] Under the condition that no closed loop is formed, one of the directions in the bidirectional dashed edge is selected as the target direction.
[0227] In a specific example of the disclosed solution, the processing unit 601 is specifically configured to:
[0228] Based on a preset strategy, a target direction is selected from the two directions of the bidirectional dotted edge; wherein, the preset strategy is: a node with a larger total number of reachable nodes points to a node with a smaller total number of reachable nodes; the total number of reachable nodes represents the number of other nodes that the current node can reach via the directed solid edge.
[0229] In a specific example of the disclosed solution, the processing unit 601 is further configured to:
[0230] Determining an objective function; wherein the objective function is used to characterize the decoherence error of the quantum circuit;
[0231] Minimizing the objective function with the start time of the quantum operation as a parameter to be processed and with the objective linear constraint;
[0232] When it is determined that the preset requirements are met, a target start time of each quantum operation in the N quantum operations is obtained.
[0233] In a specific example of the disclosed solution, the processing unit 601 is specifically configured to:
[0234] Determining an operation period of each qubit in the quantum circuit, where the operation period of the qubit is based on the duration of a quantum operation acting on the qubit;
[0235] The objective function is obtained based on the operation cycles of all quantum bits in the quantum circuit.
[0236] In a specific example of the present disclosure,
[0237] The operation period of the qubit is based on the following two parameters:
[0238] The end time of the last quantum operation among all quantum operations acting on the quantum bit, and the start time of the first quantum operation among all quantum operations acting on the quantum bit.
[0239] For the description of the specific functions and examples of each unit of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.
[0240] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0241] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0242] like Figure 7 As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0243] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0244] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as the processing method of quantum operations. For example, in some embodiments, the processing method of quantum operations may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via ROM 702 and / or a communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the processing method of quantum operations described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the processing method of quantum operations by any other appropriate means (e.g., by means of firmware).
[0245] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0246] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0247] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0248] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0249] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0250] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0251] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0252] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the principles of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for processing quantum operations, include: Determine a target directed acyclic graph corresponding to the quantum circuit to be arranged, wherein the target directed acyclic graph uses each quantum operation of the N quantum operations contained in the quantum circuit as a node, and each directed solid line edge between nodes contained in the target directed acyclic graph represents one of the following: a sequential relationship between two quantum operations that need to meet the correctness restriction rule among the N quantum operations, and a sequential relationship between two quantum operations that need to handle crosstalk conflicts among the N quantum operations; the sequential relationship between the two quantum operations that need to meet the correctness restriction rule is a sequential relationship between two quantum operations containing the same quantum bit; Based on the directed solid line edges contained in the target directed acyclic graph, a target linear constraint condition is obtained, wherein the target linear constraint condition is used to constrain the following information: the start time of each quantum operation between two quantum operations that need to meet the correctness constraint rule among the N quantum operations, so as to ensure that the two quantum operations are completed in sequence; the start time of each quantum operation between two quantum operations that need to handle crosstalk conflicts among the N quantum operations, so as to avoid crosstalk conflicts between the two quantum operations; N is a positive integer greater than or equal to 2; When the start time of the quantum operation is used as a parameter to be processed, the target start time of each quantum operation in the N quantum operations is obtained by using the target linear constraint condition; The N quantum operations are arranged based on the target start time of each quantum operation in the N quantum operations to obtain an arranged quantum circuit.
2. The method according to claim 1, in, The target linear constraint condition is obtained based on at least one of the following of each quantum operation between two quantum operations that need to have a sequential relationship: the start time of the quantum operation, and the duration of the quantum operation acting on the quantum bit.
3. The method according to claim 1, further comprising: include: Taking each quantum operation of the N quantum operations as a node, establishing a directed solid line edge according to the order relationship between two quantum operations that need to meet the correctness restriction rule, and constructing an initial directed acyclic graph corresponding to the quantum circuit; wherein the directed solid line edge in the initial directed acyclic graph is used to indicate the execution order of the two quantum operations corresponding to itself; Between two quantum operations that need to handle crosstalk conflicts, a bidirectional dashed edge is established to obtain an initial directed acyclic graph including bidirectional dashed edges and directed solid edges; Select one of the bidirectional dashed edges as the target direction, and change the bidirectional dashed edge into a directed solid edge based on the target direction; When all bidirectional dashed edges are changed into directed solid edges, the target directed acyclic graph is obtained.
4. The method according to claim 3, in, The step of selecting one of the bidirectional dashed line edges as the target direction includes: Under the condition that no closed loop is formed, select one of the bidirectional dashed edges as the target direction.
5. The method according to claim 4, in, The step of selecting one of the bidirectional dashed line edges as the target direction under the condition that no closed loop is formed includes: Based on a preset strategy, a target direction is selected from the two directions of the bidirectional dotted edge; wherein, the preset strategy is: a node with a larger total number of reachable nodes points to a node with a smaller total number of reachable nodes; the total number of reachable nodes represents the number of other nodes that the current node can reach via the directed solid edge.
6. The method according to any one of claims 1 to 5, further comprising: include: Determining an objective function; wherein the objective function is used to characterize the decoherence error of the quantum circuit; Wherein, when the start time of the quantum operation is used as a parameter to be processed, the target start time of each quantum operation in the N quantum operations is obtained by using the target linear constraint condition, including: Minimizing the objective function with the start time of the quantum operation as a parameter to be processed and with the objective linear constraint; When it is determined that the preset requirements are met, a target start time of each quantum operation in the N quantum operations is obtained.
7. The method according to claim 6, in, Determining the objective function comprises: Determining an operation period of each qubit in the quantum circuit, where the operation period of the qubit is based on the duration of a quantum operation acting on the qubit; The objective function is obtained based on the operation cycles of all quantum bits in the quantum circuit.
8. The method according to claim 7, in, The operation period of the qubit is based on the following two parameters: The end time of the last quantum operation among all quantum operations acting on the quantum bit, and the start time of the first quantum operation among all quantum operations acting on the quantum bit.
9. A processing device for quantum operations, include: A processing unit is used to determine a target directed acyclic graph corresponding to the quantum circuit to be arranged, wherein the target directed acyclic graph uses each quantum operation in the N quantum operations contained in the quantum circuit as a node, and each directed solid line edge between nodes contained in the target directed acyclic graph represents one of the following: a sequential relationship between two quantum operations that need to meet the correctness restriction rule among the N quantum operations, and a sequential relationship between two quantum operations that need to handle crosstalk conflicts among the N quantum operations; the sequential relationship between the two quantum operations that need to meet the correctness restriction rule is a sequential relationship between two quantum operations containing the same quantum bit; based on the target directed acyclic graph The directed solid line edges included in the N quantum operations are used to obtain the target linear constraint conditions, wherein the target linear constraint conditions are used to constrain the following information: the start time of each quantum operation between two quantum operations that need to meet the correctness constraint rules among the N quantum operations, so as to ensure that the two quantum operations are completed in sequence; the start time of each quantum operation between two quantum operations that need to handle crosstalk conflicts among the N quantum operations, so as to avoid crosstalk conflicts between the two quantum operations; N is a positive integer greater than or equal to 2; when the start time of the quantum operation is used as the parameter to be processed, the target start time of each quantum operation among the N quantum operations is obtained by using the target linear constraint conditions; An output unit, used to output a target start time of each quantum operation in the N quantum operations; The processing unit is further configured to arrange the N quantum operations based on the target start time of each quantum operation in the N quantum operations to obtain an arranged quantum circuit; The output unit is also used to output the arranged quantum circuit.
10. The device according to claim 9, in, The target linear constraint condition is obtained based on at least one of the following of each quantum operation between two quantum operations that need to have a sequential relationship: the start time of the quantum operation, and the duration of the quantum operation acting on the quantum bit.
11. The device according to claim 9, in, The processing unit is further used for: Taking each quantum operation of the N quantum operations as a node, establishing a directed solid line edge according to the order relationship between two quantum operations that need to meet the correctness restriction rule, and constructing an initial directed acyclic graph corresponding to the quantum circuit; wherein the directed solid line edge in the initial directed acyclic graph is used to indicate the execution order of the two quantum operations corresponding to itself; Between two quantum operations that need to handle crosstalk conflicts, a bidirectional dashed edge is established to obtain an initial directed acyclic graph including bidirectional dashed edges and directed solid edges; Select one of the bidirectional dashed edges as the target direction, and change the bidirectional dashed edge into a directed solid edge based on the target direction; When all bidirectional dashed edges are changed into directed solid edges, the target directed acyclic graph is obtained.
12. The device according to claim 11, in, The processing unit is specifically used for: Under the condition that no closed loop is formed, select one of the bidirectional dashed edges as the target direction.
13. The device according to claim 12, in, The processing unit is specifically used for: Based on a preset strategy, a target direction is selected from the two directions of the bidirectional dotted edge; wherein, the preset strategy is: a node with a larger total number of reachable nodes points to a node with a smaller total number of reachable nodes; the total number of reachable nodes represents the number of other nodes that the current node can reach via the directed solid edge.
14. The device according to any one of claims 9 to 13, in, The processing unit is further used for: Determining an objective function; wherein the objective function is used to characterize the decoherence error of the quantum circuit; Minimizing the objective function with the start time of the quantum operation as a parameter to be processed and with the objective linear constraint; When it is determined that the preset requirements are met, a target start time of each quantum operation in the N quantum operations is obtained.
15. The device according to claim 14, in, The processing unit is specifically used for: Determining an operation period of each qubit in the quantum circuit, where the operation period of the qubit is based on the duration of a quantum operation acting on the qubit; The objective function is obtained based on the operation cycles of all quantum bits in the quantum circuit.
16. The device according to claim 15, in, The operation period of the qubit is based on the following two parameters: The end time of the last quantum operation among all quantum operations acting on the quantum bit, and the start time of the first quantum operation among all quantum operations acting on the quantum bit.
17. An electronic device, include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
18. A non-transitory computer-readable storage medium storing computer instructions, in, The computer instructions are used to cause the computer to execute the method according to any one of claims 1-8.
19. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Quantum circuit depth-oriented compilation optimization method and device
CN113918168A
Quantum circuit construction method and device and quantum computer operating system
CN115310612A
