Quantum bit mapping method, device, chip, electronic device, storage medium and computer program product

The quantum bit mapping method addresses the suboptimal results of existing algorithms by using error rates and usage weights to refine mapping data through genetic algorithms, resulting in higher-quality and more accurate quantum bit mappings on quantum chips.

CN119918685BActive Publication Date: 2025-07-15SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510412523.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-07-15
Estimated Expiration
2045-04-03

AI Technical Summary

Technical Problem

Existing qubit mapping algorithms such as SABRE algorithms have low quality and effectiveness in the final mapping data due to random initialization, especially in large quantum chip topology.

Method used

By generating mapped data sets, using the inverse relationship of error rate and use weights, combining cross-operations and mutated operations in the genetic algorithm, a multi-generation mapped data set is generated, and finally the mapping data with the highest fitness is selected as the target mapped data.

Benefits of technology

It significantly improves the data quality and effect of qubit mapping, reduces the comprehensive error rate, and improves the accuracy and efficiency of mapped data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119918685B_ABST
    Figure CN119918685B_ABST
Patent Text Reader

Abstract

The present application provides a qubit mapping method, apparatus, chip, electronic device, storage medium and computer program product, which relate to the fields of data processing and quantum computing. The method includes: obtaining at least three first nodes, at least two first edges, the error rate of the first edges of a quantum chip, at least three second nodes, at least two second edges, and the usage weights of the second edges of a quantum circuit; generating a mapping data set; determining the fitness of the mapping data based on the error rate and the usage weights, where the fitness is inversely proportional to the error rate; repeatedly performing crossover operations and mutation operations on the mapping data set to generate a new mapping data set, and determining the fitness of the new mapping data based on the error rate and the usage weights until a target condition is met; and determining the mapping data with the highest fitness among all mapping data sets as the target mapping data. It is possible to determine the mapping data with the lowest comprehensive error rate, significantly improving the quality and effect of the mapping data obtained through qubit mapping.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of data processing and quantum computing, and in particular, to a quantum bit mapping method, apparatus, chip, electronic device, storage medium, and computer program product. Background Art

[0002] Quantum computing is a new computing technology that is expected to outperform classical computing technology in solving some complex problems. For example, the Shor algorithm can be used to solve the large number factorization problem, and the variational quantum algorithm is used to solve combinatorial optimization problems in drug research and development and the financial field. However, since quantum chips generally have a fixed topological structure and a specific set of logic gates, the execution of these logical quantum algorithms is restricted. For example, if the quantum bits on which a two-bit gate in a logical quantum circuit acts do not have a connection structure on the quantum chip, the two-bit gate cannot be directly implemented on the quantum chip. The algorithms for solving this problem are generally called quantum compilation algorithms, and the quantum compilation algorithms are used to convert a logical quantum circuit into an equivalent quantum circuit that can be executed on hardware. The present application relates to the problem of bit mapping in quantum compilation algorithms, that is, to establish a reasonable mapping between logical quantum bits and physical bits and insert as few SWAP gates (a two-qubit quantum logic gate) as possible to convert the logical quantum circuit into a quantum circuit that conforms to the coupling structure of the quantum chip.

[0003] Currently, the SABRE algorithm (a bit mapping algorithm) is widely used in the existing technologies for the bit mapping problem. The steps of the SABRE algorithm are to randomly initialize the bit mapping, then continuously insert SWAP gates through a heuristic search algorithm to update the mapping, use a reverse search process to update the initial mapping, and continuously repeat the above process multiple times to obtain the final bit mapping and the inserted SWAP path. Although the process of the SABRE algorithm can use the reverse search to obtain the initial mapping, the quality of the initial mapping itself has a great influence on the heuristic path search process. Therefore, the random initialization of the bit mapping in SABRE also has a great influence on the final optimization result, resulting in low quality and effect of the final obtained mapping data, especially when involving the topological structure of large quantum chips. Summary of the Invention

[0004] The present application provides a quantum bit mapping method, apparatus, chip, electronic device, storage medium, and computer program product.

[0005] On the one hand, an embodiment of the present application provides a quantum bit mapping method, the method including:

[0006] Obtain at least three first nodes, at least two first edges, the error rate of the first edges of a quantum chip, and at least three second nodes, at least two second edges, and the usage weights of the second edges of a quantum circuit;

[0007] Generate a mapping data set, where the mapping data set includes a plurality of mapping data, and the mapping data characterizes the mapping relationship between the first node and the second node;

[0008] Determine the fitness of the mapping data based on the error rate and the usage weight, where the fitness is inversely proportional to the error rate;

[0009] Repeat the crossover operation and mutation operation on the mapping data set to generate a new mapping data set, and determine the fitness of the new mapping data based on the error rate and the usage weight until the target condition is met. The target condition at least includes that the number of generations reaches a preset number;

[0010] Determine the mapping data with the highest fitness in all mapping data sets as the target mapping data.

[0011] Among them, the determining the fitness of the mapping data based on the error rate and the usage weight includes:

[0012] Traverse the at least two second edges;

[0013] Based on the mapping data, determine the shortest path of the current second edge mapped in the quantum chip;

[0014] Based on the error rate, determine the error rate of the shortest path;

[0015] Based on the usage weight of the current second edge and the error rate of the shortest path, determine the sub-fitness of the current second edge;

[0016] After the traversal is completed, obtain the sub-fitness of each second edge, and determine the sum of the sub-fitness of all second edges as the fitness of the mapping data.

[0017] Among them, the determining the shortest path of the current second edge mapped in the quantum chip based on the mapping data includes:

[0018] Determine the two second nodes of the current second edge;

[0019] Based on the mapping data, determine the two first nodes corresponding to the two second nodes;

[0020] Use a path search algorithm to determine the shortest path between the two first nodes.

[0021] Among them, the determining the error rate of the shortest path based on the error rate includes:

[0022] Based on the shortest path, determine at least one first edge;

[0023] Based on the error rate of the first edge and the corresponding correction factor, determine the corrected error rate of the first edge;

[0024] Determine the negative of the sum of the corrected error rates of the at least one first edge as the error rate of the shortest path.

[0025] Among them, determining the error rate of the shortest path based on the error rate includes:

[0026] Determine at least one first edge based on the shortest path;

[0027] Determine the corrected error rate of the first edge based on the reciprocal of the error rate of the first edge and the corresponding correction factor;

[0028] Determine the sum of the corrected error rates of the at least one first edge as the error rate of the shortest path.

[0029] Among them, determining the sub-fitness of the current second edge based on the usage weight of the current second edge and the error rate of the shortest path includes:

[0030] Determine the sub-fitness of the current second edge based on the reciprocal of the usage weight of the current second edge and the error rate of the shortest path.

[0031] Among them, repeatedly performing crossover operations and mutation operations on the mapping data set to generate a new mapping data set includes:

[0032] Repeatedly select the mapping data to be processed from the mapping data set, perform crossover operations and mutation operations on the mapping data to be processed to obtain new mapping data, and determine the fitness of the new mapping data based on the error rate and the usage weight until the number of the new mapping data reaches a preset number to obtain a new mapping data set.

[0033] Among them, performing a crossover operation on the mapping data to be processed includes:

[0034] Select crossover mapping data from the mapping data set;

[0035] Determine at least one second node in the mapping data to be processed as a crossover node, and determine the same number of second nodes in the crossover mapping data as replacement nodes;

[0036] Replace the first node corresponding to the crossover node with the first node corresponding to the replacement node, and the first node corresponding to the replacement node is different from all other first nodes in the mapping data to be processed.

[0037] Among them, performing a mutation operation on the mapping data to be processed includes:

[0038] Judge whether to perform a mutation operation on the mapping data to be processed based on a preset probability;

[0039] If so, determine at least one second node in the to-be-processed mapping data as a mutated node;

[0040] Replace the first node corresponding to the mutated node with the first node in the quantum chip, where the first node in the quantum chip is different from other first nodes in the to-be-processed mapping data.

[0041] Among them, the selection of the to-be-processed mapping data from the mapping data set includes:

[0042] Determine the individual probability based on the fitness of the mapping data;

[0043] Traverse the mapping data in the mapping data set;

[0044] Judge whether to select the current mapping data based on the selection probability of the current mapping data, where the selection probability is the sum of the individual probability of the current mapping data and the individual probabilities of the mapping data that have been traversed;

[0045] If so, determine the current mapping data as the to-be-processed mapping data.

[0046] Another aspect of the embodiments of the present application provides a quantum bit mapping device, and the device includes:

[0047] An acquisition module, configured to obtain at least three first nodes, at least two first edges, the error rate of the first edges of a quantum chip, at least three second nodes, at least two second edges, and the usage weights of the second edges of a quantum circuit;

[0048] A processing module, configured to generate a mapping data set, where the mapping data set includes a plurality of mapping data, and the mapping data represents the mapping relationship between the first nodes and the second nodes;

[0049] A calculation module, configured to determine the fitness of the mapping data based on the error rate and the usage weights, where the fitness is inversely proportional to the error rate; repeatedly perform crossover operations and mutation operations on the mapping data set to generate a new mapping data set, and determine the fitness of the new mapping data based on the error rate and the usage weights until a target condition is met, where the target condition at least includes that the number of generations reaches a preset number; and determine the mapping data with the highest fitness in all mapping data sets as the target mapping data.

[0050] Another aspect of the embodiments of the present application provides a chip, and the chip includes a processor that can execute the quantum bit mapping method.

[0051] Another aspect of the embodiments of the present application provides an electronic device, which includes a chip, and the chip includes a processor that can execute the qubit mapping method.

[0052] Another aspect of the embodiments of the present application provides a computer-readable storage medium storing a computer program for executing the qubit mapping method described above.

[0053] Another aspect of the embodiments of the present application provides a computer program product including a computer program or instruction, which, when executed by a processor, implements the qubit mapping method provided by the embodiments of the present application.

[0054] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become easily understood through the following description.

[0055] In the above solution, by making the fitness of the mapping data inversely proportional to the error rate of the first edge and the weight of the second edge, and then using the crossover operation and mutation operation in the genetic algorithm to generate multiple generations of mapping data sets, and determining the mapping data with the highest fitness in all mapping data sets as the target mapping data, so as to find the mapping data with the highest fitness, that is, the lowest comprehensive error rate, significantly improving the quality and effect of the mapping data obtained by bit mapping. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] By referring to the accompanying drawings and reading the following detailed description, the above and other purposes, features, and advantages of the exemplary embodiments of the present application will become easily understood. In the drawings, several embodiments of the present application are shown in an exemplary rather than restrictive manner, where:

[0057] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.

[0058] Figure 1 shows a flowchart of a qubit mapping method according to an embodiment of the present application;

[0059] Figure 2A shows a schematic structural diagram of a quantum circuit according to an embodiment of the present application;

[0060] Figure 2B shows a topological diagram of a quantum circuit according to an embodiment of the present application;

[0061] Figure 3 shows a flowchart of a qubit mapping method according to another embodiment of the present application;

[0062] Figure 4Shows a flowchart of a qubit mapping method according to another embodiment of the present application;

[0063] Figure 5 Shows a flowchart of a qubit mapping method according to another embodiment of the present application;

[0064] Figure 6 Shows a topological diagram of a quantum chip according to an embodiment of the present application;

[0065] Figure 7 Shows a flowchart of a qubit mapping method according to another embodiment of the present application;

[0066] Figure 8 Shows a flowchart of a qubit mapping method according to another embodiment of the present application;

[0067] Figure 9 Shows a flowchart of a qubit mapping method according to another embodiment of the present application;

[0068] Figure 10 Shows a flowchart of a qubit mapping method according to another embodiment of the present application;

[0069] Figure 11 Shows a schematic structural diagram of a qubit mapping device according to an embodiment of the present application;

[0070] Figure 12 Shows a schematic composition structure diagram of an electronic device according to an embodiment of the present application. Detailed implementation manners

[0071] To make the objectives, features, and advantages of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.

[0072] To improve the quality and effect of the mapped data obtained by bit mapping, an embodiment of the present application provides a qubit mapping method, as Figure 1 shown, the method includes:

[0073] Step 101, obtain at least three first nodes of a quantum chip, at least two first edges, the error rate of the first edges, and at least three second nodes of a quantum circuit, at least two second edges, and the usage weights of the second edges.

[0074] In this embodiment, at least three first nodes and at least two first edges of the quantum chip can be obtained by converting the structure of the quantum chip into a corresponding topological graph.

[0075] For example, the qubits of the quantum chip are determined as the nodes of the topological graph, and the coupling relationship between the qubits in the quantum chip is determined as the edges of the topological graph to generate a corresponding topological graph.

[0076] The quantum chip is tested to determine the error rate of the coupling relationship between the qubits in the quantum chip, which is the error rate of the corresponding edge after the coupling relationship is converted into the edge of the topological graph.

[0077] In this embodiment, at least three second nodes, at least two second edges and the usage weight of each edge of the quantum circuit can be obtained by converting the structure of the quantum circuit into a corresponding topological graph.

