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

By classifying and predefined conversion rules for the dual-bit quantum gate, the problems of restricted conversion types and complex rules in the prior art are solved, and a widespread and efficient quantum circuit instruction set conversion is achieved.

CN119227825AActive Publication Date: 2024-12-31INST OF COMPUTING TECH CHINESE ACAD OF SCI

Patent Information

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

Smart Images

  • Figure CN119227825A_ABST
    Figure CN119227825A_ABST
Patent Text Reader

Abstract

The invention provides a quantum circuit instruction set conversion method based on double-bit quantum gate classification. The quantum circuit instruction set conversion method comprises the following steps: disassembling a multi-bit quantum gate of an original quantum circuit into a double-bit quantum gate and a single-bit quantum gate; a plurality of classes, intra-class conversion rules and inter-class conversion rules defined for the double-bit quantum gates are obtained, each class is provided with a representative quantum gate and comprises a plurality of quantum gates, and the intra-class conversion rules comprise conversion rules between the representative quantum gate and each quantum gate of the same class; the inter-class conversion rule comprises conversion rules between representative quantum gates of every two different classes; determining a to-be-supported double-bit quantum gate and converting the quantum gate into a target double-bit quantum gate of the instruction set, and when the to-be-supported double-bit quantum gate and the target double-bit quantum gate are the same in category, converting according to an intra-class conversion rule, otherwise, converting based on the intra-class conversion rule and an inter-class conversion rule; and converting the 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 invention 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 dual-bit quantum gate classification. Background Art

[0002] In quantum algorithm design, in order to facilitate intuitive thinking about the implementation process of the algorithm, the quantum gates used usually focus on their logical meaning. On quantum computers, for the physical implementation of quantum algorithms, attention is often paid to quantum gates that are directly supported and executed by quantum computers. All quantum gates that can be directly supported and executed on quantum computers are currently called quantum circuit instruction sets supported by the quantum computer. The quantum circuit instruction sets supported by existing quantum computers usually include a non-tensor product two-bit quantum gate and several single-bit quantum gates, and these single-bit quantum gates can realize any 2nd-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] Furthermore, in order to achieve the actual effect of quantum computers executing quantum algorithms, it is necessary to equivalently transform the quantum gates in the quantum algorithm circuit into a combination of quantum gates in the quantum circuit instruction set of the target quantum computer, that is, to achieve quantum circuit instruction set conversion. Then, the quantum computer directly executes the converted series of quantum gates of the quantum algorithm to achieve the physical implementation effect of the quantum algorithm.

[0004] The implementation principle of quantum circuit instruction set conversion includes: the effects of quantum gates and quantum circuits correspond to unitary matrices, and a quantum circuit with the same unitary matrix as the target quantum gate is constructed through the quantum gates in the quantum circuit instruction set, and then replaced. For example, in the implementation of the standard quantum algorithm circuit of Shor's algorithm for integer decomposition, a large number of controlled rotation gates around the Z axis (CRz gates) are used. If the quantum computer directly supports controlled NOT gates (CNOT gates) and does not support CRz gates, the CRz gates need to be converted, such as Figure 1 As shown in the figure, it is a schematic diagram of the conversion principle of the CRz gate to the CNOT gate. 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 with a parameter of α / 2 (referred to as the Rz gate), the CNOT gate, the Rz gate with a parameter of -α / 2, and the CNOT gate. This equation indicates 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 must first be converted to the same matrix size by means of tensor product with the unit matrix.

[0005] From the above analysis, we can see that quantum circuit instruction set conversion is a key technology for actually executing quantum algorithms on quantum computers. Some quantum circuit instruction set conversion technologies have also been implemented in existing quantum computing software packages, but these conversion technologies generally contain the following problems:

[0006] 1) The types of two-bit quantum gates that support conversion are limited: Most existing quantum computing software packages only support conversion to two-bit quantum gates in the quantum circuit instruction set of a specific quantum computer, that is, they only support conversion to specific types of two-bit quantum gates in the instruction set as target two-bit quantum gates, and have a small scope of application.

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

[0008] 3) The simplest nature of the rules is difficult to guarantee: In order 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 further derive other rules from the directly given rules through the search algorithm. This simple derivation process cannot guarantee that the number of target two-bit quantum gates used in the final two-bit quantum gate conversion rule is the minimum, resulting in the problem of too complex conversion rules or the existence of redundant conversion rules.

[0009] Therefore, in the existing conversion technology for two-bit quantum gates, the types of two-bit quantum gates that support conversion are limited, resulting in poor scalability and a small scope of application. In order to improve the scope of application, it is necessary to increase conversion rules, which leads to a large number of repeated rule stacking problems, or use search algorithms to derive the final conversion rules through existing rules, which leads to the complexity of the conversion rules.

[0010] It should be noted that this background technology is only used to introduce the relevant information of the present invention to help understand the technical solution of the present invention, but it does not mean that the relevant information is necessarily the prior art. If there is no evidence that the relevant information has been disclosed before the application date of the present invention, the relevant information shall not be regarded as the prior art. Summary of the invention

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

[0012] The objective of the present invention is achieved through the following technical solutions:

[0013] According to a first aspect of the present invention, a quantum circuit instruction set conversion method based on two-bit quantum gate classification is provided, which is used to convert quantum gates in an original quantum circuit into quantum gates supported by a quantum circuit instruction set, wherein the instruction set includes a target two-bit quantum gate and multiple target single-bit quantum gates supported by a quantum computer, and the method includes:

