Efficient compiling method of multi-core quantum computer

By dividing the quantum program code into segments and mapping it to physical cores using a graph structure solver program, the performance optimization problem of multi-core quantum computers in the existing technology is solved, and efficient quantum program execution and reliability improvement on multi-core systems are achieved.

CN118742907APending Publication Date: 2024-10-01IONIC QUANTUM CANADA INC
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202380023291.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-02-22
Filing Date
2023-02-21
Publication Date
2024-10-01

Smart Images

  • Figure CN118742907A_ABST
    Figure CN118742907A_ABST
Patent Text Reader

Abstract

A computationally economical compilation method is disclosed for improving quantum code execution on a multi-core quantum computing system by minimizing the amount of inter-core quantum operations required for execution. The method comprises the following steps: dividing a complete program code into segments; identifying a non-overlapping combination of a set of contiguous segment sequences represented as Gc and a set of Gc members represented as Gnc; converting the Gc members into corresponding graph groups; using a graph solver program to map the quantum bits to the cores so as to obtain a corresponding group of inter-core quantum operands; calculating an operation amount associated with the Gnc member accordingly; and selecting a Gc member of the mapping, i.e., a contiguous code portion of the mapping, which will result in a minimum total inter-kernel operation amount.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates generally to quantum computer programming, and more particularly to methods and systems that provide optimized techniques for mapping quantum program code to multi-core quantum computing systems. Background Art

[0002] A modular quantum computing architecture consisting of multiple quantum cores has been proposed in academic and patent literature as a method for scaling quantum computers, see, for example, U.S. Patent No. 9,858,531B. In this architecture, each core contains a limited number of qubits. Qubits on different cores can interact through various inter-core communication solutions, such as by using entanglement generated by optical interconnects, see, for example, PRX Quantum 2, 017002 by David Awschalom et al. Another solution might be to shuttle qubits between cores, see, for example, Kielpinski, D., Monroe, C. and Wineland, D. Nature 417, 709-711 (2002). Inter-core communication can be used to move information in one of two ways: (a) inter-core operations: where two qubits on different cores interact indirectly, for example, by using a remote gate; (b) information exchange operations, where the information encoded in the qubit is moved to another qubit on a different core, for example, using teleportation.

[0003] Quantum compilers are used to take quantum code and modify it to improve execution on certain target architectures. In many cases, compilers include subroutines for optimally mapping logical qubits to physical qubits. Generally speaking, the output of the compiler is a modified code that can be used as input to another process of the same or a different compiler. Once all compiler processes are completed, the generated code is run on a quantum computer. Different compilers for multi-core architectures are designed to improve performance by minimizing the number of inter-core operations or minimizing the number of information exchange operations. What is lacking in the prior art is a compilation method that can optimize performance while taking both of the above approaches into account. Summary of the invention

[0004] According to an embodiment of the present invention, a processor-implemented method is disclosed for compiling quantum program code (hereinafter referred to as "code") to improve its execution performance on a multi-core quantum computing system (hereinafter referred to as "system"). In a typical embodiment, the cores are linked by entanglement-based one-time links, and the generation duration of the links varies randomly. The code includes core-local instructions and instructions involving multiple cores, so these entanglement-based inter-core links are required. The disclosed method includes the following compilation steps:

[0005] Step (a) includes dividing the code into two or more consecutive segments based on some predetermined rules. An example of division can be, from the perspective of inter-qubit logical operations, evenly divided into two or more segments. In some embodiments, the segmentation is determined based on identifying differences in code characteristics between adjacent segments.

[0006] Step (b) includes identifying a group, denoted "Gc", that includes at least a portion of all possible contiguous sequences of one or more code segments. In some embodiments, the criterion for not including all contiguous sequences may be to ensure a minimum length difference between them from the perspective of inter-qubit logical operations. Segments that include the complete code are typically included in Gc.

[0007] The following step (c) comprises identifying a group, denoted "Gnc", which includes at least a portion of all possible non-overlapping combinations of Gc members. If the Gc magnitude is high, the number of generated Gnc members may require overly complex calculations in the following steps. Therefore, in some embodiments, only a portion of them is considered. An exemplary criterion may be a certain minimum length difference between the selected combinations.