[0078] For example, as Figure 2A shown, Figure 2A is the structure of the quantum circuit, Figure 2A the horizontal lines in Figure 2B are the qubits of the quantum circuit, which are qubit 1, 2, 3, 4 and 5 respectively, and the vertical lines connecting two qubits are the two-qubit gates between these two qubits. As Figure 2B shown, Figure 2A is the topological graph obtained after the structure conversion of the quantum circuit in

[0079] The qubits of the quantum circuit are converted into the nodes of the topological graph to obtain the corresponding nodes 1, 2, 3, 4 and 5. The two-qubit gates between the qubits in the quantum circuit are determined as the edges of the topological graph, and the number of two-qubit gates between the same qubit pairs is determined as the usage weight of the corresponding edge to generate a corresponding topological graph.

[0080] Step 102, generate a mapping data set, where the mapping data set includes a plurality of mapping data, and the mapping data represents the mapping relationship between the first node and the second node.

[0081] Generate a plurality of initialized mapping data to obtain a mapping data set. The mapping data contains the mapping relationship between the qubits in the quantum circuit and the qubits in the quantum chip, that is, the mapping relationship between the first node and the second node.

[0082] For example, the first node set is , indicating that the first node set includes There are a total of four first nodes. The second node set is , indicating that the second node set includes a total of four second nodes. The mapping relationships included in a certain mapping data are , indicating the mapping data in which the included mapping relationships are has a mapping relationship with , has a mapping relationship with , has a mapping relationship with , has a mapping relationship with . The number of first nodes is the same as that of second nodes, so it is a one-to-one mapping relationship.

[0083] For another example, the first node set is , indicating the first node set in which includes a total of five first nodes. The second node set is , indicating the second node set in which includes a total of three second nodes. The mapping relationships included in a certain mapping data are , indicating the mapping data in which the included mapping relationships are has a mapping relationship with , has a mapping relationship with , has a mapping relationship with . The number of first nodes is greater than that of second nodes. Therefore, each second node has a corresponding mapping relationship, and there are first nodes without corresponding mapping relationships.

[0084] Step 103: Determine the fitness of the mapping data based on the error rate and the usage weight, where the fitness is inversely proportional to the error rate.

[0085] In this embodiment, the error rate and the usage weight can be multiplied, and then the reciprocal or opposite number of the product can be used as the fitness of the mapping data, so that the fitness is inversely proportional to the error rate and the usage weight. In other embodiments, other calculation methods can also be used to make the fitness inversely proportional to the error rate and the usage weight.

[0086] Step 104: Repeatedly perform crossover operations and mutation operations on the mapping data set to generate a new mapping data set, and determine the fitness of the new mapping data based on the error rate and the usage weight until the target conditions are met. The target conditions at least include that the number of generations reaches a preset number.

[0087] The mapping data in the mapping dataset is repeatedly subjected to crossover operations and mutation operations using a genetic algorithm to generate a new mapping dataset, and the fitness of the mapping data in the new mapping dataset is re-determined.

[0088] It should be noted that when repeatedly generating a new mapping dataset, it is necessary to repeatedly perform crossover operations and mutation operations on the mapping data in the previously generated mapping dataset to generate a new mapping dataset. For example, an initial mapping dataset A is generated. By repeatedly performing crossover operations and mutation operations on the mapping data in mapping dataset A, a new mapping dataset B is generated. Then, by repeatedly performing crossover operations and mutation operations on the mapping data in mapping dataset B, a new mapping dataset C is generated. And so on for subsequent generations.

[0089] After the target condition is met, generating new mapping datasets is stopped.

[0090] In this embodiment, the target condition at least includes that the number of generations reaches a preset number, and the preset number can be set to 100 - 1000, and can be specifically set based on requirements. In other embodiments, the target condition can also include result convergence. Result convergence means that the fitness of the mapping data in the newly generated mapping dataset cannot continue to increase compared to the fitness of the mapping data in the previously generated mapping dataset.

[0091] Step 105, determine the mapping data with the highest fitness in all mapping datasets as the target mapping data.

[0092] After the target condition is met, determine the mapping data with the highest fitness in all mapping datasets as the target mapping data, that is, the mapping relationship applied to the quantum chip and the quantum circuit.

[0093] Since in a quantum chip, the error rate of the coupling relationship between qubits specifically refers to the probability that the calculation result deviates from the expected value due to physical system interference or insufficient control accuracy when two or more qubits perform collaborative operations (such as two-qubit gates). The error rate directly reflects the degree of distortion of the quantum state during the interaction process. Therefore, in order to improve the quality and effect of the mapping data obtained by qubit mapping, we need to find the mapping data with the lowest comprehensive error rate. Therefore, in the above solution, by making the fitness of the mapping data inversely proportional to the error rate of the first edge and the weight of the second edge, and then using the crossover operation and mutation operation in the genetic algorithm to generate multiple generations of mapping datasets, and determining the mapping data with the highest fitness in all mapping datasets as the target mapping data, thereby finding the mapping data with the highest fitness, that is, the lowest comprehensive error rate, significantly improving the quality and effect of the mapping data obtained by qubit mapping.

[0094] In an example of the present application, a qubit mapping method is further provided, as Figure 3 shown, determining the fitness of the mapping data based on the error rate and the usage weight includes:

[0095] Step 201, traverse the at least two second edges.

[0096] Traverse all the edges of the quantum circuit, that is, all the second edges.

[0097] Step 202, determine the shortest path of the current second edge mapped in the quantum chip based on the mapping data.

[0098] For example, the first node set is , indicating that the first node set includes a total of four first nodes. The second node set is , indicating that the second node set includes a total of four second nodes. The mapping relationships included in the mapping data are , indicating that the mapping relationships included in the mapping data are and have a mapping relationship, and have a mapping relationship, and have a mapping relationship, and have a mapping relationship. The two second nodes of the current second edge are and , then the first nodes of these two second nodes mapped in the quantum chip are and , determine and the shortest path between them.

[0099] Step 203, determine the error rate of the shortest path based on the error rate.

[0100] The error rate of the shortest path is the sum of the error rates of all the first edges included in the shortest path.

[0101] Continuing with the above example, and the shortest path between them includes 3 first edges, and the error rates of these 3 first edges are 0.38%, 0.35% and 0.42% respectively. Therefore, and the error rate of the shortest path between them is 1.15%.

[0102] Step 204: Determine the sub - fitness of the current second edge based on the usage weight of the current second edge and the error rate of the shortest path.

[0103] Weight the error rate of the shortest path based on the usage weight of the current second edge to obtain the sub - fitness of the current second edge.