[0014] 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 a decomposed quantum circuit; S2. Obtain multiple categories, intra-category conversion rules and inter-category conversion rules pre-defined for the two-bit quantum gates, each category includes one or more quantum gates, and a representative quantum gate is set for each category. The intra-category conversion rules include conversion rules between the representative quantum gate of each category and each quantum gate of the same category, and the inter-category conversion rules include conversion rules between every two representative quantum gates of different categories; S3. Determine the two-bit quantum gates to be supported in the decomposed quantum circuit and their categories; S4. Convert the two-bit quantum gates to be supported in the decomposed quantum circuit into target two-bit quantum gates to obtain a converted quantum circuit, wherein, when the two-bit quantum gates to be supported and the target two-bit quantum gates belong to the same category, they are converted according to the intra-category conversion rules, otherwise they are converted according to the intra-category conversion rules and the inter-category conversion rules; S5. Convert the single-bit quantum gates to be supported in the converted quantum circuit into the target single-bit quantum gate to obtain a final quantum circuit.

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

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

[0017] In some embodiments of the present invention, in step S2, among the predefined multiple categories, the categories are defined in the following manner: two two-bit quantum gates that have an equivalent relationship are defined as the same category to obtain multiple categories, wherein when the 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.

[0018] In some embodiments of the present invention, in step S2, the conversion rules between the representative quantum gate of each category and each quantum gate of the same category in the intra-category conversion rules are obtained by KAK decomposition; wherein the conversion rules between the representative quantum gate of each category and each quantum gate of the same category use 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 conversion rules between every two representative quantum gates of different categories in the inter-category conversion rules are obtained by KAK decomposition.

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

[0020] The first category, whose representative quantum gate is the controlled Z gate, includes the 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 the two-bit ZZ revolving gate, includes two-bit XX revolving gate, two-bit YY revolving gate, two-bit ZZ revolving gate, two-bit ZX revolving gate, controlled Z-axis revolving gate and controlled Y-axis revolving gate;

[0022] The third category, whose representative quantum gate is the fermion simulation gate, and the two-bit quantum gates belonging to this category include the fermion simulation gate;

[0023] The fourth category, whose representative quantum gate is the square root exchange quantum gate, and the two-bit quantum gates belonging to this category include the square root exchange quantum gate.

[0024] In some embodiments of the present invention, in step S3, the method for determining the category of the two-bit quantum gate to be supported includes: judging whether there is an equivalent relationship between the two-bit quantum gate to be supported and the representative quantum gate of each category, and obtaining a judgment result; when the judgment result is that there is an equivalent relationship, determining that the two-bit quantum gate to be supported is the category of the corresponding representative quantum gate; wherein, when there is no equivalent relationship between the two-bit quantum gate to be supported and the representative quantum gates of all categories, determining that the two-bit quantum gate to be supported is a new category.

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

[0026] A quantum circuit instruction set module, used for storing a target two-bit quantum gate and multiple target single-bit quantum gates supported by a quantum computer, and storing multiple categories defined for two-bit quantum gates, each category including multiple quantum gates, and a representative quantum gate for each category;

[0027] A two-bit quantum gate conversion rule module is used to predefine intra-class conversion rules and inter-class conversion rules for two-bit quantum gates, and store the intra-class conversion rules and inter-class conversion rules, wherein 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 every two representative quantum gates of different categories;

[0028] A single-bit quantum gate rotation decomposition module is used to store the rotation decomposition rules of the single-bit quantum gate, and the rotation decomposition rules are used to convert the single-bit quantum gate to be supported into the target single-bit quantum gate;

[0029] 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 the first aspect of the present invention to obtain the final quantum circuit.

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

[0031] Compared with the prior art, the advantages of the present invention are:

[0032] The method of the present invention will pre-classify a variety of commonly used two-bit quantum gates, each category includes one or more quantum gates, a representative quantum gate is set for each category, and intra-class conversion rules and inter-class conversion rules are pre-set for the two-bit quantum gates, which can realize the mutual conversion of various types of two-bit quantum gates, has a wide range of applications, and can be applied to a variety of quantum computers for the physical implementation of a variety of quantum algorithms, with good scalability. Among them, the intra-class conversion rules include the 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 the conversion rules between every two representative quantum gates of different categories, which greatly reduces the number of conversion rules. In the process of converting the two-bit quantum gate to be supported into the target two-bit quantum gate, if the two-bit quantum gate to be supported and the target two-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, and the conversion process is simpler and the conversion efficiency is high. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The embodiments of the present invention are further described below with reference to the accompanying drawings, in which:

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

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

[0036] Figure 3 A schematic diagram of a CCZ gate according to an embodiment of the present invention being disassembled into a combination of a two-bit quantum gate and a single-bit quantum gate;

[0037] Figure 4 A schematic diagram of a CCRz gate according to an embodiment of the present invention being disassembled into a combination of a two-bit quantum gate and a single-bit quantum gate;

[0038] Figure 5 A schematic diagram of some conversion rules among Rzz gates, Rzx gates and CNOT gates according to an embodiment of the present invention;

[0039] Figure 6 A schematic diagram of some conversion rules among CRz gate, Rzz gate and CNOT gate according to an embodiment of the present invention;

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

[0041] Figure 8 A schematic diagram of converting a CU3 gate including parameters into a CZ gate according to an embodiment of the present invention;

