Quantum circuit transformation method for surface code error correction
By performing initial mapping and timing position optimization on quantum circuits and chips, surface code-encoded quantum circuits based on boundaries or defects are generated, solving the problem of high error rate in quantum computer operations and achieving more efficient execution of quantum circuits.
Patent Information
- Application Number
- CN202410744128.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2026-12-04
- Estimated Expiration
- 2044-06-11
AI Technical Summary
The high error rate of existing quantum computers leads to long execution times for quantum circuits, affecting the fidelity of the execution results.
By acquiring the initial quantum circuit and the chip to be processed, initial mapping processing is performed based on the chip parameters and surface code type to optimize the timing position and path of the quantum circuit, adjust the allocation of computing and communication resources, and generate surface code-encoded quantum circuits based on boundaries or defects.
It significantly reduces the execution time of quantum circuits and improves the fidelity of the execution results of quantum circuits.
Smart Images

Figure CN118569397B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of quantum chip technology, and more specifically to a quantum circuit conversion method for surface code error correction. Background Technology
[0002] In recent years, quantum algorithms have flourished, with various quantum algorithms theoretically demonstrating speedups far exceeding those of classical algorithms. However, due to the error-prone nature of qubits, the current error rate of quantum computers is around 1%, which is insufficient for the practical applications of quantum algorithms. To improve the accuracy of quantum circuit execution, the quantum circuit needs to be executed under the protection of quantum error-correcting codes. This requires a circuit converter to map the circuit into a quantum circuit that satisfies the execution conditions of the error-correcting code encoding operation and the quantum chip structure.
[0003] In realizing the concept disclosed herein, it was discovered that the chips in the related technologies require a long execution time when executing quantum circuits, resulting in low fidelity of the circuit execution results. Summary of the Invention
[0004] In view of the above problems, this disclosure provides a quantum circuit conversion method for surface code error correction, including:
[0005] Acquire the initial quantum circuitry and the chip to be processed;
[0006] Based on the chip parameters and surface code type of the chip to be processed, the initial quantum circuit and the chip to be processed are subjected to initial mapping processing to obtain target mapping data.
[0007] In the case where the surface code type is a boundary-based surface code, based on the circuit parameters of the initial quantum circuit and / or the chip parameters, the timing position path optimization processing is performed on multiple gate operations in the target mapping data to obtain a boundary-based surface code encoded quantum circuit.
[0008] According to embodiments of this disclosure, based on the circuit parameters of the initial quantum circuit and / or the chip parameters described above, timing position path optimization processing is performed on multiple gate operations in the target mapping data to obtain a boundary-based surface code encoded quantum circuit, including:
[0009] In the case where the initial quantum circuit includes multiple Pauli gate operations, the multiple Pauli gate operations are subjected to logical optimization processing in terms of timing position based on the equivalence relation between the basic operations of the initial quantum circuit to obtain the quantum circuit based on the boundary surface code encoding. The Pauli gate operations include X gate operations, Y gate operations or Z gate operations, and the equivalence relation between the basic operations includes commutation relations.
[0010] According to embodiments of this disclosure, based on the circuit parameters of the initial quantum circuit and / or the chip parameters described above, timing position path optimization processing is performed on multiple gate operations in the target mapping data to obtain a boundary-based surface code encoded quantum circuit, further comprising:
[0011] Based on the data dependencies of the initial quantum circuit, multiple CNOT gate operations and multiple H gate operations without a preceding operation are determined from the multiple gate operations in the initial quantum circuit.
[0012] Based on the operation parameters of each of the above CNOT gate operations and multiple H gate operations, the above CNOT gate operations and multiple H gate operations are sorted to obtain the above boundary-based surface code encoded quantum circuit, wherein the above boundary-based surface code encoded quantum circuit includes the sorted multiple CNOT gate operations and multiple H gate operations.
[0013] Specifically, based on the operation parameters of each of the aforementioned CNOT gate operations and multiple H gate operations, the multiple CNOT gate operations and multiple H gate operations are sorted to obtain the aforementioned boundary-based surface code encoded quantum circuit, including:
[0014] For each of the above CNOT gate operations and H gate operations, calculate the subsequent execution depth of the above gate operation;
[0015] When multiple subsequent execution depths of the above gate operations are different, the priority of each of the above gate operations is determined according to the multiple subsequent execution depths;
[0016] In the case where there are multiple intermediate gate operations with the same execution depth among the above gate operations, for each of the above intermediate gate operations, the priority of the above intermediate gate operation is determined according to the number of subsequent operations of the above intermediate gate operation, wherein the above operation parameters include the above execution depth and the above number of subsequent operations.
[0017] Based on the above priorities, and according to the above gate operations and / or intermediate gate operations, the above boundary-based surface code encoded quantum circuits are generated.
[0018] According to embodiments of this disclosure, the quantum circuit switching method further includes:
[0019] In the case where there is an executable H-gate operation among the multiple gate operations described above, the matrix occupied by the H-gate operation in the chip to be processed is determined, wherein the chip parameters characterize the occupied matrix.
[0020] The weights of the above matrix are adjusted to obtain the adjusted chip to be processed;
[0021] Based on the adjusted chip to be processed and the initial quantum circuit described above, the boundary-based surface code encoded quantum circuit is generated.
[0022] According to embodiments of this disclosure, the quantum circuit switching method further includes:
[0023] In the case that the above initial quantum circuit includes executable T-gate operations, the initial connection information is obtained by connecting all the current wonder state factories that have generated wonder states and the current T-gate array to be executed using virtual wonder state factories and virtual T-gate arrays.
[0024] The initial connection information is processed using the maximum flow algorithm to obtain the quantum circuit based on the boundary surface code encoding.
[0025] According to embodiments of this disclosure, the initial quantum circuit described above includes a plurality of logical bits, each logical bit including a bit matrix composed of a plurality of physical bits;
[0026] Specifically, based on the chip parameters and surface code type of the chip to be processed, an initial mapping process is performed on the initial quantum circuit and the chip to be processed to obtain target mapping data, including:
[0027] Based on the number of initial quantum circuits, the target array queue of the initial quantum circuits is determined based on the perimeter of the initial array queue. The initial array queue is a queue formed by an initial array that satisfies the number of logical bits. The chip parameters include the initial array queue.
[0028] Based on the METIS graph partitioning method, each of the above logical bits is mapped onto multiple target matrices in the above target matrix queue, resulting in multiple mapping matrices. The mapping matrix with the lowest cost is selected through a cost function.
[0029] Based on the execution frequency of the target gate operation in the initial quantum circuit, the channel bandwidth of the chip to be processed containing the above mapping matrix is adjusted to obtain the target bandwidth.
[0030] In the case where the surface code type is a boundary-based surface code, the target mapping data is generated based on the mapping matrix and the target bandwidth.
[0031] According to embodiments of this disclosure, the quantum circuit switching method further includes:
[0032] When the surface code type mentioned above is a defect-based surface code, a defect type is selected for each of the above initial matrices using the bipartite graph method to obtain defect allocation information.
[0033] Based on the above mapping matrix, the above target bandwidth, and the above defect allocation information, the above target mapping data is generated.
[0034] According to embodiments of this disclosure, the quantum circuit switching method further includes:
[0035] In the case where the surface code type is a defect-based surface code, based on a preset optimization rule, the timing position path optimization processing is performed on multiple gate operations in the target mapping data to obtain a quantum circuit encoded by the defect-based surface code.
[0036] According to embodiments of this disclosure, based on preset optimization rules, multiple gate operations in the aforementioned target mapping data undergo temporal position path optimization processing to obtain a quantum circuit based on defect-based surface code encoding, including:
[0037] Calculate the modification cost for each of the above logical bits when the defect types of the two logical bits in the initial quantum circuit are the same.
[0038] If both of the above modification costs are less than the preset value, the defect type of the logical bit corresponding to the minimum of the above modification costs will be modified to obtain the modified target mapping data.
[0039] Based on the aforementioned preset optimization rules, the timing position path optimization processing is performed on multiple gate operations in the modified target mapping data to obtain the aforementioned quantum circuit based on defect-based surface code encoding.
[0040] According to embodiments of this disclosure, the quantum circuit switching method further includes:
[0041] If there is only one case where the modification cost is less than the preset value, the defect type of the logical bit corresponding to the modification cost less than the preset value is modified to obtain the modified target mapping data.
[0042] and / or
[0043] When the two logical bits in the initial quantum circuit have different defect types, the timing position path optimization processing of multiple gate operations in the target mapping data is performed based on the preset optimization rules to obtain the quantum circuit based on the defect-based surface code encoding.
[0044] According to embodiments of this disclosure, an initial mapping process is performed on the initial quantum circuit and the chip to be processed based on the chip parameters and surface code type of the chip to be processed. When the surface code type is a boundary-based surface code, the target mapping data is obtained. Based on the circuit parameters and / or chip parameters of the initial quantum circuit, the timing position path optimization process is performed on multiple gate operations in the target mapping data to obtain a boundary-based surface code encoded quantum circuit. This allows the quantum circuit to adaptively adjust the allocation of computing and communication resources in the chip according to the characteristics of the quantum circuit of the quantum chip, thereby significantly reducing the execution time of the surface code encoded quantum circuit. Attached Figure Description
[0045] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0046] Figure 1 A flowchart illustrating a quantum circuit switching method according to an embodiment of the present disclosure is shown schematically.
[0047] Figure 2 A schematic diagram of a chip to be processed according to an embodiment of the present disclosure is shown;
[0048] Figure 3 A schematic diagram of the logic circuit corresponding to an initial quantum chip according to an embodiment of the present disclosure is shown.
[0049] Figure 4 This illustration schematically shows the optimal execution scheme according to an embodiment of the present disclosure without considering mapping bandwidth adjustment;
[0050] Figure 5 This illustration schematically demonstrates the optimal execution scheme according to embodiments of the present disclosure, taking into account mapping bandwidth adjustments.
[0051] Figure 6 This schematic diagram illustrates an optimized position for door operation according to an embodiment of the present disclosure.
[0052] Figure 7 A directed acyclic graph illustrating the dependencies of logical quantum circuit operation nodes according to embodiments of the present disclosure is shown schematically; and
[0053] Figure 8 The illustration schematically shows a depth diagram of the execution result of a quantum circuit according to an embodiment of the present disclosure. Detailed Implementation
[0054] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0055] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0056] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0057] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0058] Surface codes are currently the mainstream quantum error-correcting codes, possessing a high fault tolerance threshold. Their two-dimensional lattice topology makes them suitable for the structure of current superconducting chips. A qubit is the basic data unit in a quantum circuit, and its surface code encoding is a square matrix of physical bits. Any quantum circuit can be represented by a finite set of quantum operations {X,Y,Z,H,T,CNOT}, where X,Y,Z, and H gates can be executed directly and locally within the square matrix. T gates cannot perform fault-tolerant execution and require additional physical bit resources to perform magic state distillation. Then, CNOT gates are executed between the magic state distillation factory and the corresponding square matrix, requiring the construction of a connection path between the two bit square matrices. In this work, we assume that the magic state factory can provide sufficient magic states.
[0059] Surface codes mainly include defect-based surface codes (double defect model) and boundary-based surface codes (lattice surgery model).
[0060] In the double defect model, each logical bit corresponds to a matrix of physical bits. Each matrix contains two defects, categorized as X-defect type and Z-defect type based on the defect type. Performing CNOT gate operations between two defect matrices requires a braiding technique to construct a path connecting the two matrices within the channel. The execution time for a braided path of arbitrary length is the same, determined by the surface code encoding distance. The execution time of one braided path is called a surface code cycle. Braided paths executed within a surface code cycle cannot intersect; if a path conflict occurs, one operation must wait for the next cycle. Since the braiding technique only supports constructing paths between matrices of different defect types, when defect types are the same, execution requires an auxiliary matrix. There are two methods: 1. Modify the defect type of the matrix using an auxiliary matrix before execution, taking four surface code cycles; 2. Execute directly using an auxiliary matrix, taking three surface code cycles. The current CNOT gate mapping problem in the double defect model is mainly solved by a stack-based search for a special pattern. Within a square satisfying this special pattern, there must exist a path where three CNOT gates are executed simultaneously.
[0061] In the lattice surgery model, a quantum array can perform CNOT gate operations with neighboring arrays through lattice fusion and partitioning. To enable CNOT gate operations between distant arrays, a portion of the array in the quantum chip is divided into communication resources, within which bell-state links are constructed. The execution time of CNOT gates executed in this way is independent of distance, determined by the surface code encoding distance. The execution time of one CNOT operation is called a surface code cycle. When the surface code encoding distance is the same, the time of one surface code cycle is the same in both models. Similar to the double defect model, CNOT paths executed within one surface code cycle cannot intersect. If a path conflict occurs, one operation must wait for the next cycle to execute. The mapping problem of CNOT gates in the current lattice surgery model is mainly solved by drawing on mathematical methods for solving disjoint path problems.
[0062] In view of this, this disclosure provides a quantum circuit conversion method for surface code error correction, comprising: acquiring an initial quantum circuit and a chip to be processed; performing initial mapping processing on the initial quantum circuit and the chip to be processed based on the chip parameters and surface code type of the chip to be processed to obtain target mapping data; and, in the case where the surface code type is a boundary-based surface code, performing timing position path optimization processing on multiple gate operations in the target mapping data based on the circuit parameters and / or chip parameters of the initial quantum circuit to obtain a boundary-based surface code encoded quantum circuit.
[0063] Figure 1A flowchart illustrating a quantum circuit conversion method according to an embodiment of the present disclosure is shown schematically. Figure 2 A schematic diagram of a chip to be processed according to an embodiment of the present disclosure is shown. Figure 3 A schematic diagram of the logic circuit corresponding to an initial quantum chip according to an embodiment of the present disclosure is shown. Figure 4 The illustration shows the optimal execution scheme according to an embodiment of the present disclosure without considering mapping bandwidth adjustment. Figure 5 The illustration shows the optimal execution scheme according to an embodiment of the present disclosure, taking into account the mapping bandwidth adjustment.
[0064] like Figure 1 As shown, the quantum circuit conversion method for surface code error correction in this embodiment includes operations S110 to S130.
[0065] In operation S110, the initial quantum circuit and the chip to be processed are obtained;
[0066] In operation S120, based on the chip parameters and surface code type of the chip to be processed, the initial quantum circuit and the chip to be processed are initially mapped to obtain target mapping data.
[0067] In operation S130, when the surface code type is a boundary-based surface code, the timing position path optimization processing of multiple gate operations in the target mapping data is performed based on the circuit parameters and / or chip parameters of the initial quantum circuit to obtain a boundary-based surface code encoded quantum circuit.
[0068] According to embodiments of this disclosure, chip parameters may refer to each chip to be processed having a corresponding square matrix, for example, the chip to be processed may be as follows: Figure 2 The type shown Figure 2 (a) The chip to be processed on the left contains 3×3 square arrays, and the chip to be processed on the right contains 4×2 square arrays. In this scheme, the array queue with the smallest perimeter that satisfies the number of quantum circuit bits is selected. When the perimeters are equal, the array queue with the larger area is selected. Here, a 3×3 array queue is selected. Of course, the chip to be processed in this disclosure can also be other types of chips.
[0069] According to embodiments of this disclosure, multiple logic bits in each initial quantum circuit are respectively mapped into different arrays in the chip to be processed, that is, the logic bits in multiple initial quantum chips are mapped into... Figure 2 From the chips to be processed in the list, a specific chip can be identified as the final chip used, such as... Figure 2 As shown in (b).
[0070] According to embodiments of this disclosure, by means of... Figure 3The logic circuit corresponding to the initial quantum chip shown is used to perform an initial mapping process on the initial quantum circuit and the chip to be processed based on the chip parameters and surface code type of the chip to be processed, resulting in the following: Figure 4 The target mapping data shown is as follows. Figure 4 It contains two execution cycles. See the first execution cycle. Since the quantum gate operation between logic bits q3 and q4 and other gate operations have already occupied the bandwidth in the chip to be processed (as shown by the channels formed by every two rows of dashed lines in the figure), the quantum gate operation between q2 and q5 needs to be arranged in the second execution cycle.
[0071] According to embodiments of this disclosure, when the surface code type is a boundary-based surface code, based on the circuit parameters and / or chip parameters of the initial quantum circuit, a timing position path optimization process is performed on multiple gate operations in the target mapping data to obtain a boundary-based surface code encoded quantum circuit. This boundary-based surface code encoded quantum circuit, for example... Figure 5 The diagram shows the execution cycle. The bandwidth between the first and second square matrices is adjusted so that the quantum gate operation between q2 and q5 can be executed within the first execution cycle.
[0072] According to embodiments of this disclosure, an initial mapping process is performed on the initial quantum circuit and the chip to be processed based on the chip parameters and surface code type of the chip to be processed. When the surface code type is a boundary-based surface code, the target mapping data is obtained. Based on the circuit parameters and / or chip parameters of the initial quantum circuit, the timing position path optimization process is performed on multiple gate operations in the target mapping data to obtain a boundary-based surface code encoded quantum circuit. This allows for adaptive adjustment of the allocation of computing and communication resources in the chip according to the characteristics of the quantum circuit of the quantum chip, thereby significantly reducing the execution time of the surface code encoded quantum circuit.
[0073] According to embodiments of this disclosure, the initial quantum circuit includes There are _ logical bits, where d is the code distance specified by the quantum error-correcting code. Each logical bit is composed of _ ... A bit matrix consisting of physical bits.
[0074] According to embodiments of this disclosure, based on the chip parameters and surface code type of the chip to be processed, an initial mapping process is performed on the initial quantum circuit and the chip to be processed to obtain target mapping data, including:
[0075] Based on the number of initial quantum circuits, the target array queue of the initial quantum circuits is determined based on the perimeter of the initial array queue. The initial array queue is a queue formed by initial arrays that meet the number of logical bits. The chip parameters include the initial array queue.
[0076] Based on the cost of the square matrix, each logical bit is mapped onto multiple target square matrices in the target square matrix queue to obtain the mapping square matrix;
[0077] Based on the execution frequency of the target gate operation in the initial quantum circuit, the channel bandwidth of the chip to be processed, which contains the mapping matrix, is adjusted to obtain the target bandwidth.
[0078] In the case of a surface code type that is a boundary-based surface code, target mapping data is generated based on the mapping matrix and the target bandwidth.
[0079] According to embodiments of this disclosure, see Figure 2 (a) describes two types of chips to be processed. Based on the number of logic bits in the initial quantum circuit, the target array queue of the initial quantum circuit is determined according to the perimeter of the initial array queue. For example, this disclosure determines that... Figure 2 The 3×3 initial square array queue in (a) is determined as the target square array queue.
[0080] According to an embodiment of this disclosure, multiple mapping strategies are obtained using the METIS graph partitioning method. Then, the cost of each mapping matrix is calculated using the cost function of formula (1), and the mapping matrix with the minimum matrix cost is determined as the final mapping matrix, thereby mapping each logical bit onto multiple target matrices in the target matrix queue.
[0081] (1)
[0082] in, It is the number of CNOT gates executed between two logical bits i and j. It is the Manhattan distance between the square matrices corresponding to the i and j logical bits. It is the number of T gates executed on each logical bit. It is the distance from the square array to the nearest Wonderful State Factory.
[0083] According to embodiments of this disclosure, by pre-executing the initial quantum circuit, the channel through which the CNOT gate is executed most frequently is found, and its bandwidth is then increased until all idle bandwidth in the chip is allocated, thereby obtaining the target mapping data.
[0084] According to embodiments of this disclosure, based on the chip parameters and surface code type of the chip to be processed, an initial mapping process is performed on the initial quantum circuit and the chip to be processed to obtain target mapping data, further comprising:
[0085] When the surface code type is a defect-based surface code, the bipartite graph method is used to select a defect type for each initial matrix to obtain defect allocation information.
[0086] Target mapping data is generated based on the mapping matrix, target bandwidth, and defect allocation information.
[0087] According to embodiments of this disclosure, defect type initialization is used to determine the defect type for initializing the square matrix in a double defect model. A bipartite graph can be used to select a defect type for each initial square matrix, maximizing the number of CNOTs performed when defect types differ. This allows for the generation of target mapping data based on the mapping square matrix, target bandwidth, and defect allocation information.
[0088] Figure 6 A schematic diagram illustrating the optimized position of door operation according to an embodiment of the present disclosure is shown.
[0089] According to embodiments of this disclosure, based on the circuit parameters and / or chip parameters of the initial quantum circuit, a timing position path optimization process is performed on multiple gate operations in the target mapping data to obtain a boundary-based surface code encoded quantum circuit, including:
[0090] When the initial quantum circuit includes multiple Pauli gate operations, the timing position of the multiple Pauli gate operations is optimized based on the equivalence relation between the basic operations of the initial quantum circuit to obtain a quantum circuit with boundary-based surface code encoding. The Pauli gate operations include X-gate operations, Y-gate operations, or Z-gate operations, and the equivalence relation between the basic operations includes commutation relations.
[0091] According to embodiments of this disclosure, when the surface code type is a boundary-based surface code (i.e., a lattice surgery model), the order of the X-gate, Y-gate, and Z-gate operations is interchanged using equivalence relations until they cancel each other out or a measurement operation is encountered. In an illustrative embodiment, such as Figure 6 As shown, by sequentially... Figure 6 The door operations in (a) are swapped; see [reference]. Figure 6 (b) ~ Figure 6 The substitution process in (d) ultimately yields... Figure 6 The result of (e), where M X Characterization measurement operations.
[0092] According to an embodiment of this disclosure, when the initial quantum circuit includes multiple Pauli gate operations, the positions of the multiple Pauli gate operations are optimized based on the equivalence relationship between the Pauli gate operations, so that the optimized quantum circuit does not contain any Pauli gate operations.
[0093] According to embodiments of this disclosure, firstly, the matrix that the H-gate operation may occupy in the chip to be processed is determined, and the weights of the matrix are adjusted to obtain the adjusted chip to be processed. Secondly, all H-gates and CNOT gates are sorted according to priority.
[0094] Figure 7A directed acyclic graph illustrating the dependencies of logical quantum circuit operation nodes according to an embodiment of the present disclosure is shown.
[0095] According to embodiments of this disclosure, based on the circuit parameters of the initial quantum circuit and / or the chip parameters, a logic circuit optimization process is performed on the timing positions of multiple gate operations in the target mapping data to obtain a boundary-based surface code encoded quantum circuit, further comprising:
[0096] Based on the data dependencies of the initial quantum circuit, multiple CNOT gate operations and multiple H gate operations without a preceding operation are identified from multiple gate operations in the initial quantum circuit.
[0097] Based on the operation parameters of each CNOT gate operation and multiple H gate operations, the multiple CNOT gate operations and multiple H gate operations are sorted to obtain a boundary-based surface code encoded quantum circuit, wherein the boundary-based surface code encoded quantum circuit includes the sorted multiple CNOT gate operations and multiple H gate operations.
[0098] Specifically, based on the operation parameters of each CNOT gate operation and multiple H gate operations, the multiple CNOT gate operations and multiple H gate operations are sorted to obtain a boundary-based surface code encoded quantum circuit, including:
[0099] For each CNOT gate operation and any gate operation in the H gate operation, calculate the subsequent execution depth of the gate operation;
[0100] When multiple gate operations have different subsequent execution depths, the priority of each gate operation is determined based on the multiple subsequent execution depths;
[0101] When multiple gate operations have multiple intermediate gate operations with the same execution depth, for each intermediate gate operation, the priority of the intermediate gate operation is determined based on the number of subsequent operations. The operation parameters include the execution depth and the number of subsequent operations.
[0102] Based on multiple priorities, and according to multiple gate operations and / or intermediate gate operations, a boundary-based surface code-encoded quantum circuit is generated.
[0103] According to embodiments of this disclosure, based on data dependencies, the currently executable CNOT gate operation is found; the priority of the currently executable operation is calculated by first comparing the minimum depth of the subsequent operations of the operation. The deeper the depth, the higher the priority. If the depths are the same, the number of subsequent operations is compared. The more operations there are, the higher the priority.
[0104] According to embodiments of this disclosure, based on the above priority, specific execution matrices are assigned to each operation in sequence. If the operation is a CNOT gate operation, the shortest path is found between the two matrices on the current chip. If there is no path between the two matrices on the current chip, the operation is delayed until the next cycle. If the operation is an H gate operation, one of the execution schemes provided by the current chip is randomly selected. If there is no execution scheme on the current chip, the operation is delayed until the next cycle.
[0105] According to embodiments of this disclosure, referring to Figure 7 The specific example shown is the orange-red operation node in the diagram. (CNOT gate operation), its subsequent execution depth is 3, the number of subsequent operations is 5, and the operation node to the right of this node. The subsequent execution depth is 3, and the number of subsequent operations is 2. The priority of the operation node is determined based on the subsequent execution depth and the number of subsequent operations, thereby generating the corresponding quantum circuit based on the boundary surface code encoding.
[0106] According to embodiments of this disclosure, based on the circuit parameters and / or chip parameters of the initial quantum circuit, timing position path optimization processing is performed on multiple gate operations in the target mapping data to obtain a boundary-based surface code encoded quantum circuit, further comprising:
[0107] In the case where there is an executable H-gate operation among multiple gate operations, determine the matrix occupied by the H-gate operation in the chip to be processed, where the chip parameters characterize the occupied matrix.
[0108] The weights of the array are adjusted to obtain the adjusted chip to be processed;
[0109] Based on the adjusted chip to be processed and the initial quantum circuit, a boundary-based surface code-encoded quantum circuit is generated.
[0110] According to embodiments of this disclosure, if there is an executable H-gate operation, the surrounding matrix that needs to be occupied to execute the H-gate operation is found, their weights are increased, and the possibility of them being used by higher priority operations is reduced.
[0111] According to embodiments of this disclosure, based on the circuit parameters and / or chip parameters of the initial quantum circuit, timing position path optimization processing is performed on multiple gate operations in the target mapping data to obtain a boundary-based surface code encoded quantum circuit, further comprising:
[0112] When the initial quantum circuit includes executable T-gate operations, the virtual wondrous state factory and the array that currently need to perform T-gate operations on the chip are connected using a virtual wondrous state factory and a virtual T-gate array to obtain the initial connection information;
[0113] The initial connection information is processed using the maximum flow algorithm to obtain a boundary-based surface code-encoded quantum circuit, which serves as the execution path for multiple T-gate operations. This process is repeated until the specific operation scheme for all operations in the quantum circuit is determined.
[0114] According to embodiments of this disclosure, since all wonder factories are consistent, there is no need for a specific wonder factory to a specific matrix for executing T gates. A virtual wonder factory can be set up to connect all currently available wonder factories, and then a virtual T-gate matrix can be set up to connect all currently executable T-gate matrices to obtain initial connection information. By using the maximum flow algorithm, the most currently executable T-gate paths can be found, thereby generating a boundary-based surface code encoded quantum circuit for execution.
[0115] According to embodiments of this disclosure, after obtaining the quantum circuit based on boundary surface code encoding, the currently executable operation can be executed in priority order. If it is an H gate, it is determined whether there is an executable auxiliary array around it. If it is a CNOT gate, the shortest path that can be executed is found. If it cannot be executed, it waits for the next cycle. By continuously repeating the above steps, all gate operations are completed.
[0116] According to embodiments of this disclosure, the quantum circuit switching method further includes:
[0117] In the case of a defect-based surface code, based on preset optimization rules, temporal position path optimization is performed on multiple gate operations in the target mapping data to obtain a quantum circuit encoded by the defect-based surface code.
[0118] According to embodiments of this disclosure, based on preset optimization rules, temporal position path optimization processing is performed on multiple gate operations in the target mapping data to obtain a quantum circuit based on defect-based surface code encoding, including:
[0119] Calculate the modification cost for each logical bit when the two logical bits in the initial quantum circuit have the same defect type.
[0120] If the modification cost is less than the preset value, the defect type of the logical bit corresponding to the minimum modification cost is modified to obtain the modified target mapping data; if there is no case where the modification cost is less than the preset value, the defect type of the matrix is not modified.
[0121] Based on preset optimization rules, the temporal position path optimization processing of multiple gate operations in the modified target mapping data is performed to obtain a quantum circuit based on defect-based surface code encoding. The preset optimization rules utilize the same position path optimization method as the boundary-based surface code.
[0122] According to an embodiment of this disclosure, when the surface code type is a defect-based surface code (Double defect model) and the two logical bits in the initial quantum circuit have the same defect type, the modification cost M-value of each logical bit is calculated by formula (2).
[0123] (2)
[0124] Where Mt is the impact of modifying the defect type on time, Ms is the impact of modifying the defect type on channel occupancy, and P is a weighting parameter designed based on the current congestion level.
[0125] According to embodiments of this disclosure, the preset value can be set specifically according to actual conditions, for example, it can be 0.
[0126] When the defect types of two logical bits in the initial quantum circuit are different, the timing position path optimization of multiple gate operations in the target mapping data is performed based on a preset optimization rule to obtain a quantum circuit with surface code encoding based on defects.
[0127] Figure 8 A schematic diagram illustrating the depth of CNOT gate execution results of a quantum circuit according to an embodiment of the present disclosure is shown.
[0128] In one specific embodiment, this disclosure selected various quantum circuits of different scales, parallelisms, and practical applications for testing, totaling 22 circuits, as detailed below. Figure 8 As shown. Three sizes of chips were selected for processing: the smallest executable chip, a chip with four times the resources of the smallest executable chip, and a chip with relatively sufficient circuit resources.
[0129] Taking the compilation of the circuit on a lattice surgery model and a minimal executable chip as an example, the entire process is explained in detail below.
[0130] Step 1: Determine the mapping from logical bits to the matrix. This involves repeatedly calling the Metis algorithm to bisect the logical bits and the matrix, randomly mapping a group of logical bits onto a group of matrix elements. This process is repeated until only one logical bit remains in that group. This step is repeated multiple times, and the mapping with the lowest cost among the various mapping results is selected.
[0131] Step 2: Identify all currently executable operations and calculate the priority of each operation. First, pre-optimize the chip graph weights for H-gate execution. Execute H-gate and CNOT-gate operations according to priority. If an operation is not executable in this round, it waits for the next round. Finally, execute all currently executable T-gates uniformly by setting virtual nodes. If any operation is not executable in this round, it waits for the next round. Repeat this process until all operations are executed.
[0132] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