[0104] Step 205: After the traversal is completed, obtain the sub - fitness of each second edge, and determine the fitness of the mapping data as the sum of the sub - fitnesses of all second edges.

[0105] After the traversal of all second edges is completed, obtain the sub - fitness of each second edge, and sum up the sub - fitnesses of all second edges to obtain the fitness of the mapping data.

[0106] In the above solution, by traversing all second edges, then determining the shortest path of each second edge mapped in the quantum chip, and then determining the error rate of the shortest path, the sub - fitness of the second edge is determined based on the error rate of the shortest path and the usage weight of the second edge. Therefore, the sub - fitness of the second edge can characterize the error rate generated based on the usage frequency after the second edge is mapped to the quantum chip. Finally, the sum of the sub - fitnesses of all second edges is obtained as the fitness of the mapping data, so that the fitness of the mapping data can characterize the comprehensive error rate generated based on the usage frequency after the mapping data is applied to the quantum chip. The target mapping data screened based on this fitness has the minimum comprehensive error rate, significantly improving the quality and effect of the screened target mapping data.

[0107] In an example of the present application, a qubit mapping method is also provided. As Figure 4 shown, the method for determining the shortest path of the current second edge mapped in the quantum chip based on the mapping data includes:

[0108] Step 301: Determine two second nodes of the current second edge.

[0109] For example, the first node set is , indicating that the first node set includes a total of four first nodes. The second node set is , indicating that the second node set includes a total of four second nodes. The current second edge is the connection between the second nodes and , then the two second nodes of the current second edge are and .

[0110] Step 302: Based on the mapping data, determine two first nodes corresponding to the two second nodes.

[0111] Continuing with the above example, the mapping relationships included in the mapped data are , indicating the mapped data The mapping relationships included therein are and have a mapping relationship, and have a mapping relationship, and have a mapping relationship, and have a mapping relationship. Then the first nodes in the quantum chip to which these two second nodes are mapped are and .

[0112] Step 303, use a path search algorithm to determine the shortest path between the two first nodes.

[0113] In this embodiment, the path search algorithm can be the Dijkstra algorithm, the topological sorting algorithm, the A* algorithm (a heuristic algorithm), etc. In other embodiments, any other path search algorithm that can determine the shortest path between two nodes can also be used.

[0114] In the above solution, by determining the two first nodes in the quantum chip to which the two second nodes of the second edge are mapped based on the mapped data, and then using a path search algorithm to determine the shortest path of these two first nodes in the quantum chip structure, the fitness can be determined based on the shortest path subsequently, so as to screen out the target mapped data with better quality and effect.

[0115] In an example of the present application, a qubit mapping method is also provided. As Figure 5 shown, determining the error rate of the shortest path based on the error rate includes:

[0116] Step 401, determine at least one first edge based on the shortest path.

[0117] For example, as Figure 6 shown, Figure 6 is the topological graph of the quantum chip structure. If the shortest path is the shortest path between and , since and have a connection relationship, then this shortest path only includes this one first edge.

[0118] For another example, as Figure 6 shown, if the shortest path is and The shortest path between, since and have no connection relationship, therefore, this shortest path is as Figure 6 shown, including and these two first edges.

[0119] Step 402, determine the corrected error rate of the first edge based on the error rate of the first edge and the corresponding correction factor.

[0120] Correction factor can be determined based on the following formula:

[0121]

[0122] where is the th first edge.

[0123] For example, as Figure 6 shown, the shortest path between includes and these two first edges. The error rate of the first edge is 0.4%, and the error rate of the first edge is 0.5%. If the first edge is the first first edge, then the corresponding correction factor is 1. If the first edge is the second first edge, then the corresponding correction factor is 3. The corrected error rate of the first edge is 0.4%. The corrected error rate of the first edge is 1.5%.

[0124] Step 403, determine the negative of the sum of the corrected error rates of the at least one first edge as the error rate of the shortest path.

[0125] Continuing with the above example, the shortest path between includes and these two first edges. The corrected error rate of the first edge is 0.4%. The corrected error rate of the first edge is 1.5%. Then the error rate of the shortest path between and is 1.9%.

[0126] Specifically, the error rate of the shortest path can be determined based on the following formula :

[0127]

[0128] Among them, is the th first edge in the shortest path, is the correction factor corresponding to the th first edge in the shortest path.

[0129] Since the first first edge in the path usually does not require inserting a SWAP gate, while subsequent first edges require inserting a SWAP gate, and a SWAP gate needs three CNOT gates (a two-qubit quantum logic gate) to implement. Therefore, the error rate of subsequent first edges is three times that of the first first edge. Correction is needed. In the above solution, by determining at least one first edge included in the shortest path, and then correcting the error rate of the first edge based on the correction factor and the order of the first edges, the corrected error rate of each first edge is obtained. Finally, the corrected error rates of all first edges are summed to obtain the accurate error rate of the shortest path, and then a more accurate fitness can be determined based on the error rate of the shortest path, further improving the quality and effect of the target mapping data selected based on the fitness.

[0130] In an example of the present application, a qubit mapping method is also provided. As Figure 7 shown, determining the error rate of the shortest path based on the error rate includes:

[0131] Step 501: Determine at least one first edge based on the shortest path.

[0132] Similarly, determine at least one first edge included in the shortest path.

[0133] Step 502: Determine the corrected error rate of the first edge based on the reciprocal of the error rate of the first edge and the corresponding correction factor.

[0134] Similarly, the correction factor can be determined based on the following formula:

[0135]

[0136] Among them, is the th first edge.

[0137] For example, as Figure 6 shown, The shortest path between and and these two first edges. The error rate of the first edge is 0.4%, and the reciprocal of the error rate of the first edge is 250. The error rate of the first edge is 0.5%, and the first edge The reciprocal of the error rate is 200. The first side is the first first side, and the corresponding correction factor is 1. The first side is the second first side, and the corresponding correction factor is 3. The first side has a corrected error rate of 250. The first side has a corrected error rate of 600.

[0138] Step 503, determine the sum of the corrected error rates of the at least one first side as the error rate of the shortest path.

[0139] Continuing the above example, Between the shortest path includes and these two first sides. The first side has a corrected error rate of 250. The first side has a corrected error rate of 600. Then Between the error rate of the shortest path is 850.

