Quantum circuit conversion method for surface code error correction

By performing initial mapping processing and gate operation optimization on quantum circuits and chips, boundary-based surface code encoding quantum circuits are generated, which solves the problems of high operation error rate and long execution time of quantum computers, and achieves more efficient quantum circuit execution and results. Fidelity.

CN118569397APending Publication Date: 2024-08-30UNIV OF SCI & TECH OF CHINA +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410744128.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

The operation error rate of current quantum computers is high, resulting in long execution times of quantum circuits, which cannot meet the needs of practical applications. In addition, the conversion efficiency of quantum circuits in the existing technology is low, resulting in low fidelity of execution results.

Method used

Provides a quantum circuit conversion method for surface code error correction. By obtaining the initial quantum circuit and the chip to be processed, initial mapping processing is performed based on the chip parameters and surface code type, the timing position path of the gate operation is optimized, and a boundary-based surface is generated. Code-encoded quantum circuits include technical means such as logic optimization, sorting, bandwidth adjustment, and defect allocation.

Benefits of technology

By adaptively adjusting the allocation of computing resources and communication resources, the execution time of surface code-encoded quantum circuits is significantly reduced, and the accuracy and efficiency of execution results are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118569397A
    Figure CN118569397A
Patent Text Reader

Abstract

The invention provides a quantum circuit conversion method for surface code error correction. The quantum circuit conversion method comprises the following steps: acquiring an initial quantum circuit and a to-be-processed chip; performing initial mapping processing on the initial quantum circuit and the to-be-processed chip based on the chip parameters and the surface code type of the to-be-processed chip to obtain target mapping data; and under the condition of the boundary-based surface code, performing time sequence position path optimization processing on the plurality of gate operations in the target mapping data based on the line parameters and / or chip parameters of the initial quantum line to obtain a boundary-based surface code coding quantum line, and the line execution time being as short as possible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of quantum chip technology, and in particular to a quantum circuit conversion method for surface code error correction. Background Art

[0002] In recent years, quantum algorithms have flourished, and many quantum algorithms have theoretically proven to be super-polynomially faster than classical algorithms. However, due to the error-prone nature of quantum bits, the current quantum computer operation error rate is around 1%, which cannot meet the needs of quantum algorithms with practical application significance. In order to improve the accuracy of quantum circuit execution results, quantum circuits need to be executed in the form of quantum error correction code encoding protection, which requires the circuit converter to map it into a quantum circuit that meets the error correction code encoding operation execution conditions and quantum chip structure.

[0003] In the process of implementing the concept of the present disclosure, it was found that the chips in the related art required 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, the present disclosure provides a quantum circuit conversion method for surface code error correction, comprising:

[0005] Obtain initial quantum circuits and chips to be processed;

[0006] Based on the chip parameters and surface code type of the chip to be processed, performing initial mapping processing on the initial quantum circuit and the chip to be processed to obtain target mapping data;

[0007] In the case where the surface code type is a boundary-based surface code, based on the line parameters of the initial quantum circuit and / or the chip parameters, a plurality of gate operations in the target mapping data are subjected to timing position path optimization processing to obtain a quantum circuit encoded by a boundary-based surface code.

[0008] According to an embodiment of the present disclosure, based on the line parameters of the initial quantum circuit and / or the chip parameters, a plurality of gate operations in the target mapping data are subjected to timing position path optimization processing to obtain a quantum circuit encoded by a boundary-based surface code, including:

[0009] In the case where the initial quantum circuit includes a plurality of Pauli gate operations, the plurality of Pauli gate operations are subjected to logic optimization processing in terms of timing and position based on an equivalent relationship between basic operations of the initial quantum circuit to obtain the boundary-based surface code-encoded quantum circuit, wherein the Pauli gate operation includes an X-gate operation, a Y-gate operation or a Z-gate operation, and the equivalent relationship between the basic operations includes a commutation relationship.

[0010] According to an embodiment of the present disclosure, based on the line parameters of the initial quantum circuit and / or the chip parameters, a plurality of gate operations in the target mapping data are subjected to timing position path optimization processing to obtain a quantum circuit encoded by a boundary-based surface code, further comprising:

[0011] According to the data dependency of the initial quantum circuit, a plurality of CNOT gate operations and a plurality of H gate operations without preceding operations to be performed are determined from the plurality of gate operations in the initial quantum circuit;

[0012] Sorting the plurality of CNOT gate operations and the plurality of H gate operations based on the operation parameters of each of the CNOT gate operations and the plurality of H gate operations to obtain the boundary-based surface code-encoded quantum circuit, wherein the boundary-based surface code-encoded quantum circuit includes the sorted plurality of CNOT gate operations and the plurality of H gate operations;

