A quantum circuit instruction set conversion method based on double-bit quantum gate classification

By classifying two-qubit quantum gates and setting conversion rules, the problems of limited applicability and complex rules in existing two-qubit quantum gate conversion technologies are solved, achieving a wider range of applicability and a more efficient conversion process.

CN119227825BActive Publication Date: 2025-11-25INST OF COMPUTING TECH CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411269830.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2025-11-25
Estimated Expiration
2044-09-11

AI Technical Summary

Technical Problem

In existing quantum computing software packages, the conversion technique of two-qubit quantum gates suffers from limitations in types, poor scalability, and limited applicability, and also exhibits serious problems of rule stacking and complication.

Method used

Two-qubit quantum gates are classified, with each category including one or more quantum gates. Intra-class and inter-class conversion rules are set, and the conversion rules are obtained through KAK decomposition to realize the mutual conversion of various types of two-qubit quantum gates.

Benefits of technology

It improves the applicability and scalability of two-qubit quantum gates, simplifies the conversion process, reduces the number of conversion rules, and improves conversion efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227825B_ABST
    Figure CN119227825B_ABST
Patent Text Reader

Abstract

The application provides a quantum circuit instruction set conversion method based on double-bit quantum gate classification, comprising: disassembling multi-bit quantum gates of an original quantum circuit into double-bit quantum gates and single-bit quantum gates; obtaining a plurality of categories defined for double-bit quantum gates, intra-class conversion rules and inter-class conversion rules, each category being provided with a representative quantum gate and comprising a plurality of quantum gates, the intra-class conversion rules comprising conversion rules between the representative quantum gate and each quantum gate of the same category, and the inter-class conversion rules comprising conversion rules between representative quantum gates of each two different categories; determining a double-bit quantum gate to be supported and converting the quantum gate into a target double-bit quantum gate of the instruction set, when the categories of the double-bit quantum gate to be supported and the target double-bit quantum gate are the same, converting according to the intra-class conversion rules, otherwise converting based on the intra-class conversion rules and the inter-class conversion rules; and converting a single-bit quantum gate to be supported into a target single-bit quantum gate of the instruction set.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of quantum computing, in particular, to the field of quantum circuit instruction set conversion, and more particularly, to a quantum circuit instruction set conversion method based on double-bit quantum gate classification. BACKGROUND

[0002] In the design of quantum algorithms, in order to facilitate the intuitive thinking of the implementation process of the algorithm, the quantum gates used usually focus on their logical meaning. However, in quantum computers, in order to realize the physical implementation of quantum algorithms, attention is often paid to the quantum gates that can be directly supported and executed by quantum computers. The existing quantum circuit instruction set that can be directly supported and executed on quantum computers is referred to as the quantum circuit instruction set supported by the quantum computer. The quantum circuit instruction set supported by the existing quantum computer usually includes a non-tensor product double-bit quantum gate and several single-bit quantum gates, and these single-bit quantum gates can realize any 2-order unitary matrix. Therefore, theoretical analysis can prove that such a quantum circuit instruction set can realize any quantum circuit on any number of quantum bits.

[0003] Further, in order to realize the actual effect of the quantum computer executing the quantum algorithm, it is necessary to equivalently transform the quantum gates in the quantum algorithm circuit into a combination of each quantum gate in the quantum circuit instruction set of the target quantum computer, that is, to realize the quantum circuit instruction set conversion. Then, by directly executing the series of quantum gates of the quantum algorithm after conversion on the quantum computer, the physical implementation effect of the quantum algorithm is achieved.

[0004] The implementation principle of quantum circuit instruction set conversion includes that the effect of quantum gates and quantum circuits corresponds to unitary matrices, and by constructing a quantum circuit with the same unitary matrix as the target quantum gate in the quantum circuit instruction set and replacing it, the conversion can be realized. For example, for the Shor algorithm of integer factorization, a large number of controlled Z-axis rotation gates (referred to as CRz gates) are used in the implementation of the standard quantum algorithm circuit. If the quantum computer directly supports the controlled NOT gate (referred to as CNOT gate) and does not support the CRz gate, the CRz gate needs to be converted, as shown in Figure 1 The left side of the equation in the figure represents the CRz gate as a whole, and the right side of the equation represents the Z-axis rotation gate (referred to as Rz gate) with a parameter of a / 2, CNOT gate, Rz gate with a parameter of -a / 2, and CNOT gate from left to right in order. The equation represents that the quantum gate matrices on the left and right are equal. Among them, the matrix on the right is equal to the product of all quantum gate matrices, and the single-bit gate needs to be changed into the same matrix size by being tensor multiplied with the unit matrix first.

[0005] It can be known from the above analysis that the quantum circuit instruction set conversion is a key technology for actually executing a quantum algorithm on a quantum computer. Some quantum circuit instruction set conversion technologies are implemented in existing quantum computing software packages, but these conversion technologies generally have the following problems:

[0006] 1) The type of double-bit quantum gate supported by the conversion is limited: Most of the existing quantum computing software packages only support the conversion into double-bit quantum gates in the quantum circuit instruction set of a specific quantum computer, that is, only support the conversion into a specific type of double-bit quantum gate in the instruction set as a target double-bit quantum gate, and the scope of application is small.

[0007] 2) A large number of conversion rules are stacked: The double-bit quantum gate conversion based on rule replacement means that the conversion rules required between each pair of supported double-bit quantum gates need to be written. Therefore, in this case, if n different double-bit quantum gates need to be supported, n(n-1) conversion rules need to be written. There is a lot of repeated stacking in these rules. This is the main reason why existing quantum computing software packages choose to support only a small number of conversion rules.

[0008] 3) The minimality of the rules is difficult to guarantee: To avoid the problem of a large number of repeated stacking caused by listing all the rules, the existing solution is to directly give some rules, and the other rules are further derived from the directly given rules by a search algorithm. This simple derivation process cannot guarantee that the number of target double-bit quantum gates used in the final double-bit quantum gate conversion rules is the smallest, resulting in the problem of overly complex conversion rules or redundant conversion rules.

[0009] Therefore, in the existing conversion technology for double-bit quantum gates, the type of double-bit quantum gate supported by the conversion is limited, resulting in poor scalability and small scope of application. If the scope of application is to be improved, the conversion rules need to be increased, which leads to the problem of a large number of repeated rules. Or, by using a search algorithm to derive the final conversion rules from the existing rules, which leads to the problem of complex conversion rules.

[0010] It should be noted that the background technology is only used to introduce the relevant information of the present application, so as to facilitate the understanding of the technical scheme of the present application, but it does not mean that the relevant information must be prior art. In the absence of evidence that the relevant information has been disclosed before the filing date of the present application, the relevant information should not be regarded as prior art. SUMMARY