[0140] Since the first first side in the path usually does not require inserting a SWAP gate, while the subsequent first sides require inserting a SWAP gate, and the SWAP gate needs three CNOT gates (a two-qubit quantum logic gate) to implement. Therefore, the error rate of the subsequent first sides is three times that of the first first side. Correction is needed. In the above solution, by determining at least one first side included in the shortest path, and then correcting the error rate of the first side based on the correction factor and the order of the first sides, the corrected error rate of each first side is obtained. Finally, the sum of the corrected error rates of all first sides is calculated to obtain the accurate error rate of the shortest path, and then the more accurate fitness can be determined based on the error rate of the shortest path, further improving the quality and effect of the target mapping data selected based on the fitness. And the corrected error rate of the first side is determined based on the reciprocal of the error rate of the first side. Therefore, the fitness is inversely proportional to the error rate, and the mapping data with the maximum fitness is determined as the target mapping data, that is, the mapping data with the lowest error rate.

[0141] In an example of the present application, a qubit mapping method is further provided. Determining the sub-fitness of the current second side based on the usage weight of the current second side and the error rate of the shortest path includes:

[0142] Determine the sub-fitness of the current second side based on the reciprocal of the usage weight of the current second side and the error rate of the shortest path.

[0143] If the corrected error rate of the first edge is determined based on the reciprocal of the error rate of the first edge, then when determining the sub-fitness of the current second edge, it is also necessary to determine the sub-fitness based on the reciprocal of the usage weight of the current second edge and the error rate of the shortest path.

[0144] In the above solution, when the corrected error rate of the first edge is determined based on the reciprocal of the error rate of the first edge, when determining the sub-fitness of the current second edge, it is also necessary to determine the sub-fitness based on the reciprocal of the usage weight of the current second edge and the error rate of the shortest path, so that the fitness is also inversely proportional to the usage weight of the second edge, and further enables the fitness to characterize the comprehensive error rate generated based on the usage frequency after the mapped data is applied to the quantum chip. The target mapped data selected based on this fitness has the minimum comprehensive error rate, significantly improving the quality and effect of the selected target mapped data.

[0145] In an example of the present application, a qubit mapping method is also provided. Repeatedly performing crossover operations and mutation operations on the mapping data set to generate a new mapping data set includes:

[0146] Repeatedly selecting the mapping data to be processed from the mapping data set, performing crossover operations and mutation operations on the mapping data to be processed to obtain new mapping data, and determining the fitness of the new mapping data based on the error rate and the usage weight until the number of the new mapping data reaches a preset number to obtain a new mapping data set.

[0147] In this embodiment, the mapping data to be processed can be selected from the mapping data set by means of roulette wheel selection method, tournament selection method or ranking selection method, etc. In other embodiments, the mapping data to be processed can also be selected from the mapping data set by other selection methods.

[0148] It should be noted that specific mapping data in the current mapping data set can also be retained in the new mapping data set by means of elitist retention strategy (retaining the mapping data with the optimal fitness in the current mapping data set to the new mapping data set to ensure that high-quality mapping data is not damaged by random operations), etc.

[0149] After selecting the mapping data to be processed, perform crossover operations and mutation operations on the mapping data to be processed to obtain new mapping data, re-determine the fitness of the new mapping data, and add the mapping data to the new mapping data set. Then re-select the mapping data to be processed for processing until the number of mapping data in the new mapping data set reaches the preset number.

[0150] In this embodiment, the preset number is set to be the same as the number of mapping data in the initial mapping data set. In other embodiments, the preset number can be set according to specific requirements.

[0151] In the above solution, the to-be-processed mapping data is selected from the mapping dataset by means of roulette wheel selection method, tournament selection method, sorting selection method, etc., and then the selected to-be-processed mapping data is subjected to crossover operation and mutation operation to generate new mapping data. Furthermore, a new mapping dataset is obtained, effectively avoiding the problem of local optimum. Further, the specific mapping data in the current mapping dataset can be retained in the new mapping dataset through the elite retention strategy, ensuring that high-quality mapping data is not destroyed by random operations, and can accelerate the convergence speed and improve the efficiency of bit mapping.

[0152] In an example of the present application, a quantum bit mapping method is further provided, as Figure 8 shown, the crossover operation on the to-be-processed mapping data includes:

[0153] Step 601, select crossover mapping data from the mapping dataset.

[0154] Similarly, in this embodiment, the to-be-processed mapping data can be selected from the mapping dataset by means of roulette wheel selection method, tournament selection method, sorting selection method, etc. In other embodiments, the to-be-processed mapping data can also be selected from the mapping dataset by other selection methods. It should be noted that the mapping dataset for selecting the crossover mapping data does not include the to-be-mapped dataset that has been selected.

[0155] Step 602, determine at least one second node in the to-be-processed mapping data as a crossover node, and determine the same number of second nodes in the crossover mapping data as replacement nodes.

[0156] In this embodiment, at least one second node can be randomly selected from the second nodes in the to-be-processed mapping data and determined as a crossover node. It can also be selected based on different requirements. In order to accelerate the convergence speed, at least one second node with higher sub-fitness can be selected for processing.

[0157] For example, the first node set is , indicating that the first node set includes a total of eight first nodes. The second node set is , indicating that the second node set includes a total of four second nodes. The second node and the second node are selected, and these two second nodes are determined as crossover nodes.

[0158] For another example, the first node set is , indicating that the first node set includes There are a total of eight first nodes. The second node set is , indicating that the second node set includes a total of four second nodes. The sub-fitness values of each second node in the mapping data to be processed are respectively . If two second nodes need to be selected for processing, then select the second node with a sub-fitness value of 1.5% and the second node with a sub-fitness value of , and determine these two second nodes as crossover nodes. It should be noted that the sub-fitness value of a second node can be the sum of the sub-fitness values of all the second edges that contain this second node.

[0159] Step 603: Replace the first node corresponding to the crossover node with the first node corresponding to the replacement node, and the first node corresponding to the replacement node is different from all other first nodes in the mapping data to be processed.

[0160] Continuing with the above example, determine the second node and the second node as crossover nodes. The mapping relationships included in the mapping data to be processed are , indicating that the mapping relationships included in the mapping data are has a mapping relationship with , has a mapping relationship with , has a mapping relationship with , has a mapping relationship with . The mapping relationships included in the crossover mapping data are , indicating that the mapping relationships included in the mapping data are has a mapping relationship with , has a mapping relationship with , has a mapping relationship with , has a mapping relationship with . Replace the first node corresponding to the crossover node with the first node corresponding to the replacement node. The mapping relationships included in the mapping data to be processed after replacement are .

[0161] It should be noted that each second node can only have one mapped first node, and the first nodes mapped by different second nodes are all different from each other. If, during the replacement process, it is found that the replaced first node is the same as other first nodes in the mapping data to be processed, then stop the replacement.

