MCT line decomposition method capable of sensing hardware constraint

The MCT gate is decomposed into the NCV gate library by perceiving the quantum chip topology, and the qubit connection is optimized in combination with Miller's decomposition and derivation decomposition methods, which solves the problem of difficult balance of quantum circuit complexity and execution fidelity after decomposition in the prior art, and achieves more efficient quantum circuit decomposition and execution.

CN119940564AInactive Publication Date: 2025-05-06NANTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510086093.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2025-05-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art fails to fully consider the constraints of the quantum chip architecture during the advanced quantum gate decomposition process, resulting in difficult to balance the complexity of quantum circuits and execution fidelity after decomposition.

Method used

By perceiving the quantum chip topology, Miller decomposition and three derivatization methods are used to accurately decompose the MCT gate sequence to the NCV gate library, and qubit connections are optimized by controlling the division of qubits and the binary k-means clustering algorithm to reduce the number of redundant gates and routing times.

Benefits of technology

It significantly reduces the number of basic gates and routing times of quantum lines, improves the execution fidelity and hardware adaptability of the lines, and optimizes resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119940564A_ABST
    Figure CN119940564A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of quantum computing, in particular to an MCT circuit decomposition method for sensing hardware constraints. The problem that a quantum chip architecture is difficult to adapt in advanced quantum circuit decomposition is solved. According to the technical scheme, the method comprises the steps that S1, a quantum circuit is traversed, and MCT circuit modules needing to be decomposed are found out; s2, performing line preprocessing on each MCT line module to generate an associated gate pair; s3, sensing sub-topology in the quantum chip, and performing control quantum bit grouping on each MCT line module according to a control quantum bit number division strategy and a number-limited bipartite k-means clustering algorithm in a cluster; s4, adopting a reciprocal decomposition strategy for each MCT line module according to Miller decomposition and three derivative decomposition modes; and S5, placing the decomposed quantum circuit on a quantum computing device for mapping. The method has the beneficial effects that the basic gate number and the additional gate number of the quantum circuit are reduced; and the execution fidelity of the quantum circuit is improved.
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 technology, and in particular to an MCT circuit decomposition method that perceives hardware constraints. Background Art

[0002] As quantum computing technology gradually shows great potential, more and more research institutions and scholars are devoted to this field. Reference paper: Gill SS, Kumar A, Singh H, et al. Quantum computing: A taxonomy, systematic review and future directions [J]. Software: Practice and Experience, 2022, 52(1): 66-114. Quantum computing can solve specific problems that are difficult to solve in classical computing with its exponential acceleration. This advantage is particularly prominent in the fields of artificial intelligence (Zhang X, Wang L, Helwig J, et al. Artificial intelligence for science in quantum, atomic, and continuum systems [J]. arXiv preprint arXiv: 2307.08423, 2023) and quantum finance (Egger DJ, Gambella C, Marecek J, et al. Quantum computing for finance: State-of-the-art and future prospects [J]. IEEE Transactions on Quantum Engineering, 2020, 1: 1-24). Although existing quantum computing devices are physically constrained, even noisy intermediate-scale (NISQ) quantum computing devices have the potential to accelerate the solution of classical problems, as described in the paper Zhu P, Zheng S, Wei L, et al. The complexity of quantum circuit mapping with fixed parameters [J]. Quantum Information Processing, 2022, 21 (10): 361.

[0003] As described in the paper: Mosca M. Quantum algorithms [J]. arXiv preprint arXiv: 0808.0369, 2008., a quantum algorithm is a computing algorithm designed and operated based on the principles of quantum mechanics, which can be represented by a quantum circuit model. Compared with classical algorithms, quantum algorithms use the characteristics of quantum superposition and quantum entanglement to more efficiently solve problems such as combinatorial optimization and encryption cracking. Currently, reference papers: Monz T, Nigg D, Martinez EA, et al. Realization of a scalable Shor algorithm [J]. Science, 2016, 351 (6277): 1068-1070. and Kain B. Searching a quantum database with Grover's search algorithm [J]. American journal of physics, 2021, 89 (6): 618-626. Classical quantum algorithms include Shor's factorization algorithm, Grover's search algorithm, etc. Typically, the logical functions of quantum algorithms are implemented by advanced quantum gates, and the Multiple-Control Toffoli (MCT) gate is a typical example of advanced quantum gates. Although the use of advanced quantum gates makes quantum algorithms easier to construct, they are difficult to implement on physical devices, as described in the paper:

[0004] Bhattacharjee D, Saki AA, Alam M, et al. MUQUT: Multi-constraint quantum circuit mapping on NISQ computers[C] / / 2019IEEE / ACM international conference on computer-aided design(ICCAD).IEEE, 2019: 1-7. As mentioned above, if a quantum algorithm composed of advanced quantum gates needs to be mapped to a quantum computing device with physical limitations, the advanced quantum gates need to be first decomposed into single-qubit gates or double-qubit gates, and then further mapped so that all quantum gates can be directly executed on the quantum computing device.

[0005] At present, there have been many studies on the decomposition of advanced reversible MCT circuits. In the literature Liu J, Bowman M, Gokhale P, et al. QContext: Context-Aware Decomposition for Quantum Gates [J]. arXiv preprint arXiv: 2302.02003, 2023., a new quantum compiler named QContext is proposed, which combines context and quantum chip topology awareness for quantum gate decomposition. The compiler uses circuit information and hardware topology to select quantum gate variants that improve circuit optimization opportunities, but the efficiency of decomposing different quantum algorithms has not been verified. In the literature Niemann P, de Almeida AAA, Dueck G, et al. Template-based mapping of reversible circuits to IBM quantum computers [J]. Microprocessors and Microsystems, 2022, 90: 104487., a method of using template technology to map MCT circuits to superconducting quantum computing devices is proposed, and experiments show that considering the topological constraints of the target quantum chip in the process of advanced quantum gate decomposition can effectively reduce the complexity of the quantum circuit after decomposition. In the paper McKinney E, Hatridge M, Jones AK. MIRAGE: Quantum Circuit Decomposition and Routing Collaborative Design using Mirror Gates [C] / / 2024 IEEE International Symposium on High-Performance Computer Architecture (HPCA). IEEE, 2024: 704-718., a quantum circuit conversion method called MIRAGE is proposed. This method uses mirror gates to minimize the number of routing times and improve the decomposition of advanced quantum gates. Experimental results show that the number of routing times and circuit depth can be further reduced by using the iSWAP gate family, and the execution fidelity of the circuit can be improved. At present, the existing decomposition of MCT circuits does not consider the constraints of quantum chip architecture, and the decomposition method is relatively fixed.