[0013] The multiple CNOT gate operations and the multiple H gate operations are sorted based on the operation parameters of each of the CNOT gate operations and the multiple H gate operations to obtain the quantum circuit encoded by the boundary-based surface code, including:

[0014] For each of the CNOT gate operations and any of the H gate operations, calculate the subsequent execution depth of the gate operation;

[0015] In the case where the multiple subsequent execution depths of the multiple gate operations are different, determining the priority of each of the gate operations according to the multiple subsequent execution depths;

[0016] In the case that there are multiple intermediate gate operations with the same subsequent execution depth among the multiple gate operations, for each of the intermediate gate operations, determining the priority of the intermediate gate operation according to the number of subsequent operations of the intermediate gate operation, wherein the operation parameters include the subsequent execution depth and the number of subsequent operations;

[0017] Based on the plurality of the priorities, and according to the plurality of the gate operations and / or intermediate gate operations, the boundary-based surface code-encoded quantum circuit is generated.

[0018] According to an embodiment of the present disclosure, the quantum circuit conversion method further includes:

[0019] In the case that there is an executable H gate operation among the plurality of gate operations, determining a square matrix occupied by the H gate operation in the chip to be processed, wherein the chip parameter represents the occupied square matrix;

[0020] Adjust the weight of the above matrix to obtain an adjusted chip to be processed;

[0021] The quantum circuit encoded with the boundary-based surface code is generated according to the adjusted chip to be processed and the initial quantum circuit.

[0022] According to an embodiment of the present disclosure, the quantum circuit conversion method further includes:

[0023] When the above initial quantum circuit includes an executable T-gate operation, the virtual wonderful state factory and the virtual T-gate matrix are used to connect all the wonderful state factories that have currently generated wonderful states and the matrix that is currently to execute the T-gate to obtain initial connection information;

[0024] The above initial connection information is processed using the maximum flow algorithm to obtain the above boundary-based surface code-encoded quantum circuit.

[0025] According to an embodiment of the present disclosure, the above-mentioned initial quantum circuit includes a plurality of logical bits, each of which includes a bit matrix composed of a plurality of physical bits;

[0026] Among them, based on the chip parameters and surface code type of the above-mentioned chip to be processed, the above-mentioned initial quantum circuit and the above-mentioned chip to be processed are initially mapped to obtain target mapping data, including:

[0027] According to the number of the initial quantum circuits, a target square matrix queue of the initial quantum circuit is determined based on the perimeter of the initial square matrix queue, wherein the initial square matrix queue is a queue formed by initial square matrices that meet the number of logical bits, and the chip parameters include the initial square matrix queue;

[0028] Based on the METIS graph partitioning method, each of the above logic bits is mapped onto multiple target matrices of the above target matrix queue to obtain multiple mapping matrices, and the mapping matrix with the minimum cost is selected through a cost function;

[0029] Based on the execution frequency of the target gate operation in the initial quantum circuit, adjusting the channel bandwidth of the chip to be processed including the mapping matrix 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 according to the mapping matrix and the target bandwidth.

[0031] According to an embodiment of the present disclosure, the quantum circuit conversion method further includes:

[0032] In the case where the surface code type is a defect-based surface code, a defect type is selected for each of the initial square matrices using a bipartite graph method to obtain defect allocation information;

[0033] The target mapping data is generated according to the mapping matrix, the target bandwidth and the defect allocation information.

[0034] According to an embodiment of the present disclosure, the quantum circuit conversion method further includes:

[0035] In the case where the surface code type is a defect-based surface code, based on preset optimization rules, multiple gate operations in the target mapping data are optimized in time sequence position path to obtain a quantum circuit encoded by the defect-based surface code.

[0036] According to an embodiment of the present disclosure, based on a preset optimization rule, a plurality of gate operations in the above target mapping data are subjected to timing position path optimization processing to obtain a quantum circuit encoded by a defect-based surface code, including:

[0037] When the defect types of the two logic bits in the initial quantum circuit are the same, calculating the modification cost of each of the logic bits;

[0038] In the case where both of the above modification costs are less than the preset value, the defect type of the logic bit corresponding to the minimum value of the above modification cost is modified to obtain the modified target mapping data;

[0039] Based on the preset optimization rules, a plurality of gate operations in the modified target mapping data are optimized in time sequence and position to obtain the defect-based surface code-encoded quantum circuit.

[0040] According to an embodiment of the present disclosure, the quantum circuit conversion method further includes:

[0041] In the case where only one of the modification costs is smaller than the preset value, the defect type of the logic bit corresponding to the modification cost smaller than the preset value is modified to obtain modified target mapping data;

[0042] and / or