[0042] Fig. 9 A schematic diagram of the structure of an original quantum circuit according to an embodiment of the present invention;

[0043] Fig.10 A schematic diagram of a circuit structure in which an original quantum circuit is converted into a quantum circuit instruction set according to an embodiment of the present invention;

[0044] Fig.11 Schematic diagram of a complete process of converting a quantum circuit according to an embodiment of the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below through specific embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0046] As mentioned in the background technology section, in the existing conversion technology for two-bit quantum gates, the types of two-bit quantum gates that support conversion are limited, resulting in poor scalability and a small scope of application. In order to increase the scope of application, it is necessary to increase conversion rules, which leads to a large number of repeated rule stacking problems, or use a search algorithm to derive the final conversion rules through the existing rules, which leads to the problem of complicated conversion rules.

[0047] Based on the above problems, the inventors proposed a quantum circuit instruction set conversion method based on two-bit quantum gate classification, which is 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 target two-bit quantum gate and multiple target single-bit quantum gates supported by the quantum computer. In order to solve the problems of poor scalability and small scope of application, the method of the present invention will pre-classify a variety of commonly used two-bit quantum gates, each category includes one or more quantum gates, a representative quantum gate is set for each category, and intra-class conversion rules and inter-class conversion rules are pre-set for two-bit quantum gates, which can realize the mutual conversion of various types of two-bit quantum gates, has a wide scope of application, and can be applied to a variety of quantum computers for the physical implementation of a variety of quantum algorithms, and has good scalability. In order to solve the problem of repeated stacking of a large number of rules, the intra-class conversion rules of the method of the present invention include the 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 the conversion rules between every two representative quantum gates of different categories. Compared with the existing method of supporting n different two-bit quantum gates, it is necessary to write n (n-1) conversion rules. The present invention not only has a wide range of applications, but also greatly reduces the number of conversion rules, avoiding a large number of repeated stacking of rules. In order to solve the problem of complicated conversion rules, in the process of converting the two-bit quantum gate to be supported into the target two-bit quantum gate, if the two-bit quantum gate to be supported and the target two-bit quantum gate belong to the same category, the conversion is carried out according to the intra-class conversion rules, otherwise the conversion is carried out based on the intra-class conversion rules and the inter-class conversion rules. There is no need to provide the conversion rules between all two-bit quantum gates, and the conversion process is more concise and the conversion efficiency is high.

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

[0049] Step S1: Decompose the multi-bit quantum gates to be supported in the original quantum circuit into a combination of a two-bit quantum gate and a single-bit quantum gate to obtain a decomposed quantum circuit.

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

[0051] According to an embodiment of the present invention, the multi-bit quantum gate to be supported can be decomposed in an existing manner, for example, by decomposing the multi-bit quantum gate into a combination of a dual-bit quantum gate and a single-bit quantum gate by decomposing the quantum gate unitary matrix. Figure 3 , which is a schematic diagram of the disassembly of the CCZ gate into a combination of a two-bit quantum gate and a single-bit quantum gate. The left side of the figure shows the multi-bit quantum gate to be supported: the CCZ gate. After disassembling it, the disassembly result is shown on the right, that is, a combination of CX gate, tdg gate, CX gate, T gate, CX gate, tdg gate, CX gate, T gate, CX gate, tdg gate, CX gate, T gate and T gate in sequence. See also Figure 4 , which is a schematic diagram of the decomposition of the CCRz gate into a combination of a two-bit quantum gate and a single-bit quantum gate. The left side of the figure shows a multi-bit quantum gate with a parameter of α to be supported: the CCRz gate. After decomposing it, the decomposition result is shown on the right, that is, a CRz gate with a parameter of α / 2, a CX gate, a CRz gate with a parameter of -α / 2, a CX gate, and a CRz gate with a parameter of α / 2.

[0052] Step S2: obtaining a plurality of predefined categories, intra-category conversion rules and inter-category conversion rules for two-bit quantum gates, wherein each category includes a plurality of quantum gates, and a representative quantum gate is provided for each category. The intra-category conversion rules include conversion rules between the representative quantum gate of each category and each quantum gate of the same category, and the inter-category conversion rules include conversion rules between representative quantum gates of every two different categories.

[0053] According to an embodiment of the present invention, before introducing the multiple categories, intra-category conversion rules and inter-category conversion rules predefined for two-bit quantum gates in the present invention, the following two aspects of the problems and corresponding principles caused by the conversion rules and methods of existing two-bit quantum gates are first illustrated by examples:

[0054] First, if the existing method wants to improve the applicability of the conversion method, it will set a conversion rule for any two two-bit quantum gates, which will lead to the problem of a large number of repeated rules. Figure 5 , which is a schematic diagram of some conversion rules between Rzz gate, Rzx gate and CNOT gate. In the figure, α represents the parameters of the corresponding quantum gate, and equation (a) is the rule when Rzz gate is converted to CNOT gate: Rzz gate = CNOT gate + Rz gate + CNOT gate, equation (b) is the rule when Rzx gate is converted to CNOT gate: Rzx gate = H gate + CNOT gate + Rz gate + CNOT gate + H gate, and equation (c) is the conversion rule between Rzz gate and Rzx gate: Rzx gate = H gate + Rzz gate + H gate. It can be clearly seen that there is rule stacking in equation (a) and equation (b), that is, they both need CNOT gate + Rz gate + CNOT gate, and the two rules of equation (a) and equation (b) can actually be directly derived from the conversion rule equation (c) between Rzz gate and Rzx gate, without converting them to CNOT gates respectively. Therefore, directly setting rules between two gates will lead to a large number of repeated rule stacking.