[0006] Quantum logic gates are basic devices that make up quantum circuits. They manipulate the state of quantum bits in a specific way. High-level logic quantum circuits can be further converted into low-level quantum logic quantum circuits by decomposition. Usually, MCT gates are high-level quantum gates, and the primary form of quantum algorithms generally includes MCT gate sequences. A single MCT gate is usually composed of a control qubit. and the target qubit x t The symbolic expression is As described in the paper: Daiss S, Langenfeld S, Welte S, et al. A quantum-logic gate between distant quantum-network modules [J]. Science, 2021, 371 (6529): 614-617., the state of the target qubit is reversed if and only if the input state of all control qubits is |1>, otherwise, the values ​​of the control qubit and the target qubit pass through the gate unchanged.

[0007] The typical low-level quantum gate library is the NCV gate library. Since the quantum gates in this gate library can always approximate the unitary matrix with arbitrary precision, this gate library is also called the universal gate library for quantum computing. As described in the paper: Li Z, Chen S, Song X, et al. Quantum circuit synthesis using a new quantum logic gate library of NCVquantum gates[J]. International Journal of Theoretical Physics, 2017, 56: 1023-1038. The NCV gate library includes a single-qubit gate (NOT gate), three double-qubit gates (CNOT gate, Controlled-V gate, Controlled-V gate) and a pair of double-qubit gates (CNOT gate, Controlled-V gate). + Gate). Paper: Satoh T, Oomura S, Sugawara M, et al. Pulse-engineered Controlled-V gate and its applications on superconducting quantum device[J]. IEEE Transactions on Quantum Engineering, 2022, 3: 1-10. It has been proved that the Controlled-V gate and Controlled-V +Compared with the controlled NOT gate, the gate can save 65.5% of the running time and has a higher average output state fidelity. Therefore, decomposing it into NOT gate, controlled NOT gate and controlled square root NOT gate (NOT, CNOT, Controlled-Square-Root-of-NOT: NCV) gate library can produce better results.

[0008] As described in the paper: De Leon NP, Itoh KM, Kim D, et al. Materials challenges and opportunities for quantum computing hardware[J]. Science, 2021, 372(6539):eabb2823., the physical structure of a quantum computing device is generally represented by the topological structure of a quantum chip, which can represent the connection relationship between physical quantum bits and physical quantum bits in a quantum computing architecture.

[0009] In summary, the prior art has the following disadvantages

[0010] (1) Decomposition using a fixed template

[0011] The decomposition of advanced quantum circuits is mainly based on fixed templates, which are usually designed for specific application scenarios and requirements. They lack sufficient flexibility to adapt to different changes and needs, and lack opportunities to fully explore circuit optimization.

[0012] (2) The specific quantum chip topology is not considered during decomposition

[0013] If the specific quantum chip topology is not considered during decomposition, more routing operations will often be required when actually executing the quantum circuit. More routing operations will result in more physical resource consumption and a decrease in circuit execution fidelity.

[0014] (3) It is difficult to balance complexity and accuracy

[0015] When decomposing advanced quantum circuits, it is difficult to simplify the decomposition process and improve computational efficiency while maintaining the functional integrity of the circuit, so some approximate decompositions are often introduced, which affects the accuracy of the final result. Summary of the invention

[0016] The object of the present invention is to provide a method for decomposing an MCT circuit that perceives hardware constraints. The present invention accurately decomposes the MCT gate sequence into the NCV gate library by perceiving the topological substructure of the quantum chip to optimize the circuit. In the decomposition process, the number of basic gates of the decomposed quantum circuit can be further reduced, and mapping the decomposed quantum circuit can reduce the number of required routing times, thereby improving the execution fidelity of the quantum circuit. The present invention transforms the advanced reversible MCT circuit into a quantum circuit composed of a cascade of NCV basic quantum gates for subsequent execution on the quantum chip.

[0017] The present invention perceives the quantum chip topology and accurately decomposes the MCT gate sequence into the NCV quantum gate library to optimize the circuit.

[0018] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is specifically as follows:

[0019] A hardware-constraint aware MCT circuit decomposition method comprises the following steps:

[0020] Step S1: traverse the quantum circuit and find the MCT circuit module that needs to be decomposed; the operation complexity of the MCT circuit module is relatively high. By accurately searching and decomposing it, it can be converted into basic gates, which can better analyze the calculation process and resource consumption of the circuit.

[0021] Step S2: Perform line preprocessing on each MCT line module, generate PP gate pairs and NP associated gate pairs through exchange rules, and avoid PN gate pairs; PP gate pairs and NP gate pairs help optimize the line structure and improve decomposition efficiency; while PN gate pairs will interfere with decomposition.

[0022] Step S3: Perceive the neutron topology of the quantum chip, and group the control qubits of each MCT circuit module according to the control qubit number division strategy and the binary k-means clustering algorithm with a limited number of clusters; through the reasonable grouping of control qubits, the quantum chip architecture can be better adapted, which has a positive impact on subsequent mapping.

[0023] Step S4: According to Miller decomposition and three derivative decomposition methods, a reciprocal decomposition strategy is adopted for each MCT circuit module to reduce the number of quantum basic gates; by flexibly selecting the decomposition method of the MCT gate, the opportunity for circuit optimization can be fully explored, and the combination of the reciprocal decomposition strategy can better reduce the redundant gates in the circuit.