[0008] Step (d) is also directly based on step (b), and comprises converting each Gc member into a corresponding graph, thereby creating a graph group denoted as "Ggc", the conversion being performed by associating each logical qubit contained in the continuous code portion constituting the converted Gc member with a different vertex in the graph, and then associating each inter-qubit operation in the converted Gc member with a different edge between the vertex pair corresponding to the operation.

[0009] Next, in step (e), a graph solver program, denoted "Solver", is provided. Such a program may be implemented over the Internet, possibly under an open source license. The purpose of employing the Solver is to map the logical qubits contained in each Gc member to different physical cores. The Solver performs this mapping by processing the graph corresponding to each Gc member in the following manner: partitioning the graph vertices into exclusive groups representing the system cores, such that the number and magnitude of the groups are limited by the number of system cores and the number of physical qubits within each core, respectively, while attempting to minimize the total amount of inter-group edges generated, which corresponds to the amount of operations between different cores, denoted "inter-core operations".

[0010] The next step (f) comprises applying the solver to all Ggc graphs, thereby creating a corresponding set of solver results, denoted "Gsc", wherein each Gsc member now corresponds to a corresponding Gc member and its corresponding contiguous code portion which now contains physical qubits. The application of the solver to any Gsc member graph also comprises providing the amount of inter-core operations now associated with the contiguous program portion corresponding to that Gsc member, denoted "Asc".

[0011] The next step (g) includes calculating a set of inter-core operation quantities, denoted as "Gamnt", that correspond one-to-one to Gnc in the following manner:

[0012] I. For a Gnc member that is a complete code segment, its corresponding Gamnt member is determined as Asc associated with the Gsc member corresponding to the complete code segment, denoted as Cse.

[0013] II. For any Gnc member that is not a complete code segment, its associated Gamnt member is calculated by adding the Asc amounts associated with all Gsc members corresponding to said any Gnc member, and for all code portions outside said all Gsc members, if such code portions exist, the amounts of all Cse inter-core operations belonging to said code portions outside said Gsc members are also included in the calculated Gamnt.

[0014] III. For any Gnc member that is not a complete code segment, the Gamnt member calculated in II above also includes penalties that may be associated with code transitions between adjacent Gsc members and / or between Cse code portions other than them, where the penalty associated with each such transition is calculated as the amount of inter-core operations required to transfer qubits between cores due to each such transition. In some embodiments, these operations include qubit teleportation in typical embodiments.

[0015] Step (h) includes determining the best compiled code structure from the perspective of having the minimum amount of inter-core operations in the following manner:

[0016] I. Select the Gnc member that achieves the minimum Gamnt member in step (g) above.

[0017] II. Representing the code in the form of physical qubits based on the Gsc member corresponding to the selected Gnc member and the Cse code portion outside of it, and

[0018] III. If necessary, based on step (g) iii above, add inter-core operations in the code for transferring qubits between cores.

[0019] In some embodiments, the calculation of the Asc quantity takes into account weights associated with the edges of the graph processed by the solver, i.e., weights associated with the logic operations of the code. In these and other embodiments, calculating the Gamnt member includes using a weighted sum of the inter-core operations involved, including inter-core operations associated with qubit transfer operations.

[0020] In some embodiments, when the system is constructed so that some cores are connected to other cores through physical connections that have much higher latency than the physical connections interconnecting other cores, an optional step may be applied. This step includes remapping logical qubits to physical qubits so that those cores with high latency physical connections have fewer inter-core operations per core than the other cores.

[0021] In some embodiments, at least a portion of the code segment is predetermined based on the following criterion of the distribution of finite qubits in the segment: the ratio of the number of different qubits in the segment to the total number of inter-qubit operations therein is not greater than a predetermined maximum threshold. In one embodiment, for at least a portion of the Gc members that do not meet the above criterion, the system is computationally reduced by calculating the above ratio for such Gc members; and if the calculated ratio is not lower than a predetermined minimum threshold higher than the above maximum threshold, the system is computationally reduced for the at least a portion of the Gc members according to the calculated ratio.