[0011] Therefore, the purpose of the present application is to overcome the defects of the prior art and provide a quantum circuit instruction set conversion method based on double-bit quantum gate classification.

[0012] The purpose of the present application is achieved by the following technical scheme:

[0013] According to a first aspect of the present application, a quantum circuit instruction set conversion method based on double-bit quantum gate classification is provided for converting quantum gates in an original quantum circuit into quantum gates supported by a quantum circuit instruction set, wherein the instruction set includes a target double-bit quantum gate and a plurality of target single-bit quantum gates supported by a quantum computer, and the method includes:

[0014] S1, decompose a multi-bit quantum gate to be supported in an original quantum circuit into a combination of double-bit quantum gates and single-bit quantum gates to obtain a decomposed quantum circuit; S2, obtain a plurality of categories, intra-class conversion rules and inter-class conversion rules predefined for double-bit quantum gates, each category including one or more quantum gates, and a representative quantum gate is provided for each category, the intra-class conversion rules include conversion rules between the representative quantum gate of each category and each quantum gate of the same category, and the inter-class conversion rules include conversion rules between the representative quantum gates of each two different categories; S3, determine the double-bit quantum gate to be supported and its category in the decomposed quantum circuit; S4, convert the double-bit quantum gate to be supported in the decomposed quantum circuit into a target double-bit quantum gate to obtain a converted quantum circuit, wherein when the categories to which the double-bit quantum gate to be supported and the target double-bit quantum gate belong are the same, conversion is performed according to the intra-class conversion rules, otherwise conversion is performed according to the intra-class conversion rules and the inter-class conversion rules; S5, convert the single-bit quantum gate to be supported in the converted quantum circuit into a target single-bit quantum gate to obtain a final quantum circuit.

[0015] In some embodiments of the present application, in the step S4, the conversion according to the intra-class conversion rules includes: converting the double-bit quantum gate to be supported into a first form including a representative quantum gate of the category to which the double-bit quantum gate to be supported belongs according to the intra-class conversion rules; converting the representative quantum gate contained in the first form into a second form including the target double-bit quantum gate according to the intra-class conversion rules; and combining the first form and the second form to obtain a final form including the target double-bit quantum gate.

[0016] In some embodiments of the present application, in the step S4, the conversion based on the intra-class conversion rules and the inter-class conversion rules includes: converting the double-bit quantum gate to be supported into a third form including a representative quantum gate of the category to which the double-bit quantum gate to be supported belongs according to the intra-class conversion rules; converting the representative quantum gate contained in the third form into a fourth form including a representative quantum gate corresponding to the category of the target double-bit quantum gate according to the inter-class conversion rules; converting the representative quantum gate contained in the fourth form into a fifth form including the target double-bit quantum gate according to the intra-class conversion rules; and combining the third form, the fourth form and the fifth form to obtain a final form including the target double-bit quantum gate.

[0017] In some embodiments of the present application, in the step S2, the plurality of predefined categories are defined by the following method: defining two double-bit quantum gates with equivalence relationship as the same category to obtain the plurality of categories, wherein the equivalence relationship between two double-bit quantum gates means that the two double-bit quantum gates can be converted to each other by a double-bit quantum gate and a plurality of single-bit quantum gates.

[0018] In some embodiments of the present application, in the step S2, the conversion rule between the representative quantum gate of each category and each quantum gate in the same category is obtained by KAK decomposition; wherein the conversion rule between the representative quantum gate of each category and each quantum gate in the same category is achieved by a double-bit quantum gate and a plurality of single-bit quantum gates to convert the representative quantum gate and the corresponding quantum gate in the same category to each other; and the conversion rule between the representative quantum gates of each two different categories in the inter-category conversion rule is obtained by KAK decomposition.

[0019] In some embodiments of the present application, in the step S2, the plurality of categories include:

[0020] The first category, whose representative quantum gate is a controlled Z gate, includes the following double-bit quantum gates: controlled NOT gate, controlled Y gate, controlled Z gate, controlled H gate and echo cross-resonance gate;

[0021] The second category, whose representative quantum gate is a double-bit ZZ rotation gate, includes the following double-bit quantum gates: double-bit XX rotation gate, double-bit YY rotation gate, double-bit ZZ rotation gate, double-bit ZX rotation gate, controlled rotation gate around Z axis and controlled rotation gate around Y axis;

[0022] The third category, whose representative quantum gate is a fermionic simulation gate, includes the following double-bit quantum gates: fermionic simulation gate;

[0023] The fourth category, whose representative quantum gate is a square root swap quantum gate, includes the following double-bit quantum gates: square root swap quantum gate.

[0024] In some embodiments of the present application, in the step S3, the determination of the category of the double-bit quantum gate to be supported includes: judging whether there is an equivalence relationship between the double-bit quantum gate to be supported and the representative quantum gate of each category to obtain a judgment result; when the judgment result is that there is an equivalence relationship, it is determined that the double-bit quantum gate to be supported is the category of the corresponding representative quantum gate; wherein when there is no equivalence relationship between the double-bit quantum gate to be supported and the representative quantum gate of all categories, it is determined that the double-bit quantum gate to be supported is a new category.

[0025] According to a second aspect of the present application, there is provided a quantum circuit instruction set conversion system, the system comprising:

[0026] a quantum circuit instruction set module for storing a target double-bit quantum gate supported by a quantum computer, a plurality of target single-bit quantum gates, and a plurality of categories defined for the double-bit quantum gate, each category comprising a plurality of quantum gates, and a representative quantum gate for each category;

[0027] a double-bit quantum gate conversion rule module for predefining intra-category conversion rules and inter-category conversion rules for the double-bit quantum gate, and storing the intra-category conversion rules and the inter-category conversion rules, wherein the intra-category conversion rules comprise conversion rules between the representative quantum gate of each category and each quantum gate of the same category, and the inter-category conversion rules comprise conversion rules between the representative quantum gates of each two different categories;

[0028] a single-bit quantum gate rotation decomposition module for storing rotation decomposition rules of the single-bit quantum gate, the rotation decomposition rules being used to convert a single-bit quantum gate to be supported into a target single-bit quantum gate;

[0029] a circuit analysis execution module for converting quantum gates to be supported in an original quantum circuit into quantum gates in a quantum circuit instruction set based on the method of the first aspect of the present application, to obtain a final quantum circuit.

[0030] According to a third aspect of the present application, there is provided an electronic device comprising one or more processors; and a memory, wherein the memory is configured to store executable instructions; and the one or more processors are configured to implement the steps of the method of the first aspect of the present application by executing the executable instructions.

[0031] Compared with the prior art, the present application has the following advantages:

[0032] The method of the present application classifies a plurality of commonly used double-bit quantum gates in advance, each category comprising one or more quantum gates, a representative quantum gate being provided for each category, and intra-category conversion rules and inter-category conversion rules being preconfigured for the double-bit quantum gate, so that mutual conversion of a plurality of types of double-bit quantum gates can be achieved, the application range is wide, and the method can be applied to a plurality of quantum computers for physical implementation of a plurality of quantum algorithms, and the scalability is good. The intra-category conversion rules comprise conversion rules between the representative quantum gate of each category and each quantum gate of the same category, and the inter-category conversion rules comprise conversion rules between the representative quantum gates of each two different categories, so that the number of conversion rules is greatly reduced. In the process of converting a double-bit quantum gate to be supported into a target double-bit quantum gate, if the double-bit quantum gate to be supported and the target double-bit quantum gate belong to the same category, conversion is performed according to the intra-category conversion rules, otherwise conversion is performed based on the intra-category conversion rules and the inter-category conversion rules, so that the conversion process is more concise and the conversion efficiency is high. Attached Figure Description

[0033] The embodiments of the present invention will be further described below with reference to the accompanying drawings, wherein:

[0034] Figure 1 This is a schematic diagram illustrating the conversion principle of a CRz gate to a CNOT gate according to an embodiment of the present invention;

[0035] Figure 2 This is a schematic flowchart of a quantum circuit instruction set conversion method according to an embodiment of the present invention;

[0036] Figure 3 This is a schematic diagram illustrating the decomposition of the CCZ gate into a combination of a two-qubit quantum gate and a one-qubit quantum gate according to an embodiment of the present invention;

[0037] Figure 4 This is a schematic diagram illustrating the decomposition of the CCRz gate into a combination of a two-qubit quantum gate and a one-qubit quantum gate according to an embodiment of the present invention;

[0038] Figure 5 This is a schematic diagram illustrating some of the conversion rules between the Rzz ​​gate, Rzx gate, and CNOT gate according to an embodiment of the present invention;

[0039] Figure 6 This is a schematic diagram illustrating some of the conversion rules between the CRz gate, Rzz gate, and CNOT gate according to an embodiment of the present invention;

[0040] Figure 7 This is a schematic diagram illustrating the principle of KAK decomposition according to an embodiment of the present invention;

[0041] Figure 8 This is a schematic diagram illustrating the conversion of a parameterized CU3 gate to a CZ gate according to an embodiment of the present invention;

[0042] Figure 9 This is a schematic diagram of the original quantum circuit according to an embodiment of the present invention;

[0043] Figure 10 This is a schematic diagram of the circuit structure for converting the original quantum circuit to a quantum circuit instruction set according to an embodiment of the present invention;

[0044] Figure 11 This is a schematic diagram illustrating the complete process of converting a quantum circuit according to an embodiment of the present invention. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the invention.

[0046] As mentioned in the background section, in the existing conversion technology for double-bit quantum gates, the type of double-bit quantum gates supported by the conversion is limited, resulting in poor scalability and small application range. If the application range is to be improved, the conversion rules need to be increased, which leads to a large number of repeated rules. Alternatively, a search algorithm is used to derive the final conversion rule from the existing rules, which leads to the problem of complex conversion rules.

[0047] Based on the above problems, the inventors propose a quantum circuit instruction set conversion method based on double-bit quantum gate classification, which is used to convert quantum gates in an original quantum circuit into quantum gates supported by a quantum circuit instruction set. The instruction set includes a target double-bit quantum gate supported by a quantum computer and a plurality of target single-bit quantum gates. To solve the problems of poor scalability and small application range, the method classifies a plurality of commonly used double-bit quantum gates in advance, each category including one or more quantum gates, a representative quantum gate is provided for each category, and intra-class conversion rules and inter-class conversion rules are provided in advance for double-bit quantum gates. The mutual conversion of a plurality of types of double-bit quantum gates can be achieved, the application range is wide, and the method can be applied to a plurality of quantum computers for physical implementation of a plurality of quantum algorithms, and the scalability is good. To solve the problem of a large number of repeated rules, the intra-class conversion rules include conversion rules between the representative quantum gate of each category and each quantum gate of the same category, and the inter-class conversion rules include conversion rules between the representative quantum gates of each two different categories. Compared with the existing method of writing n(n-1) conversion rules when supporting n different double-bit quantum gates, the application has a wide application range and greatly reduces the number of conversion rules, avoiding a large number of repeated rules. To solve the problem of complex conversion rules, in the process of converting the double-bit quantum gate to be supported into the target double-bit quantum gate, if the double-bit quantum gate to be supported and the target double-bit quantum gate belong to the same category, the conversion is performed according to the intra-class conversion rules, otherwise the conversion is performed based on the intra-class conversion rules and the inter-class conversion rules. The conversion rules between all double-bit quantum gates do not need to be given, and the conversion process is more concise and efficient.

[0048] According to one embodiment of the application, referring to Figure 2 which is a flowchart of the quantum circuit instruction set conversion method of the application, which includes steps S1, S2, S3, S4 and S5. In order to better understand the application, each step will be described in detail below in conjunction with specific embodiments.

[0049] Step S1: The multi-bit quantum gate to be supported in the original quantum circuit is disassembled into a combination of double-bit quantum gates and single-bit quantum gates, and a disassembled quantum circuit is obtained.

[0050] According to one embodiment of the present application, the original quantum circuit is a logic circuit in the design of quantum algorithm, in which there are quantum gates that cannot be directly executed on a quantum computer, which are referred to as to-be-supported quantum gates in the present application, and can be divided into to-be-supported multi-bit quantum gates, to-be-supported double-bit quantum gates and to-be-supported single-bit quantum gates according to the number of qubits contained therein. Among them, the multi-bit quantum gate refers to a quantum gate with more than two qubits, for example, a multi-controlled Z gate (Controlled-Controlled-Z gate, referred to as CCZ gate) and a multi-controlled rotation Z gate (Controlled-Controlled-RZ gate, referred to as CCRZ gate), both of which operate on three qubits, so both the CCZ gate and the CCRZ gate represent a three-qubit quantum gate.

[0051] According to one embodiment of the present application, the disassembling method of the to-be-supported multi-bit quantum gate can adopt the existing method, for example, the quantum gate unitary matrix decomposition method to disassemble it into a combination of double-bit quantum gates and single-bit quantum gates. Referring to Figure 3 , which is a schematic diagram of disassembling the CCZ gate into a combination of double-bit quantum gates and single-bit quantum gates. The left side of the diagram is the to-be-supported multi-bit quantum gate: CCZ gate, and after disassembling, the disassembled result is in the form shown on the right side, that is, a combination of CX gates, tdg gates, CX gates, T gates, CX gates, tdg gates, CX gates, T gates, CX gates, tdg gates, CX gates, T gates and T gates. Referring to Figure 4 , which is a schematic diagram of disassembling the CCRz gate into a combination of double-bit quantum gates and single-bit quantum gates. The left side of the diagram is the to-be-supported multi-bit quantum gate: CCRz gate with parameter a, and after disassembling, the disassembled result is in the form shown on the right side, that is, a combination of CRz gates with parameters a / 2, CX gates, CRz gates with parameters -a / 2, CX gates, CRz gates with parameters a / 2.