[0024] Step S5: Place the decomposed quantum circuit on the quantum computing device for mapping. The effectiveness of the proposed decomposition method is verified by three indicators in the experimental results: the number of basic gates of the circuit, the number of additional gates of the circuit, and the fidelity.

[0025] Step S1 is specifically as follows:

[0026] For the test circuits in the quantum circuit benchmark set Benchmark, it is necessary to find the quantum circuits containing MCT gates, and then use the conventional traversal method for the quantum circuits containing MCT gates to find the MCT circuit modules that need to be decomposed for subsequent decomposition work.

[0027] Step S2 is specifically as follows:

[0028] Before decomposition, preprocessing the circuit will greatly improve the efficiency of decomposition and reduce redundant gates in the circuit.

[0029] For the MCT circuit module found in step S1, the circuit movement rule is adopted: in the MCT quantum gate sequence, if the control qubit of gate G1 and the target qubit of gate G2 are not on the same qubit, and the target qubit of gate G1 and the control qubit of gate G2 are not on the same qubit, then gate G1 and gate G2 can be exchanged.

[0030] Generate PP gate pairs and NP associated gate pairs to avoid PN gate pairs;

[0031] Among them: In the MCT gate sequence, if two adjacent MCT gates have a common target bit and the number of common control bits is greater than or equal to 3, the gate pair is called a Public-Public gate pair, abbreviated as a PP gate pair;

[0032] If the target bits of two adjacent MCT gates are adjacent and the number of common control qubits is greater than or equal to 3, the gate pair is called a None-Public gate pair, or NP gate pair for short;

[0033] If two adjacent MCT gates have a common target bit and the number of common control bits is at most 2, the gate pair is called a Public-None gate pair, or PN gate pair for short.

[0034] Step S3 is specifically as follows:

[0035] Step S31: After sensing the anyon topology in the quantum chip that is consistent with the number of qubits of the MCT quantum circuit to be decomposed,

[0036] Step S32: The MCT gate in the circuit controls the division of the quantum bits from two perspectives;

[0037] The division of the number of control qubits; the division of control qubits is proved from a mathematical point of view, and the number of basic gates generated by equal division of control qubits is the least;

[0038] The positions of the control qubits are divided; the positions of the control qubits are divided into groups using a binary k-means clustering algorithm with a limited number of clusters.

[0039] Step S4 is specifically as follows:

[0040] For Miller decomposition, according to the properties of quantum circuits:

[0041] In Miller decomposition, the Controlled-V gate and Controlled-V+ gate of the same control qubit and target qubit are replaced with each other, and the final function of the quantum circuit does not change;

[0042] Due to the reversible nature of the MCT gate, if the gate order of the two decomposition methods is completely opposite, and the type and number of gates do not change, the final function of the quantum circuit will not change;

[0043] Three decomposition methods are derived; the reciprocal decomposition strategy is combined with the division of the control qubits in step S3;

[0044] Step S5 is specifically as follows:

[0045] The decomposed circuit is mapped and executed on a quantum chip, which reduces redundant gates and the number of additional gates required for mapping, thereby improving circuit fidelity.

[0046] The strategy for controlling the number of qubits in step S32 is:

[0047] In order to efficiently execute quantum circuits on quantum computing devices, the MCT gates need to be reasonably decomposed to reduce the number of routing times required for subsequent circuit mapping. By reasonably dividing the qubits controlled by the MCT gates, the number of routing times required for quantum circuit mapping can be significantly reduced.

[0048] In the process of using Miller iterative decomposition, the control qubits of the original MCT gate are divided into two groups until the number of control qubits in each group does not exceed 2, that is, decomposition to the Toffoli gate;

[0049] This grouping method involves not only the division of the number of control qubits, but also the division of their positions after sensing the hardware topology.

[0050] In the decomposition process of the MCT circuit, each MCT gate circuit module will follow the decomposition method of the first gate (i.e., the division of the number of control qubits and the division of the position after sensing the hardware topology), so as to make the corresponding decomposition;

[0051] The present invention discusses in detail the strategy for controlling the number of quantum bits from a mathematical perspective.

[0052] Divide the number of control qubits: Assume that the number of control qubits of a single MCT gate is m, and find the minimum number of divisions n so that the integer m can be divided into several m i, since each MCT gate stops when the Miller iteration decomposition reaches a control qubit of less than or equal to 2, each m i It must be an integer between 1 and 2. Its specific form is shown in formula (1).

[0053]

[0054] The iterative process of Miller decomposition is expressed in formula form as shown in formula (2); where T m is the total number of basic quantum gates required to decompose an MCT gate with m control qubits, and S represents the number of additional two-qubit gates introduced during the decomposition process, i.e., the number of Controlled-V gates and Controlled-V + Number of doors;

[0055] When m = 1, T1 is a CNOT gate and counts as a basic quantum gate;

[0056] When m = 2, T2 is a Toffoli gate, which is counted as 5 basic quantum gates;

[0057] When m>2, T m It needs to be further iterated and decomposed into 2 sets of identical MCT gates and 4 two-qubit gates;

[0058]

[0059] In the case where the number of controlled qubits is evenly divided, when the number of controlled qubits m by the MCT gate is an even number, take When the number of qubits controlled by the MCT gate is an odd number, At this time, decompose to The calculation of the basic number of gates in the quantum circuit at the stage is shown in formula (3);

[0060]

[0061] In the case where the number of controlled qubits is not evenly divided, when the number of controlled qubits m by the MCT gate is an even number, When the number m of qubits controlled by the MCT gate is an odd number, To facilitate specific calculations, At this time, decompose to The calculation of the basic number of gates in the quantum circuit at the stage is shown in formula (4);

[0062]

[0063]

[0064] Step S32: The position is divided into:

[0065] Perform initial mapping work to map logical qubits to physical qubits;