[0022] Embodiments of the present invention also include various processing devices for executing the above method steps. Such processing devices may be, but are not limited to, desktop or mobile traditional computers or servers, distributed computerized systems, quantum computers, and any suitable combination thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The present invention will be more fully understood through the following detailed description of the embodiments of the present invention in conjunction with the accompanying drawings, in which:

[0024] Figure 1 A flow chart is shown, which schematically illustrates a method for compiling a quantum program code into a multi-core quantum computing system according to an embodiment of the present invention.

[0025] Figures 2a to 2j Compilation of an exemplary quantum program code for a physical multi-core quantum computing system according to one embodiment of the present invention is shown. DETAILED DESCRIPTION

[0026] Embodiments of the present invention provide methods for optimizing processor implementation of quantum program code including logical qubits. In these embodiments, the code should be executed on a multi-core quantum computing system having a known number of cores and a known number of physical qubits in each core. The optimization is achieved by mapping logical code qubits to physical qubits in the system core while trying to minimize the total inter-core operations (referred to as "inter-core operations"). The basic principle of this optimization strategy is that such inter-core operations are usually performed through a high-latency interconnect system. Such a system can adopt a one-time Einstein-Podolsky-Rosen (EPR) link based on entanglement, whose generation duration varies randomly, usually much longer than the inter-qubit operation time in each core. Minimizing the number of such links also helps to improve code execution reliability. Another advantage provided by the disclosed technology is that the above optimization is achieved with a reasonable computational burden.

[0027] Reference now Figure 1 , a flow chart 100 is shown schematically illustrating a method for mapping quantum program code to a multi-core quantum computing system according to one embodiment of the present invention. The flow chart starts with method step 100p, in which a code for mapping to a given system as described above is provided. Step 100a includes dividing the code into two or more consecutive segments based on some predetermined rules. An example of division can be a uniform division into two or more segments from the perspective of inter-qubit logical operations. In some embodiments, segmentation is determined based on identifying differences in code features between adjacent segments.

[0028] Step 100b includes identifying a group, denoted "Gc", that includes at least a portion of all possible contiguous sequences of one or more code segments. In some embodiments, the criterion for not including all contiguous sequences may be to ensure a minimum length difference between them from the perspective of inter-qubit operations. Segments that include complete code are typically included in Gc. In some embodiments, at least a portion of the code segments are predetermined based on the following criterion of the distribution of finite qubits in the segment: the ratio of the number of different qubits in the segment to the total number of inter-qubit operations therein is not greater than a predetermined maximum threshold. In one of the embodiments, for at least a portion of the Gc members that do not meet the above criterion, the system is computationally reduced by calculating the above ratio for such Gc members, and if the calculated ratio is not lower than a predetermined minimum threshold that is higher than the above maximum threshold, the system is computationally reduced for the at least a portion of the Gc members according to the calculated ratio.

[0029] The following step 100c includes identifying a group, denoted "Gnc", which includes at least a portion of all possible non-overlapping combinations of Gc members. If the Gc magnitude is high, the number of generated Gnc members may require overly complex calculations in the following steps. Therefore, in some embodiments, only a portion of them is considered. An exemplary criterion may be a certain minimum length difference between the selected combinations.

[0030] Step 100d is also directly based on step 100b, and includes converting each Gc member into a corresponding graph, thereby creating a corresponding group of graphs denoted “Ggc.” The conversion is performed by associating each logical qubit contained in the contiguous code portions that make up the converted Gc member with a different vertex in the graph, and then associating each inter-qubit operation in the converted Gc member with a different edge between the pair of vertices corresponding to the operation.

[0031] Next, in step 100e, a graph solver program, denoted "Solver," is provided. Such a program may be implemented over the Internet, possibly under an open source license. The purpose of employing the Solver is to map the logical qubits contained in each Gc member to different physical cores. The Solver performs this mapping by processing the graph corresponding to each Gc member in the following manner: partitioning the graph vertices into exclusive groups representing the system cores, such that the number and magnitude of the groups are limited by the number of system cores and the number of physical qubits within each core, respectively, while attempting to minimize the total amount of inter-group edges generated, which corresponds to the amount of operations between different cores, denoted "inter-core operations."