[0055] Second aspect: Increasing the scope of application of the conversion method by deriving rules through search algorithms will lead to the complexity of the conversion rules. Figure 6 , which is a schematic diagram of some conversion rules between CRz gate, Rzz gate and CNOT gate. In the figure, -π / 2, -π, α, 2α all represent the parameters of the corresponding quantum gates. Equation (a) in the figure gives the rule of using CRz gate to represent CNOT gate: CNOT gate = H gate + Rz gate + CRz gate + H gate, and equation (b) gives the rule of using CNOT gate to represent Rzz gate: Rzz gate = CNOT gate + Rz gate + CNOT gate. Among them, the search algorithm is based on Figure 6 Equations (a) and (b) can naturally derive a rule for representing the Rzz ​​gate using two CRz gates and a series of single-bit quantum gates, but there is actually a simpler rule, namely equation (c), which only requires one CRz gate and one Rz gate to represent the Rzz ​​gate. Therefore, deriving the rule through the search algorithm leads to the complication of the conversion rule.

[0056] In order to solve the above two problems, the inventors considered the mathematical structure of the two-bit quantum gates, and defined the two quantum gates as an equivalent relationship in which only one two-bit quantum gate and several single-bit quantum gates are needed to represent each other. The two-bit quantum gates are classified in advance according to the equivalent relationship. According to one embodiment of the present invention, in step S2, among the multiple predefined categories, the categories are defined in the following way: the two two-bit quantum gates with an equivalent relationship are defined as the same category to obtain multiple categories, wherein when the two two-bit quantum gates can be converted to each other 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. The technical solution of this embodiment can at least achieve the following beneficial technical effects: under such an equivalent relationship definition, the present invention classifies commonly used two-bit quantum gates, provides a simpler conversion for subsequent rule setting and conversion, and avoids repeated stacking of rules.

[0057] According to an embodiment of the present invention, in step S2, multiple categories are shown in Table 1 below, which is a classification result of defining multiple categories for two-bit quantum gates. When defining multiple categories, two two-bit quantum gates that have an equivalent relationship are classified into the same category. If a two-bit quantum gate has no equivalent relationship with all other two-bit quantum gates, it is classified into a separate category. The multiple categories defined in this way include: the first category, whose representative quantum gate is the controlled Z gate (referred to as CZ gate), and the two-bit quantum gates belonging to this category include the controlled NOT gate, the controlled Y gate (referred to as CY gate), the controlled Z gate (referred to as CZ gate), the controlled H gate (referred to as CH gate) and the echo cross resonance gate (referred to as ECR gate); the second category, whose representative quantum gate is the two-bit ZZ rotation gate (referred to as Rzz gate), and the two-bit quantum gates belonging to this category include the two-bit XX rotation gate (referred to as Rxx gate), the two-bit YY rotation gate (referred to as Ryy gate), the two-bit ZZ rotation gate, the two-bit ZX rotation gate (referred to as Rzx gate), the controlled rotation gate around the Z axis (referred to as CRz gate) and the controlled rotation gate around the Y axis (referred to as CRy gate); the third category, whose representative quantum gate is the fermion simulation gate (referred to as Fs im gate), and the two-bit quantum gates belonging to this category include the fermion simulation gate; the fourth category, whose representative quantum gate is the square root exchange quantum gate (referred to as sqi Swap gate), and the two-bit quantum gates belonging to this category include the square root swap quantum gate. The technical solution of this embodiment can at least achieve the following beneficial technical effects: the present invention includes most of the two-bit quantum gates used by current quantum algorithms and supported by quantum computers, and has good scalability. Among them, there is an equivalence relationship between any two two-bit quantum gates in each category, which is convenient for the same type of conversion.

[0058] Table 1: Classification results for defining multiple categories for two-bit quantum gates

[0059] category Represents a quantum gate Similar quantum gates Category I CZ Door CX door, CY door, CZ door, CH door, ECR door Second Category Rzz Gate Rxx gate, Ryy gate, Rzz gate, Rzx gate, CRz gate, CRy gate Category III FSim Gate FSim Gate Category 4 sqiSwap Gate sqiSwap Gate

[0060] According to one embodiment of the present invention, in step S2, the conversion rules between the representative quantum gate of each category and each quantum gate of the same category in the intra-class conversion rules are obtained by KAK decomposition (Kraus Operator Decomposition); the conversion rules between each two representative quantum gates of different categories in the inter-class conversion rules are obtained by KAK decomposition. Among them, the conversion rules between the representative quantum gate of each category and each quantum gate of the same category use 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. For example, the CY gate belonging to the first category is converted to the CX gate belonging to the first category, which can be converted to the CX gate 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 invention, for the classification results of Table 1 above, the inter-class conversion rules include 4*3=12 conversion rules. Among the intra-class conversion rules, there are 5 in the first category, 6 in the second category, and only one two-bit quantum gate in the third category and the fourth category. The two-bit quantum gate contained in the third category and the fourth category is the representative quantum gate of the corresponding category. Therefore, there is one conversion rule in the intra-class conversion rules corresponding to each of the two categories, which is a conversion rule corresponding to the representative quantum gate and itself, for example, FSim gate=FSim gate. Therefore, only 25 conversion rules are needed to realize the mutual conversion between the 13 two-bit quantum gates in Table 1. The technical solution of this embodiment can at least achieve the following beneficial technical effects: it includes the vast majority of two-bit quantum gates used by current quantum algorithms and supported by quantum computers, and has good scalability. Compared with the existing support for n different two-bit quantum gates that require writing n(n-1) rules, the present invention only needs to implement the conversion rules between the same category and the conversion rules between the representative quantum gates, and there is an equivalence relationship between the same category. Only one two-bit quantum gate is needed for mutual conversion, and the conversion rules are simple.