[0066] According to the positions of the control qubits of the MCT gate, the control qubits are divided into two groups using a binary k-means clustering algorithm with a limited number of clusters. The number of control qubits in each cluster is determined by an equal division method.

[0067] According to the constraint of equal division of quantity, its positions are randomly divided into two groups, the coordinates of the center position of each group are calculated, and each control qubit is assigned to the group with a closer Manhattan distance to the center coordinate of each group, and the process is repeated until the assignment process does not change;

[0068] The three Miller decompositions in step S4 are derived as follows:

[0069] Derivative decomposition method 1 of Miller decomposition;

[0070] Derivative decomposition method 2 of Miller decomposition;

[0071] The third derivative decomposition method of Miller decomposition.

[0072] After verification by truth table and unitary matrix calculation method, Miller decomposition is completely equivalent to the above three derivative decomposition methods;

[0073] Miller decomposition and the first decomposition method of Miller decomposition, the second decomposition method of Miller decomposition and the third decomposition method of Miller decomposition are defined as homologous decompositions;

[0074] Miller decomposition and its derivative decomposition method 2, Miller decomposition derivative decomposition method 1 and Miller decomposition derivative decomposition method 3 are defined as reciprocal decompositions.

[0075] Comparison between the equal distribution method and the non-equal distribution method by controlling the number of quantum bits:

[0076] In these two ways of number division, when the number of control qubits of a single MCT gate is iteratively decomposed to At the stage, that is, the maximum number of qubits controlled by the MCT gate in the circuit is When , the number of basic quantum gates of the equipartition method is

[0077] The number of quantum basic gates in the non-uniform distribution method is

[0078] By comparison, it is found that in the process of iterative decomposition, the number of basic gates generated by the equal distribution of control qubits is less than that of the non-equal distribution. Therefore, it is concluded that in the Miller decomposition process of the MCT circuit, if the number of control qubits of a single MCT gate is m, when it is iteratively decomposed into sub-MCT gates, the closer the number of control qubits of the sub-MCT gates is, the smaller the number of basic gates generated by the equal distribution of control qubits is. The number of basic gates in the final decomposed quantum circuit will be smaller.

[0079] Compared with the prior art, the present invention has the following beneficial effects:

[0080] (1) Reduce the number of basic gates of quantum circuits

[0081] By introducing Miller decomposition and the three derived decomposition methods proposed, the flexibility of circuit decomposition is significantly enhanced. On this basis, the associated gate pairs are generated by cleverly and reasonably using the movement rules. The subsequent reciprocal decomposition technology can reduce the number of basic gates required in the quantum circuit, thereby achieving efficient simplification of the circuit.

[0082] (2) Reduce the number of routing times required for quantum circuit mapping after decomposition

[0083] By accurately sensing the sub-topology of the quantum chip, the number and location of the control qubit groupings are considered in the process of dividing the control qubits of the MCT gate. The resulting grouping scheme can optimize the connection between qubits, thereby reducing the number of routings required in the mapping process and improving overall efficiency and performance.

[0084] (3) Improved the fidelity of quantum circuit execution

[0085] This decomposition method not only effectively reduces the number of basic gates in the quantum circuit after decomposition, but also significantly reduces the number of routing times required in the mapping process. Due to the reduction in the number of gates, the fidelity of quantum circuit execution is directly improved, ensuring higher calculation accuracy.

[0086] (4) Enhance hardware adaptability

[0087] Quantum computing chips have multiple constraints, such as connectivity constraints, fidelity of gate operations, etc. This decomposition method can optimize the circuit according to the connection method and operation restrictions of a specific quantum computing chip, so that the circuit can better adapt to the physical connection, thereby improving the feasibility on the quantum chip architecture.

[0088] (5) Optimizing resource utilization

[0089] The hardware resources in quantum computing are relatively limited. This decomposition method can decompose the MCT gate into more efficient sub-operations according to the resource situation of the quantum chip, avoid wasting resources, and enable more effective calculations to be completed within a limited time. BRIEF DESCRIPTION OF THE DRAWINGS

[0090] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.

[0091] Figure 1 It is a schematic diagram of the NCV door library of the present invention.

[0092] Figure 2 This is a topological diagram of the ibm_cairo quantum chip of the present invention.

[0093] Figure 3 Schematic diagram of an exemplary MCT gate sequence of the present invention.

[0094] Figure 4 Schematic diagram of associated gate pairs of the present invention.

[0095] Figure 5 Schematic diagram of the division of quantum bit positions controlled by the MCT gate of the present invention.

[0096] Figure 6 This is a schematic diagram of Miller decomposition of the present invention.

[0097] Figure 7 It is a schematic diagram of the decomposition of the Toffoli gate of the present invention.

[0098] Figure 8 This is a schematic diagram of a Miller decomposition derivative decomposition method of the present invention.

[0099] Fig. 9 This is a schematic diagram of the second decomposition method derived from Miller decomposition of the present invention.

[0100] Fig.10 This is a schematic diagram of the third Miller decomposition derivative decomposition method of the present invention.

[0101] Fig.11 This is a schematic diagram of generating associated gate pairs according to Example 2 of the present invention.

[0102] Fig.12 This is a schematic diagram of decomposition step 1 of Example 2 of the present invention.

[0103] Fig.13 This is a schematic diagram of decomposition step 2 of Example 2 of the present invention.

[0104] Fig.14 This is a schematic diagram of decomposition step three of Example 2 of the present invention. DETAILED DESCRIPTION

[0105] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. Of course, the specific embodiments described here are only used to explain the present invention and are not used to limit the present invention.

[0106] Example 1

[0107] The NCV gate library includes a single-qubit gate (NOT gate), three double-qubit gates (CNOT gate, Controlled-V gate, Controlled-V+ gate), and its quantum gate symbols, icons, and matrix definitions are as follows: Figure 1 shown.