[0043] In the case where the defect types of the two logic bits in the above-mentioned initial quantum circuit are different, the timing position path optimization processing is performed on the multiple gate operations in the above-mentioned target mapping data based on the above-mentioned preset optimization rules to obtain the above-mentioned defect-based surface code encoded quantum circuit.

[0044] According to an embodiment of the present disclosure, initial mapping processing is performed on the initial quantum circuit and the chip to be processed based on the chip parameters and the surface code type of the chip to be processed to obtain target mapping data. When the surface code type is a boundary-based surface code, based on the line parameters and / or chip parameters of the initial quantum circuit, multiple gate operations in the target mapping data are subjected to timing position path optimization processing to obtain a quantum circuit encoded with a boundary-based surface code. This can adaptively adjust the allocation of computing resources and communication resources in the chip according to the characteristics of the quantum circuit of the quantum chip, thereby greatly reducing the execution time of the quantum circuit encoded with the surface code. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0046] Figure 1 A flowchart of a quantum circuit conversion method according to an embodiment of the present disclosure is schematically shown;

[0047] Figure 2 A schematic diagram of a chip to be processed according to an embodiment of the present disclosure is schematically shown;

[0048] Figure 3 A schematic diagram of a logic circuit corresponding to an initial quantum chip according to an embodiment of the present disclosure is shown schematically;

[0049] Figure 4 The optimal execution scheme without considering the adjustment of mapping bandwidth according to the embodiment of the present disclosure is schematically shown;

[0050] Figure 5 Schematically illustrates the optimal execution scheme considering mapping bandwidth adjustment according to an embodiment of the present disclosure

[0051] Figure 6 Schematically shows a schematic diagram of position optimization of door operation according to an embodiment of the present disclosure;

[0052] Figure 7 A directed acyclic graph schematically illustrates the dependency relationship of logic quantum circuit operation nodes according to an embodiment of the present disclosure; and

[0053] Figure 8 A schematic diagram of the execution result of the quantum circuit according to an embodiment of the present disclosure is shown in depth. DETAILED DESCRIPTION

[0054] Hereinafter, embodiments of the present disclosure will 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 present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0055] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0056] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0057] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0058] Surface codes are the current mainstream quantum error correction codes with a high fault tolerance threshold. Their two-dimensional grid topology makes them compatible with the structure of current superconducting chips. Quantum bits are the basic data units in quantum circuits, and their surface code encoding form is a set of physical bit matrices. Any quantum circuit can be represented by a finite set of quantum operations {X, Y, Z, H, T, CNOT}, where X, Y, Z, H gates can be directly executed locally in the matrix, and T gates cannot be executed fault-tolerantly. Additional physical bit resources are required to perform magic state distillation, and then CNOT gates are executed between the magic state distillation factory and the corresponding matrix. CNOT gates require a connection path to be built between the two bit 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 a group of physical bits. Each matrix has two defects. According to the defect type, the matrix is ​​divided into X-defect type and Z-defect type. To perform CNOT gate operations between two defect matrices, weaving technology needs to build a path connecting the two matrices in the channel. The execution time required for weaving paths of any length is the same, which is determined by the surface code encoding distance. We call the execution time of a weaving path a surface code cycle. The weaving paths executed in a surface code cycle cannot intersect. If a path conflict occurs, one of the operations needs to wait for the next cycle to execute. Since weaving technology only supports the construction of paths between matrices of different defect types, when the defect types are the same, it is necessary to execute through an auxiliary matrix. There are two specific methods: 1. Modify the matrix defect type through an auxiliary matrix and then execute it, which takes four surface code cycles; 2. Execute directly through the auxiliary matrix, which takes three surface code cycles. The mapping problem of CNOT gates in the current double defect model is mainly solved by stack search in a special mode. In the square that satisfies this special mode, there must be a path where three CNOT gates are executed simultaneously.

[0061] In the lattice surgery model, squares can perform CNOT gate operations with surrounding adjacent squares through lattice fusion and division. In order to enable remote squares to perform CNOT gate operations, we divide a part of the squares in the quantum chip into communication resources and build bell state links in them. The execution time of the CNOT gate executed in this way is independent of the distance and is determined by the surface code encoding distance. We call the execution time of a CNOT a surface code cycle. When the surface code encoding distance is the same, the time of a surface code cycle in the two models is the same. As in the double defect model, the CNOT paths executed within a surface code cycle cannot intersect. If a path conflict occurs, one of the operations must wait for the next cycle to execute. The mapping problem of the CNOT gate in the current lattice surgery model is mainly solved by referring to the non-intersecting path problem in mathematics.

