A distributed quantum circuit mapping method based on Monte Carlo tree
Through the distributed quantum circuit mapping method based on Monte Carlo trees, the quantum circuit routing mode is optimized, which solves the problems of high quantum resource consumption and unconsidered QPU connectivity in distributed quantum computing, and improves the fidelity and efficiency of calculations.
Patent Information
- Application Number
- CN202310503167.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-06
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2043-05-06
AI Technical Summary
The existing distributed quantum circuit mapping method has the problems of excessive quantum resource consumption, failure to consider the connectivity of QPU and high calculation error rate, and cannot effectively support the development of superconducting quantum computing networks.
Using a distributed quantum circuit mapping method based on Monte Carlo trees, by constructing a distributed superconducting quantum computing architecture model and quantum network topology diagram, the quantum circuit routing mode is optimized, the number of SWAP gates is reduced, and the Monte Carlo tree search algorithm is used to find routes. The lowest cost path.
It reduces the complexity of distributed quantum circuit mapping, improves the fidelity and accuracy of calculations, speeds up the solution of the mapping process, and reduces the resource consumption and error rate of quantum computing.
Smart Images

Figure CN116502727B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum circuit mapping and optimization technology, and in particular to a distributed quantum circuit mapping method based on a Monte Carlo tree. Background Art
[0002] Current quantum computers can only implement a very limited number of qubits within a quantum chip and are unable to handle complex practical problems. This causes difficulties for quantum computers in solving many practical problems. The implementation of qubits usually uses physical systems such as superconducting circuits and ion traps, which have certain limitations on the number of qubits and error correction capabilities. For example, qubits in superconducting circuits need to operate at very low temperatures and require precise fine-tuning and calibration, requirements that become more difficult as the number of qubits within a single quantum chip increases. Distributed quantum computing provides a scalable way for the number of qubits to break through the limitations of a single QPU.
[0003] The key to distributed quantum computing lies in the distributed quantum circuit mapping and routing in the compilation phase, so as to split the circuit into sub-circuits and distribute them to different sub-architectures for execution, and require the sub-circuits to meet the hardware constraints of the sub-architecture, and improve the execution fidelity of the distributed quantum circuits, thereby improving the accuracy of distributed computers. Traditional quantum circuit mapping involves mapping quantum circuits to physical hardware architectures while minimizing errors and optimizing performance. Unlike centralized quantum mapping, distributed quantum mapping involves distributing quantum computing across multiple hardware devices or nodes while ensuring that the overall computing remains consistent and efficient.
[0004] In the distributed quantum computing model, the circuit is divided into multiple partitions and mapped to different partitions for execution. To execute a global gate, the states of all related qubits need to be transferred to the same partition and the quantum gate is executed in that partition. Since the quantum state cannot be cloned, the transferred qubits need to be retransmitted back to the original partition after the execution of the global gate is completed.
[0005] The quantum circuit mapping problem on a single QPU has been proven to be an NP-Complete problem. The quantum circuit mapping and routing methods on a single QPU are described in the paper Li G, Ding Y, Xie Y. Tackling the qubit mapping problem for NISQ-era quantum devices[C] / / Proceedings of the Twenty-FourthInternational Conference on Architectural Support for Programming Languagesand Operating Systems.2019:1001-1014. Another paper Niu S, SuauA, Staffelbach G, et al. A hardware-aware heuristic for the qubit mapping problem in the nisq era[J]. IEEE Transactions on Quantum Engineering, 2020, 1:1-14.
[0006] However, in distributed computing systems, quantum circuit mapping needs to consider the physical constraints imposed by each QPU as well as the physical constraints imposed by the underlying communication mechanism, so it is more complex. In the paper: Zomorodi-Moghadam M, Houshmand M, Houshmand M. Optimizing teleportation cost indistributed quantum circuits[J]. International Journal of Theoretical Physics, 2018,57:848-861. and Daei O, Navi K, Zomorodi-Moghadam M. Optimized quantum circuitpartitioning[J]. International Journal of Theoretical Physics Physics, 2020, 59(12): 3804-3820. And Ghodsollahee I, Davarzani Z, Zomorodi M, et al. Connectivity matrixmodel of quantum circuits and its application to distributed quantum circuit optimization [J]. Quantum Information Processing, 2021, 20: 1-21. And Dadkhah D, Zomorodi M, Hosseini SE, et al. Reordering and partitioning of distributedquantum circuits[J].IEEE Access, 2022, 10: 70329-70341. and Andres-Martinez P, Heunen C. Automated distribution of quantum circuits via hypergraph partitioning [J]. Physical Review A, 2019, 100 (3): 032308. There are some studies on distributed quantum circuit mapping, but these studies are all aimed at a hypothetical distributed computing model based on the quantum Internet. In this hypothetical model, the quantum Internet uses quantum teleportation technology to transmit data between QPUs, but this technology is mainly aimed at long-distance quantum communication scenarios rather than quantum computing scenarios.In addition, in this hypothetical model, any two QPUs are directly connected, and any pair of quantum bits in a QPU is also directly connected. Obviously, this hypothetical model is not suitable for quantum computing scenarios, and does not conform to the current development status and future development trend of superconducting quantum computing. Therefore, the quantum circuit mapping method based on this hypothetical distributed model cannot be directly applied to the emerging superconducting quantum computing network.
[0007] Distributed quantum networks based on superconducting quantum bit interconnection technology are an effective way to solve the problem of insufficient quantum bits in a single QPU. Superconducting quantum bit interconnection achieves the transmission of quantum states over quantum microwave links by establishing microwave links between different QPUs. In the paper: P. Kurpiers, P. Magnard, T. Walter, B. Royer, M. Pechal, J. Heinsoo, Y. Salath′e, A. Akin, S. Storz, J.-C. Besse, et al., Deterministic quantum state transfer and remote entanglement using microwave photons, Nature 558, 264 (2018)., it was found in the study of quantum microwave link transmission that superconducting quantum bits and microwave links can be efficiently coupled through coupled resonators. In the literature: Magnard P, Storz S, Kurpiers P, et al. Microwave quantum link between superconducting circuits housed in spatially separated cryogenic systems [J]. Physical Review Letters, 2020, 125(26): 260502. Experiments show that a low-temperature microwave link is established between quantum bit nodes in a low-temperature refrigerator 5 meters away, and the average fidelity of quantum state transfer between the two nodes reaches 85.8%. In addition, in the literature: Zhong Y, Chang HS, Bienfait A, et al. Deterministic multi-qubit entanglement in a quantum network [J]. Nature, 2021, 590 (7847): 571-575. and the paper: Leung N, Lu Y, Chakram S, et al. Deterministic bidirectional communication and remote entanglement generation between superconducting qubits [J]. npj quantum information, 2019, 5 (1): 18., by establishing a high-fidelity communication link with a distance of 1 meter, entangled quantum bit transmission with a fidelity of 72.2% and 79.3% was achieved respectively. Superconducting signals operate in the microwave spectrum and are easily affected by thermal energy, which is one of the reasons for establishing short-distance low-temperature microwave links.A new method for high-density quantum microwave transmission using room-temperature lossy waveguides was proposed in the literature: Qasymeh M, Eleuch H. High-fidelity quantum information transmission using a room-temperature nonrefrigerated lossy microwave waveguide [J]. Scientific Reports, 2022, 12(1): 16352. to solve this problem, achieving 95% reliability of quantum microwave link communication at a distance of 100 meters. This method breaks the limitation of low temperature, effectively increases the transmission distance of microwave link communication, and provides a new method for establishing quantum network architecture in the future.
[0008] Transmitting quantum states using quantum microwave links does not require the use of classical communication channels, but directly communicates over microwave links. This method also does not require the consumption of quantum entangled pairs or quantum state measurements, saving quantum resource consumption while ensuring high transmission efficiency and fidelity. Based on quantum microwave link transmission, literature: GF, Puebla R, Ramos T, et al. Universal deterministic quantum operations in microwave quantum links[J]. Physical Review Applied, 2022, 17(5): 054038. A distributed quantum gate implementation protocol based purely on quantum state transfer was proposed to achieve universal distributed quantum gates. In the paper: Laracuente N, Smith KN, Imany P, et al. Short-range microwave networks to scale superconducting quantum computation[J]. arXiv preprint arXiv: 2201.08825, 2022., four 27-qubit QPUs were connected via microwave links, expanding the architecture to a 108-qubit distributed architecture. In the paper: Wu A, Zhang H, Li G, et al. AutoComm: A Framework for Enabling Efficient Communication in Distributed Quantum Programs[C] / / 2022 55th IEEE / ACM International Symposium on Microarchitecture(MICRO). IEEE, 2022: 1027-1041. and the paper: Smith KN, Ravi GS, Baker JM, et al. Scaling Superconducting Quantum Computers with Chiplet Architectures[C] / / 2022 55th IEEE / ACM International Symposium on Microarchitecture(MICRO). IEEE, 2022: 1092-1109., the development of quantum microwave link transmission technology has also promoted the development of large-scale distributed quantum computing and quantum networks, and promoted the future quantum network architecture of millions of quantum bits to become a reality.
[0009] In summary: Currently, distributed quantum circuit mapping is based on teleportation communication, which has the following shortcomings:
[0010] (1) Excessive consumption of quantum resources:
[0011] Teleportation is a protocol that uses quantum entanglement to transfer information. In the teleportation protocol, there is a quantum entanglement relationship between two entangled quantum bits. By changing the state of one quantum bit, the state of the other quantum bit can be transmitted. However, in practical applications, quantum entanglement needs to be prepared and operated, which involves some quantum technologies, such as quantum entanglement sources and quantum gate operations. These technologies require a large amount of quantum resources, such as the number of quantum bits and quantum gates, as well as computing resources, so the realization of teleportation will occupy a certain amount of quantum resources.
[0012] (2) The connectivity of QPU is not considered:
[0013] At present, the distributed quantum circuit mapping based on teleportation is based on a fully connected topological structure, without considering the connectivity of the QPU architecture. This is an idealized distributed computing model. This model allows quantum states to be transmitted between arbitrary qubits, which is impossible to achieve in the underlying implementation and cannot execute distributed circuits on existing quantum computing devices, so this model has no practical significance.
[0014] (3) High calculation error rate:
[0015] Teleportation is mainly aimed at long-distance quantum communication, which has the problem of high error rate and is difficult to meet the requirements of distributed quantum computing in terms of fidelity, transmission efficiency, latency, etc. In addition, teleportation is a very complex technology that requires precise preparation, transmission and detection of quantum states. These operations are easily disturbed by factors such as environmental noise and temperature changes, resulting in the loss of quantum states and an increase in error rates, which ultimately leads to a high error rate in distributed computing. Summary of the invention
[0016] The object of the present invention is to provide a distributed quantum circuit mapping method based on Monte Carlo tree to solve multiple defects caused by the prior art.
[0017] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is specifically as follows:
[0018] A distributed quantum circuit mapping method based on Monte Carlo tree, comprising the following steps:
[0019] S1: Establish a distributed superconducting quantum computing architecture model, specifically including: S11: Distributed architecture model construction and S12: Distributed quantum network topology map construction;
[0020] S2: Distributed quantum circuit routing mode; specifically includes S21: Quantum chip: routing mode between QPUs, S22: routing mode within QPUs;
[0021] S3: Distributed quantum circuit routing optimization strategy; specifically includes S31: determining optimization indicators, S32: constructing a three-layer search tree model for distributed quantum circuit routing, and S33: using Monte Carlo tree to search for the path with the lowest routing cost.
[0022] When the circuit cannot be executed on a single QPU, the circuit needs to be distributed to X QPUs for execution. To this end, a distributed quantum computing underlying architecture model suitable for this circuit needs to be constructed, using step S11, which specifically includes:
[0023] S111: Using quantum bit interconnection technology, a short-range communication channel is established between two QPUs to achieve quantum state transmission;
[0024] S112: Based on the quantum state transmission model, a communication link is established between X QPUs, which constitute a distributed quantum architecture;
[0025] Where X is greater than or equal to 2;
[0026] S113: In the process of distributed quantum architecture, a quantum communication channel will only act on two qubits, and the qubits acted on are called communication qubits;
[0027] S114: Quantum communication only occurs between communicating qubits, so it is called communication-restricted;
[0028] S115: Communication qubits are used to send and receive quantum states and support quantum state operations, i.e., executing quantum gates.
[0029] S116: Other qubits on the QPU that do not support quantum communication are called data qubits and are used to perform conventional quantum state operations;
[0030] S117: A distributed quantum architecture was constructed. The constraints of the established distributed architecture model are as follows:
[0031]
[0032] In the formula, k is the number of partitions, a i is the number of qubits on architecture i, n is the total number of qubits in the initial circuit, t i is the number of communication qubits in partition i, where 1≤t i ≤a i-1 ;
[0033] When X QPUs are connected to form a topological structure through quantum channels, step S12 is used, which specifically includes:
[0034] The distributed model of X QPUs is described as a distributed quantum network topology graph, which regards each QPU as a node in the network and defines the connection between them, so that distributed quantum computing no longer focuses on the specific qubits established by the communication link, but only focuses on the connection relationship between the nodes;
[0035] Wherein, X is greater than or equal to 2.
[0036] After matching the appropriate distributed architecture and topology, the distributed lines need to be mapped to X QPUs for execution, using step S21, which specifically includes:
[0037] S211: According to the distributed quantum network topology diagram and the distributed architecture model, a mapping relationship between distributed quantum circuits and distributed architectures is established, that is, the logical qubits of the distributed circuits are allocated to the physical qubits of the distributed architecture;
[0038] S212: After mapping, not all quantum gates satisfy the neighbor constraint of the topological architecture. It is necessary to route the two qubits of the quantum gate that does not satisfy the neighbor constraint (the double quantum gate must act on two adjacent qubits in the topological graph) to the neighbor position, that is, two adjacent qubits in the topological graph through qubit routing;
[0039] Routing between QPUs is based on quantum communication of qubit interconnection, and a quantum state transfer operation is defined as an ST operation;
[0040] S213: Under communication constraints, the ST operation can only act on two qubits connected by the communication link, the communication qubit, to achieve the transmission of quantum states;
[0041] Where X is greater than or equal to 2;
[0042] After step S21 is executed, there are still global quantum gates that cannot be directly executed, and step S22 is used, which specifically includes:
[0043] S221 receiving routing: used to empty the communication qubit at the receiving end so that the communication qubit at the sending end can transmit the quantum state to the receiving end; the receiving routing needs to find the idle qubit closest to the communication qubit, and route the quantum state on the communication qubit to this idle qubit by inserting a SWAP gate (a quantum gate that executes the auxiliary gate of the quantum gate neighbor);
[0044] S222 execution routing: the routing method is the same as that in the centralized quantum circuit mapping, and only the nearest neighbors of the quantum gate need to be realized; the execution routing method is the same as the traditional centralized quantum circuit routing method, and only the nearest neighbors of the executable quantum gates after receiving the quantum state need to be paid attention to, and the nearest neighbors of these quantum gates can be completed by inserting the SWAP gate;
[0045] S223 Send routing: It is used to route the qubits to be transmitted to the communication qubits in order to perform the ST operation; after the execution of the routing, the sending routing is required to route the quantum state to be transmitted from the data qubit to the transmission quantum state. The number of SWAP gates inserted in this process is equal to the length of the transmission path of this quantum state, so this problem can be transformed into calculating the shortest path from the qubit to be transmitted to the transmission qubit in the graph.
[0046] Step S31 is specifically as follows:
[0047] Additional SWAP gates need to be inserted in the distributed quantum circuit routing process. The number of SWAP gates inserted in the distributed quantum circuit mapping is determined by the three routing modes: receiving routing, execution routing, and sending routing. The number of SWAP gates required for routing within the circuit QPU is C SWAP Expressed in formula (2), and considering the routing cost C between QPUs route It is expressed by formula (3):
[0048] C SWAP =C receive +C execute +C send (2)
[0049]
[0050] Where ω1 and ω2 represent the weights of inter-QPU routing and intra-QPU routing, n represents the number of blocks of the distributed line; C receive represents the SWAP gate cost of the receiving route, C execute represents the SWAP gate cost of executing routing, C send represents the SWAP gate cost of the sending route, ST is the number of ST operations, that is, the number of ST gates;
[0051] Step S32 is specifically as follows:
[0052] Since the three routing modes within the QPU are in a progressive relationship, the routing result of the previous layer directly affects the routing result of the next layer. Therefore, using a greedy strategy in each layer to obtain the lowest cost of each layer of routing cannot ensure that the overall cost in formula (2) is the lowest. Based on the progressive relationship of the three routing modes within the QPU, a search tree model of the three routing models is constructed; in this search tree model, the first layer is the receiving route R; the second layer is the execution route E, and the third layer is the only corresponding sending route S after each execution route.
[0053] Step S33 is specifically as follows:
[0054] There must be a path in this search tree that minimizes the routing cost within the QPU. A distributed quantum circuit routing optimization strategy based on Monte Carlo tree search is used. The algorithm flow of this strategy is as follows:
[0055] Step 1: Initialize a root node to represent the current state;
[0056] Step 2: For the current node, use heuristic search to select an unexpanded child node and add it to the tree;
[0057] Step 3: Use random simulation to evaluate the routing cost of the child node and obtain the weight of the child node;
[0058] Step 4: Update the status of all nodes in the tree and the corresponding routing costs to avoid repeated searches;
[0059] Step 5: Repeat steps 2-4 until the path with the lowest weight is found, that is, the three grandparent and grandchild nodes with the lowest routing cost.
[0060] Compared with the prior art, the present invention has the following beneficial effects:
[0061] (1) Reduce the complexity of mapping:
[0062] In distributed quantum circuit mapping, it is necessary to map the logic circuit to the topological structure of the physical quantum chip. Therefore, some SWAP gates are needed to exchange the connection between physical quantum bits so that the quantum gates satisfy the nearest neighbor constraint and can be executed on the QPU. However, adding too many SWAP gates will increase the complexity of the mapping. Therefore, reducing the use of SWAP gates can reduce the complexity of distributed quantum circuit mapping. The present invention abstracts the distributed quantum circuit routing into three routing modes and reduces the number of SWAP gates in the routing process. These methods can simplify the distributed quantum circuit mapping process, reduce the complexity of the mapping, and improve the mapping efficiency.
[0063] (2) Improving the fidelity of distributed quantum computing:
[0064] Errors in distributed quantum computing mainly come from errors in quantum communication and errors in double quantum gates during subcircuit execution. During the execution of double quantum gates, the more SWAP gates are inserted, the more logic gates there are in the quantum circuit. This will increase the time complexity and resource consumption of quantum computing, and increase the error rate of quantum computing. Therefore, reducing the number of SWAP gates is an important means to improve the fidelity of quantum computing. By reducing the number of SWAP gates required for double quantum gate routing, the probability of quantum gate calculation errors will also be reduced, improving the fidelity of distributed quantum computing, thereby improving the reliability and accuracy of quantum computing.
[0065] (3) Accelerate the solution speed of the mapping process:
[0066] When the search space is large, the brute force search routing algorithm needs to enumerate all possible states, so it is difficult to complete the search within an acceptable time. The Monte Carlo tree search algorithm can control the search depth according to actual needs, avoiding a large number of invalid calculations and searches. In addition, the essence of the Monte Carlo tree search algorithm is a Monte Carlo simulation, so it is very suitable for parallel processing. It can accelerate the search through multi-threading and other methods, greatly improving the speed of solving the routing method. Unlike centralized quantum circuit mapping, the search tree model corresponding to distributed quantum circuit mapping has deeper layers, faster search convergence speed, and can find a mapping method with lower routing cost in various mappings more quickly. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] 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.
[0068] Figure 1 It is a schematic diagram of the distributed quantum mapping model of the present invention.
[0069] Figure 2 It is a schematic diagram of the quantum state transmission model of the present invention.
[0070] Figure 3 Schematic diagram of the distributed QPU architecture model of the present invention; (a) is an example diagram of a distributed architecture model of two QPUs, (b) is an example diagram of a distributed architecture model of three QPUs, and (c) is an example diagram of a distributed architecture model of four QPUs.
[0071] Figure 4 Schematic diagram of the one-dimensional topology of the distributed quantum network of the present invention; (a) is a schematic diagram of the distributed one-dimensional network topology of two QPUs, (b) is a schematic diagram of the distributed one-dimensional network topology of three QPUs, and (c) is a schematic diagram of the distributed one-dimensional network topology of four QPUs.
[0072] Figure 5 Schematic diagram of the distributed two-dimensional network topology of three QPUs of the present invention.
[0073] Figure 6 Schematic diagram of the two-dimensional topology of the distributed quantum network of the present invention, (a) a schematic diagram of the low-connectivity distributed two-dimensional network topology of four QPUs, and (b) a schematic diagram of the high-connectivity distributed two-dimensional network topology of four QPUs.
[0074] Figure 7 It is a schematic diagram of the ST operation of the present invention.
[0075] Figure 8It is a schematic diagram of the distributed line routing process of the present invention.
[0076] Fig. 9 It is a schematic diagram of the distributed line receiving routing of the present invention.
[0077] Fig.10 A schematic diagram of the distributed line sending routing of the present invention.
[0078] Fig.11 Schematic diagram of the search tree model of the three routing modes of the present invention.
[0079] Fig.12 Schematic diagram of distributed quantum circuit mapping of Example 2; (a) is a schematic diagram of a distributed circuit, and (b) is a schematic diagram of a distributed architecture.
[0080] Fig.13 Schematic diagram of the distributed mapping process of Example 2; (a) is a schematic diagram of the first step of quantum gate G1 sending routing, (b) is a schematic diagram of the second step of quantum gate G1 sending routing, (c) is a schematic diagram of the first ST operation of quantum gate G1, (d) is a schematic diagram of the second ST operation of quantum gate G1, and (e) is a schematic diagram of the logic circuit after all quantum gate routings are completed. DETAILED DESCRIPTION
[0081] 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.
[0082] Figure 1 A distributed quantum computing model is presented, in which the circuit is divided into multiple partitions and mapped to different partitions for execution. Quantum gates G1 to G7 are global gates, and G8 is a local gate. Executing a global gate requires transmitting the states of all related qubits to the same partition through quantum channels (links), and executing the quantum gate in the partition.
[0083] Example 1
[0084] A distributed quantum circuit mapping method based on Monte Carlo tree, comprising the following steps:
[0085] S1: Establish a distributed superconducting quantum computing architecture model, specifically including: S11: Distributed architecture model construction and S12: Distributed quantum network topology map construction;
[0086] S2: Distributed quantum circuit routing mode; specifically includes S21: Quantum chip: routing mode between QPUs, S22: routing mode within QPUs;
[0087] S3: Distributed quantum circuit routing optimization strategy; specifically includes S31: determining optimization indicators, S32: constructing a three-layer search tree model for distributed quantum circuit routing, and S33: using Monte Carlo tree to search for the path with the lowest routing cost.
[0088] When the circuit cannot be executed on a single QPU, the circuit needs to be distributed to X QPUs for execution. To this end, a distributed quantum computing underlying architecture model suitable for this circuit needs to be constructed, using step S11, which specifically includes:
[0089] S111: Using quantum bit interconnection technology, a short-range communication channel is established between two QPUs to achieve the transmission of quantum states; quantum states achieve bidirectional communication between two quantum bits. In a distributed quantum network, each partition communicates with each other and cooperates with each other to form a distributed quantum computing system. In the present invention, quantum bit interconnection technology is used to establish a short-range communication channel between two QPUs to achieve the transmission of quantum states. Currently, there are many ways to implement quantum bit interconnection technology, which differ in technical details such as temperature control, transmission distance, and pulse control. However, these methods have the same functions at the logical level, which are to transmit a quantum state from a quantum bit of one device to a quantum bit on another device. Therefore, the present invention abstracts this quantum state transmission method based on quantum bit interconnection into Figure 2 In the model shown, quantum states enable bidirectional communication between two qubits.
[0090] S112: Based on the quantum state transmission model, a communication link is established between X QPUs, which constitute a distributed quantum architecture;
[0091] Where X is greater than or equal to 2;
[0092] Based on the quantum state transmission model, a communication link is established between multiple quantum chips (QPU), which constitute a distributed quantum architecture. In the process of distributed quantum architecture, a quantum communication channel will only act on two qubits, and the qubits acted on are called communication qubits. Quantum communication only occurs between communication qubits, so it is called limited communication. Communication qubits are used to send and receive quantum states, and support conventional quantum state operations, that is, execute quantum gates. Other qubits on the QPU that do not support quantum communication are called data qubits, which are used to perform conventional quantum state operations. Thus, the present invention constructs a distributed quantum architecture. Figure 3 The distributed architecture model of multiple QPUs shown in the figure, the dotted circles represent communication qubits, the solid circles represent data qubits, and the dotted arrows represent quantum communication. Figure 3 (a) represents a one-dimensional distributed architecture model consisting of only two QPUs. Figure 3 (b) represents a one-dimensional distributed architecture model consisting of three QPUs. Figure 3(c) shows the two-dimensional distributed architecture model consisting of four QPUs.
[0093] S113: In the process of distributed quantum architecture, a quantum communication channel will only act on two qubits, and the qubits acted on are called communication qubits;
[0094] S114: Quantum communication only occurs between communicating qubits, so it is called communication-restricted;
[0095] S115: Communication qubits are used to send and receive quantum states and support quantum state operations, i.e., executing quantum gates.
[0096] S116: Other qubits on the QPU that do not support quantum communication are called data qubits and are used to perform conventional quantum state operations;
[0097] S117: A distributed quantum architecture was constructed. The constraints of the established distributed architecture model are as follows:
[0098]
[0099] In the formula, k is the number of partitions, a i is the number of qubits on architecture i, n is the total number of qubits in the initial circuit, t i is the number of communication qubits in partition i, where 1≤t i ≤a i-1 ;
[0100] According to formula (1), when the number of quantum bits of the circuit is greater than 8, Figure 3 The distributed architecture model shown in (a) is no longer applicable. Therefore, it is necessary to build a distributed architecture model containing more QPUs, such as a distributed architecture with three QPUs or a distributed architecture with four QPUs. Figure 3 (b) and Figure 3 (c) as shown. Figure 3 (c) with Figure 3 (a) (b) is different from the one-dimensional layout. The two-dimensional layout is adopted, and its transmission method is more flexible. The specific distributed architecture layout and connection method need to be determined by the number of logical quantum bits of the line and the available architecture. In order to further describe the abstract relationship between distributed QPUs, these distributed models of multiple QPUs can be abstracted into a distributed quantum network topology diagram, such as Figure 4 and Figure 5 shown. Figure 4 Represent the one-dimensional distributed quantum network topology diagrams composed of two, three, and four QPUs respectively, where Figure 4 The distributed quantum network topology diagram of (a) corresponds to Figure 3 (a) One-dimensional distributed architecture model of two QPUs, Figure 4(b) The distributed quantum network topology corresponds to Figure 3 (b) One-dimensional distributed architecture model of three QPUs. Figure 5 and Figure 6 They represent the distributed two-dimensional network topologies of three and four QPUs respectively, where Figure 5 and Figure 6 (b) A two-dimensional network topology diagram showing a highly connected distributed quantum network. Figure 6 (a) A two-dimensional network topology diagram of a distributed quantum network with low connectivity, corresponding to Figure 3 (c) A two-dimensional distributed architecture model of four QPUs. The distributed quantum network topology diagram no longer focuses on the specific quantum bits established by the communication link, but only focuses on the connection relationship of the nodes. In the distributed quantum network topology diagram, the circles represent the nodes or subsystems of the distributed quantum network, and the architecture within the node needs to be adjusted according to the scale of the quantum circuit.
[0101] When X QPUs are connected to form a topological structure through quantum channels, step S12 is used, which specifically includes:
[0102] The distributed model of X QPUs is described as a distributed quantum network topology graph, which regards each QPU as a node in the network and defines the connection between them, so that distributed quantum computing no longer focuses on the specific qubits established by the communication link, but only focuses on the connection relationship between the nodes;
[0103] Wherein, X is greater than or equal to 2.
[0104] After matching the appropriate distributed architecture and topology, the distributed lines need to be mapped to X QPUs for execution, using step S21, which specifically includes:
[0105] S211: According to the distributed quantum network topology diagram and the distributed architecture model, a mapping relationship between distributed quantum circuits and distributed architectures is established, that is, the logical qubits of the distributed circuits are allocated to the physical qubits of the distributed architecture;
[0106] S212: After mapping, not all quantum gates satisfy the neighbor constraint of the topological architecture. It is necessary to route the two qubits of the quantum gate that does not satisfy the neighbor constraint (the double quantum gate must act on two adjacent qubits in the topological graph) to the neighbor position, that is, two adjacent qubits in the topological graph through qubit routing;
[0107] Routing between QPUs is based on quantum communication of qubit interconnection, and a quantum state transfer operation is defined as an ST operation;
[0108] According to the distributed quantum network topology diagram and the distributed architecture model, a mapping relationship between distributed quantum circuits and distributed architectures can be established, that is, the logical qubits of the distributed circuits are assigned to the physical qubits of the distributed architecture. After mapping, some quantum gates cannot meet the neighbor constraints of the topological architecture, so it is necessary to route the two qubits of the quantum gate that do not meet the neighbor conditions to the neighbor position through qubit routing. Different from traditional quantum routing, distributed quantum circuits are divided into routing between QPUs and routing within QPUs. Routing between QPUs is quantum communication based on quantum bit interconnection. In order to better represent the routing between QPUs in logical circuits, the present invention defines a quantum state transmission operation as an ST operation, and the arrow indicates the transmission direction, such as Figure 7 shown.
[0109] S213: Under communication constraints, the ST operation can only act on two qubits connected by the communication link, the communication qubit, to achieve the transmission of quantum states;
[0110] Where X is greater than or equal to 2;
[0111] Under communication constraints, the ST operation can only act on two qubits connected by the communication link, that is, Figure 3 The communication qubits of the dashed line in the middle realize the transmission of quantum states. In order to better represent the storage process after transmission in the logic circuit, two auxiliary qubits T1 and T2 need to be introduced in the logic circuit as communication qubits. In other words, if the distributed circuit mapping is Figure 3 In the architecture, qubit T1 is mapped to q2 of QPU1, and qubit T2 is mapped to q0 of QPU2.
[0112] After step S21 is executed, there are still global quantum gates that cannot be directly executed, and step S22 is used, which specifically includes:
[0113] S221 receiving routing: used to empty the communication qubit at the receiving end so that the communication qubit at the sending end can transmit the quantum state to the receiving end; the receiving routing needs to find the idle qubit closest to the communication qubit, and route the quantum state on the communication qubit to this idle qubit by inserting a SWAP gate (a quantum gate that executes the auxiliary gate of the quantum gate neighbor);
[0114] S222 execution routing: the routing method is the same as that in the centralized quantum circuit mapping, and only the nearest neighbors of the quantum gate need to be realized; the execution routing method is the same as the traditional centralized quantum circuit routing method, and only the nearest neighbors of the executable quantum gates after receiving the quantum state need to be paid attention to, and the nearest neighbors of these quantum gates can be completed by inserting the SWAP gate;
[0115] S223 Send routing: It is used to route the qubits to be transmitted to the communication qubits in order to perform the ST operation; after the execution of the routing, the sending routing is required to route the quantum state to be transmitted from the data qubit to the transmission quantum state. The number of SWAP gates inserted in this process is equal to the length of the transmission path of this quantum state, so this problem can be transformed into calculating the shortest path from the qubit to be transmitted to the transmission qubit in the graph.
[0116] Different from the routing operation between QPUs, the present invention focuses more on the routing operation within a QPU. The routing within a QPU can be divided into the following three modes:
[0117] Receive routing, execute routing, and send routing. Receive routing is used to empty the communication qubit at the receiving end so that the communication qubit at the sending end can transmit the quantum state to the receiving end. Execute routing is the same as the routing method in centralized quantum circuit mapping, and only the neighbor of the quantum gate needs to be realized. Send routing is used to route the qubit to be transmitted to the communication qubit in order to perform ST operations. The three routing modes within the QPU and the routing process between QPUs are as follows: Figure 8 shown.
[0118] by Figure 3 Taking the distributed architecture in as an example, the process of distributed line routing in a single QPU is introduced. When the quantum state is transferred from the Q0 qubit in QPU2 to the Q2 qubit in QPU1 through the ST operation, the receiving routing needs to be performed in QPU1 first. Figure 8 In the coupling diagram shown, when the communication qubit Q2 is occupied, the ST operation cannot be performed and a receiving route is required. The receiving route requires moving Q2 on the communication qubit to an idle qubit by inserting a SWAP gate. Fig. 9 Taking the receiving route shown as an example, a SWAP gate is first inserted between Q0 and Q1, and then a SWAP gate is inserted between Q1 and Q2, so that the idle quantum state Q0 is routed to the communication quantum bit Q2 to receive the transmitted quantum state.
[0119] The execution routing method is the same as the traditional centralized quantum circuit routing method. It only needs to pay attention to the neighbor constraints of the executable quantum gates after receiving the quantum state, and insert the SWAP gate to make these quantum gates complete the neighbor. Some excellent routing methods such as SABER and HA have realized the execution routing function.
[0120] After the execution of routing is completed, the transmission routing needs to be performed to route the quantum state to be transmitted from the data qubit to the transmission quantum state. The number of SWAP gates inserted in this process is equal to the length of the transmission path of this quantum state, so this problem can be transformed into calculating the shortest path from the qubit to be transmitted to the transmission qubit in the graph. Fig.10As shown in the figure, when the quantum state on the Q3 qubit needs to be transmitted, the shortest distance from this qubit to the communication qubit Q2 is 2, and the transmission path is Q3-Q1-Q2, requiring a total of two SWAP gates to complete the transmission route. At this point, the routing process in QPU1 is completed.
[0121] Step S31 is specifically as follows:
[0122] Additional SWAP gates need to be inserted in the distributed quantum circuit routing process. The number of SWAP gates inserted in the distributed quantum circuit mapping is determined by the three routing modes: receiving routing, execution routing, and sending routing. The number of SWAP gates required for routing within the circuit QPU is C SWAP Expressed in formula (2), and considering the routing cost C between QPUs route It is expressed by formula (3):
[0123] C SWAP =C receive +C execute +C send (2)
[0124]
[0125] Where ω1 and ω2 represent the weights of inter-QPU routing and intra-QPU routing, and n represents the number of blocks of the distributed line; C receive represents the SWAP gate cost of the receiving route, C executr represents the SWAP gate cost of executing routing, C send represents the SWAP gate cost of the sending route, ST is the number of ST operations, that is, the number of ST gates;
[0126] Step S32 is specifically as follows:
[0127] Since the three routing modes within the QPU are in a progressive relationship, the routing result of the previous layer directly affects the routing result of the next layer. Therefore, using a greedy strategy in each layer to obtain the lowest cost of each layer of routing cannot ensure that the overall cost in formula (2) is the lowest. Based on the progressive relationship of the three routing modes within the QPU, a search tree model of the three routing models is constructed; in this search tree model, the first layer is the receiving route R; the second layer is the execution route E, and the third layer is the only corresponding sending route S after each execution route.
[0128] Based on the progressive relationship of the three intra-QPU routing modes, three dependent search tree models are constructed, such as Fig.11As shown. The first layer of the search tree model is i receiving routes R, namely R1, R2, ...Ri. Each receiving route contains n execution routes. The number of execution routes corresponding to each receiving route is different, so the value of n is also different. Taking the first receiving route as an example, assuming that there are j execution routes, their execution routes E are E11, E12, E13...E1j. Each execution route corresponds to only one sending route S. Taking the first receiving route as an example, its corresponding sending routes are S11, S12, S13...S1j.
[0129] Step S33 is specifically as follows:
[0130] There must be a path in this search tree that minimizes the routing cost within the QPU. A distributed quantum circuit routing optimization strategy based on Monte Carlo tree search is used. The algorithm flow of this strategy is as follows:
[0131] Step 1: Initialize a root node to represent the current state;
[0132] Step 2: For the current node, use heuristic search to select an unexpanded child node and add it to the tree;
[0133] Step 3: Use random simulation to evaluate the routing cost of the child node and obtain the weight of the child node;
[0134] Step 4: Update the status of all nodes in the tree and the corresponding routing costs to avoid repeated searches;
[0135] Step 5: Repeat steps 2-4 until the path with the lowest weight is found, that is, the three grandparent and grandchild nodes with the lowest routing cost.
[0136] Example 2
[0137] like Fig.12 As shown. Fig.12 (a) The lines are mapped to Fig.12 (b) In the distributed architecture, the mapping method P1{q0,q1,q2} is mapped to QPU1{Q0,Q1,Q3}, and P2{q3,q4,q5} is mapped to QPU2{Q1,Q2,Q3}.
[0138] After the optimization of s3 in Example 1 based on Monte Carlo tree search, the following optimal routing strategy is obtained. The specific mapping and routing process is as follows:
[0139] Step 1: First, make sure that the G1 gate is executed on QPU1. Since the quantum state can only be communicated on the qubit Q2 of QPU1 and the qubit Q0 of QPU2, two SWAP gates are inserted to transfer the target bit of the G1 gate to Q0, such as Fig.12As shown in (a) and (b).
[0140] Fig.13 (a) is the sending route, which means that a SWAP gate is first inserted between the physical qubits Q1 and Q2 of QPU2, so that the state of the logical qubit q4 mapped on Q2 is transferred to the physical qubit Q1. The inserted SWAP gate causes the quantum gates acting on q3 and q4 in the line to change. After applying this SWAP gate, the state of the logical qubit q4 is still not on the communication qubit, and the ST operation cannot be performed. Therefore, continue to use the sending route and insert a SWAP gate between the physical qubits Q0 and Q1 of QPU2, so that the state of the logical qubit q4 is transferred to the physical qubit Q0. The corresponding line of this process is as follows Fig.13 (b). So Fig.13 (a) and Fig.13 (b) shows the process of sending routing in the logical circuit.
[0141] Step 2: Execute the ST operation to transfer the state of Q0 of QPU2 to the qubit Q2 of QPU1. At this time, the control bit of quantum gate G1 is located at Q1, and the target bit is located at Q2, which satisfies the nearest neighbor constraint and can be executed, such as Fig.13 (c) as shown.
[0142] according to Figure 8 The distributed line routing process shown in the figure needs to execute the receiving route after executing the sending route. However, the communication qubit Q2 in QPU1 used for receiving is not occupied by the quantum state, so the receiving route does not need to be executed at this time, and the ST operation is directly executed to transmit the quantum state of the communication qubit Q0 in QPU2 to the communication qubit Q2 in QPU1. So Fig.13 (c) shows the process of ST operation in the logic circuit. Step 3: After executing quantum gate G1, the quantum bits transmitted in Step 2 need to be transmitted back to the original partition, so continue to perform ST operation, such as Fig.13 (d) as shown.
[0143] After the ST operation in Step 2, the two qubits of the first global gate G1 act on the physical qubits Q1 and Q2 in QPU1, satisfying the neighbor condition. There is no need to act on the execution route, and then determine whether the sending route is needed. Since the quantum state to be transmitted is currently located in the communication qubit Q2 in QPU1, there is no need to send the route. Therefore, continue to determine whether the receiving route is needed. Since the communication qubit Q0 in QPU2 is an inactive qubit at this time, there is no need to receive the route. After the above judgment and analysis, a ST operation is directly performed after executing quantum gate G1. The corresponding logic circuit operation is as follows Fig.13 (d) as shown.
[0144] Step 4: From the merged transmission model of distributed quantum circuits, we know that gates G2 to G4 will be executed in QPU2. Apply two SWAP gates to transfer qubit q0 from Q0 of QPU1 to Q2.
[0145] After executing the first global gate G1, the next step is to process the subsequent global gates. According to the merge transmission model of the distributed quantum circuit, the global gates G2 to G4 need to transmit the quantum bit q0, so the gates G2 to G4 will be executed on QPU2. Figure 8 The distributed line routing process shown in the figure needs to use execution routing after the ST operation in Step 3. However, there is no quantum gate to be executed in QPU2 at present, so the execution routing can be omitted. Continue to execute the sending routing to transfer the logical qubit q0 acting on the physical qubit Q0 of QPU1 to the communication qubit Q2. Therefore, two SWAP gates are needed to realize the transfer of quantum states. The logical line operations corresponding to this sending routing process are as follows: Fig.13 Step 5: Before the ST operation, apply the SWAP gate to move Q0 on QPU2 to Q1 so that the qubit Q0 can receive the qubit from ST.
[0146] After the sending route, continue to execute the receiving route. First, determine whether the communication qubit Q0 on QPU2 is occupied by other quantum states. Since the state of the target bit of the global gate G1 is still on the communication qubit Q0 on QPU2 after the ST operation in Step 3, it is necessary to execute the receiving route on the communication qubit Q0 of QPU2. At this time, the state of the qubit Q1 closest to Q0 is empty, so the receiving route is implemented by inserting a SWAP gate between Q0 and Q1 of QPU2, so that the communication qubit Q0 of QPU2 is empty, which is convenient for the subsequent reception of the quantum state transmitted after the ST operation. The logical circuit operation corresponding to this receiving route is as follows: Fig.13 The third SWAP gate in (e).
[0147] Step 6: Execute the ST operation to transfer the state of Q2 of QPU1 to the qubit Q0 of QPU2. At this time, the quantum states required by the three gates are all located in QPU2. Only a SWAP gate is needed to insert Q0 and Q1 of QPU2 to satisfy the neighbors of the three gates.
[0148] Since the sending and receiving routes of the global gates G2 to G4 are located in two different QPUs and can be processed simultaneously, Step5 and Step6 support parallel processing, further shortening the execution time of the routes. After executing Step5 and Step6, the ST operation needs to be performed to transfer the state of Q2 of QPU1 to the qubit Q0 of QPU2. The logic line operation corresponding to this ST operation is shown in Fig.13(e) The third ST. After the ST operation, the quantum states required to execute global gates G2 to G4 all exist in QPU2, so execution routing is applied to global gates G2 to G4 in QPU2. The best execution routing method selected after Monte Carlo tree search is to insert a SWAP gate in Q0 and Q1 of QPU2, so that global gates G2 to G4 all meet the neighbor condition and can be directly executed. The logic circuit operation corresponding to this execution routing process is as follows Fig.13 The sixth SWAP gate in (e).
[0149] So far, Fig.12 The distributed circuit shown in (a) completes the routing and execution. Finally, each qubit is measured and the result of the initial circuit is restored. The final complete mapping and routing circuit is shown in Fig.13 (e) as shown.
[0150] 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 distributed quantum circuit mapping method based on Monte Carlo tree, characterized in that: The following steps are involved: S1: Establish a distributed superconducting quantum computing architecture model, specifically including: S11: Distributed architecture model construction and S12: Distributed quantum network topology map construction; S2: Distributed quantum circuit routing mode; specifically includes S21: Quantum chip: routing mode between QPUs, S22: routing mode within QPUs; S3: Distributed quantum circuit routing optimization strategy; specifically including S31: determining optimization indicators, S32: constructing a three-layer search tree model for distributed quantum circuit routing, and S33: using Monte Carlo tree to search for the path with the lowest routing cost; Step S31 is specifically as follows: Additional SWAP gates need to be inserted in the distributed quantum circuit routing process; the number of SWAP gates inserted in the distributed quantum circuit mapping is determined by the three routing modes: receiving routing, execution routing, and sending routing. The number of SWAP gates required for routing within the circuit QPU is C SWAP Expressed in formula (2), and considering the routing cost C between QPUs route It is expressed by formula (3): C SWAP =C receive +C execute +C send (2) Where ω1 and ω2 represent the weights of inter-QPU routing and intra-QPU routing, n represents the number of blocks of the distributed line; C receive represents the SWAP gate cost of the receiving route, C execute represents the SWAP gate cost of executing routing, C send represents the SWAP gate cost of the sending route, ST is the number of ST operations, that is, the number of ST gates; Step S32 is specifically as follows: Since the three routing modes in QPU are in a progressive relationship, the routing result of the previous layer directly affects the routing result of the next layer. Therefore, using a greedy strategy in each layer to obtain the lowest cost of each layer of routing cannot ensure the lowest overall cost in formula (2). Based on the progressive relationship of the three routing modes in QPU, a search tree model of three routing models is constructed; in this search tree model, the first layer is the receiving route R; the second layer is the executing route E; the third layer is the sending route S corresponding to each executing route; Step S33 is specifically as follows: There must be a path in this search tree that minimizes the routing cost within the QPU. A distributed quantum circuit routing optimization strategy based on Monte Carlo tree search is used. The algorithm flow of this strategy is as follows: Step 1: Initialize a root node to represent the current state; Step 2: For the current node, use heuristic search to select an unexpanded child node and add it to the tree; Step 3: Use random simulation to evaluate the routing cost of the child node and obtain the weight of the child node; Step 4: Update the status of all nodes in the tree and the corresponding routing costs to avoid repeated searches; Step 5: Repeat steps 2-4 until the path with the lowest weight is found, that is, the three grandparent and grandchild nodes with the lowest routing cost.
2. A distributed quantum circuit mapping method based on Monte Carlo tree according to claim 1, characterized in that: When the circuit cannot be executed on a single QPU, the circuit needs to be distributed to X QPUs for execution. To this end, a distributed quantum computing underlying architecture model suitable for this circuit needs to be constructed, using step S11, which specifically includes: S111: Using quantum bit interconnection technology, a short-range communication channel is established between two QPUs to achieve quantum state transmission; S112: Based on the quantum state transmission model, a communication link is established between X QPUs, which constitute a distributed quantum architecture; Where X is greater than or equal to 2; S113: In the process of distributed quantum architecture, a quantum communication channel will only act on two qubits, and the qubits acted on are called communication qubits; S114: Quantum communication only occurs between communicating qubits, so it is called communication-restricted; S115: Communication qubits are used to send and receive quantum states and support quantum state operations, i.e., executing quantum gates; S116: Other qubits on the QPU that do not support quantum communication are called data qubits and are used to perform conventional quantum state operations; S117: A distributed quantum architecture was constructed. The constraints of the established distributed architecture model are as follows: In the formula, k is the number of partitions, a i is the number of qubits on partition i, n is the total number of qubits in the initial circuit, t i is the number of communication qubits in partition i, where 1≤t i ≤a i -1; When X QPUs are connected to form a topological structure through quantum channels, step S12 is used, which specifically includes: The distributed model of X QPUs is described as a distributed quantum network topology graph, which regards each QPU as a node in the network and defines the connection between them, so that distributed quantum computing no longer focuses on the specific qubits established by the communication link, but only focuses on the connection relationship between the nodes; Wherein, X is greater than or equal to 2.
3. A distributed quantum circuit mapping method based on Monte Carlo tree according to claim 1, characterized in that: After matching the appropriate distributed architecture and topology, the distributed lines need to be mapped to X QPUs for execution, using step S21, which specifically includes: S211: According to the distributed quantum network topology diagram and the distributed architecture model, a mapping relationship between distributed quantum circuits and distributed architectures is established, that is, the logical qubits of the distributed circuits are allocated to the physical qubits of the distributed architecture; S212: After mapping, not all quantum gates satisfy the neighbor constraint of the topological architecture, and it is necessary to route the two quantum bits of the quantum gate that do not satisfy the neighbor constraint to the neighbor position through quantum bit routing; Routing between QPUs is based on quantum communication of qubit interconnection, and a quantum state transfer operation is defined as an ST operation; S213: Under communication constraints, the ST operation can only act on two qubits connected by the communication link, the communication qubit, to achieve the transmission of quantum states; Where X is greater than or equal to 2; After step S21 is executed, there are still global quantum gates that cannot be directly executed, and step S22 is used, which specifically includes: S221 receiving routing: used to empty the communication qubit at the receiving end so that the communication qubit at the sending end can transmit the quantum state to the receiving end; the receiving routing needs to find the idle qubit closest to the communication qubit, and route the quantum state on the communication qubit to this idle qubit by inserting a SWAP gate; S222 execution routing: The same as the routing method in centralized quantum circuit mapping, only the nearest neighbors of quantum gates need to be realized; the execution routing method is the same as the traditional centralized quantum circuit routing method, only the nearest neighbor constraints of the executable quantum gates after receiving the quantum state need to be paid attention to, and the nearest neighbors of these quantum gates are completed by inserting SWAP gates; S223 Send routing: used to route the qubits that need to be transmitted to the communication qubits in order to perform the ST operation; after the execution of the routing is completed, the sending routing needs to be performed to route the quantum state that needs to be transmitted from the data qubit to the transmission quantum state.