[0052] Step S2: obtaining a plurality of categories, intra-class conversion rules and inter-class conversion rules defined in advance for double-bit quantum gates, each category including a plurality of quantum gates, and a representative quantum gate being provided for each category, the intra-class conversion rules including conversion rules between the representative quantum gate of each category and each quantum gate of the same category, and the inter-class conversion rules including conversion rules between the representative quantum gates of each two different categories.

[0053] According to one embodiment of the present application, before introducing the plurality of categories, intra-class conversion rules and inter-class conversion rules defined in advance for double-bit quantum gates by the present application, the following two aspects of examples are given to illustrate the problems and corresponding principles of the conversion rules and methods of existing double-bit quantum gates:

[0054] The first aspect: in the prior art, in order to improve the scope of application of the conversion method, a conversion rule is set for any two double-bit quantum gates, which leads to a problem of a large number of repeated rules. Referring to Figure 5 which is a part of conversion rules between Rzz gates, Rzx gates and CNOT gates. In the figure, a represents the parameter of the corresponding quantum gate, and equation (a) is the rule for converting the Rzz gate into the CNOT gate: Rzz gate = CNOT gate + Rz gate + CNOT gate, equation (b) is the rule for converting the Rzx gate into the CNOT gate: Rzx gate = H gate + CNOT gate + Rz gate + CNOT gate + H gate, and equation (c) is the conversion rule between the Rzz gate and the Rzx gate: Rzx gate = H gate + Rzz gate + H gate. It can be seen that there is rule stacking in equation (a) and equation (b), that is, they both require CNOT gate + Rz gate + CNOT gate, and equation (a) and equation (b) can actually be directly derived from the conversion rule between the Rzz gate and the Rzx gate, equation (c), without converting into the CNOT gate. Therefore, directly setting rules between each other will lead to a large number of repeated rule stacking.

[0055] The second aspect: searching for an algorithm to derive rules to improve the scope of application of the conversion method will lead to the complication of the conversion rules. Referring to Figure 6 which is a part of conversion rules between CRz gates, Rzz gates and CNOT gates. In the figure, -π / 2, -π, a and 2a represent the parameters of the corresponding quantum gates, equation (a) in the figure is a rule for representing the CNOT gate with the CRz gate: CNOT gate = H gate + Rz gate + CRz gate + H gate, and equation (b) is a rule for representing the Rzz gate with the CNOT gate: Rzz gate = CNOT gate + Rz gate + CNOT gate. Among them, according to Figure 6 equation (a) and equation (b), a rule for representing the Rzz gate with 2 CRz gates and a series of single-bit quantum gates can be naturally derived, but actually there is a simpler rule, equation (c), which only needs to use 1 CRz gate and 1 Rz gate to represent the Rzz gate. Therefore, deriving rules through a search algorithm leads to the complication of the conversion rules.

[0056] To solve the above two problems, the inventors consider the mathematical structure of double-bit quantum gates, and find that two double-bit quantum gates can be represented by one double-bit quantum gate and several single-bit quantum gates. The two double-bit quantum gates are defined as equivalent relations, and the double-bit quantum gates are classified according to the equivalent relations. According to an embodiment of the present application, in step S2, the categories are defined as follows: two double-bit quantum gates with equivalent relations are defined as the same category, and a double-bit quantum gate without equivalent relations with other double-bit quantum gates is defined as a separate category. The categories defined in this way include: a first category, which represents a controlled Z gate (CZ gate), and the double-bit quantum gates in this category include a controlled NOT gate, a controlled Y gate (CY gate), a controlled Z gate (CZ gate), a controlled H gate (CH gate), and an echo cross resonance gate (ECR gate); a second category, which represents a double-bit ZZ rotation gate (Rzz gate), and the double-bit quantum gates in this category include a double-bit XX rotation gate (Rxx gate), a double-bit YY rotation gate (Ryy gate), a double-bit ZZ rotation gate, a double-bit ZX rotation gate (Rzx gate), a controlled Z-axis rotation gate (CRz gate), and a controlled Y-axis rotation gate (CRy gate); a third category, which represents a fermionic simulation gate (Fs im gate), and the double-bit quantum gates in this category include a fermionic simulation gate; and a fourth category, which represents a square root swap quantum gate (sqi Swap gate), and the double-bit quantum gates in this category include a square root swap quantum gate. The technical scheme of this embodiment can at least achieve the following beneficial technical effects: the present application classifies commonly used double-bit quantum gates according to the above equivalent relations, which provides a more concise conversion for subsequent rule setting and conversion, and avoids repeated stacking of rules.

[0057] According to an embodiment of the present application, in step S2, the categories are as shown in Table 1, which is the classification result of defining multiple categories for double-bit quantum gates. When defining multiple categories, two double-bit quantum gates with equivalent relations are divided into the same category, and a double-bit quantum gate without equivalent relations with other double-bit quantum gates is divided into a separate category. The multiple categories defined in this way include: a first category, which represents a controlled Z gate (CZ gate), and the double-bit quantum gates in this category include a controlled NOT gate, a controlled Y gate (CY gate), a controlled Z gate (CZ gate), a controlled H gate (CH gate), and an echo cross resonance gate (ECR gate); a second category, which represents a double-bit ZZ rotation gate (Rzz gate), and the double-bit quantum gates in this category include a double-bit XX rotation gate (Rxx gate), a double-bit YY rotation gate (Ryy gate), a double-bit ZZ rotation gate, a double-bit ZX rotation gate (Rzx gate), a controlled Z-axis rotation gate (CRz gate), and a controlled Y-axis rotation gate (CRy gate); a third category, which represents a fermionic simulation gate (Fs im gate), and the double-bit quantum gates in this category include a fermionic simulation gate; and a fourth category, which represents a square root swap quantum gate (sqi Swap gate), and the double-bit quantum gates in this category include a square root swap quantum gate. The technical scheme of this embodiment can at least achieve the following beneficial technical effects: the present application includes most of the double-bit quantum gates used by current quantum algorithms and supported by quantum computers, and has good scalability, wherein any two double-bit quantum gates in each category have equivalent relations, which facilitates the same type of conversion.

[0058] Table 1: Classification result of defining multiple categories for double-bit quantum gates

[0059] Class Representative quantum gate Homogeneous quantum gate First class CZ gate CX gate, CY gate, CZ gate, CH gate, ECR gate Second class Rzz gate Rxx gate, Ryy gate, Rzz gate, Rzx gate, CRz gate, CRy gate Third class FSim gate FSim gate Fourth class sqiSwap gate sqiSwap gate