[0062] According to one embodiment of the present invention, see Figure 7 , which is a schematic diagram of the principle of the KAK decomposition method. From this figure, we can see that the principle of the KAK decomposition method is: for any two-bit quantum gate U, there is the following KAK decomposition structure, which can be calculated through some matrix operations. Among them, K L0 , K L1 , K R0 , K R1They represent four single-bit quantum gates respectively. The matrices of the four single-bit quantum gates are unitary matrices, which are determined by the matrix decomposition result of quantum gate U. i represents an imaginary number. XX, YY, and ZZ can be understood as X gate, Y gate, and Z gate acting on the dual quantum bits simultaneously. represents the range of values ​​of a, b, c, (a, b, c) is the set of all feasible values ​​of (x, y, z), where when x is equal to π / 4, z is greater than or equal to 0, and such a, b, c is unique in the KAK decomposition. The KAK decomposition gives an equivalence relationship between two-bit quantum gates: if two two-bit quantum gates have the same a, b, c in this decomposition, then the two two-bit quantum gates can be converted to each other through a two-bit quantum gate and several single-bit quantum gates.

[0063] According to an embodiment of the present invention, the representative quantum gates selected for each category need to take into account commonality and simplicity of mutual representation. Therefore, the representative quantum gates of each category are shown in Table 1 above, or representative quantum gates are selected according to actual needs, for example, the CX gate is used as the representative quantum gate of the first category, and the present invention is not limited to this. Among them, if the representative quantum gates shown in Table 1 above, the number of two-bit quantum gates required to convert from a representative quantum gate to be converted to a target representative quantum gate in the inter-class conversion rule is shown in Table 2 below:

[0064] Table 2: Number of two-bit quantum gates required to represent the conversion rules between quantum gates

[0065]

[0066] In Table 2 above, the first row is the representative quantum gate to be converted, and the first column is the target representative quantum gate. The value in each column indicates the number of two-bit quantum gates required to convert the corresponding representative quantum gate to be converted into each target representative quantum gate. When the representative quantum gate to be converted and the target representative quantum gate are the same two-bit quantum gate, it means a one-to-one conversion. For example, one CZ gate is required to achieve the conversion from CZ gate to CZ gate.

[0067] Step S3: Determine the two-bit quantum gates to be supported in the disassembled quantum circuit and their categories.

[0068] According to an embodiment of the present invention, in step S3, the method for determining the category of the two-bit quantum gate to be supported includes: judging whether there is an equivalent relationship between the two-bit quantum gate to be supported and the representative quantum gate of each category, and obtaining a judgment result; when the judgment result is that there is an equivalent relationship, determining that the two-bit quantum gate to be supported is the category of the corresponding representative quantum gate; wherein, when there is no equivalent relationship between the two-bit quantum gate to be supported and the representative quantum gates of all categories, determining that the two-bit quantum gate to be supported is a new category.

[0069] According to one embodiment of the present invention, the KAK decomposition method of the above embodiment is used to determine whether there is an equivalent relationship between the two-bit quantum gate to be supported and the representative quantum gate of each category. If there is an equivalent relationship, it means that the two-bit quantum gate to be supported currently belongs to the category of the representative quantum gate. Or directly refer to the classification results in Table 1 above to determine whether the two-bit quantum gate to be supported currently belongs to one of the four categories set in the above embodiment. Among them, when the two-bit quantum gate to be supported does not belong to the four categories set in the above embodiment, the two-bit quantum gate to be supported is divided into a new category, such as the fifth category. When there is a two-bit quantum gate that has an equivalent relationship with the two-bit quantum gate to be supported, it is also divided into the fifth category.

[0070] Step S4: converting the two-bit quantum gate to be supported in the disassembled quantum circuit into a target two-bit quantum gate to obtain a converted quantum circuit, wherein when the two-bit quantum gate to be supported and the target two-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 invention, in step S4, when the two-bit quantum gate to be supported and the target two-bit quantum gate belong to the same category, the method of converting according to the intra-class conversion rule includes: according to the intra-class conversion rule, using the conversion rule between the two-bit quantum gate to be supported and the representative quantum gates of the same category, converting the two-bit quantum gate to be supported into a 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 intra-class conversion rule, using the conversion rule between the target two-bit quantum gate and the representative quantum gates of the same category, converting the representative quantum gates included in the first form into a second form, which includes the target two-bit quantum gate; based on the first form and the second form, combining to obtain a final form including the target two-bit quantum gate. Among them, a combination form including the target two-bit quantum gate and a plurality of single-bit quantum gates is obtained. The technical solution of this embodiment can at least achieve the following beneficial technical effects: when the categories of the two-bit quantum gate to be supported and the target two-bit quantum gate are the same, the conversion is performed using the intra-class conversion rules, and each conversion rule in the intra-class conversion rules has an equivalent relationship, thereby simplifying the conversion process; and, only two intra-class conversion rules under the category are required to realize the conversion of the target two-bit quantum gate, thereby further simplifying the conversion process.