[0108] Figure 2 The topology graph of the 27-qubit quantum chip ibm_cairo provided by IBM is given. Each colored vertex in the topology graph corresponds to a physical qubit in the quantum chip, and each colored edge corresponds to a coupling bus connecting adjacent qubits in the quantum chip. Figure 2 In the figure, darker colors indicate lower error rates, while lighter colors indicate higher errors. This topological diagram depicts the connectivity between qubits on a quantum computing device. Only two-qubit gates acting on two qubits directly connected in the topological diagram are physically allowed.

[0109] A hardware-constraint aware MCT circuit decomposition method comprises the following steps:

[0110] Step S1: traverse the quantum circuit and find the MCT circuit module that needs to be decomposed; the operation complexity of the MCT circuit module is relatively high. By accurately searching and decomposing it, it can be converted into basic gates, which can better analyze the calculation process and resource consumption of the circuit.

[0111] Step S2: Perform line preprocessing on each MCT line module, generate PP gate pairs and NP associated gate pairs through exchange rules, and avoid PN gate pairs; PP gate pairs and NP gate pairs help optimize the line structure and improve decomposition efficiency; while PN gate pairs will interfere with decomposition.

[0112] Step S3: Perceive the neutron topology of the quantum chip, and group the control qubits of each MCT circuit module according to the control qubit number division strategy and the binary k-means clustering algorithm with a limited number of clusters; through the reasonable grouping of control qubits, the quantum chip architecture can be better adapted, which has a positive impact on subsequent mapping.

[0113] Step S4: According to Miller decomposition and three derivative decomposition methods, a reciprocal decomposition strategy is adopted for each MCT circuit module to reduce the number of quantum basic gates; by flexibly selecting the decomposition method of the MCT gate, the opportunity for circuit optimization can be fully explored, and the combination of the reciprocal decomposition strategy can better reduce the redundant gates in the circuit.

[0114] Step S5: Place the decomposed quantum circuit on the quantum computing device for mapping. The effectiveness of the proposed decomposition method is verified by three indicators in the experimental results: the number of basic gates of the circuit, the number of additional gates of the circuit, and the fidelity.

[0115] like Figure 3 As described, the figure gives an example of a quantum circuit containing 3 MCT gates.

[0116] Step S1 is specifically as follows:

[0117] For the test circuits in the quantum circuit benchmark set Benchmark, it is necessary to find the quantum circuits containing MCT gates, and then use the conventional traversal method for the quantum circuits containing MCT gates to find the MCT circuit modules that need to be decomposed for subsequent decomposition work.

[0118] Step S2 is specifically as follows:

[0119] Before decomposition, preprocessing the circuit will greatly improve the efficiency of decomposition and reduce redundant gates in the circuit.

[0120] For the MCT circuit module found in step S1, the circuit movement rule is adopted: in the MCT quantum gate sequence, if the control qubit of gate G1 and the target qubit of gate G2 are not on the same qubit, and the target qubit of gate G1 and the control qubit of gate G2 are not on the same qubit, then gate G1 and gate G2 can be exchanged.

[0121] Generate PP gate pairs and NP associated gate pairs to avoid PN gate pairs;

[0122] Among them: in the process of high-level quantum gate decomposition, redundant gates often lead to waste of computing resources and performance degradation. Through the reciprocal decomposition strategy, some redundant gates can be eliminated, but if this decomposition method is based on a specific associated gate pair, the decomposition efficiency can be improved. A total of three associated gate pairs are proposed in the content of the present invention. In the MCT gate sequence, if two adjacent MCT gates have a common target bit and the number of common control bits is greater than or equal to 3, the gate pair is called a Public-Public gate pair, abbreviated as a PP gate pair;

[0123] If the target bits of two adjacent MCT gates are adjacent and the number of common control qubits is greater than or equal to 3, the gate pair is called a None-Public gate pair, or NP gate pair for short;

[0124] If two adjacent MCT gates have a common target bit and the number of common control bits is at most 2, the gate pair is called a Public-None gate pair, or PN gate pair for short. Figure 4 Example diagrams of three types of associated gate pairs are given.

[0125] Among these three gate pairs, the PN gate pair should be avoided as much as possible, because this gate pair cannot reduce redundant gates through reciprocal decomposition through Miller decomposition and its derivative decomposition. The PP gate pair and the NP gate pair should appear in the MCT quantum gate sequence as much as possible. If the PP gate pair and the NP gate pair appear in the same MCT quantum gate sequence at the same time, the decomposition priority of the PP gate pair is higher than that of the NP gate pair.

[0126] Step S3 is specifically as follows:

[0127] Step S31: After sensing the anyon topology in the quantum chip that is consistent with the number of qubits of the MCT quantum circuit to be decomposed,

[0128] Step S32: The MCT gate in the circuit controls the division of the quantum bits from two perspectives;

[0129] The division of the number of control qubits; the division of control qubits is proved from a mathematical point of view, and the number of basic gates generated by equal division of control qubits is the least;

[0130] The positions of the control qubits are divided; the positions of the control qubits are divided into groups using a binary k-means clustering algorithm with a limited number of clusters.

[0131] Step S4 is specifically as follows:

[0132] For Miller decomposition, according to the properties of quantum circuits:

[0133] In Miller decomposition, the Controlled-V gate and Controlled-V+ gate of the same control qubit and target qubit are replaced with each other, and the final function of the quantum circuit does not change;

[0134] Due to the reversible nature of the MCT gate, if the gate order of the two decomposition methods is completely opposite, and the type and number of gates do not change, the final function of the quantum circuit will not change;

[0135] Three decomposition methods are derived; the reciprocal decomposition strategy is combined with the division of the control qubits in step S3;

[0136] Step S5 is specifically as follows:

[0137] The decomposed circuit is mapped and executed on a quantum chip, which reduces redundant gates and the number of additional gates required for mapping, thereby improving circuit fidelity.

[0138] The strategy for controlling the number of qubits in step S32 is:

[0139] In order to efficiently execute quantum circuits on quantum computing devices, the MCT gates need to be reasonably decomposed to reduce the number of routing times required for subsequent circuit mapping. By reasonably dividing the qubits controlled by the MCT gates, the number of routing times required for quantum circuit mapping can be significantly reduced.