[0162] In the above solution, by selecting cross-mapping data from the mapping dataset, then selecting at least one second node from the mapping data to be processed as the cross node, and then replacing the first node corresponding to the cross node with the first node corresponding to the replacement node to complete the cross operation and generate new mapping data. Furthermore, the mapping data with the optimal fitness is selected from the large number of generated mapping data as the target mapping data, which improves the quality and effect of the selected target mapping data.

[0163] In an example of the present application, a qubit mapping method is also provided. As Figure 9 shown, the mutation operation on the mapping data to be processed includes:

[0164] Step 701, based on a preset probability, determine whether to perform a mutation operation on the mapping data to be processed.

[0165] After performing a cross operation on the data to be processed, it is necessary to determine whether to perform a mutation operation on the data to be processed based on a preset probability.

[0166] In this embodiment, the preset probability is usually set to 10%. In other embodiments, the preset probability can be set based on specific requirements.

[0167] The method for judging based on the preset probability can be determined by generating a random number within a numerical range. For example, the preset probability is 10%. Generate a random number from the range. If the random number is within the range, it is determined that a mutation operation needs to be performed on the mapping data to be processed. If the random number is within the range, it is determined that no mutation operation needs to be performed on the mapping data to be processed.

[0168] Step 702, if so, determine at least one second node in the mapping data to be processed as the mutation node.

[0169] If it is determined based on the preset probability that a mutation operation needs to be performed on the mapping data to be processed, then at least one second node in the mapping data to be processed is determined as the mutation node.

[0170] Similarly, in this embodiment, at least one second node can be randomly selected from the second nodes in the mapping data to be processed and determined as the mutation node. It can also be selected based on different requirements. To accelerate the convergence speed, at least one second node with a higher sub-fitness can be selected for processing.

[0171] For example, the first node set is , indicating that the first node set includes There are a total of eight first nodes. The second node set is , indicating that the second node set includes a total of four second nodes. The second node and the second node are selected, and these two second nodes are determined as mutant nodes.

[0172] For another example, the first node set is , indicating that the first node set includes a total of eight first nodes. The second node set is , indicating that the second node set includes a total of four second nodes. The sub-fitness of each second node in the mapping data to be processed is respectively . If two second nodes need to be selected for processing, then the second node with a sub-fitness of 2% and the second node with a sub-fitness of are selected, and these two second nodes are determined as mutant nodes. It should be noted that the sub-fitness of the second node can be the sum of the sub-fitnesses of all the second edges containing the second node.

[0173] Step 703: Replace the first node corresponding to the mutant node with the first node in the quantum chip, and the first node in the quantum chip is different from the other first nodes in the mapping data to be processed.

[0174] Randomly select the same number of first nodes in the quantum chip as the mutant nodes, and replace the first node corresponding to the mutant node with the first nodes selected from the quantum chip.

[0175] Continuing with the above example, the second node and the second node are determined as mutant nodes. The mapping relationships included in the mapping data to be processed are , indicating that the mapping relationships included in the mapping data are has a mapping relationship with , has a mapping relationship with , has a mapping relationship with , has a mapping relationship with . The first node and the first node are selected from the first nodes of the quantum chip., replace the first node corresponding to the mutated node with the first node selected from the first nodes of the quantum chip. The mapping relationship included in the to-be-processed mapping data after replacement is .

[0176] In the above solution, by determining whether to perform a mutation operation on the to-be-mapped data based on a preset probability, after determining that a mutation operation is required, at least one second node is selected from the to-be-processed mapping data as the mutated node, and then the same number of first nodes as the mutated nodes are selected from the first nodes of the quantum chip. Finally, replace the first node corresponding to the mutated node with the first node selected from the first nodes of the quantum chip to complete the mutation operation and generate new mapping data. Furthermore, select the mapping data with the optimal fitness from the large number of generated mapping data as the target mapping data, which improves the quality and effect of the selected target mapping data.

[0177] In an example of this application, a qubit mapping method is also provided, as Figure 10 shown. The selection of the to-be-processed mapping data from the mapping data set includes:

[0178] Step 801, determine the individual probability based on the fitness of the mapping data.

[0179] Specifically, the individual probability of the mapping data can be determined based on the fitness of the mapping data according to the following formula :

[0180]

[0181] where is the fitness of the mapping data, is the sum of the fitnesses of all mapping data in the mapping data set to which the mapping data belongs.

[0182] For example, if the fitness of a certain mapping data is 80% and the sum of the fitnesses of all mapping data in the mapping data set to which this mapping data belongs is 1000%, then the individual probability of this mapping data is 8%.

[0183] Step 802, traverse the mapping data in the mapping data set.

[0184] Step 803, determine whether to select the current mapping data based on the selection probability of the current mapping data. The selection probability is the sum of the individual probability of the current mapping data and the individual probabilities of the mapping data that has been traversed.

[0185] If the currently traversed mapping data is the first mapping data in the mapping data set, the selection probability of the current mapping data is its individual probability. If the currently traversed mapping data is not the first mapping data in the mapping data set, the selection probability of the current mapping data is the sum of the individual probabilities of the current mapping data and the mapping data that has been traversed.

[0186] For example, a certain mapping data set includes 8 mapping data, and the individual probabilities of these 8 mapping data are 8%, 8%, 15%, 20%, 10%, 12%, 18%, and 9% respectively. Start traversing. When traversing to the first mapping data, the selection probability of this mapping data is 8%. Based on this selection probability, if the selection probability is not hit, then traverse the next mapping data. When traversing to the second mapping data, the selection probability of this mapping data is 16%. Based on this selection probability, if the selection probability is not hit, then continue to traverse the next mapping data. When traversing to the third mapping data, the selection probability of this mapping data is 31%. Based on this selection probability, if the selection probability is hit, then determine the third mapping data as the mapping data to be processed and stop traversing.

[0187] Step 804, if so, determine the current mapping data as the mapping data to be processed.

[0188] In the above solution, by determining the individual probability of the mapping data based on the fitness of the mapping data, then traversing the mapping data in the mapping data set, and obtaining the selection probability by traversing and accumulating the individual probabilities of the mapping data. Only the individual probability and the random sampling of the probability interval need to be determined based on the fitness. Therefore, when processing a large-scale mapping data set, the processing efficiency is higher and the requirements for device performance are lower.

[0189] To implement the above quantum bit mapping method, as Figure 11 shown, an embodiment of the present application provides a quantum bit mapping device, including:

[0190] An acquisition module 10, configured to obtain at least three first nodes, at least two first edges, the error rate of the first edges of a quantum chip, and at least three second nodes, at least two second edges, and the usage weights of the second edges of a quantum circuit;