[0060] According to an embodiment of the present application, in step S2, the conversion rule between the representative quantum gate of each category and each quantum gate of the same category in the intra-class conversion rule is obtained by KAK decomposition; and the conversion rule between the representative quantum gate of each two different categories in the inter-class conversion rule is obtained by KAK decomposition. Wherein, the conversion rule between the representative quantum gate of each category and each quantum gate of the same category is implemented by a double-bit quantum gate and a plurality of single-bit quantum gates to realize the mutual conversion between the representative quantum gate and the corresponding quantum gate of the same category. For example, the conversion of the CY gate belonging to the first category into the CX gate belonging to the first category can be realized by CY gate = U3 gate + CX gate + U3 gate, wherein the U3 gate is a single quantum bit three-dimensional rotation gate.

[0061] According to an embodiment of the present application, in terms of the classification results of the above table 1, the inter-class conversion rule includes 4*3 = 12 conversion rules, and the intra-class conversion rule includes 5 conversion rules in the first category, 6 conversion rules in the second category, and each of the third category and the fourth category includes only one double-bit quantum gate, and the double-bit quantum gate included in the third category and the fourth category is the representative quantum gate of the corresponding category, therefore, there is 1 conversion rule in the intra-class conversion rule corresponding to each of the two categories, which is 1 conversion rule of the corresponding representative quantum gate and itself, for example, FSim gate = FSim gate, therefore, only 25 conversion rules are required to realize the mutual conversion among the 13 double-bit quantum gates in table 1. The technical scheme of the embodiment can at least achieve the following beneficial technical effects: most of the double-bit quantum gates used by the current quantum algorithm and supported by the quantum computer are included, and the scalability is good. Compared with the existing support for n different double-bit quantum gates, which requires to write n(n-1) rules, the present application only needs to realize the conversion rule between the same class and the conversion rule between the representative quantum gates, and there is an equivalent relationship between the same class, and only one double-bit quantum gate is required for mutual conversion, and the conversion rule is simple.

[0062] According to an embodiment of the present application, referring to Figure 7 which is a schematic diagram of the principle of KAK decomposition. As can be seen from the diagram, the principle of KAK decomposition is that for any double-bit quantum gate U, there is a KAK decomposition structure as follows, which can be calculated by some matrix operations. Wherein, K L0 , K L1 , K R0 , K R1respectively represent four single-bit quantum gates, the matrix of the four single-bit quantum gates is a unitary matrix, i represents an imaginary number, and XX, YY and ZZ can be understood as simultaneously acting X gate, Y gate and Z gate on double quantum bits respectively, represents the value range of a, b and c, and (a, b, c) is a set of all feasible values of (x, y, z), wherein, when x is equal to π / 4, z is greater than or equal to 0, and such a, b and c are unique in KAK decomposition. The KAK decomposition gives an equivalence relationship between double-bit quantum gates: if two double-bit quantum gates have the same a, b and c in the decomposition, the two double-bit quantum gates can be converted into each other by a double-bit quantum gate and a plurality of single-bit quantum gates.

[0063] According to an embodiment of the present application, the selected representative quantum gate of each category needs to consider the commonality and the simplicity of mutual representation, therefore, the representative quantum gate of each category is shown in Table 1, or the representative quantum gate is selected according to actual needs, for example, the CX gate is selected as the representative quantum gate of the first category, and the present application is not limited thereto. If the representative quantum gate shown in Table 1 is selected, the number of double-bit quantum gates required for conversion from a to-be-converted representative quantum gate to a target representative quantum gate is shown in Table 2.

[0064] Table 2: Number of double-bit quantum gates required for conversion between representative quantum gates

[0065]

[0066] In Table 2, the first row is a to-be-converted representative quantum gate, the first column is a target representative quantum gate, each column value represents the number of double-bit quantum gates required for conversion of the corresponding to-be-converted representative quantum gate to each target representative quantum gate, and when the to-be-converted representative quantum gate and the target representative quantum gate are the same double-bit quantum gate, it means that the conversion is one-to-one. For example, one CZ gate is required to convert from CZ gate to CZ gate.

[0067] Step S3: determining the to-be-supported double-bit quantum gate and the category thereof in the disassembled quantum circuit.

[0068] According to an embodiment of the present application, in step S3, the determination of the category of the to-be-supported double-bit quantum gate includes: judging whether there is an equivalence relationship between the to-be-supported double-bit quantum gate and the representative quantum gate of each category, to obtain a judgment result; when the judgment result is that there is an equivalence relationship, determining that the to-be-supported double-bit quantum gate is the category of the corresponding representative quantum gate; wherein, when there is no equivalence relationship between the to-be-supported double-bit quantum gate and the representative quantum gate of all categories, determining that the to-be-supported double-bit quantum gate is a new category.

[0069] According to one embodiment of the present application, whether there is an equivalence relationship between the to-be-supported double-bit quantum gate and the representative quantum gate of each category is determined by using the KAK decomposition method of the above embodiment, and if there is an equivalence relationship, it indicates that the current to-be-supported double-bit quantum gate belongs to the category of the representative quantum gate. Or directly refer to the classification results in Table 1 above to determine whether the current to-be-supported double-bit quantum gate belongs to one of the four categories set in the above embodiment. When the to-be-supported double-bit quantum gate does not belong to the four categories set in the above embodiment, the to-be-supported double-bit quantum gate is divided into a new category, for example, the fifth category, and when there is a double-bit quantum gate that has an equivalence relationship with the to-be-supported double-bit quantum gate, it is also divided into the fifth category.

[0070] Step S4: converting the to-be-supported double-bit quantum gate in the disassembled quantum circuit into a target double-bit quantum gate to obtain a converted quantum circuit, wherein when the to-be-supported double-bit quantum gate and the target double-bit quantum gate belong to the same category, the conversion is performed according to the intra-class conversion rule, otherwise the conversion is performed based on the intra-class conversion rule and the inter-class conversion rule.

[0071] According to one embodiment of the present application, in step S4, when the to-be-supported double-bit quantum gate and the target double-bit quantum gate belong to the same category, the conversion according to the intra-class conversion rule includes: converting the to-be-supported double-bit quantum gate into a first form containing the representative quantum gate of the category to which the to-be-supported double-bit quantum gate belongs according to the intra-class conversion rule and the conversion rule between the to-be-supported double-bit quantum gate and the representative quantum gate in the same category; converting the representative quantum gate contained in the first form into a second form containing the target double-bit quantum gate according to the intra-class conversion rule and the conversion rule between the target double-bit quantum gate and the representative quantum gate in the same category; and combining the first form and the second form to obtain a final form containing the target double-bit quantum gate. Wherein a combined form containing the target double-bit quantum gate and a plurality of single-bit quantum gates is obtained. The technical scheme of this embodiment can at least achieve the following beneficial technical effects: when the to-be-supported double-bit quantum gate and the target double-bit quantum gate belong to the same category, the intra-class conversion rule is used for conversion, and each conversion rule in the intra-class conversion rule has an equivalence relationship, thereby simplifying the conversion process; and only two intra-class conversion rules in the category are needed to realize the conversion of the target double-bit quantum gate, further simplifying the conversion process.