[0062] In view of this, the present disclosure provides a quantum circuit conversion method for surface code error correction, comprising: obtaining 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 chip parameters of the chip to be processed and the surface code type to obtain target mapping data; when 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 line parameters and / or chip parameters of the initial quantum circuit to obtain a quantum circuit encoded with a boundary-based surface code.

[0063] Figure 1The flowchart of the quantum circuit conversion method according to the embodiment of the present disclosure is schematically shown. Figure 2 The schematic diagram of a chip to be processed according to an embodiment of the present disclosure is schematically shown. Figure 3 The figure schematically shows a logic circuit diagram corresponding to the initial quantum chip according to an embodiment of the present disclosure. Figure 4 The optimal execution scheme without considering the mapping bandwidth adjustment according to the embodiment of the present disclosure is schematically shown. Figure 5 The optimal execution scheme considering the mapping bandwidth adjustment according to the embodiment of the present disclosure is schematically shown.

[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, an initial quantum circuit and a 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, an initial mapping process is performed on the initial quantum circuit and the chip to be processed to obtain target mapping data;

[0067] In operation S130, when the surface code type is a boundary-based surface code, a plurality of gate operations in the target mapping data are optimized in timing position path based on the line parameters and / or chip parameters of the initial quantum circuit to obtain a quantum circuit encoded by the boundary-based surface code.

[0068] According to an embodiment of the present disclosure, the chip parameter may refer to that each chip to be processed has 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. This scheme selects the square array queue with the smallest perimeter that meets the number of quantum circuit bits. When the perimeters are equal, the square array queue with a larger area is selected. Here, the 3×3 square array queue is selected. Of course, the chip to be processed disclosed in the present invention can also be other types of chips.

[0069] According to the embodiment of the present disclosure, the multiple logical bits in each initial quantum circuit are respectively mapped in different square arrays in the chip to be processed, that is, the logical bits in the multiple initial quantum chips are mapped in different square arrays. Figure 2 Among the chips to be processed, a specific chip to be processed can be determined as the final chip to be used, such as Figure 2 (b) shown.

[0070] According to an embodiment of the present disclosure, by Figure 3The logic circuit corresponding to the initial quantum chip shown in FIG. 1 is initially mapped to 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, and the following is obtained: Figure 4 The target mapping data shown, Figure 4 It includes two execution cycles, referring to the first execution cycle. Since the quantum gate operation between the logic bits q3 and q4 and other gate operations have occupied the bandwidth in the chip to be processed (as shown in the channel formed by every two rows of dotted lines in the figure), it is necessary to arrange the quantum gate operation between q2 and q5 in the second execution cycle.

[0071] According to an embodiment of the present disclosure, when the surface code type is a boundary-based surface code, based on the line parameters and / or chip parameters of the initial quantum circuit, a plurality of gate operations in the target mapping data are subjected to timing position path optimization processing to obtain a quantum circuit encoded by the boundary-based surface code, the quantum circuit encoded by the boundary-based surface code, for example Figure 5 The execution cycle schematic diagram shown in the figure adjusts the bandwidth between the first row matrix and the second matrix so that the quantum gate operation between q2 and q5 can be executed in the first execution cycle.

[0072] According to an embodiment of the present disclosure, initial mapping processing is performed on the initial quantum circuit and the chip to be processed based on the chip parameters and the surface code type of the chip to be processed to obtain target mapping data. When the surface code type is a boundary-based surface code, based on the line parameters and / or chip parameters of the initial quantum circuit, multiple gate operations in the target mapping data are optimized in timing position path to obtain a quantum circuit encoded with a boundary-based surface code, thereby adaptively adjusting the allocation of computing resources and communication resources in the chip according to the characteristics of the quantum circuit of the quantum chip, thereby greatly reducing the execution time of the quantum circuit encoded with the surface code.

[0073] According to an embodiment of the present disclosure, the initial quantum circuit includes logical bits, d is the code distance specified by the quantum error correction code, and each logical bit is A bit matrix consisting of physical bits.

[0074] According to an embodiment of the present 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] According to the number of initial quantum circuits, a target square array queue of the initial quantum circuit is determined based on the perimeter of the initial square array queue, wherein the initial square array queue is a queue formed by initial square arrays that meet the number of logical bits, and the chip parameters include the initial square array queue;

[0076] Based on the matrix cost, each logic bit is mapped onto multiple target matrices in the target matrix queue to obtain a mapping 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 including the mapping matrix is ​​adjusted to obtain the target bandwidth;

[0078] When the surface code type is a boundary-based surface code, target mapping data is generated according to the mapping matrix and the target bandwidth.

[0079] According to the embodiments of the present disclosure, see Figure 2 The two chips to be processed in (a) determine the target square array of the initial quantum circuit based on the number of logical bits of the initial quantum circuit and the perimeter of the initial square array. For example, the present disclosure determines Figure 2 The 3×3 initial square array in (a) is determined as the target square array.