[0032] The next step 100f comprises applying the solver to all Ggc graphs, thereby creating a corresponding set of solver results, denoted "Gsc", where each Gsc member now corresponds to a corresponding Gc member and its corresponding contiguous code portion that now contains physical qubits. The application of the solver to any Gsc member graph also provides the amount of inter-core operations now associated with the contiguous program portion corresponding to that Gsc member, denoted "Asc". In some embodiments, the calculation of the Asc amount takes into account the weights associated with the edges of the graph processed by the solver, i.e., the weights associated with the code logic operations.

[0033] Flowchart 100 proceeds to step 100g, which includes calculating a set of inter-core operation quantities corresponding to Gnc in a one-to-one manner, denoted as “Gamnt”:

[0034] I. For a Gnc member that is a complete code segment, its corresponding Gamnt member is determined as Asc associated with the Gsc member corresponding to the complete code segment, denoted as Cse.

[0035] II. For any Gnc member that is not a complete code segment, its associated Gamnt member is calculated by adding the Asc amounts associated with all Gsc members corresponding to said any Gnc member, and for all code portions outside said all Gsc members, if such code portions exist, the amounts of all Cse inter-core operations belonging to said code portions outside said Gsc members are also included in the calculated Gamnt.

[0036] III. For any Gnc member that is not a complete code segment, also included in the Gamnt member calculated in II above are penalties that may be associated with code transitions between adjacent Gsc members and / or between Cse code portions outside of them, where the penalty associated with each such transition is calculated as the amount of inter-core operations required to transfer qubits between cores due to each such transition. In some embodiments, these operations include qubit teleportation, represented as remote:TP in the example shown in FIG.

[0037] In some embodiments, computing the Gamnt member includes using a weighted sum of the involved inter-core operations, including inter-core operations associated with qubit transfer operations.

[0038] Step 100h includes determining the best compiled code structure from the perspective of having the least amount of inter-core operations (i.e., having the least Gamnt members) in the following manner:

[0039] I. Select the Gnc member that achieves the minimum Gamnt member in step 100g above.

[0040] II. Representing the code in the form of physical qubits based on the Gsc member corresponding to the selected Gnc member and the Cse code portion outside of it, and

[0041] III. If necessary, based on step 100g.III above, add inter-core operations in the code for transferring qubits between cores.

[0042] Flowchart 100 ends with optional step 100i, which may be applied when the system is configured so that some cores are connected to other cores by physical connections that have a much higher latency than the physical connections interconnecting the other cores. This step includes remapping logical qubits to physical qubits so that those cores with high latency physical connections have fewer inter-core operations per core than the other cores.

[0043] Flowchart 100 is an exemplary flow chart, which is selected purely for conceptual clarity. In alternative embodiments, any other suitable flow chart may also be used to illustrate the disclosed method. For simplicity, Figure 1Method steps that are not mandatory for understanding the disclosed technology have been omitted.

[0044] Figures 2a to 2j (For the sake of brevity, it is now described and indicated as "FIG. 2") Figure 1 The method steps described in this embodiment are as follows: Figure 2a An example of mapping a quantum code 202 depicted in FIG. 2 to a physical multi-core system. Since mapping an actual code in real life would require a very complex description, a particularly simple code was chosen. Code 202 comprises 4 logical qubits q0 to q3 and it must be compiled for a dual-core physical system, with each core having 3 physical qubits. For simplicity, all logical operations as well as physical inter-core operations are given equal weight. For simplicity, reference Figure 1 Some groups described that have many members are also shown only partially.

[0045] Figure 2b Corresponding to method step 100a, the division of the code 202 into five segments S1 to S5 is shown, which are denoted by reference numerals 204, 206, ... 212, respectively.

[0046] Based on step 100b, Figure 2 shows a group Gc of continuous code parts that can be formed based on the above division: Gc0 = [s1|s2|s3|s4|s5] = complete code 202, Gcl = [sl], Gc2 = [s2], Gc3 = [s3], Gc4 = [s4], Gc5 = [s5], Gc6 = [sl|s2|s3], Gc7 = [sl|s2], Gc8 = [s3|s4|s5]…, where | indicates that the segments are connected to form a continuous code.