[0072] According to an embodiment of the present application, when the categories are the same, the conversion operation is performed according to the order of the to-be-supported double-bit quantum gate, the same-category representative quantum gate and the target double-bit quantum gate. Illustratively, taking the to-be-supported double-bit quantum gate and the target double-bit quantum gate as Rzx gate and CRz gate respectively, the categories of the two quantum gates are the same, and the conversion is performed according to the in-category conversion rule. The representative quantum gate in this category is Rzz gate, therefore, the obtained in-category conversion rule includes the conversion rule between Rzx gate and Rzz gate and the conversion rule between Rzz gate and CRz gate, the Rzx gate is first converted into a first form composed of Rzz gate and other multiple single-bit quantum gates by using the conversion rule between Rzx gate and Rzz gate, and then the Rzz gate is converted into a second form composed of CRz gate and other multiple single-bit quantum gates by using the conversion rule between Rzz gate and CRz gate, so as to obtain the final form composed of the target double-bit quantum gate CRz and multiple single-bit quantum gates by conversion in this way. For example, the conversion operation is performed according to the order of the to-be-supported double-bit quantum gate A, the same-category representative quantum gate B and the target double-bit quantum gate C, then the first form is the to-be-supported double-bit quantum gate A = the same-category representative quantum gate B + Rz gate + Rx gate, the second form is the same-category representative quantum gate B = the target double-bit quantum gate C + X gate, and the final form obtained by conversion of the to-be-supported double-bit quantum gate A is the combination of the first form and the second form, i.e. A = C + X gate + Rz gate + Rx gate.

[0073] According to an embodiment of the present application, when the categories are the same, if the to-be-supported double-bit quantum gate and the same-category representative quantum gate are the same kind of double-bit quantum gate, the obtained first form only includes the double-bit quantum gate of the same kind. For example, both are CZ gate, then the CZ gate is converted into CZ gate one-to-one in the conversion, no other single-bit quantum gate is combined, and the obtained first form only includes the CZ gate. Similarly, if the same-category representative quantum gate and the target double-bit quantum gate are the same, the obtained second form only includes the same double-bit quantum gate.

[0074] According to one embodiment of the present application, in step S4, when the to-be-supported double-bit quantum gate and the target double-bit quantum gate belong to different categories, the conversion manner based on the intra-class conversion rule and the inter-class conversion rule comprises: converting the to-be-supported double-bit quantum gate into a third form which contains a representative quantum gate of the category to which the to-be-supported double-bit quantum gate belongs, according to the intra-class conversion rule and the conversion rule between the to-be-supported double-bit quantum gate and the representative quantum gate in the same category; converting the representative quantum gate contained in the third form into a fourth form which contains a representative quantum gate corresponding to the category of the target double-bit quantum gate, according to the inter-class conversion rule and the conversion rule between the to-be-supported double-bit quantum gate and the representative quantum gate in the category to which the target double-bit quantum gate belongs; converting the representative quantum gate contained in the fourth form into a fifth form which contains the target double-bit quantum gate, according to the intra-class conversion rule and the conversion rule between the target double-bit quantum gate and the representative quantum gate in the same category; and combining the third form, the fourth form and the fifth form to obtain a final form which contains the target double-bit quantum gate. The final form is a combined form of the target double-bit quantum gate and a plurality of single-bit quantum gates. The technical solution of this embodiment can at least achieve the following beneficial technical effects: when the to-be-supported double-bit quantum gate and the target double-bit quantum gate belong to different categories, only one intra-class conversion rule of the two quantum gates and the conversion rule between the two representative quantum gates are needed to realize the conversion of the target double-bit quantum gate, and the conversion process is simple and efficient.

[0075] According to an embodiment of the present application, when the categories are different, the conversion operation is performed according to the order of the to-be-supported double-bit quantum gate, the representative quantum gate of the category to which the to-be-supported double-bit quantum gate belongs, the representative quantum gate of the category to which the target double-bit quantum gate belongs, and the target double-bit quantum gate. Illustratively, taking the to-be-supported double-bit quantum gate and the target double-bit quantum gate as the CY gate and the CRz gate respectively, the categories to which the two quantum gates belong are different, and are the first category and the second category respectively, and the conversion is performed according to the intra-category conversion rule and the inter-category conversion rule. The representative quantum gate of the first category is the CZ gate, and the representative quantum gate of the second category is the Rzz gate, so that, when the conversion is performed, the obtained intra-category conversion rule includes the conversion rule between the CY gate and the CZ gate and the conversion rule between the Rzz gate and the CRz gate, and the obtained inter-category conversion rule includes the conversion rule between the two representative quantum gates CZ gate and Rzz gate. When the conversion is performed, the CY gate is first converted into a third form composed of the CZ gate and other multiple single-bit quantum gates by using the conversion rule between the CY gate and the CZ gate, then the CZ gate is converted into a fourth form composed of the Rzz gate and other multiple single-bit quantum gates by using the conversion rule between the two representative quantum gates CZ gate and Rzz gate, and then the Rzz gate is converted into a fifth form composed of the CRz gate and other multiple single-bit quantum gates by using the conversion rule between the Rzz gate and the CRz gate, so as to obtain the final form composed of the target double-bit quantum gate CRz and multiple single-bit quantum gates by conversion in this way.

[0076] According to an embodiment of the present application, similarly, when the conversion is performed based on the intra-category conversion rule, if the two double-bit quantum gates to be converted are the same kind of double-bit quantum gate, the obtained third form only includes the same kind of double-bit quantum gate. For example, when the third form is obtained by converting the CZ gate into the CZ gate, no other single-bit quantum gate is needed to be combined, and the obtained third form only includes the CZ gate. When the fifth form is obtained by converting the CRz gate into the CRz gate, no other single-bit quantum gate is needed to be combined, and the obtained fifth form only includes the CRz gate.