[0072] According to one embodiment of the present invention, when the categories are the same, the conversion operation is performed in the order of the two-bit quantum gate to be supported → the representative quantum gate of the same category → the target two-bit quantum gate. Schematically, taking the two-bit quantum gate to be supported and the target two-bit quantum gate as an example, the two quantum gates belong to the same category and are converted according to the intra-class conversion rule. The representative quantum gate under this category is the Rzz ​​gate. Therefore, when converting, the intra-class conversion rules obtained include the conversion rules between the Rzx gate and the Rzz ​​gate and the conversion rules between the Rzz ​​gate and the CRz gate. The conversion rules between the Rzx gate and the Rzz ​​gate are first used to convert the Rzx gate into a first form composed of the Rzz ​​gate and other multiple single-bit quantum gates. Then, the conversion rules between the Rzz ​​gate and the CRz gate are used to convert the Rzz ​​gate into a second form composed of the CRz gate and other multiple single-bit quantum gates. In this way, the final form including the target two-bit quantum gate CRz and a plurality of single-bit quantum gates is converted. For example, the conversion operation is performed in the order of the two-bit quantum gate A to be supported → the representative quantum gate B of the same type → the target two-bit quantum gate C. Then, the first form is the two-bit quantum gate A to be supported = the representative quantum gate B of the same type + the Rz gate + the Rx gate, and the second form is the representative quantum gate B of the same type = the target two-bit quantum gate C + the X gate. Then, the final form obtained by converting the two-bit quantum gate A to be supported is a combination of the first form and the second form, that is, A = C + X gate + Rz gate + Rx gate.

[0073] According to an embodiment of the present invention, when the categories are the same, if the two-bit quantum gate to be supported and the representative quantum gate of the same category are the same two-bit quantum gate, the first form obtained only includes the same two-bit quantum gate. For example, if they are all CZ gates, then during the conversion, the CZ gate is converted to the CZ gate in a one-to-one conversion, and no other single-bit quantum gate combination is required, and the first form obtained only includes the CZ gate. Similarly, if the representative quantum gate of the same category is the same as the target two-bit quantum gate, the second form obtained only includes the same gate two-bit quantum gate.

[0074] According to an embodiment of the present invention, in step S4, when the categories to be supported by the two-bit quantum gate and the target two-bit quantum gate are different, the method of converting based on the intra-class conversion rule and the inter-class conversion rule includes: according to the intra-class conversion rule, using the conversion rule between the two-bit quantum gate to be supported and the representative quantum gates under the same category, converting the two-bit quantum gate to be supported into a third form, which includes the representative quantum gate of the category to which the two-bit quantum gate to be supported belongs; according to the inter-class conversion rule, using the conversion rule between the representative quantum gates of the categories to which the two-bit quantum gate to be supported and the target two-bit quantum gate respectively belong, converting the representative quantum gate included in the third form into a fourth form, which includes the representative quantum gate corresponding to the category of the target two-bit quantum gate; according to the intra-class conversion rule, using the conversion rule between the target two-bit quantum gate and the representative quantum gate under the same category, converting the representative quantum gate included in the fourth form into a fifth form, which includes the target two-bit quantum gate; based on the third form, the fourth form and the fifth form, combining to obtain a final form including the target two-bit quantum gate. The final form is a combination of the target two-bit quantum gate and several single-bit quantum gates. The technical solution of this embodiment can at least achieve the following beneficial technical effects: when the categories of the two-bit quantum gate to be supported and the target two-bit quantum gate are different, only one intra-class conversion rule of the two quantum gates and a conversion rule between two representative quantum gates are required to realize the conversion of the target two-bit quantum gate, and the conversion process is simple and efficient.

[0075] According to one embodiment of the present invention, when the categories are different, the conversion operation is performed in the order of the two-bit quantum gate to be supported → the representative quantum gate of the category to which the two-bit quantum gate to be supported belongs → the representative quantum gate of the category to which the target two-bit quantum gate belongs → the target two-bit quantum gate. Schematically, taking the two-bit quantum gate to be supported and the target two-bit quantum gate as an example, the categories to which the two quantum gates belong are different, namely the first category and the second category, and the conversion is performed according to the intra-class conversion rule and the inter-class conversion rule. Among them, 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. Therefore, when converting, the intra-class conversion rules obtained include the conversion rules between the CY gate and the CZ gate and the conversion rules between the Rzz ​​gate and the CRz gate, and the inter-class conversion rules obtained include the conversion rules between the two representative quantum gates, the CZ gate and the Rzz ​​gate. During the conversion, the conversion rule between the CY gate and the CZ gate is first used to convert the CY gate into a third form composed of the CZ gate and other multiple single-bit quantum gates. Then, the conversion rule between the two representative quantum gates, the CZ gate and the Rzz ​​gate, is used to convert the CZ gate into a fourth form composed of the Rzz ​​gate and other multiple single-bit quantum gates. Then, the conversion rule between the Rzz ​​gate and the CRz gate is used to convert the Rzz ​​gate into a fifth form composed of the CRz gate and other multiple single-bit quantum gates. In this way, the final form containing the target two-bit quantum gate CRz and a combination of several single-bit quantum gates is obtained.