[0191] A processing module 20, configured to generate a mapping data set, where the mapping data set includes a plurality of mapping data, and the mapping data represents the mapping relationship between the first nodes and the second nodes;

[0192] A calculation module 30, configured to determine the fitness of the mapping data based on the error rate and the usage weight, where the fitness is inversely proportional to the error rate; repeatedly perform crossover operations and mutation operations on the mapping data set to generate a new mapping data set, and determine the fitness of the new mapping data based on the error rate and the usage weight until a target condition is met, where the target condition at least includes that the number of generations reaches a preset number; and determine the mapping data with the highest fitness in all mapping data sets as the target mapping data.

[0193] Wherein, the processing module 20 is further configured to traverse the at least two second edges;

[0194] The calculation module 30 is further configured to determine the shortest path of the current second edge mapped in the quantum chip based on the mapping data; determine the error rate of the shortest path based on the error rate; and determine the sub-fitness of the current second edge based on the usage weight of the current second edge and the error rate of the shortest path;

[0195] After the traversal is completed, the processing module 20 is further configured to obtain the sub-fitness of each second edge, and determine the fitness of the mapping data as the sum of the sub-fitnesses of all second edges.

[0196] Wherein, the processing module 20 is further configured to determine two second nodes of the current second edge;

[0197] The processing module 20 is further configured to determine two first nodes corresponding to the two second nodes based on the mapping data;

[0198] The calculation module 30 is further configured to determine the shortest path between the two first nodes by using a path search algorithm.

[0199] Wherein, the processing module 20 is further configured to determine at least one first edge based on the shortest path;

[0200] The calculation module 30 is further configured to determine the corrected error rate of the first edge based on the error rate of the first edge and the corresponding correction factor; and determine the error rate of the shortest path as the opposite of the sum of the corrected error rates of the at least one first edge.

[0201] Wherein, the processing module 20 is further configured to determine at least one first edge based on the shortest path;

[0202] The calculation module 30 is further configured to determine the corrected error rate of the first edge based on the reciprocal of the error rate of the first edge and the corresponding correction factor; and determine the error rate of the shortest path as the sum of the corrected error rates of the at least one first edge.

[0203] Among them, the calculation module 30 is further configured to determine the sub-fitness of the current second edge based on the reciprocal of the usage weight of the current second edge and the error rate of the shortest path.

[0204] Among them, the calculation module 30 is further configured to repeatedly select the mapping data to be processed from the mapping data set, perform crossover operation and mutation operation on the mapping data to be processed to obtain new mapping data, and determine the fitness of the new mapping data based on the error rate and the usage weight until the number of the new mapping data reaches a preset number, so as to obtain a new mapping data set.

[0205] Among them, the processing module 20 is further configured to select crossover mapping data from the mapping data set;

[0206] The calculation module 30 is further configured to determine at least one second node in the mapping data to be processed as a crossover node, and determine the same number of second nodes in the crossover mapping data as replacement nodes; and replace the first node corresponding to the crossover node with the first node corresponding to the replacement node, and the first node corresponding to the replacement node is different from other first nodes in the mapping data to be processed.

[0207] Among them, the calculation module 30 is further configured to determine whether to perform a mutation operation on the mapping data to be processed based on a preset probability; if so, determine at least one second node in the mapping data to be processed as a mutation node; and replace the first node corresponding to the mutation node with the first node in the quantum chip, and the first node in the quantum chip is different from other first nodes in the mapping data to be processed.

[0208] Among them, the calculation module 30 is further configured to determine an individual probability based on the fitness of the mapping data;

[0209] The processing module 20 is further configured to traverse the mapping data in the mapping data set;

[0210] The calculation module 30 is further configured to determine whether to select the current mapping data based on the selection probability of the current mapping data, where the selection probability is the sum of the individual probability of the current mapping data and the individual probabilities of the mapping data that has been traversed; and if so, determine the current mapping data as the mapping data to be processed.

[0211] An embodiment of the present application further provides a chip, where the chip includes a processor, and the processor can execute the quantum bit mapping method provided by the embodiment of the present application.

[0212] An embodiment of the present application further provides an electronic device.

[0213] Figure 12FIG. shows a schematic block diagram of an exemplary electronic device 900 that can be used to implement an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as, for example, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, for example, personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely exemplary and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0214] As Figure 12 shown, the electronic device 900 includes a computing unit 901 that can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0215] A plurality of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a magnetic disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0216] The computing unit 901 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 executes the various methods and processes described above, such as the qubit mapping method. For example, in some embodiments, the qubit mapping method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the qubit mapping method described above can be executed. Alternatively, in other embodiments, the computing unit 901 can be configured to execute the qubit mapping method in any other suitable manner (e.g., by means of firmware).

[0217] An embodiment of the present application provides a computer-readable storage medium storing executable instructions, in which a computer program is stored, and the computer program is used to execute the qubit mapping method provided by the embodiment of the present application.

[0218] An embodiment of the present application provides a computer program product, which includes a computer program or instruction, and the computer program or instruction is stored in a computer-readable storage medium. A processor of a computer device reads the computer program or instruction from the computer-readable storage medium, and the processor executes the computer program or instruction, so that the computer device executes the qubit mapping method described above in the embodiment of the present application.

[0219] In some embodiments, the computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; it can also be various devices including one or any combination of the above memories.

[0220] In some embodiments, the computer program can be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and can be deployed in any form, including being deployed as an independent program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0221] As an example, a computer program can be deployed to execute on one computing device, or on multiple computing devices located at one location, or alternatively, on multiple computing devices distributed across multiple locations and interconnected by a communication network.

[0222] Various embodiments of the systems and techniques described above in this disclosure can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), system on a chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from, and transmits data and instructions to, a storage system, at least one input device, and at least one output device.

[0223] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine, or entirely on a remote machine or server.

[0224] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0225] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).

[0226] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.

[0227] A computer system can include a client and a server. The client and the server are generally far from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, or a server of a distributed system, or a server incorporating a blockchain.

[0228] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and no limitation is imposed herein.

[0229] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" can explicitly or implicitly include at least one of the features. In the description of this disclosure, "a plurality of" means two or more unless otherwise specifically defined.

[0230] As described above, it is only the specific implementation manner of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present disclosure can easily think of changes or substitutions, which should all be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claimed rights.

Claims