[0077] The method of the present application realizes mutual conversion of most double-bit quantum gates. Since any 4*4 unitary matrix can be used as a legal double-bit quantum gate in principle, the present application cannot exhaust all cases. Therefore, according to an embodiment of the present application, double-bit quantum gates that cannot be converted by the classification and conversion rules defined in the present application can be decomposed into double-bit quantum gates supported by a quantum computer by using KAK decomposition. For example, a double-bit quantum gate CU3 gate can be regarded as a double-bit quantum gate of an arbitrary unitary matrix due to its uncertain parameters, and can be decomposed into a supportable double-bit quantum gate by KAK decomposition. Wherein, for double-bit quantum gates without parameters and some double-bit quantum gates with specific parameters, the matrices are the same, and the conversion can be directly performed. For example, some CU3 gates with special parameters do not need to be decomposed by KAK, and can be directly converted into a supportable double-bit quantum gate. See Figure 8 which is a schematic diagram of converting a CU3 gate with parameters into a CZ gate. In the figure, when the three parameters of the CU3 gate are 0, 0 and π respectively, the matrix of the CU3 gate is the same as that of the CZ gate. At this time, the CU3 gate can be directly converted into a CZ gate without KAK decomposition.

[0078] Step S5: converting the to-be-supported single-bit quantum gate in the converted quantum circuit into a target single-bit quantum gate to obtain a final quantum circuit.

[0079] According to an embodiment of the present application, the conversion of the to-be-supported single-bit quantum gate into the target single-bit quantum gate can be performed by using existing methods, such as conversion rules of rotation combination around Z axis and Y axis (referred to as zyz rule), rotation combination around X axis and Y axis (referred to as xyx rule), etc. into single-bit quantum gates in the quantum circuit instruction set, that is, any single-bit quantum gate can be converted into a combination of Rz gate, Ry gate and Rz gate by using the zyz rule. After all to-be-supported multi-bit quantum gates in the original quantum circuit are disassembled, and all to-be-supported double-bit quantum gates and to-be-supported single-bit quantum gates are converted into quantum gates in the quantum circuit instruction set, a final quantum circuit is obtained.

[0080] For example, see Figure 9 which is a structural schematic diagram of an original quantum circuit. In the figure, there are CY gate, CZ gate and CRz gate with a parameter of π / 2, which all act on two quantum bits q0 and q1. The quantum circuit instruction set includes CX gate, Rx gate, Ry gate, Rz gate, H gate and X gate. The original quantum circuit is converted into the quantum circuit instruction set to obtain a final quantum circuit. See Figure 10Figure 1 is a circuit structure diagram of the original quantum circuit converted to the quantum circuit instruction set according to the present application, which is a circuit structure diagram of the original quantum circuit converted to the quantum circuit instruction set. The figure sequentially shows an Rz gate with a parameter of -π / 2, a CNOT gate, an Rz gate with a parameter of -π, an Rx gate with a parameter of π / 2, an Rz gate with a parameter of π / 2, a CNOT gate, an Rz gate with a parameter of -3π / 2, an Rx gate with a parameter of π / 2, an Rz gate with a parameter of 3π / 4, a CNOT gate, an Rz gate with a parameter of -π / 4, and a CNOT gate.

[0081] According to one embodiment of the present application, referring to Figure 11 Figure 2 is a complete flow diagram of the conversion of the quantum circuit using the method of the present application. The figure includes the following steps 1-10:

[0082] Step 1: At the beginning, based on the original quantum circuit, disassemble the supported multi-bit quantum gates present therein to obtain a disassembled quantum circuit;

[0083] Step 2: Based on the disassembled quantum circuit, traverse all the supported double-bit quantum gates present therein;

[0084] Step 3: Read the quantum gates in the disassembled quantum circuit one by one, and for each next quantum gate in the circuit, perform the following judgment:

[0085] Step 4: Determine whether the quantum gate is a double-bit quantum gate, if so, continue to execute step 5, if not, execute step 9;

[0086] Step 5: Determine whether it belongs to the double-bit quantum gate in the quantum circuit instruction set, if not, continue to execute step 6, if so, execute step 9;

[0087] Step 6: Determine whether the class of the double-bit quantum gate is the same as that of the target double-bit quantum gate in the quantum circuit instruction set, if so, continue to execute step 7, if not, execute step 8;

[0088] Step 7: Convert the double-bit quantum gate based on the intra-class conversion rule defined in the present application;

[0089] Step 8: Convert the double-bit quantum gate based on the intra-class conversion rule and the inter-class conversion rule defined in the present application;

[0090] Step 9: Return to the original quantum circuit, including returning the originally supported quantum gate and returning the converted quantum gate;

[0091] Step 10: Determine whether all quantum gates have been traversed, if not, continue to execute steps 3-9, if all quantum gates have been traversed, and the supported double-bit quantum gate and the supported single-bit quantum gate have been converted to the quantum gate in the quantum circuit instruction set, obtain the converted quantum circuit.

[0092] According to one embodiment of the present application, a quantum circuit instruction set conversion system is provided, the system comprising: a quantum circuit instruction set module for storing a target double-bit quantum gate supported by a quantum computer, a plurality of target single-bit quantum gates, and a plurality of categories defined for the double-bit quantum gate, each category comprising a plurality of quantum gates, and a representative quantum gate provided in each category; a double-bit quantum gate conversion rule module for pre-defining intra-category conversion rules and inter-category conversion rules for the double-bit quantum gate, and storing the intra-category conversion rules and the inter-category conversion rules, wherein the intra-category conversion rules comprise conversion rules between the representative quantum gate of each category and each quantum gate of the same category, and the inter-category conversion rules comprise conversion rules between the representative quantum gates of each two different categories; a single-bit quantum gate rotation decomposition module for storing rotation decomposition rules of the single-bit quantum gates, the rotation decomposition rules being used to convert a single-bit quantum gate to be supported into a target single-bit quantum gate; and a circuit analysis and execution module for converting quantum gates to be supported in an original quantum circuit into quantum gates in a quantum circuit instruction set based on the conversion method of the above embodiment, to obtain a final quantum circuit. The rotation decomposition rules of the single-bit quantum gates comprise zyz rules and xyx rules, etc.

[0093] It should be noted that although the above describes each step in a specific order, it does not mean that each step must be performed in the above specific order. In fact, some of these steps can be performed concurrently, or even in a changed order, as long as the desired function can be achieved.

[0094] The present application can be a system, a method, and / or a computer program product. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present application.

[0095] The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or punched tape, a magneto-optical or other optical device, a portable memory stick, a machine-readable readable storage device incorporating a suitable non-transitory computer-readable medium, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium can also include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or punched tape, a magneto-optical or other optical device, a portable memory stick, a machine-readable readable storage device incorporating a suitable non-transitory computer-readable medium, or any suitable combination of the foregoing.

[0096] Having described various embodiments of the application, it is to be understood that the above description is meant not to limit and not to encompass all of the possible embodiments covered by the claims. Many modifications and variations of this application can be apparent to those of ordinary skill in the art without departing from the spirit and scope of the described embodiments. It is intended that the scope of the application should only be limited by the appended claims.

Claims