[0076] According to an embodiment of the present invention, similarly, when converting based on the intra-class conversion rule, if the two two-bit quantum gates that convert to each other are the same two-bit quantum gate, the third form obtained only includes the same two-bit quantum gate. For example, when the third form is obtained by converting from a CZ gate to a CZ gate, no other single-bit quantum gate combination is required, and the third form obtained only includes the CZ gate. When the fifth form is obtained by converting from a CRz gate to a CRz gate, no other single-bit quantum gate combination is required, and the fifth form obtained only includes the CRz gate.

[0077] Although the method of the present invention realizes the mutual conversion of most two-bit quantum gates, since in principle any 4×4 unitary matrix can be used as a legal two-bit quantum gate, the present invention cannot cover all situations. Therefore, according to one embodiment of the present invention, for two-bit quantum gates that cannot be converted through the classification and conversion rules defined in the present invention, KAK decomposition can be used to decompose them into two-bit quantum gates supported by quantum computers. For example, the two-bit quantum gate CU3 gate, due to the uncertainty of its parameters, can be regarded as a two-bit quantum gate of any unitary matrix, and decomposed into supported two-bit quantum gates through KAK decomposition. Among them, when the matrix of a two-bit quantum gate without parameters is the same as that of some two-bit quantum gates with specific parameters, they can be directly converted. For example, some CU3 gates with special parameters do not need to be decomposed by KAK and can be directly converted to supported two-bit quantum gates. See. Figure 8 , which is a schematic diagram of converting a CU3 gate with parameters to a CZ gate. In the figure, when the three parameters of the CU3 gate are 0, 0, and π, the matrix of the CU3 gate is the same as the matrix of the CZ gate. At this time, it can be directly converted to a CZ gate without KAK decomposition.

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

[0079] According to one embodiment of the present invention, the single-bit quantum gate to be supported is converted into the target single-bit quantum gate in an existing manner, for example, through the rotation combination rule around the Z axis and the Y axis (abbreviated as zyz rule), the rotation combination rule around the X axis and the Y axis (abbreviated as xyx rule) and other conversion rules into the single-bit quantum gate 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 through the zyz rule. After all the multi-bit quantum gates to be supported in the original quantum circuit are disassembled, and all the dual-bit quantum gates to be supported and the single-bit quantum gates to be supported are converted into quantum gates in the quantum circuit instruction set, the final quantum circuit is obtained.

[0080] Indicatively, see Fig. 9 , which is a schematic diagram of the structure of the original quantum circuit, which shows the CY gate, CZ gate and CRz gate with parameter π / 2, and all act on the two quantum bits q 0 ,q 1 The quantum circuit instruction set includes CX gate, Rx gate, Ry gate, Rz gate, H gate and X gate, which are converted to the quantum circuit instruction set to obtain the final quantum circuit, see Fig.10, which is a schematic diagram of the circuit structure of the original quantum circuit converted to the quantum circuit instruction set. The figure shows the Rz gate with a parameter of -π / 2, the CNOT gate, the Rz gate with a parameter of -π, the Rx gate with a parameter of π / 2, the Rz gate with a parameter of π / 2, the CNOT gate, the Rz gate with a parameter of -3π / 2, the Rx gate with a parameter of π / 2, the Rz gate with a parameter of 3π / 4, the CNOT gate, the Rz gate with a parameter of -π / 4, and the CNOT gate.

[0081] According to one embodiment of the present invention, see Fig.11 , which is a complete flow chart of converting quantum circuits using the method of the present invention. The figure includes the following steps 1-10:

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

[0083] Step 2: Based on the disassembled quantum circuit, traverse all the two-bit quantum gates to be supported in it;

[0084] Step 3: Read the quantum gates in the disassembled quantum circuit one by one. Each time the next quantum gate in the circuit is read, make the following judgment:

[0085] Step 4: Determine whether the quantum gate is a two-bit quantum gate. If so, proceed to step 5. If not, proceed to step 9.

[0086] Step 5: Determine whether it belongs to the two-bit quantum gate in the quantum circuit instruction set. If not, proceed to step 6. If yes, proceed to step 9.

[0087] Step 6: Determine whether the two-bit quantum gate is of the same type as the target two-bit quantum gate in the quantum circuit instruction set. If so, proceed to step 7. If not, proceed to step 8.

[0088] Step 7: converting the two-bit quantum gate based on the intra-class conversion rule defined in the present invention;

[0089] Step 8: converting the two-bit quantum gate based on the intra-class conversion rule and inter-class conversion rule defined in the present invention;

[0090] Step 9: Put back the original quantum circuit, including putting back the originally supported quantum gates and the converted quantum gates;

[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 two-bit quantum gates to be supported and the single-bit quantum gates to be supported are converted into quantum gates in the quantum circuit instruction set, the converted quantum circuit is obtained.

[0092] According to one embodiment of the present invention, a quantum circuit instruction set conversion system is provided, which includes: a quantum circuit instruction set module, which is used to store a target two-bit quantum gate supported by a quantum computer, multiple target single-bit quantum gates, and multiple categories defined for two-bit quantum gates, each category includes multiple quantum gates, and a representative quantum gate is provided for each category; a two-bit quantum gate conversion rule module, which is used to predefine intra-class conversion rules and inter-class conversion rules for two-bit quantum gates, and store intra-class conversion rules and inter-class conversion rules, wherein the intra-class conversion rules include conversion rules between representative quantum gates of each category and each quantum gate of the same category, and the inter-class conversion rules include conversion rules between representative quantum gates of every two different categories; a single-bit quantum gate rotation decomposition module, which is used to store rotation decomposition rules of single-bit quantum gates, which are used to convert single-bit quantum gates to be supported into target single-bit quantum gates; a circuit analysis execution module, which is used to convert quantum gates to be supported in the original quantum circuit into quantum gates in the quantum circuit instruction set based on the conversion method of the above embodiment, to obtain the final quantum circuit. Among them, the rotation decomposition rules of single-bit quantum gates include zyz rules and xyx rules.

[0093] It should be noted that although the above describes the various steps in a specific order, it does not mean that the steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently or even in a different order as long as the required functions can be achieved.

[0094] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.

[0095] Computer readable storage medium can be a tangible device that holds and stores instructions used by an instruction execution device. Computer readable storage medium can include, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: 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), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a protruding structure in a groove on which instructions are stored, and any suitable combination thereof.