[0080] According to an embodiment of the present disclosure, a plurality of mapping policies are obtained by using the METIS graph partitioning method, and then the cost function of formula (1) is used to calculate the cost of each mapping matrix, and the mapping matrix with the smallest matrix cost is determined as the final mapping matrix, thereby mapping each logical bit to multiple target matrices of the target matrix queue.

[0081] (1)

[0082] in, is the number of CNOT gates executed between two logic bits i and j, is the Manhattan distance of the square matrix corresponding to the i and j logical bits, is the number of T gates executed on each logic bit, It is the distance from the square to the nearest Miaotai factory.

[0083] According to an embodiment of the present disclosure, by pre-executing the initial quantum circuit, the channel where the CNOT gate is executed most frequently is found, and then its bandwidth is increased until all idle bandwidth in the chip is allocated, thereby obtaining the target mapping data.

[0084] According to an embodiment of the present disclosure, based on the chip parameters and surface code type of the chip to be processed, initial mapping processing is performed on the initial quantum circuit and the chip to be processed to obtain target mapping data, and further includes:

[0085] In the case where the surface code type is a defect-based surface code, a defect type is selected for each initial square matrix using a bipartite graph method to obtain defect allocation information;

[0086] Target mapping data is generated according to the mapping matrix, target bandwidth and defect allocation information.

[0087] According to an embodiment of the present disclosure, the initialization of the defect type is used to determine the defect type of the matrix initialization in the double defect model. A bipartite graph can be used to select a defect type for each initial matrix, so that as many CNOTs as possible are performed when the defect types are different, thereby generating target mapping data based on the mapping matrix, target bandwidth and defect allocation information.

[0088] Figure 6 A schematic diagram of position optimization of door operation according to an embodiment of the present disclosure is schematically shown.

[0089] According to an embodiment of the present disclosure, based on the line parameters and / or chip parameters of the initial quantum circuit, multiple gate operations in the target mapping data are subjected to timing position path optimization processing to obtain a quantum circuit encoded by a boundary-based surface code, including:

[0090] In the case where the initial quantum circuit includes multiple Pauli gate operations, the multiple Pauli gate operations are logically optimized in terms of timing and position based on the equivalence relationship between basic operations of the initial quantum circuit to obtain a quantum circuit encoded with a boundary-based surface code, wherein the Pauli gate operation includes an X-gate operation, a Y-gate operation or a Z-gate operation, and the equivalence relationship between the basic operations includes a commutation relationship.

[0091] According to an embodiment of the present disclosure, when the surface code type is a boundary-based surface code (i.e., a lattice surgery model), the order of the X gate operation, the Y gate operation, and the Z gate operation is swapped through an equivalent relationship until the operation is offset or a measurement operation is encountered. In an exemplary embodiment, Figure 6 As shown, by sequentially Figure 6 The gate operation in (a) is swapped, see Figure 6 (b) ~ Figure 6 (d) The replacement process finally obtains Figure 6 (e) The result, where M X Characterize the measurement operation.

[0092] According to an embodiment of the present disclosure, when the initial quantum circuit includes multiple Pauli gate operations, the multiple Pauli gate operations are positionally optimized based on the equivalence relationship between the Pauli gate operations, so that the optimized quantum circuit does not contain Pauli gate operations.

[0093] According to the embodiment of the present disclosure, firstly, the square matrix that the H gate operation may occupy in the chip to be processed is determined, and the weight of the square matrix is ​​adjusted to obtain the adjusted chip to be processed. Secondly, all H gates and CNOT gates are sorted according to priority.

[0094] Figure 7The directed acyclic graph of the dependency relationship of the logic quantum circuit operation nodes according to the embodiment of the present disclosure is schematically shown.

[0095] According to an embodiment of the present disclosure, based on the circuit parameters of the initial quantum circuit and / or the chip parameters, a plurality of gate operations in the target mapping data are subjected to logic circuit optimization processing in a sequential position to obtain a quantum circuit encoded by a boundary-based surface code, further comprising:

[0096] According to the data dependency of the initial quantum circuit, a plurality of CNOT gate operations and a plurality of H gate operations without preceding order operations to be executed are determined from the plurality of gate operations in the initial quantum circuit;

[0097] Sorting the multiple CNOT gate operations and the multiple H gate operations based on the operation parameters of each CNOT gate operation and the multiple H gate operations to obtain a quantum circuit encoded by a surface code based on a boundary, wherein the quantum circuit encoded by the surface code based on the boundary includes the sorted multiple CNOT gate operations and the multiple H gate operations;