[0140] In the process of using Miller iterative decomposition, the control qubits of the original MCT gate are divided into two groups until the number of control qubits in each group does not exceed 2, that is, decomposition to the Toffoli gate;

[0141] This grouping method involves not only the division of the number of control qubits, but also the division of their positions after sensing the hardware topology.

[0142] In the decomposition process of the MCT circuit, each MCT gate circuit module will follow the decomposition method of the first gate (i.e., the division of the number of control qubits and the division of the position after sensing the hardware topology), so as to make the corresponding decomposition;

[0143] The present invention discusses in detail the strategy for controlling the number of quantum bits from a mathematical perspective.

[0144] Divide the number of control qubits: Assume that the number of control qubits of a single MCT gate is m, and find the minimum number of divisions n so that the integer m can be divided into several m i , since each MCT gate stops when the Miller iteration decomposition reaches a control qubit of less than or equal to 2, each m i It must be an integer between 1 and 2. Its specific form is shown in formula (1).

[0145]

[0146] The iterative process of Miller decomposition is expressed in formula form as shown in formula (2); where T m is the total number of basic quantum gates required to decompose an MCT gate with m control qubits, and S represents the number of additional two-qubit gates introduced during the decomposition process, i.e., the number of Controlled-V gates and Controlled-V + Number of doors;

[0147] When m = 1, T1 is a CNOT gate and counts as a basic quantum gate;

[0148] When m = 2, T2 is a Toffoli gate, which is counted as 5 basic quantum gates;

[0149] When m>2, T m It needs to be further iterated and decomposed into 2 sets of identical MCT gates and 4 two-qubit gates;

[0150]

[0151] In the case where the number of controlled qubits is evenly divided, when the number of controlled qubits m by the MCT gate is an even number, take When the number of qubits controlled by the MCT gate is an odd number, At this time, decompose to The calculation of the basic number of gates in the quantum circuit at the stage is shown in formula (3);

[0152]

[0153] In the case where the number of controlled qubits is not evenly divided, when the number of controlled qubits m by the MCT gate is an even number, When the number m of qubits controlled by the MCT gate is an odd number, To facilitate specific calculations, At this time, decompose to The calculation of the basic number of gates in the quantum circuit at the stage is shown in formula (4);

[0154]

[0155] Step S32: The position is divided into:

[0156] Perform the initial mapping work to map the logical qubits to the physical qubits. The following is an example of MCT gate decomposition. In order to produce a better decomposition effect, the example MCT gate is mapped to {q0→Q7,q1→Q 10 ,q2→Q 12 ,q3→Q 15 ,q4→Q5,q5→Q8,q6→Q 11 ,q7→Q 13 ,q8→Q 14}'s initial mapping is assigned to Figure 2 In the selected optimal subtopology, the specific quantum bit layout is as follows Figure 5 shown.

[0157] According to the positions of the control qubits of the MCT gate, the control qubits are divided into two groups using a binary k-means clustering algorithm with a limited number of clusters. The number of control qubits in each cluster is determined by an equal division method.

[0158] like Figure 5 As shown, the set of control qubits that need to be divided is {q0,q1,q2,q3,q4,q5,q6},

[0159] According to the constraint of equal division of quantity, its positions are randomly divided into two groups, the coordinates of the center position of each group are calculated, and each control qubit is assigned to the group with a closer Manhattan distance to the center coordinate of each group, and the process is repeated until the assignment process does not change;

[0160] like Figure 5 As shown in the figure, the partitioning process of the number of qubits controlled by the MCT gate is {7}→{{3},{4}}→{{1,2},{2,2}}. Based on this partitioning, the binary k-means clustering algorithm with limited number of clusters is used for partitioning, and the location of the example MCT gate mapped to the sub-topology is {{{q0,q1},{q2,q3}},{q5,{q4,q6}}}.

[0161] The three Miller decompositions in step S4 are derived as follows:

[0162] Derivative decomposition method 1 of Miller decomposition;

[0163] Derivative decomposition method 2 of Miller decomposition;

[0164] The third derivative decomposition method of Miller decomposition.

[0165] In the field of superconducting quantum computing, the coupling mode of current computing devices has certain limitations, which makes it difficult to perform multiple controls between multiple quantum bits, resulting in the MCT gate in the quantum algorithm cannot be directly executed on the quantum computing device. Therefore, it is necessary to further decompose it until the quantum circuit consists of only single-qubit gates or double-qubit gates to adapt to existing superconducting quantum computing devices. The patent of this invention decomposes the MCT gate into an NCV gate sequence.

[0166] This patent decomposes the MCT circuit based on Miller decomposition and proposes three derivative decomposition methods. The traditional Miller decomposition decomposes the MCT gate into four sub-MCT gates (M0, M1, M2, M3) with fewer control qubits and four two-qubit gates (S0, S1, S2, S3), where M0 is completely consistent with M2, M1 is completely consistent with M3, and similarly, S0 is completely consistent with S2, S1 is completely consistent with S3. The decomposition details are as follows Figure 6 shown.

[0167] Assuming that the control qubit set of the original MCT gate is C, the control qubit set of the decomposed MCT gate M0 (or M2) is C1, and the control qubit set of the decomposed MCT gate M1 (or M3) is C2, the constraints that need to be satisfied are shown in formula (5).

[0168]

[0169] The decomposition can be performed recursively until the quantum circuit consists of only single-qubit gates or double-qubit gates. When decomposing to Toffoli gates, a Toffoli gate can be decomposed into five basic quantum gates. Figure 7 shown.

[0170] Since in Miller decomposition, the Controlled-V gates of the same control qubit and target qubit are the same as the Controlled-V gates of the same control qubit and target qubit. + The gates are replaced with each other, and the final function of the quantum circuit does not change. The derivative decomposition method of Miller decomposition is as follows: Figure 8 shown.