[0096] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A quantum circuit instruction set conversion method based on two-bit 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 target two-bit quantum gate and multiple target single-bit quantum gates supported by the quantum computer, and the method includes: S1. Decompose the multi-bit quantum gate to be supported in the original quantum circuit into a combination of a dual-bit quantum gate and a single-bit quantum gate to obtain a decomposed quantum circuit; S2. Obtain multiple categories, intra-category conversion rules, and inter-category conversion rules predefined for two-bit quantum gates, where each category includes one or more quantum gates, and each category is provided with a representative quantum gate. The intra-category conversion rules include conversion rules between the representative quantum gate of each category and each quantum gate of the same category, and the inter-category conversion rules include conversion rules between every two representative quantum gates of different categories; S3, determining the two-bit quantum gates to be supported in the disassembled quantum circuit and their categories; S4, converting the two-bit quantum gate to be supported in the disassembled quantum circuit into a target two-bit quantum gate to obtain a converted quantum circuit, wherein when the two-bit quantum gate to be supported and the target two-bit quantum gate belong to the same category, the conversion is performed according to the intra-class conversion rule, otherwise the conversion is performed 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 a 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 conversion according to the intra-class conversion rule includes: According to the intra-class conversion rule, the two-bit quantum gate to be supported is converted into a first form, which includes a representative quantum gate of the class to which the two-bit quantum gate to be supported belongs; According to the intra-class conversion rule, the representative quantum gate contained in the first form is converted into a second form, which contains the target two-bit quantum gate; Based on the first form and the second form, a final form including the target two-bit quantum gate is obtained by combination.

3. The method according to claim 1, characterized in that In step S4, the method of performing conversion according to the intra-class conversion rule and the inter-class conversion rule includes: According to the intra-class conversion rule, the two-bit quantum gate to be supported is converted into a third form, which includes a representative quantum gate of the class to which the two-bit 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 a fourth form, which contains the representative quantum gate corresponding to the class of the target two-bit quantum gate; According to the intra-class conversion rule, the representative quantum gate contained in the fourth form is converted into a fifth form, which contains the target two-bit quantum gate; Based on the third form, the fourth form and the fifth form, a final form including the target two-bit quantum gate is obtained by combination.

4. The method according to claim 1, characterized in that In the step S2, among the predefined multiple categories, the categories are defined in the following manner: Two two-bit quantum gates that have an equivalent relationship are defined as the same category to obtain multiple categories, wherein 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 rules between the representative quantum gate of each category and each quantum gate of the same category in the intra-category conversion rules are obtained by using KAK decomposition; The conversion rules between the representative quantum gate of each category and each quantum gate of the same category use 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 conversion rules between each two representative quantum gates of different categories in the inter-class conversion rules are obtained by using KAK decomposition.

6. The method according to claim 4, characterized in that In step S2, the multiple categories include: The first category, whose representative quantum gate is the controlled Z gate, includes the controlled NOT gate, controlled Y gate, controlled Z gate, controlled H gate and echo cross resonance gate. The second category, whose representative quantum gate is the two-bit ZZ revolving gate, includes two-bit XX revolving gate, two-bit YY revolving gate, two-bit ZZ revolving gate, two-bit ZX revolving gate, controlled Z-axis revolving gate and controlled Y-axis revolving gate; The third category, whose representative quantum gate is the fermion simulation gate, and the two-bit quantum gates belonging to this category include the fermion simulation gate; The fourth category, whose representative quantum gate is the square root exchange quantum gate, and the two-bit quantum gates belonging to this category include the square root exchange quantum gate.

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

8. A quantum circuit instruction set conversion system, characterized in that: The system includes: A quantum circuit instruction set module, used for storing a target two-bit quantum gate and multiple target single-bit quantum gates supported by a quantum computer, and storing multiple categories defined for two-bit quantum gates, each category including multiple quantum gates, and a representative quantum gate for each category; A two-bit quantum gate conversion rule module is used to predefine intra-class conversion rules and inter-class conversion rules for two-bit quantum gates, and store the intra-class conversion rules and inter-class conversion rules, wherein 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 every two representative quantum gates of different categories; A single-bit quantum gate rotation decomposition module is used to store the rotation decomposition rules of the single-bit quantum gate, and the rotation decomposition rules are used to convert the single-bit quantum gate to be supported into the target single-bit quantum gate; A 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 to 7, so as to obtain a final quantum circuit.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program 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 A memory, wherein the memory is used to store executable instructions; The one or more processors are configured to implement the steps of the method of 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 circuit processing method and device, storage medium and electronic device

    CN110363301A

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

    US20220327413A1

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

    WO2022217823A1

Cited By

  • Implementation method of quantum circuit braiding

    CN120409729A