[0098] The multiple CNOT gate operations and the multiple H gate operations are sorted based on the operation parameters of each CNOT gate operation and the multiple H gate operations to obtain a quantum circuit encoded by a boundary-based surface code, including:

[0099] For each CNOT gate operation and any gate operation among the H gate operations, calculate the subsequent execution depth of the gate operation;

[0100] In the case where the multiple subsequent execution depths of the multiple gate operations are different, determining a priority of each gate operation according to the multiple subsequent execution depths;

[0101] In the case where there are multiple intermediate gate operations with the same subsequent execution depth among the multiple gate operations, for each intermediate gate operation, determining the priority of the intermediate gate operation according to the number of subsequent operations of the intermediate gate operation, wherein the operation parameters include the subsequent execution depth and the number of subsequent operations;

[0102] Based on multiple priorities, a boundary-based surface code-encoded quantum circuit is generated according to multiple gate operations and / or intermediate gate operations.

[0103] According to an embodiment of the present disclosure, the currently executable CNOT gate operation is found according to the data dependency relationship; the priority of the currently executable operation is calculated, and the minimum depth of the subsequent operations of the operation is first compared. The deeper the depth, the higher the priority. When the depth is the same, the number of operations of the subsequent operations is compared. The larger the number, the higher the priority.

[0104] According to an embodiment of the present disclosure, based on the above-mentioned priority, a specific execution matrix is ​​assigned to each operation in sequence. If the operation is a CNOT gate operation, the shortest path is found for the two matrixes on the current chip. If there is no path between the two matrixes on the current chip, the operation is delayed to the next cycle for execution; if the operation is an H gate operation, a random one of the execution schemes that the current chip can provide is selected. If no execution scheme exists for the current chip, the operation is delayed to the next cycle for execution.