[0047] Based on step 100c, FIG2 also shows a group Gnc, each member of which is a non-overlapping combination of Gc members: Gnccl = {Gc0}, Gnc2 = {Gcl, Gc2, Gc3, Gc4, Gc5}, Gnc3 = {Gc6, Gc4, Gc5}, Gnc4 = {Gc7, Gc8}, Gnc5 = {Gc1, Gc2, Gc8} ...

[0048] Based on steps 100d and 100f, FIG. 2 also shows a group Ggc and its corresponding group Gsc, respectively. Ggc includes graphs converted from its corresponding Gc members. Gsc includes these Ggc graphs mapped to the above-mentioned physical system by the solver provided in step 100e. The graphs shown are:<Ggc0,Gsc0> ,<Ggcl,Gscl> ,<Ggc2,Gsc2> ,<Ggc3,Gsc3> ,<Ggc4,Gsc4> ,<Ggc5,Gsc5> ,<Ggc6,Gsc6> .

[0049] Based on step 100f, FIG. 2 also shows the corresponding Asc members associated with each Gsc member, namely Asc0 to Asc6, representing the corresponding number of inter-core operations between core 0 and core 1.

[0050] Reference now Figure 2c , where Gc0 is shown, which is equal to Gnc1 and the complete code 202. Also shown are their corresponding graphs Ggc0 and their mapped versions Gsc0, which are together depicted as block 214. Block 214 includes cores 216 and 218 associated with 4 inter-core operations. Therefore, the quantity Asc0 is equal to 4. Figure 2d The final compiled code 220 associated with Gnc1 is shown, including mappings to cores 216 and 218 . Figure 2c The 4 inter-core operations in are represented as “remote:cx”. Since there is no penalty due to code conversion, Gamnt1=Asc0=4.

[0051] Next Figure 2e The Gnc2 code structure 222 as described above is shown. Figure 2f Ggc and Gsc members 224, 226 ... 232 corresponding to the Gnc2 code portion are shown. From the Gsc diagram, it can be seen that their respective inter-core operations Asc1 = Asc2 = Asc3 = Asc4 = Asc5 = 0. Figure 2g The compiled code 234 associated with Gnc2 is shown. There are 0 inter-core operations (remote:cx) because all associated Asc members are equal to 0. However, the 4 conversions between the mapping code sections result in a corresponding 4 qubit transfers, denoted as "remote:tp", which results in a transfer penalty of 4 teleportations. Adding the Asc members and the penalties gives Gamnt2=4.

[0052] Figure 2h The Gnc3 code structure 236 as described above is shown. Figure 2i Ggc and Gsc members 240, 230 and 232 corresponding to the Gnc3 code portion are shown. From the Gsc diagram, it can be seen that their respective inter-core operations are Asc6=1 and Asc4=Asc5=0. Figure 2j The compiled code 242 associated with Gnc3 is shown. There is one inter-core operation (remote:cx) contributed by Asc6. However, the 2 conversions between the mapped code parts result in a corresponding 2 qubit transfers (remote:tp), which results in a transmission penalty of 2 teleportations. Adding the Asc and penalty components, we get Gamnt3=3. Considering the above results, as well as the results obtained for the other Gnc members (not shown in Figure 2 for simplicity), this becomes the best compilation.

[0053] Therefore, it should be understood that the above embodiments are cited only as examples, and the present invention is not limited to the contents specifically shown and described above. On the contrary, the scope of the present invention includes the combination and sub-combination of the above various features, as well as changes and modifications that those skilled in the art will think of after reading the above description and are not disclosed in the prior art.

Claims