[0171] Due to the reversible nature of the MCT gate, if the gate order of the two decomposition methods is completely opposite, and the type and number of gates do not change, the final function of the quantum circuit will not change. Therefore, the derived decomposition method 2 and the derived decomposition method 3 of Miller decomposition are obtained for the original Miller decomposition and the derived decomposition method 1 of Miller decomposition, as shown in the figure below: Fig. 9 and Fig.10 shown.

[0172] After verification by truth table and unitary matrix calculation method, Miller decomposition is completely equivalent to the above three derivative decomposition methods;

[0173] Miller decomposition and the first decomposition method of Miller decomposition, the second decomposition method of Miller decomposition and the third decomposition method of Miller decomposition are defined as homologous decompositions;

[0174] Miller decomposition and its derivative decomposition method 2, Miller decomposition derivative decomposition method 1 and Miller decomposition derivative decomposition method 3 are defined as reciprocal decompositions.

[0175] Comparison between the equal distribution method and the non-equal distribution method by controlling the number of quantum bits:

[0176] In these two ways of number division, when the number of control qubits of a single MCT gate is iteratively decomposed to At the stage, that is, the maximum number of qubits controlled by the MCT gate in the circuit is When , the number of basic quantum gates of the equipartition method is

[0177] The number of quantum basic gates in the non-uniform distribution method is

[0178] By comparison, it is found that in the process of iterative decomposition, the number of basic gates generated by the equal distribution of control qubits is less than that of the non-equal distribution. Therefore, it is concluded that in the Miller decomposition process of the MCT circuit, if the number of control qubits of a single MCT gate is m, when it is iteratively decomposed into sub-MCT gates, the closer the number of control qubits of the sub-MCT gates is, the smaller the number of basic gates generated by the equal distribution of control qubits is. The number of basic gates in the final decomposed quantum circuit will be smaller.

[0179] Example 2

[0180] Based on Example 1. According to the control qubit grouping scheme given in the present invention, Figure 3 An exploded view of the MCT circuit is shown to give a detailed description. Figure 3 An example of a quantum circuit consisting of three MCT gates is given.

[0181] First, preprocess the circuit. The sequence consists of MCT gates G1, G2, and G3. Since gates G2 and G3 can be exchanged, and gates G1 and G3 can form an associated gate pair after the exchange, it is convenient to use Miller decomposition and its derivative decomposition methods to perform reciprocal decomposition to reduce redundant gates. The specific process is as follows: Fig.11 shown.

[0182] According to the MCT gate control qubit number equal distribution strategy, the first grouping result of the control qubit is {{4},{3}}. According to the binary k-means clustering algorithm with limited number in the cluster, the grouping result of the control qubit is {{q0,q1,q2,q3},{q4,q5,q6}}. For gate G1, according to this division, Miller derivative decomposition rule three is used for the first round of decomposition. The control qubit division of gate G3 follows gate G1 and uses Miller decomposition derivative rule one for reciprocal decomposition. As a result, redundant gates appear between adjacent gate pairs and are eliminated. Gate G2 does not have a gate pair relationship with other gates, so it is divided into control qubits separately, and the division result is {{q2},{q3,q4}}. Following this division can reduce the number of routing times in subsequent mapping. The decomposition steps are the same as Fig.12 shown.

[0183] The second round of decomposition is performed. According to the results of the second round of division, the division results of the control qubits are {{{q0,q1},{q2,q3}},{q5,{q4,q6}}}, so the control qubits of the first sub-MCT gate in the first decomposition of gate G1 are divided and decomposed. Since the number of control qubits in the second sub-MCT gate is equal to the number of qubits minus one, the decomposition method without auxiliary lines is adopted to reduce the number of basic gates. Decomposition step 2 is as follows Fig.13 shown.

[0184] At this point, the example MCT circuit has been completely decomposed into a Toffoli gate and a two-qubit gate. When the adjacent Toffoli gate is decomposed into an NCV gate set, the reciprocal decomposition method is also used. Some two-qubit gates can be deleted. The decomposition step three is as follows: Fig.14 After adopting this decomposition method, the number of basic gates in the circuit is 92, which is 26% less than the 122 basic gates in the initial decomposition method.

[0185] The number of additional gates required to map the decomposed quantum circuit on the selected quantum chip sub-topology is 114, which is 41% less than the 192 additional gates required for the initial decomposition method, thus improving the fidelity of circuit execution to a certain extent.

[0186] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A hardware-constrained MCT line decomposition method, characterized in that: The following steps are involved: Step S1: traverse the quantum circuit and find the MCT circuit module that needs to be decomposed; Step S2: Perform line preprocessing on each MCT line module, generate PP gate pairs and NP associated gate pairs through exchange rules, and avoid PN gate pairs; Step S3: sensing the neutron topology of the quantum chip, and grouping the control qubits of each MCT circuit module according to the control qubit number division strategy and the binary k-means clustering algorithm with limited number in the cluster; Step S4: adopting a reciprocal decomposition strategy for each MCT circuit module according to Miller decomposition and three derivative decomposition methods to reduce the number of quantum basic gates; Step S5: placing the decomposed quantum circuit on a quantum computing device for mapping.

2. The MCT line decomposition method based on hardware constraints according to claim 1, characterized in that: Step S1 is specifically as follows: For the test circuits in the quantum circuit benchmark set Benchmark, it is necessary to find the quantum circuits containing MCT gates, and then use the conventional traversal method for the quantum circuits containing MCT gates to find the MCT circuit modules that need to be decomposed for subsequent decomposition work.

3. The MCT circuit decomposition method based on hardware constraints according to claim 1, characterized in that: Step S2 is specifically as follows: For the MCT line module found in step S1, the line movement rule is adopted: Generate PP gate pairs and NP associated gate pairs to avoid PN gate pairs; Among them: In the MCT gate sequence, if two adjacent MCT gates have a common target bit and the number of common control bits is greater than or equal to 3, the gate pair is called a Public-Public gate pair, abbreviated as a PP gate pair; If the target bits of two adjacent MCT gates are adjacent and the number of common control qubits is greater than or equal to 3, the gate pair is called a None-Public gate pair, or NP gate pair for short; If two adjacent MCT gates have a common target bit and the number of common control bits is at most 2, the gate pair is called a Public-None gate pair, or PN gate pair for short.