1. A quantum circuit instruction set conversion method based on two-qubit quantum gate classification, used to convert quantum gates in the original quantum circuit into quantum gates supported by the quantum circuit instruction set, wherein, The instruction set includes a single-target two-qubit quantum gate and multiple single-target one-qubit quantum gates supported by a quantum computer, and the method includes: S1. Decompose the multi-bit quantum gates to be supported in the original quantum circuit into a combination of two-bit quantum gates and single-bit quantum gates to obtain the decomposed quantum circuit. S2. Obtain multiple predefined categories, intra-category conversion rules, and inter-category conversion rules for two-qubit quantum gates. Each category includes one or more quantum gates. A representative quantum gate is set for each category. The intra-category conversion rules include the conversion rules between the representative quantum gate of each category and each quantum gate of the same category. The inter-category conversion rules include the conversion rules between the representative quantum gates of every two different categories. S3. Determine the two-qubit quantum gates to be supported in the disassembled quantum circuit and their categories; S4. Convert the two-qubit quantum gate to be supported in the disassembled quantum circuit into the target two-qubit quantum gate to obtain the converted quantum circuit. When the two-qubit quantum gate to be supported and the target two-qubit quantum gate belong to the same category, the conversion is carried out according to the intra-class conversion rule; otherwise, the conversion is carried out according to the intra-class conversion rule and the inter-class conversion rule. S5. Convert the single-bit quantum gate to be supported in the converted quantum circuit into the target single-bit quantum gate to obtain the final quantum circuit.

2. The method according to claim 1, characterized in that, In step S4, the method of performing the conversion according to the intra-class conversion rules includes: According to the intraclass conversion rules, the two-bit quantum gate to be supported is converted into the first form, which includes the representative quantum gate of the category to which the two-bit quantum gate to be supported belongs; According to the intraclass conversion rule, the representative quantum gate contained in the first form is converted into the second form, which contains the target two-qubit quantum gate; Based on the first and second forms, the final form including the target two-bit quantum gate is obtained by combining them.

3. The method according to claim 1, characterized in that, In step S4, the conversion based on intra-class conversion rules and inter-class conversion rules includes the following methods: According to the intra-class conversion rules, the two-qubit quantum gate to be supported is converted into a third form, which includes the representative quantum gate of the category to which the two-qubit quantum gate to be supported belongs; According to the inter-class conversion rule, the representative quantum gate contained in the third form is converted into the fourth form, which contains the representative quantum gate corresponding to the category of the target two-qubit quantum gate; According to the intraclass conversion rules, the representative quantum gate contained in the fourth form is converted into the fifth form, which contains the target two-qubit quantum gate; Based on the third, fourth, and fifth forms, the final form including the target two-qubit quantum gate is obtained by combining them.

4. The method according to claim 1, characterized in that, In step S2, the predefined multiple categories are defined in the following manner: Two two-bit quantum gates that have an equivalent relationship are defined as belonging to the same category, resulting in multiple categories. Among them, when two two-bit quantum gates can be mutually converted through one two-bit quantum gate and several single-bit quantum gates, it indicates that there is an equivalent relationship between the two two-bit quantum gates.

5. The method according to claim 4, characterized in that, In step S2, the conversion rule between the representative quantum gate of each category and each quantum gate of the same category in the intra-class conversion rule is obtained by KAK decomposition. The conversion rule between the representative quantum gate of each category and each quantum gate of the same category is implemented by using a two-bit quantum gate and several single-bit quantum gates to realize the mutual conversion between the representative quantum gate and the corresponding quantum gate of the same category; The transformation rule between each pair of representative quantum gates of different classes in the inter-class transformation rule is obtained by KAK decomposition.

6. The method according to claim 4, characterized in that, In step S2, the plurality of categories include: The first category is represented by the controlled Z-gate. Two-qubit quantum gates belonging to this category include the controlled NOT gate, the controlled Y-gate, the controlled Z-gate, the controlled H-gate, and the echo cross-resonance gate. The second category is represented by the two-qubit ZZ rotation gate. Two-qubit quantum gates belonging to this category include the two-qubit XX rotation gate, the two-qubit YY rotation gate, the two-qubit ZZ rotation gate, the two-qubit ZX rotation gate, the controlled rotation gate around the Z-axis, and the controlled rotation gate around the Y-axis. The third category is represented by fermion analog gates, and two-qubit quantum gates belonging to this category include fermion analog gates; The fourth category is represented by the square root commutative quantum gate, and two-qubit quantum gates belonging to this category include the square root commutative quantum gate.

7. The method according to claim 4, characterized in that, In step S3, the method for determining the category of the two-qubit quantum gate to be supported includes: Determine whether there is an equivalence relationship between the two-qubit quantum gate to be supported and the representative quantum gate of each category, and obtain the determination result; When the judgment result indicates that an equivalence relationship exists, the two-qubit quantum gate to be supported is determined to be the category of the corresponding representative quantum gate; Specifically, if there is no equivalence relationship between the two-qubit quantum gate to be supported and the representative quantum gates of all categories, the two-qubit quantum gate to be supported is determined as a new category.

8. A quantum circuit instruction set conversion system, characterized in that, The system includes: The quantum circuit instruction set module is used to store a target two-qubit quantum gate, multiple target single-qubit quantum gates supported by the quantum computer, and to store multiple categories defined for the two-qubit quantum gate, each category including multiple quantum gates, and a representative quantum gate for each category; The two-qubit quantum gate conversion rule module is used to predefine intra-class conversion rules and inter-class conversion rules for two-qubit quantum gates, and to store the intra-class conversion rules and inter-class conversion rules. The intra-class conversion rules include the conversion rules between the representative quantum gate of each class and each quantum gate of the same class, and the inter-class conversion rules include the conversion rules between the representative quantum gates of every two different classes. The single-qubit quantum gate rotation decomposition module is used to store the rotation decomposition rules of single-qubit quantum gates. The rotation decomposition rules are used to convert the single-qubit quantum gate to be supported into the target single-qubit quantum gate. The circuit analysis execution module is used to convert the quantum gates to be supported in the original quantum circuit into quantum gates in the quantum circuit instruction set based on the method described in any one of claims 1-7, so as to obtain the final quantum circuit.

9. A computer-readable storage medium, characterized in that, It stores a computer program that can be executed by a processor to implement the steps of the method according to any one of claims 1 to 7.

10. An electronic device, characterized in that, include: One or more processors; as well as Memory, wherein the memory is used to store executable instructions; The one or more processors are configured to implement the steps of the method according to any one of claims 1 to 7 by executing the executable instructions.

Citation Information

Patent Citations

  • Processing method and device of a quantum circuit, storage medium and electronic device

    CN109165741A

  • Quantum control system, quantum control processor, and execution method for quantum instruction set

    WO2022217823A1