1. A processor-implemented compilation method for efficiently mapping quantum logic qubits in a program code to a multi-core quantum computing physical system, hereinafter referred to as "program code" as "code", and "multi-core quantum computing physical system" as "system", wherein the system has a known number of cores and a known number of physical qubits in each core, the method comprising the following steps: a. dividing the code into two or more predetermined consecutive segments; b. Identify a group denoted as "Gc" that includes at least a portion of all possible contiguous sequences of one or more code segments; c. Identify a group denoted as "Gnc" that includes at least a portion of all possible non-overlapping combinations of Gc members; d. converting each Gc member to a corresponding graph, thereby creating a graph group denoted as "Ggc", the conversion being performed by associating each logical qubit in said each Gc member with a different vertex in the graph, and associating each inter-qubit operation in said each Gc member with a different edge between a pair of vertices involved in said each inter-qubit operation; e. providing a graph solver program, hereinafter also referred to as a "solver", which is suitable for mapping logical qubits in a given Gc member to corresponding physical qubits in a system core, the mapping being performed by processing a graph corresponding to the given Gc member in the following manner: partitioning the graph vertices into exclusive groups representing system cores, such that the number and magnitude of the groups are limited by the number of system cores and the number of physical qubits in each core, respectively, while trying to minimize the total amount of inter-group edges generated, i.e., the amount of operations between different cores, hereinafter referred to as "inter-core operations"; f. applying the solver to all Ggc members, thereby creating a corresponding set of solver results, denoted “Gsc”, where each member comprises the contiguous code portion of its corresponding Gc member, now containing physical qubits, and is associated with the amount of inter-core operations included in the contiguous code portion, denoted “Asc”; g. Calculate a set of inter-core operation quantities corresponding to Gnc in the following way, denoted as "Gamnt": i. For a Gnc member that is a complete code segment, its corresponding Gamnt member is determined as Asc associated with the Gsc member corresponding to the complete code segment, denoted as Cse; ii. For any Gnc member that is not a complete code segment, its associated Gamnt member is calculated by adding the Asc amounts associated with all Gsc members corresponding to the any Gnc member, and for all code portions outside the all Gsc members, if such code portions exist, the amounts of all Cse inter-core operations belonging to the code portions outside the associated Gamnt are also included; and iii. for any Gnc member that is not a complete code segment, also included in the Gamnt member calculated in II above are penalties that may be associated with code transitions between adjacent Gsc members and / or between Cse code portions other than them, wherein the penalty associated with each such transition is calculated as the amount of inter-core operations required to transfer qubits between cores as a result of said each such transition; and h. Determine the compiled code structure from the perspective of having the fewest Gamnt members as follows: i. Select the Gnc member that achieves the minimum Gamnt member in step g above; ii. Representing the code in the form of physical qubits according to the Gsc member corresponding to the selected Gnc member and the Cse code portion outside of it; as well as iii. If necessary, based on step g.iii above, add inter-core operations in the code for transferring qubits between cores.

2. The method of claim 1, comprising optionally weighting the edges of the graph processed by the solver and affecting the Asc amount obtained in step f accordingly.

3. The method of claim 1 , comprising computing the Gamnt member in step g optionally using a weighted sum of the involved inter-core operations and qubit transfer operations.

4. The method of claim 1 , wherein the inter-core operations required to transfer qubits between cores comprise qubit teleportation.

5. The method of claim 1 , comprising predetermining at least a portion of the code segment based on the following criterion for maximum qubit distribution in a segment: a ratio of the number of different qubits involved in a segment to the total number of inter-qubit operations therein is no greater than a predetermined maximum threshold.

6. The method according to claim 5, comprising: For at least a portion of the Gc members that do not meet the above criteria, computationally reducing the system by calculating the above ratio for such Gc members; and computationally downscaling the system according to the calculated ratio for said at least a portion of said Gc members if the calculated ratio is not below a predetermined minimum threshold that is higher than said maximum threshold.

7. The method of claim 1 , comprising a further step, provided that the system is configured such that a relatively small set of cores are connected to other cores via physical connections having a much higher latency than the physical connections interconnecting the other cores, the further step comprising remapping logical qubits to physical qubits such that the cores having the high latency physical connections have fewer inter-core operations per core than the other cores.

8. A processing device for executing the method of claim 1.

Citation Information

Patent Citations

  • Fault tolerant scalable modular quantum computer architecture with an enhanced control of multi-mode couplings between trapped ion qubits

    US9858531B1

  • Single-amplitude quantum calculation simulation method

    CN111931939A

  • Incremental generation of quantum circuits

    CN113383348A

  • Modular Control in a Quantum Computing System

    US20180260730A1

  • System and method of optimizing instructions for quantum computers

    US20210334081A1