4. The MCT circuit decomposition method based on hardware constraints according to claim 1, characterized in that: Step S3 is specifically as follows: Step S31: After sensing the anyon topology in the quantum chip that is consistent with the number of qubits of the MCT quantum circuit to be decomposed, Step S32: The MCT gate in the circuit controls the division of the quantum bits: The division of the number of control qubits; the division of control qubits is proved from a mathematical point of view, and the number of basic gates generated by equal division of control qubits is the least; The positions of the control qubits are divided; the positions of the control qubits are divided into groups using a binary k-means clustering algorithm with a limited number of clusters.

5. The method for MCT circuit decomposition based on hardware constraints according to claim 1, characterized in that: Step S4 is specifically as follows: For Miller decomposition, according to the properties of quantum circuits: In Miller decomposition, the Controlled-V gate and Controlled-V+ gate of the same control qubit and target qubit are replaced with each other, and the final function of the quantum circuit does not change; Due to the reversible nature of the MCT gate, if the gate order of the two decomposition methods is completely opposite, and the type and number of gates do not change, the final function of the quantum circuit will not change; Three decomposition methods are derived; the reciprocal decomposition strategy is combined with the division of the control qubits in step S3.

6. The MCT circuit decomposition method based on hardware constraints according to claim 1, characterized in that: Step S5 is specifically as follows: The decomposed circuit is mapped and executed on a quantum chip, which reduces redundant gates and the number of additional gates required for mapping, thereby improving circuit fidelity.

7. The method for MCT circuit decomposition based on hardware constraints according to claim 4, characterized in that: The strategy for controlling the number of qubits is: In the process of using Miller iterative decomposition, the control qubits of the original MCT gate are divided into two groups until the number of control qubits in each group does not exceed 2, that is, decomposition to the Toffoli gate; During the decomposition of the MCT circuit, each MCT gate circuit module will follow the decomposition method of the first gate to make corresponding decomposition; Divide the number of control qubits: Assume that the number of control qubits of a single MCT gate is m, and find the minimum number of divisions n so that the integer m can be divided into several m i , since each MCT gate stops when the Miller iteration decomposition reaches a control qubit of less than or equal to 2, each m i It must be an integer between 1 and 2. The specific form is shown in formula (1); The iterative process of Miller decomposition is expressed in formula form as shown in formula (2); where T m is the total number of basic quantum gates required to decompose an MCT gate with m control qubits, and S represents the number of additional two-qubit gates introduced during the decomposition process, i.e., the number of Controlled-V gates and Controlled-V + Number of doors; When m = 1, T1 is a CNOT gate and counts as a basic quantum gate; When m = 2, T2 is a Toffoli gate, which is counted as 5 basic quantum gates; When m>2, T m It needs to be further iterated and decomposed into 2 sets of identical MCT gates and 4 two-qubit gates; In the case where the number of controlled qubits is evenly divided, when the number of controlled qubits m by the MCT gate is an even number, take When the number of qubits controlled by the MCT gate is an odd number, At this time, decompose to The calculation of the basic number of gates in the quantum circuit at the stage is shown in formula (3); In the case where the number of controlled qubits is not evenly divided, when the number of controlled qubits m by the MCT gate is an even number, When the number m of qubits controlled by the MCT gate is an odd number, To facilitate specific calculations, At this time, decompose to The calculation of the basic number of gates in the quantum circuit at the stage is shown in formula (4); 8. The method for MCT circuit decomposition based on hardware constraints according to claim 4, characterized in that: The positions are divided into: Perform initial mapping work to map logical qubits to physical qubits; According to the positions of the control qubits of the MCT gate, the control qubits are divided into two groups using a binary k-means clustering algorithm with a limited number of clusters. The number of control qubits in each cluster is determined by an equal division method. According to the constraint of equal division of quantity, their positions are randomly divided into two groups, the coordinates of the center position of each group are calculated, and each control qubit is assigned to the group with a closer Manhattan distance to the center coordinate of each group. The process is repeated until the allocation process does not change. This process always ensures that the number of control qubits in the cluster does not change.

9. The method for MCT circuit decomposition based on hardware constraints according to claim 5, characterized in that: The three Miller decompositions are derived as: Derivative decomposition method 1 of Miller decomposition; Derivative decomposition method 2 of Miller decomposition; Derivative decomposition method 3 of Miller decomposition; After verification by truth table and unitary matrix calculation method, Miller decomposition is completely equivalent to the above three derivative decomposition methods; Miller decomposition and the first decomposition method of Miller decomposition, the second decomposition method of Miller decomposition and the third decomposition method of Miller decomposition are defined as homologous decompositions; Miller decomposition and its derivative decomposition method 2, Miller decomposition derivative decomposition method 1 and Miller decomposition derivative decomposition method 3 are defined as reciprocal decompositions.

10. The method for MCT circuit decomposition based on hardware constraints according to claim 7, characterized in that: Comparison between the equal distribution method and the non-equal distribution method by controlling the number of quantum bits: In these two ways of number division, when the number of control qubits of a single MCT gate is iteratively decomposed to At the stage, that is, the maximum number of qubits controlled by the MCT gate in the circuit is When , the number of basic quantum gates of the equipartition method is The number of quantum basic gates in the non-uniform distribution method is By comparison, it is found that in the process of iterative decomposition, the number of basic gates generated by the equal distribution of control qubits is less than that of the non-equal distribution; in the Miller decomposition process of the MCT circuit, if the number of control qubits of a single MCT gate is m, when iteratively decomposed into sub-MCT gates, the closer the number of control qubits of the sub-MCT gates is, the greater the number of basic gates generated by the equal distribution of control qubits is. The number of basic gates in the final decomposed quantum circuit will be smaller.