[0105] According to the embodiments of the present disclosure, referring to Figure 7 In the specific example shown, the orange operation nodes in the figure (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 a corresponding boundary-based surface code-encoded quantum circuit.

[0106] According to an embodiment of the present disclosure, based on the line parameters and / or chip parameters of the initial quantum circuit, multiple gate operations in the target mapping data are optimized in time sequence position path to obtain a quantum circuit encoded by a boundary-based surface code, and further comprising:

[0107] In the case where there is an executable H gate operation among the multiple gate operations, determining a square matrix occupied by the H gate operation in the chip to be processed, wherein the chip parameter characterizes the occupied square matrix;

[0108] The weight of the matrix is ​​adjusted to obtain an adjusted chip to be processed;

[0109] A quantum circuit encoded with a boundary-based surface code is generated according to the adjusted chip to be processed and the initial quantum circuit.

[0110] According to an embodiment of the present disclosure, if there is an H-gate operation that can be performed currently, the surrounding square matrices that need to be occupied to perform the H-gate operation are found, and their weights are increased to reduce the possibility of being used by operations with higher priority.

[0111] According to an embodiment of the present disclosure, based on the line parameters and / or chip parameters of the initial quantum circuit, multiple gate operations in the target mapping data are optimized in time sequence position path to obtain a quantum circuit encoded by a boundary-based surface code, and further comprising:

[0112] When the initial quantum circuit includes executable T-gate operations, the virtual wonderful state factory and the virtual T-gate matrix are used to connect the currently available wonderful state factory on the chip and the matrix that currently needs to perform the T-gate operation to obtain initial connection information;

[0113] The maximum flow algorithm is used to process the initial connection information to obtain a quantum circuit encoded with a boundary-based surface code, which is an execution circuit for multiple T-gate operations. This step is repeated until all operations in the quantum circuit have determined specific operation plans.

[0114] According to the embodiments of the present disclosure, since all the wonderful state factories are consistent, there is no need for a specific wonderful state factory to execute a specific matrix of T-gates. A virtual wonderful state factory can be set to connect all currently available wonderful state factories, and then a virtual T-gate matrix can be set to connect all currently executable T-gate matrices to obtain initial connection information. Through the maximum flow algorithm, the most executable T-gate path can be found, thereby generating a boundary-based surface code-encoded quantum circuit for execution.

[0115] According to the embodiments of the present disclosure, after the quantum circuit encoded by the boundary-based surface code is obtained, the currently executable operation can be executed in order of priority. If it is an H gate, it is determined whether there are executable auxiliary matrices around it. If it is a CNOT gate, the currently executable shortest path is found. If it cannot be executed, wait for the next cycle; the above steps are repeated until all gate operations are completed.

[0116] According to an embodiment of the present disclosure, the quantum circuit conversion method further includes:

[0117] When the surface code type is a defect-based surface code, based on the preset optimization rules, multiple gate operations in the target mapping data are optimized in time sequence position path to obtain a quantum circuit encoded by the defect-based surface code.

[0118] According to an embodiment of the present disclosure, based on a preset optimization rule, a plurality of gate operations in the target mapping data are subjected to timing position path optimization processing to obtain a quantum circuit encoded by a defect-based surface code, including:

[0119] When the defect types of the two logic bits in the initial quantum circuit are the same, the modification cost of each logic bit is calculated;

[0120] If the modification cost is less than the preset value, the defect type of the logic bit corresponding to the minimum modification cost is modified to obtain the modified target mapping data; if the modification cost is not less than the preset value, the defect type of the matrix is ​​not modified.

[0121] Based on preset optimization rules, multiple gate operations in the modified target mapping data are subjected to sequential position path optimization processing to obtain a quantum circuit encoded by a defect-based surface code, wherein the preset optimization rules utilize the same position path optimization method as the boundary-based surface code.

[0122] According to an embodiment of the present disclosure, when the surface code type is a defect-based surface code (Double defect model) and the defect types of two logic bits in the initial quantum circuit are the same, the modification cost M-value of each logic bit is calculated by formula (2).

[0123] (2)

[0124] Among them, 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 weight parameter designed according to the current congestion level.

[0125] According to an embodiment of the present disclosure, the preset value may be specifically set according to actual conditions, for example, it may be 0.

[0126] When the defect types of two logic bits in the initial quantum circuit are different, multiple gate operations in the target mapping data are optimized in time sequence and position based on preset optimization rules to obtain a quantum circuit encoded with a defect-based surface code.

[0127] Figure 8 A schematic diagram of the CNOT gate execution result of the quantum circuit according to an embodiment of the present disclosure is shown in depth.

[0128] In a specific embodiment, the present disclosure selects a variety of quantum circuits of different scales, different circuit parallelism, and practical application significance for testing, a total of 22 circuits, as follows: Figure 8 As shown in the figure, three sizes of chips to be processed are selected, namely: the smallest executable chip, the smallest executable chip with four times the resources, and the chip with sufficient line resources.

[0129] Taking the compilation of a circuit on a lattice surgery model and a minimum executable chip as an example, the entire process is described in detail below.

[0130] Step 1: Determine the mapping of logical bits to square matrices. Here, the metis algorithm is called multiple times to divide the logical bits and square matrices into two, and a group of logical bits is randomly mapped to a group of square matrices. This process is repeated until there is only one logical bit in the group. This step is repeated multiple times, and the mapping with the lowest cost is selected from the multiple mapping results.

[0131] Step 2: Find all currently executable operations and calculate the priority of each operation. First, pre-optimize the chip map weight for the execution of the H gate, and execute the H gate and CNOT gate operations according to the priority. If the operation cannot be executed in this round, wait for the next round of execution. Finally, set the virtual node to uniformly execute the currently executable T gate. If an operation cannot be executed in this round, wait for the next round of execution. Repeat until all operations are executed.

[0132] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A quantum circuit conversion method for surface code error correction, characterized in that: The method comprises: Obtain initial quantum circuits and chips to be processed; Based on the chip parameters and surface code type of the chip to be processed, performing initial mapping processing on the initial quantum circuit and the chip to be processed to obtain target mapping data; In the case where the surface code type is a boundary-based surface code, a plurality of gate operations in the target mapping data are subjected to timing position path optimization processing based on the line parameters of the initial quantum circuit and / or the chip parameters to obtain a quantum circuit encoded by the boundary-based surface code.

2. The method according to claim 1, characterized in that Based on the line parameters of the initial quantum circuit and / or the chip parameters, a plurality of gate operations in the target mapping data are subjected to timing position path optimization processing to obtain a quantum circuit encoded by a boundary-based surface code, including: In the case where the initial quantum circuit includes a plurality of Pauli gate operations, logic optimization processing is performed on the plurality of Pauli gate operations in terms of timing and position based on an equivalent relationship between basic operations of the initial quantum circuit to obtain the boundary-based surface code encoded quantum circuit, wherein the Pauli gate operation includes an X-gate operation, a Y-gate operation or a Z-gate operation, and the equivalent relationship between the basic operations includes a commutation relationship.

3. The method according to claim 2, characterized in that Based on the circuit parameters of the initial quantum circuit and / or the chip parameters, a logic circuit optimization process is performed on the multiple gate operations in the target mapping data in terms of timing positions to obtain a quantum circuit encoded by a boundary-based surface code, further comprising: According to the data dependency of the initial quantum circuit, determining a plurality of CNOT gate operations and a plurality of H gate operations without preceding order operations to be performed from a plurality of gate operations in the initial quantum circuit; Sorting the plurality of CNOT gate operations and the plurality of H gate operations based on the operation parameters of each of the CNOT gate operations and the plurality of H gate operations to obtain the boundary-based surface code-encoded quantum circuit, wherein the boundary-based surface code-encoded quantum circuit includes the sorted plurality of CNOT gate operations and the plurality of H gate operations; The step of sorting the multiple CNOT gate operations and the multiple H gate operations based on the operation parameters of each of the CNOT gate operations and the multiple H gate operations to obtain the boundary-based surface code-encoded quantum circuit comprises: For each of the CNOT gate operations and the H gate operations, calculating a subsequent execution depth of the gate operation; In the case where the multiple subsequent execution depths of the multiple gate operations are different, determining the priority of each gate operation according to the multiple subsequent execution depths; In the case that there are multiple intermediate gate operations with the same subsequent execution depth among the multiple gate operations, for each of the intermediate gate operations, determining the priority of the intermediate gate operation according to the number of subsequent operations of the intermediate gate operation, wherein the operation parameters include the subsequent execution depth and the number of subsequent operations; Based on the plurality of priorities, the boundary-based surface code-encoded quantum circuit is generated according to the plurality of gate operations and / or intermediate gate operations.

4. The method according to claim 3, characterized in that The method further comprises: In the case that there is an executable H gate operation among the plurality of gate operations, determining a square matrix occupied by the H gate operation in the chip to be processed, wherein the chip parameter characterizes the occupied square matrix; Adjusting the weight of the matrix to obtain an adjusted chip to be processed; The boundary-based surface code-encoded quantum circuit is generated according to the adjusted chip to be processed and the initial quantum circuit.

5. The method according to claim 2, characterized in that: The method further comprises: When the initial quantum circuit includes an executable T-gate operation, the virtual wonderful state factory and the virtual T-gate matrix are used to connect all the wonderful state factories that have currently generated wonderful states and the matrix that is currently to execute the T-gate to obtain initial connection information; The initial connection information is processed using a maximum flow algorithm to obtain the boundary-based surface code-encoded quantum circuit.

6. The method according to claim 1, characterized in that The initial quantum circuit includes a plurality of logical bits, each of which includes a bit matrix composed of a plurality of physical bits; Wherein, based on the chip parameters and surface code type of the chip to be processed, the initial mapping process is performed on the initial quantum circuit and the chip to be processed to obtain target mapping data, including: According to the number of the initial quantum circuits, a target square matrix queue of the initial quantum circuit is determined based on the perimeter of the initial square matrix queue, wherein the initial square matrix queue is a queue formed by initial square matrices that meet the number of logical bits, and the chip parameters include the initial square matrix queue; Based on the METIS graph partitioning method, each of the logic bits is mapped onto multiple target matrices of the target matrix queue to obtain multiple mapping matrices, and the mapping matrix with the minimum cost is selected through a cost function; Based on the execution frequency of the target gate operation in the initial quantum circuit, adjusting the channel bandwidth of the chip to be processed including the mapping matrix to obtain a target bandwidth; In the case where the surface code type is a boundary-based surface code, the target mapping data is generated according to the mapping matrix and the target bandwidth.

7. The method according to claim 6, characterized in that The method further comprises: In the case where the surface code type is a defect-based surface code, a defect type is selected for each of the initial square matrices using a bipartite graph method to obtain defect allocation information; The target mapping data is generated according to the mapping matrix, the target bandwidth and the defect allocation information.

8. The method according to claim 7, characterized in that The method further comprises: In the case where the surface code type is a defect-based surface code, a plurality of gate operations in the target mapping data are subjected to timing position path optimization processing based on preset optimization rules to obtain a quantum circuit encoded by the defect-based surface code.

9. The method according to claim 8, characterized in that Based on preset optimization rules, multiple gate operations in the target mapping data are optimized in time sequence and position to obtain a quantum circuit encoded by a defect-based surface code, including: When the defect types of two logic bits in the initial quantum circuit are the same, calculating the modification cost of each of the logic bits; In the case where both modification costs are less than a preset value, the defect type of the logic bit corresponding to the minimum modification cost is modified to obtain modified target mapping data; Based on the preset optimization rule, a plurality of gate operations in the modified target mapping data are subjected to timing position path optimization processing to obtain the defect-based surface code-encoded quantum circuit.

10. The method according to claim 9, characterized in that The method further comprises: In the case that only one modification cost is smaller than the preset value, modifying the defect type of the logic bit corresponding to the modification cost smaller than the preset value to obtain modified target mapping data; and / or In the case where the defect types of the two logic bits in the initial quantum circuit are different, a plurality of gate operations in the target mapping data are optimized in time sequence position path based on the preset optimization rule to obtain the defect-based surface code encoded quantum circuit.