1. A quantum bit mapping method, characterized in that, The method includes: obtaining at least three first nodes, at least two first edges, the error rate of the first edges, at least three second nodes of a quantum circuit, at least two second edges, and the usage weights of the second edges, where the error rate of the first edges is obtained by testing the quantum chip, the error rate of the first edges is the error rate of the coupling relationship between corresponding two qubits in the quantum chip, and the usage weight of the second edges is the number of two-qubit gates corresponding to the second edges in the quantum circuit; generating a mapping data set, where the mapping data set includes a plurality of mapping data, and the mapping data represents the mapping relationship between the first nodes and the second nodes; determining the fitness of the mapping data based on the error rate and the usage weight, where the fitness is inversely proportional to the error rate and the fitness is inversely proportional to the usage weight; repeatedly performing a crossover operation and a mutation operation on the mapping data set to generate a new mapping data set, and determining the fitness of the new mapping data based on the error rate and the usage weight until a target condition is met, where the target condition at least includes that the number of generations reaches a preset number; determining the mapping data with the highest fitness in all mapping data sets as the target mapping data; wherein, determining the fitness of the mapping data based on the error rate and the usage weight includes: traversing the at least two second edges; determining the shortest path in the quantum chip where the current second edge is mapped based on the mapping data, where the shortest path includes at least one first edge; determining the error rate of the shortest path based on the error rate of the at least one first edge included in the shortest path; determining the sub-fitness of the current second edge based on the usage weight of the current second edge and the error rate of the shortest path; after the traversal is completed, obtaining the sub-fitness of each second edge, and determining the sum of the sub-fitness of all second edges as the fitness of the mapping data.

2. The method according to claim 1, wherein Determining the shortest path in the quantum chip where the current second edge is mapped based on the mapping data includes: determining two second nodes of the current second edge; determining two first nodes corresponding to the two second nodes based on the mapping data; using a path search algorithm to determine the shortest path between the two first nodes.

3. The method according to claim 1, wherein Determining the error rate of the shortest path based on the error rate includes: determining at least one first edge based on the shortest path; determining the corrected error rate of the first edge based on the error rate of the first edge and the corresponding correction factor; determining the negative value of the sum of the corrected error rates of the at least one first edge as the error rate of the shortest path.

4. The method according to claim 1, characterized in that Determining the error rate of the shortest path based on the error rate includes: determining at least one first edge based on the shortest path; determining the corrected error rate of the first edge based on the reciprocal of the error rate of the first edge and the corresponding correction factor; determining the sum of the corrected error rates of the at least one first edge as the error rate of the shortest path.

5. The method according to claim 4, wherein Determining the sub-fitness of the current second edge based on the usage weight of the current second edge and the error rate of the shortest path includes: Determine the sub - fitness of the current second edge based on the reciprocal of the usage weight of the current second edge and the error rate of the shortest path.

6. The method according to claim 1, wherein The repeating the crossover operation and the mutation operation on the mapping data set to generate a new mapping data set includes: Repeatedly select the mapping data to be processed from the mapping data set, perform the crossover operation and the mutation operation on the mapping data to be processed to obtain new mapping data, and determine the fitness of the new mapping data based on the error rate and the usage weight until the number of the new mapping data reaches a preset number to obtain a new mapping data set.

7. The method according to claim 6, characterized in that, The performing the crossover operation on the mapping data to be processed includes: Select the crossover mapping data from the mapping data set; Determine at least one second node in the mapping data to be processed as the crossover node, and determine the same number of second nodes in the crossover mapping data as the replacement nodes; Replace the first node corresponding to the crossover node with the first node corresponding to the replacement node, and the first node corresponding to the replacement node is different from the other first nodes in the mapping data to be processed.

8. The method according to claim 7, wherein The performing the mutation operation on the mapping data to be processed includes: Judge whether to perform the mutation operation on the mapping data to be processed based on a preset probability; If so, determine at least one second node in the mapping data to be processed as the mutation node; Replace the first node corresponding to the mutation node with the first node in the quantum chip, and the first node in the quantum chip is different from the other first nodes in the mapping data to be processed.

9. The method according to claim 6, wherein The selecting the mapping data to be processed from the mapping data set includes: Determine the individual probability based on the fitness of the mapping data; Traverse the mapping data in the mapping data set; Judge whether to select the current mapping data based on the selection probability of the current mapping data, and the selection probability is the sum of the individual probability of the current mapping data and the individual probabilities of the mapping data that have been traversed; If so, determine the current mapping data as the mapping data to be processed.

10. A quantum bit mapping device, characterized in that, The device includes: An acquisition module, configured to obtain at least three first nodes, at least two first edges, the error rate of the first edges of a quantum chip, at least three second nodes, at least two second edges, and the usage weight of the second edges of a quantum circuit. The error rate of the first edges is obtained by testing the quantum chip, the error rate of the first edges is the error rate of the coupling relationship between the corresponding two qubits in the quantum chip, and the usage weight of the second edges is the number of two - qubit gates corresponding to the second edges in the quantum circuit; A processing module, configured to generate a mapping data set, where the mapping data set includes a plurality of mapping data, and the mapping data represents the mapping relationship between the first nodes and the second nodes; A calculation module, configured to determine the fitness of the mapping data based on the error rate and the usage weight, where the fitness is inversely proportional to the usage weight, and the usage weight is inversely proportional to the error rate; repeatedly perform crossover operations and mutation operations on the mapping data set to generate a new mapping data set, and determine the fitness of the new mapping data based on the error rate and the usage weight until a target condition is met, where the target condition at least includes that the number of generations reaches a preset number; and determine the mapping data with the highest fitness in all mapping data sets as the target mapping data; Wherein, the processing module 20 is further configured to traverse the at least two second edges; The calculation module 30 is further configured to determine the shortest path in the quantum chip where the current second edge is mapped based on the mapping data, where the shortest path includes at least one first edge; determine the error rate of the shortest path based on the error rates of the at least one first edge included in the shortest path; and determine the sub-fitness of the current second edge based on the usage weight of the current second edge and the error rate of the shortest path; The processing module 20 is further configured to, after the traversal is completed, obtain the sub-fitness of each second edge, and determine the fitness of the mapping data as the sum of the sub-fitnesses of all second edges.

11. A chip, characterized in that, The chip includes a processor, and the processor is capable of executing the quantum bit mapping method according to any one of claims 1 to 9.

12. An electronic device, characterized in that, The electronic device includes a chip, the chip includes a processor, and the processor is capable of executing the quantum bit mapping method according to any one of claims 1 to 9.

13. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program is used to execute the quantum bit mapping method according to any one of claims 1 to 9.

14. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instruction is executed by a processor, the quantum bit mapping method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Quantum circuit processing method, device and equipment, storage medium and product

    CN112668722A

  • Method and apparatus for automated design of quantum circuits

    US20060123363A1