Quantum bit mapping method and device, chip, electronic equipment, storage medium and computer program product
Through the fitness optimization algorithm based on the error rate and usage weight of quantum chips, high-quality quantum bit mapping data is generated, which solves the problem of low quality of mapping data in the prior art and is suitable for large quantum chips.
Patent Information
- Application Number
- CN202510412523.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-04-03
AI Technical Summary
Existing qubit mapping algorithms, such as the SABRE algorithm, randomly initialize bit mapping, resulting in low quality and effectiveness of the final mapping data, especially in large quantum chip topology.
By obtaining the error rate of nodes and edges of the quantum chip and the use weight of the quantum circuit, a mapping data set is generated, and the fitness of the mapping data is determined based on the error rate and use weights. A new mapping data set is generated through cross-operation and mutation operations until the target condition is met, and the mapping data with the highest fitness is determined as the target mapping data.
The quality and effect of the mapping data obtained through bit mapping is significantly improved, and the mapping data with the lowest comprehensive error rate is found, which is suitable for large quantum chip topology.
Smart Images

Figure CN119918685A_ABST
Abstract
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, device, chip, electronic device, storage medium and computer program product. Background Art
[0002] Quantum computing is a new computing technology that is expected to surpass classical computing technology in solving some complex problems. For example, Shor's algorithm can be used to solve large number decomposition problems, and variational quantum algorithms are used to solve combinatorial optimization problems in drug development and finance. 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 limited. For example, if the quantum bits acted by the two-bit gate in the logical quantum circuit do not have a connection structure on the quantum chip, the two-bit gate cannot be directly implemented on the quantum chip. The algorithm to solve this problem is generally called a quantum compilation algorithm, which is used to convert a logical quantum circuit into an equivalent quantum circuit that can be executed on hardware. The present application relates to the bit mapping problem in the quantum compilation algorithm, that is, establishing a reasonable mapping between logical quantum bits and physical bits and inserting 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] The SABRE algorithm (a bit mapping algorithm) is the most widely used in the existing technologies for bit mapping problems. 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 repeat the above process multiple times to obtain the final bit mapping and insert the SWAP path. Although the SABRE algorithm process can use reverse search to obtain the initial mapping, the quality of the initial mapping itself has a great impact on the heuristic path search process. Therefore, the random initialization of the bit mapping in SABRE also has a great impact on the final optimization result, resulting in low quality and effect of the final mapping data, especially when it comes to large quantum chip topology structures. Summary of the invention
[0004] The present application provides a quantum bit mapping method, device, chip, electronic device, storage medium and computer program product.
[0005] An embodiment of the present application provides a quantum bit mapping method on the one hand, the method comprising: Obtaining at least three first nodes, at least two first edges, and error rates of the first edges of the quantum chip and at least three second nodes, at least two second edges, and usage weights of the second edges of the quantum circuit; Generate a mapping data set, the mapping data set including a plurality of mapping data, the mapping data representing a mapping relationship between the first node and the second node; determining a fitness of the mapping data based on the error rate and the usage weight, the fitness being inversely proportional to the error rate; Repeating the crossover operation and the mutation operation on the mapping data set to generate a new mapping data set, and determining the fitness of the new mapping data set based on the error rate and the usage weight until a target condition is met, wherein the target condition at least includes that the number of generation times reaches a preset number of times; The mapping data with the highest fitness among all mapping data sets is determined as the target mapping data.
[0006] 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; Determine the shortest path of the current second edge mapping in the quantum chip based on the mapping data; determining an error rate of the shortest path based on the error rate; 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; After the traversal is completed, the sub-fitness of each second edge is obtained, and the sum of the sub-fitnesses of all the second edges is determined as the fitness of the mapping data.
[0007] Wherein, determining the shortest path of the current second edge mapping in the quantum chip based on the mapping data includes: Determine the two second nodes of the current second edge; Determine two first nodes corresponding to the two second nodes based on the mapping data; A path search algorithm is used to determine the shortest path between the two first nodes.
[0008] 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 a corrected error rate of the first edge based on the error rate of the first edge and a corresponding correction factor; The inverse of the sum of the corrected error rates of the at least one first edge is determined as the error rate of the shortest path.
[0009] 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 a corrected error rate of the first edge based on the inverse of the error rate of the first edge and a corresponding correction factor; The sum of the corrected error rates of the at least one first edge is determined as the error rate of the shortest path.
[0010] The determining of 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: The sub-fitness of the current second edge is determined based on the inverse of the usage weight of the current second edge and the error rate of the shortest path.
[0011] The repeatedly performing the crossover operation and the mutation operation on the mapping data set to generate a new mapping data set includes: Repeatedly selecting mapping data to be processed from the mapping data set, and 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, thereby obtaining a new mapping data set.
[0012] The performing a cross operation on the mapping data to be processed includes: Selecting cross-mapping data from the mapping data set; 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; The first node corresponding to the cross node is replaced 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.
[0013] The step of performing a mutation operation on the mapping data to be processed includes: Determining whether to perform a mutation operation on the mapping data to be processed based on a preset probability; If yes, determining at least one second node in the to-be-processed mapping data as a mutated node; The first node corresponding to the mutated node is replaced 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.
[0014] Wherein, the selecting the mapping data to be processed from the mapping data set includes: determining individual probabilities based on fitness of the mapped data; Traversing the mapping data in the mapping data set; 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 probability of the mapping data that has been traversed; If yes, the current mapping data is determined as the mapping data to be processed.
[0015] Another aspect of the present application provides a quantum bit mapping device, the device comprising: A collection module, used to obtain at least three first nodes, at least two first edges, and error rates of the first edges of the quantum chip and at least three second nodes, at least two second edges, and usage weights of the second edges of the quantum circuit; A processing module, configured to generate a mapping data set, wherein the mapping data set includes a plurality of mapping data, and the mapping data represents a mapping relationship between the first node and the second node; A calculation module is used to determine the fitness of the mapping data based on the error rate and the usage weight, wherein 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, wherein the target condition at least includes that the number of generation times reaches a preset number; and determine the mapping data with the highest fitness among all the mapping data sets as the target mapping data.
[0016] Another aspect of an embodiment of the present application provides a chip, the chip comprising a processor, and the processor is capable of executing the quantum bit mapping method.
[0017] Another aspect of an embodiment of the present application provides an electronic device, wherein the electronic device includes a chip, the chip includes a processor, and the processor is capable of executing the quantum bit mapping method.
[0018] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the quantum bit mapping method.
[0019] On the other hand, an embodiment of the present application provides a computer program product, including a computer program or instructions, which is used to cause a processor to execute and implement the quantum bit mapping method provided in the embodiment of the present application.
[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description.
[0021] In the above scheme, the fitness of the mapping data is inversely proportional to the error rate of the first side and the usage weight of the second side, and then the crossover operation and mutation operation in the genetic algorithm are used to generate multiple generations of mapping data sets. The mapping data with the highest fitness in all the mapping data sets are determined as the target mapping data, so as to find the mapping data with the highest fitness, that is, the lowest comprehensive error rate, which significantly improves the quality and effect of the mapping data obtained by bit mapping. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become readily understood. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, wherein: In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0023] Figure 1 A flowchart of a quantum bit mapping method according to an embodiment of the present application is shown; Figure 2A A schematic diagram of the structure of a quantum circuit according to an embodiment of the present application is shown; Figure 2B A topological diagram of a quantum circuit according to an embodiment of the present application is shown; Figure 3 A flowchart of a quantum bit mapping method according to another embodiment of the present application is shown; Figure 4 A flowchart of a quantum bit mapping method according to another embodiment of the present application is shown; Figure 5 A flowchart of a quantum bit mapping method according to another embodiment of the present application is shown; Figure 6 A topological diagram of a quantum chip according to an embodiment of the present application is shown; Figure 7 A flowchart of a quantum bit mapping method according to another embodiment of the present application is shown; Figure 8 A flowchart of a quantum bit mapping method according to another embodiment of the present application is shown; Fig. 9 A flowchart of a quantum bit mapping method according to another embodiment of the present application is shown; Fig.10 A flowchart of a quantum bit mapping method according to another embodiment of the present application is shown; Fig.11 A schematic diagram of the structure of a quantum bit mapping device according to an embodiment of the present application is shown; Fig.12A schematic diagram of the structure of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0024] In order to make the purpose, features, and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0025] In order to improve the quality and effect of the mapping data obtained by bit mapping, an embodiment of the present application provides a quantum bit mapping method, such as Figure 1 As shown, the method includes: Step 101, obtaining at least three first nodes, at least two first edges, and error rates of the first edges of a quantum chip and at least three second nodes, at least two second edges, and usage weights of the second edges of a quantum circuit.
[0026] In this embodiment, at least three first nodes and at least two first edges of the quantum chip may be obtained by converting the structure of the quantum chip into a corresponding topological graph.
[0027] For example, the quantum bits of the quantum chip are determined as nodes of the topological graph, and the coupling relationships between the quantum bits in the quantum chip are determined as edges of the topological graph to generate a corresponding topological graph.
[0028] The quantum chip is tested to determine the error rate of the coupling relationship between quantum bits in the quantum chip. The error rate is the error rate of the corresponding edge after the coupling relationship is converted into the edge of the topological graph.
[0029] 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.
[0030] For example, Figure 2A As shown, Figure 2A is the structure of the quantum circuit, Figure 2A The horizontal lines in the figure represent the quantum bits of the quantum circuit, which are quantum bits 1, 2, 3, 4, and 5. The vertical line connecting two quantum bits is the two-bit gate between the two quantum bits. Figure 2B As shown, Figure 2B for Figure 2AThe topological graph obtained after the structural conversion of the quantum circuit in the quantum circuit is converted. The quantum bits of the quantum circuit are converted into nodes of the topological graph to obtain the corresponding nodes 1, 2, 3, 4 and 5. The two-bit gates between the quantum bits in the quantum circuit are determined as the edges of the topological graph. The number of two-bit gates between the same quantum bit pairs is determined as the usage weight of the corresponding edge to generate the corresponding topological graph.
[0031] It should be pointed out that the quantum circuit is operated based on the quantum chip structure, so the number of quantum bits in the quantum circuit must be less than or equal to the number of quantum bits in the quantum chip. That is, the number of second nodes must be less than or equal to the number of first nodes.
[0032] Step 102: Generate a mapping data set, where the mapping data set includes a plurality of mapping data, and the mapping data represents a mapping relationship between the first node and the second node.
[0033] Generate multiple initialized mapping data to obtain a mapping data set. The mapping data includes a mapping relationship between the quantum bits in the quantum circuit and the quantum bits in the quantum chip, that is, a mapping relationship between the first node and the second node.
[0034] For example, the first node set is , represents the first node set Included There are four first nodes in total. The second node set is , represents the second node set Included There are four second nodes in total. The mapping relationship contained in a certain mapping data is , indicating the mapping data The mapping relationship contained in is and There is a mapping relationship, and There is a mapping relationship, and There is a mapping relationship, and There is a mapping relationship. The number of the first node and the second node is the same, so it is a one-to-one mapping relationship.
[0035] For another example, the first node set is , represents the first node set Included There are five first nodes in total. The second node set is , represents the second node set Included There are three second nodes in total. The mapping relationship contained in a certain mapping data is , indicating the mapping data The mapping relationship contained in is and There is a mapping relationship, and There is a mapping relationship, and There is a mapping relationship. The number of first nodes is greater than the number of second nodes, so the second nodes all have corresponding mapping relationships, and there are first nodes that do not have corresponding mapping relationships.
[0036] Step 103: determining the fitness of the mapping data based on the error rate and the usage weight, wherein the fitness is inversely proportional to the error rate.
[0037] In this embodiment, the error rate and the usage weight are multiplied, and the reciprocal or opposite number of the product is 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, the fitness is inversely proportional to the error rate and the usage weight through other calculation methods.
[0038] Step 104, repeatedly performing crossover and mutation operations on the mapping data set to generate a new mapping data set, and determining the fitness of the new mapping data set based on the error rate and the usage weight until a target condition is met, wherein the target condition at least includes that the number of generation times reaches a preset number of times.
[0039] A genetic algorithm is used to repeatedly perform crossover operations and mutation operations on the mapping data in the mapping data set to generate a new mapping data set, and the fitness of the mapping data in the new mapping data set is re-determined.
[0040] It should be noted that when repeatedly generating a new mapping data set, it is necessary to repeatedly perform crossover and mutation operations on the mapping data in the mapping data set generated last time to generate a new mapping data set. For example, an initial mapping data set A is generated. By repeatedly performing crossover and mutation operations on the mapping data in mapping data set A, a new mapping data set B is generated. Then, by repeatedly performing crossover and mutation operations on the mapping data in mapping data set B, a new mapping data set C is generated. The same applies to the subsequent operations.
[0041] After the target condition is met, stop generating new mapping datasets.
[0042] In this embodiment, the target condition at least includes that the number of generation times reaches a preset number, which can be set to 100-1000 and can be set based on demand. In other implementations, the target condition can also include result convergence, which means that the fitness of the mapping data in the generated new mapping data set cannot continue to improve compared with the fitness of the mapping data in the last generated mapping data set.
[0043] Step 105: determining the mapping data with the highest fitness among all the mapping data sets as the target mapping data.
[0044] After the target conditions are met, the mapping data with the highest fitness among all mapping data sets is determined as the target mapping data, that is, the mapping relationship applied to the quantum chip and quantum circuit.
[0045] Since the error rate of the coupling relationship between quantum bits in a quantum chip specifically refers to the probability that the calculation results deviate from the expected due to interference from the physical system or insufficient control accuracy when two or more quantum bits perform collaborative operations (such as a two-bit gate). 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 bit mapping, we need to find the mapping data with the lowest comprehensive error rate. Therefore, in the above scheme, by making the fitness of the mapping data inversely proportional to the error rate of the first side and the usage weight of the second side, and then using the crossover operation and mutation operation in the genetic algorithm to generate multiple generations of mapping data sets, the mapping data with the highest fitness in all mapping data sets is determined as the target mapping data, so as to find the mapping data with the highest fitness, that is, the lowest comprehensive error rate, which significantly improves the quality and effect of the mapping data obtained by bit mapping.
[0046] In an example of the present application, a quantum bit mapping method is also provided, such as Figure 3 As shown, the determining the fitness of the mapping data based on the error rate and the usage weight includes: Step 201, traverse the at least two second edges.
[0047] Traverse all the edges of the quantum circuit, that is, all the second edges.
[0048] Step 202: Determine the shortest path of the current second edge mapping in the quantum chip based on the mapping data.
[0049] For example, the first node set is , represents the first node set Included There are four first nodes in total. The second node set is , represents the second node set Included There are four second nodes in total. The mapping data contains the mapping relationship: , indicating the mapping data The mapping relationship contained in is and There is a mapping relationship, and There is a mapping relationship, and There is a mapping relationship, and There is a mapping relationship. The two second nodes of the current second edge are and , then the first nodes mapped to these two second nodes in the quantum chip are and ,Sure and The shortest path between .
[0050] Step 203: determine the error rate of the shortest path based on the error rate.
[0051] The error rate of the shortest path is the sum of the error rates of all first edges included in the shortest path.
[0052] Following the above example, and The shortest path between includes three first edges, and the error rates of these three first edges are 0.38%, 0.35%, and 0.42%, respectively. and The error rate of the shortest path between them is 1.15%.
[0053] Step 204 : 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.
[0054] The error rate of the shortest path is weighted based on the usage weight of the current second edge to obtain the sub-fitness of the current second edge.
[0055] Step 205: After the traversal is completed, the sub-fitness of each second edge is obtained, and the sum of the sub-fitness of all the second edges is determined as the fitness of the mapping data.
[0056] After traversing all the second edges, the sub-fitness of each second edge is obtained, and the sub-fitness of all the second edges is summed to obtain the fitness of the mapped data.
[0057] In the above scheme, by traversing all the 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 frequency of use after the second edge is mapped to the quantum chip. Finally, the sub-fitness of all the second edges is summed to obtain the fitness of the mapping data, so that the fitness of the mapping data can characterize the comprehensive error rate generated based on the frequency of use after the mapping data is applied to the quantum chip. The target mapping data screened out based on the fitness minimizes the comprehensive error rate, which significantly improves the quality and effect of the screened target mapping data.
[0058] In an example of the present application, a quantum bit mapping method is also provided, such as Figure 4 As shown, determining the shortest path of the current second edge mapping in the quantum chip based on the mapping data includes: Step 301, determine two second nodes of the current second edge.
[0059] For example, the first node set is , represents the first node set Included There are four first nodes in total. The second node set is , represents the second node set Included There are four second nodes in total. The current second edge is the second node and , then the two second nodes of the current second edge are and .
[0060] Step 302: Determine two first nodes corresponding to the two second nodes based on the mapping data.
[0061] Continuing with the above example, the mapping relationship contained in the mapping data is , indicating the mapping data The mapping relationship contained in is and There is a mapping relationship, and There is a mapping relationship, and There is a mapping relationship, and There is a mapping relationship. Then the first nodes mapped to these two second nodes in the quantum chip are and .
[0062] Step 303: Determine the shortest path between the two first nodes using a path search algorithm.
[0063] In this embodiment, the path search algorithm may be Dijkstra algorithm, topological sorting algorithm, A-star algorithm (a heuristic algorithm), etc. In other implementations, any other path search algorithm that can determine the shortest path between two nodes may also be selected.
[0064] In the above scheme, the two second nodes of the second edge are mapped to the two first nodes in the quantum chip based on the mapping data, and then the path search algorithm is used to determine the shortest path between the two first nodes in the quantum chip structure, so that the fitness can be determined based on the shortest path, thereby screening out target mapping data with better quality and effect.
[0065] In an example of the present application, a quantum bit mapping method is also provided, such as Figure 5 As shown, determining the error rate of the shortest path based on the error rate includes: Step 401: determine at least one first edge based on the shortest path.
[0066] For example, Figure 6 As shown, Figure 6 is the topological diagram of the quantum chip structure. If the shortest path is and The shortest path between and If there is a connection relationship, the shortest path only includes This one first side.
[0067] For example, Figure 6 As shown, if the shortest path is and The shortest path between and There is no connection relationship, so the shortest path is Figure 6 Shown, including and These two first sides.
[0068] Step 402: Determine a corrected error rate of the first edge based on the error rate of the first edge and a corresponding correction factor.
[0069] Correction Factor It can be determined based on the following formula:
[0070] in, For the The first side.
[0071] For example, Figure 6 As shown, and The shortest path between and These two first sides. The error rate is 0.4%, the first side The error rate is 0.5%. is the first side, then the corresponding correction factor is 1, the first side is the second first side, the corresponding correction factor is 3. The corrected error rate is 0.4%. The corrected error rate is 1.5%.
[0072] Step 403: determine the inverse of the sum of the corrected error rates of the at least one first edge as the error rate of the shortest path.
[0073] Following the above example, and The shortest path between and These two first sides. The corrected error rate is 0.4%. The corrected error rate is 1.5%. and The error rate of the shortest path between them is 1.9%.
[0074] Specifically, the error rate of the shortest path can be determined based on the following formula :
[0075] in, The shortest path The first side, The shortest path The correction factor corresponding to the first side.
[0076] Since the first first edge in the path usually does not need to be inserted with a SWAP gate, while the subsequent first edges need to be inserted with a SWAP gate, and the SWAP gate requires three CNOT gates (a dual-qubit quantum logic gate) to implement. Therefore, the error rate of the subsequent first edge is three times the error rate of the first first edge. Correction is required. In the above scheme, by determining at least one first edge included in the shortest path, the error rate of the first edge is corrected based on the correction factor and the order of the first edges to obtain the corrected error rate of each first edge, and finally the corrected error rates of all the first edges are summed to obtain the accurate error rate of the shortest path, so that 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 screened based on fitness.
[0077] In an example of the present application, a quantum bit mapping method is also provided, such as Figure 7 As shown, determining the error rate of the shortest path based on the error rate includes: Step 501: determine at least one first edge based on the shortest path.
[0078] Likewise, at least one first edge included in the shortest path is determined.
[0079] Step 502: determine a corrected error rate of the first edge based on the inverse of the error rate of the first edge and a corresponding correction factor.
[0080] Likewise, the correction factor It can be determined based on the following formula:
[0081] in, For the The first side.
[0082] For example, Figure 6 As shown, and The shortest path between and These two first sides. The error rate is 0.4%, the first side The inverse of the error rate is 250. The first side The error rate is 0.5%, the first side The inverse of the error rate is 200. The first side is the first side, then the corresponding correction factor is 1, the first side is the second first side, the corresponding correction factor is 3. The corrected error rate is 250. The first side The corrected error rate is 600.
[0083] Step 503: Determine the sum of the corrected error rates of the at least one first edge as the error rate of the shortest path.
[0084] Following the above example, and The shortest path between and These two first sides. The corrected error rate is 250. The first side The corrected error rate is 600. and The error rate of the shortest path between them is 850.
[0085] Since the first first edge in the path usually does not need to be inserted with a SWAP gate, while the subsequent first edges need to be inserted with a SWAP gate, the SWAP gate requires three CNOT gates (a dual-qubit quantum logic gate) to implement. Therefore, the error rate of the subsequent first edge is three times the error rate of the first first edge. Correction is required. In the above scheme, by determining at least one first edge included in the shortest path, the error rate of the first edge is corrected based on the correction factor and the order of the first edge, and 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 screened based on fitness. And the corrected error rate of the first edge is determined based on the inverse of the error rate of the first edge, so that the fitness is inversely proportional to the error rate, and the mapping data with the largest fitness is determined as the target mapping data, that is, the mapping data with the lowest error rate.
[0086] In an example of the present application, a quantum bit mapping method is also provided, wherein the sub-fitness of the current second edge is determined based on the usage weight of the current second edge and the error rate of the shortest path, including: The sub-fitness of the current second edge is determined based on the inverse of the usage weight of the current second edge and the error rate of the shortest path.
[0087] If the corrected error rate of the first edge is determined based on the inverse 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 inverse of the usage weight of the current second edge and the error rate of the shortest path.
[0088] In the above scheme, when the corrected error rate of the first side is determined based on the inverse of the error rate of the first side, when determining the sub-fitness of the current second side, it is also necessary to determine the sub-fitness based on the inverse of the current usage weight of the second side and the error rate of the shortest path, so that the fitness is also inversely proportional to the usage weight of the second side, and thus the fitness can characterize the comprehensive error rate generated based on the usage frequency after the mapping data is applied to the quantum chip. The comprehensive error rate of the target mapping data screened out based on the fitness is minimized, which significantly improves the quality and effect of the screened target mapping data.
[0089] In an example of the present application, a quantum bit mapping method is also provided, wherein the step of repeatedly performing a crossover operation and a mutation operation on the mapping data set to generate a new mapping data set includes: Repeatedly selecting mapping data to be processed from the mapping data set, and 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, thereby obtaining a new mapping data set.
[0090] In this embodiment, the mapping data to be processed may be selected from the mapping data set by a roulette selection method, a tournament selection method, or a ranking selection method, etc. In other implementations, the mapping data to be processed may also be selected from the mapping data set by other selection methods.
[0091] It should be pointed out that it is also possible to retain specific mapping data in the current mapping dataset in the new mapping dataset through methods such as the elite retention strategy (retaining the mapping data with the best fitness in the current mapping dataset in the new mapping dataset to ensure that the high-quality mapping data is not destroyed by random operations).
[0092] After selecting the mapping data to be processed, crossover and mutation operations are performed on the mapping data to be processed to obtain new mapping data, the fitness of the new mapping data is re-determined, and the mapping data is added to the new mapping data set. Then the mapping data to be processed is re-selected for processing. Until the number of mapping data in the new mapping data set reaches a preset number.
[0093] 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 implementations, the preset number can be set based on specific needs.
[0094] In the above scheme, the mapping data to be processed is selected from the mapping data set by roulette selection method, tournament selection method or sorting selection method, and then the selected mapping data to be processed is subjected to crossover operation and mutation operation to generate new mapping data. Then a new mapping data set is obtained, which effectively avoids the problem of local optimality. Furthermore, the elite retention strategy can be used to retain specific mapping data in the current mapping data set to the new mapping data set, 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.
[0095] In an example of the present application, a quantum bit mapping method is also provided, such as Figure 8 As shown, the cross operation on the mapping data to be processed includes: Step 601: Select cross-mapping data from the mapping data set.
[0096] Similarly, in this embodiment, the mapping data to be processed can be selected from the mapping data set by a roulette selection method, a tournament selection method, or a ranking selection method. In other embodiments, the mapping data to be processed can also be selected from the mapping data set by other selection methods. It should be noted that the mapping data set for selecting cross-mapping data does not include the selected mapping data set.
[0097] Step 602: determine at least one second node in the mapping data to be processed as a cross node, and determine the same number of second nodes in the cross mapping data as replacement nodes.
[0098] 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 a crossover node. The selection can also be made based on different requirements. In order to speed up the convergence speed, at least one second node with a higher sub-fitness can be selected for processing.
[0099] For example, the first node set is , represents the first node set Included There are eight first nodes in total. The second node set is , represents the second node set Included There are four second nodes in total. Select the second node and the second node , determine the two second nodes as cross nodes.
[0100] For another example, the first node set is , represents the first node set Included There are eight first nodes in total. The second node set is , represents the second node set Included There are four second nodes in total. The sub-fitness of each second node in the mapping data to be processed is , two second nodes need to be selected for processing, so the second node with a sub-fitness of 1.5% is selected And the sub-fitness is The second node , and determine the two second nodes as cross nodes. It should be noted that the sub-fitness of the second node may be the sum of the sub-fitnesses of all second edges containing the second node.
[0101] Step 603: Replace the first node corresponding to the cross node with the first node corresponding to the replacement node, wherein the first node corresponding to the replacement node is different from other first nodes in the mapping data to be processed.
[0102] Continuing with the above example, let's change the second node and the second node Determined as a cross node, the mapping relationship contained in the mapping data to be processed is , indicating the mapping data The mapping relationship contained in is and There is a mapping relationship, and There is a mapping relationship, and There is a mapping relationship, and There is a mapping relationship. The mapping relationship contained in the cross-mapping data is , indicating the mapping data The mapping relationship contained in is and There is a mapping relationship, and There is a mapping relationship, and There is a mapping relationship, and There is a mapping relationship. Replace the first node corresponding to the cross node with the first node corresponding to the replacement node. The mapping relationship contained in the replaced mapping data is .
[0103] It should be noted that each second node can only have one mapped first node, and the first nodes mapped to different second nodes are different. If the replaced first node is found to be the same as other first nodes in the mapping data to be processed during the replacement process, the replacement is stopped.
[0104] In the above scheme, cross-mapping data is selected from the mapping data set, and then at least one second node is selected from the mapping data to be processed as a cross-node, and then the first node corresponding to the cross-node is replaced with the first node corresponding to the replacement node to complete the cross-operation and generate new mapping data, and then the mapping data with the best fitness is selected from the large amount of generated mapping data as the target mapping data, thereby improving the quality and effect of the screened target mapping data.
[0105] In an example of the present application, a quantum bit mapping method is also provided, such as Fig. 9 As shown, the mutation operation on the mapping data to be processed includes: Step 701: determine whether to perform a mutation operation on the mapping data to be processed based on a preset probability.
[0106] After performing a crossover 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.
[0107] In this embodiment, the preset probability is usually set to 10%. In other implementations, the preset probability can be set based on specific needs.
[0108] The method based on the preset probability judgment can be determined by generating random numbers from a numerical range. For example, if the preset probability is 10%, Generate a random number in the range. If the random number is within If the random number is within the range, it is determined that a mutation operation needs to be performed on the mapped data to be processed. range, it is determined that no mutation operation is required on the mapping data to be processed.
[0109] Step 702: If yes, determine at least one second node in the to-be-processed mapping data as a variant node.
[0110] If it is determined based on the preset probability that a mutation operation needs to be performed on the mapping data to be processed, at least one second node in the mapping data to be processed is determined as a mutation node.
[0111] 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 a mutation node. The selection can also be made based on different requirements. In order to speed up the convergence speed, at least one second node with a higher sub-fitness can be selected for processing.
[0112] For example, the first node set is , represents the first node set Included There are eight first nodes in total. The second node set is , represents the second node set Included There are four second nodes in total. Select the second node and the second node , determine the two second nodes as mutation nodes.
[0113] For another example, the first node set is , represents the first node set Included There are eight first nodes in total. The second node set is , represents the second node set Included There are four second nodes in total. The sub-fitness of each second node in the mapping data to be processed is , two second nodes need to be selected for processing, so the second node with a sub-fitness of 2% is selected And the sub-fitness is The second node , and determine the two second nodes as variant nodes. It should be noted that the sub-fitness of the second node may be the sum of the sub-fitnesses of all second edges containing the second node.
[0114] Step 703: 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 mapping data to be processed.
[0115] The first nodes in the quantum chip having the same number as the mutated nodes are randomly selected, and the first nodes corresponding to the mutated nodes are replaced with the first nodes selected from the quantum chip.
[0116] Continuing with the above example, let's change the second node and the second node Determined as a mutation node, the mapping relationship contained in the mapping data to be processed is , indicating the mapping data The mapping relationship contained in is and There is a mapping relationship, and There is a mapping relationship, and There is a mapping relationship, and There is a mapping relationship. The first node is selected from the first node of the quantum chip and the first node , the first node corresponding to the mutated node is replaced with the first node selected from the first node of the quantum chip. The mapping relationship contained in the replaced mapping data to be processed is .
[0117] In the above scheme, by determining whether to perform a mutation operation on the mapping data to be processed based on a preset probability, after determining that a mutation operation is required, at least one second node is selected from the mapping data to be processed as a mutation node, and then the first nodes with the same number as the mutation nodes are selected from the first nodes of the quantum chip. Finally, the first node corresponding to the mutation node is replaced with the first node selected from the first node of the quantum chip to complete the mutation operation and generate new mapping data, and then the mapping data with the best fitness is selected from a large amount of generated mapping data as the target mapping data, thereby improving the quality and effect of the selected target mapping data.
[0118] In an example of the present application, a quantum bit mapping method is also provided, such as Fig.10 As shown, the selecting the mapping data to be processed from the mapping data set includes: Step 801, determining individual probabilities based on the fitness of the mapping data.
[0119] Specifically, the individual probability of the mapped data can be determined based on the fitness of the mapped data according to the following formula :
[0120] in, is the fitness of the mapping data, It is the sum of the fitness of all mapping data in the mapping data set to which the mapping data belongs.
[0121] For example, if the fitness of a certain mapping data is 80%, and the sum of the fitness of all mapping data in the mapping data set to which the mapping data belongs is 1000%, then the individual probability of the mapping data is 8%.
[0122] Step 802: traverse the mapping data in the mapping data set.
[0123] Step 803 : judging whether to select the current mapping data based on the selection probability of the current mapping data, wherein the selection probability is the sum of the individual probability of the current mapping data and the individual probability of the mapping data that has been traversed.
[0124] If the current mapping data traversed is the first mapping data in the mapping data set, the selection probability of the current mapping data is its individual probability. If the current mapping data traversed 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 have been traversed.
[0125] For example, a 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, and when traversing to the first mapping data, the selection probability of this mapping data is 8%. Based on the selection probability, make a judgment. If the selection probability does not hit, traverse to the next mapping data. When traversing to the second mapping data, the selection probability of this mapping data is 16%. Based on the selection probability, make a judgment. If the selection probability does not hit, continue to traverse to the next mapping data. When traversing to the third mapping data, the selection probability of this mapping data is 31%. Based on the selection probability, make a judgment. If the selection probability hits, determine the third mapping data as the mapping data to be processed, and stop traversing.
[0126] Step 804: If yes, the current mapping data is determined as the mapping data to be processed.
[0127] In the above scheme, the individual probability of the mapping data is determined based on the fitness of the mapping data, and then the mapping data in the mapping data set is traversed, and the selection probability is obtained by traversing and accumulating the individual probabilities of the mapping data. Only random sampling based on the fitness to determine the individual probability and probability interval is required. Therefore, when processing large-scale mapping data sets, the processing efficiency is higher and the requirements on device performance are lower.
[0128] In order to implement the above-mentioned quantum bit mapping method, Fig.11 As shown, an example of the present application provides a quantum bit mapping device, including: The acquisition module 10 is used to obtain at least three first nodes, at least two first edges, and error rates of the first edges of the quantum chip and at least three second nodes, at least two second edges, and usage weights of the second edges of the quantum circuit; A processing module 20, configured to generate a mapping data set, wherein the mapping data set includes a plurality of mapping data, and the mapping data represents a mapping relationship between the first node and the second node; The calculation module 30 is used to determine the fitness of the mapping data based on the error rate and the usage weight, wherein 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, wherein the target condition at least includes that the number of generations reaches a preset number; and determine the mapping data with the highest fitness among all mapping data sets as the target mapping data.
[0129] Wherein, the processing module 20 is further used to traverse the at least two second edges; The calculation module 30 is further used 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; The processing module 20 is further configured to obtain the sub-fitness of each second edge after the traversal is completed, and determine the sum of the sub-fitnesses of all the second edges as the fitness of the mapping data.
[0130] Wherein, the processing module 20 is further used to determine two second nodes of the current second edge; The processing module 20 is further configured to determine two first nodes corresponding to the two second nodes based on the mapping data; The calculation module 30 is further configured to determine the shortest path between the two first nodes using a path search algorithm.
[0131] Wherein, the processing module 20 is further used to determine at least one first edge based on the shortest path; The calculation module 30 is further configured to determine a corrected error rate of the first edge based on the error rate of the first edge and a corresponding correction factor; and determine the inverse of the sum of the corrected error rates of at least one first edge as the error rate of the shortest path.
[0132] Wherein, the processing module 20 is further used to determine at least one first edge based on the shortest path; The calculation module 30 is further configured to determine a corrected error rate of the first edge based on the inverse of the error rate of the first edge and a corresponding correction factor; and determine the sum of the corrected error rates of at least one first edge as the error rate of the shortest path.
[0133] The calculation module 30 is further configured to determine the sub-fitness of the current second edge based on the inverse of the usage weight of the current second edge and the error rate of the shortest path.
[0134] Among them, the calculation module 30 is also used to repeatedly select the mapping data to be processed from the mapping data set, and 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.
[0135] Wherein, the processing module 20 is further used to select cross-mapping data from the mapping data set; The calculation module 30 is also used to determine at least one second node in the mapping data to be processed as a cross node, and determine the same number of second nodes in the cross mapping data as replacement nodes; and replace the first node corresponding to the cross 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.
[0136] Among them, the calculation module 30 is also used 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.
[0137] Wherein, the calculation module 30 is further used to determine the individual probability based on the fitness of the mapping data; The processing module 20 is further used to traverse the mapping data in the mapping data set; The calculation module 30 is also used 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 probability of the mapping data that has been traversed; and if so, determine the current mapping data as the mapping data to be processed.
[0138] An embodiment of the present application also provides a chip, which includes a processor, and the processor can execute the quantum bit mapping method provided in the embodiment of the present application.
[0139] An embodiment of the present application also provides an electronic device.
[0140] Fig.12 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as 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 personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0141] like Fig.12As shown, the electronic device 900 includes a computing unit 901, which 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.
[0142] A number 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 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 through a computer network such as the Internet and / or various telecommunication networks.
[0143] The computing unit 901 may be a variety of general and / or special 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, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as the quantum bit mapping method. For example, in some embodiments, the quantum bit mapping method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on 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 quantum bit mapping method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the quantum bit mapping method in any other appropriate manner (e.g., by means of firmware).
[0144] An embodiment of the present application provides a computer-readable storage medium storing executable instructions, wherein a computer program is stored therein, and the computer program is used to execute the quantum bit mapping method provided in the embodiment of the present application.
[0145] The embodiment of the present application provides a computer program product, which includes a computer program or instructions, and the computer program or instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer program or instructions from the computer-readable storage medium, and the processor executes the computer program or instructions, so that the computer device executes the quantum bit mapping method described in the embodiment of the present application.
[0146] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.
[0147] In some embodiments, a computer program may 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 may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0148] By way of example, a computer program may be deployed to be executed on one computing device or on multiple computing devices at one site or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0149] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), integrated systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0150] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0151] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0152] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types 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, voice input, or tactile input).
[0153] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0154] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0155] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0156] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0157] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A quantum bit mapping method, characterized in that: The method comprises: Obtaining at least three first nodes, at least two first edges, and error rates of the first edges of the quantum chip and at least three second nodes, at least two second edges, and usage weights of the second edges of the quantum circuit; Generate a mapping data set, the mapping data set including a plurality of mapping data, the mapping data representing a mapping relationship between the first node and the second node; determining a fitness of the mapping data based on the error rate and the usage weight, the fitness being inversely proportional to the error rate; Repeating the crossover operation and the mutation operation on the mapping data set to generate a new mapping data set, and determining the fitness of the new mapping data set based on the error rate and the usage weight until a target condition is met, wherein the target condition at least includes that the number of generation times reaches a preset number of times; The mapping data with the highest fitness among all mapping data sets is determined as the target mapping data.
2. The method according to claim 1, characterized in that The determining the fitness of the mapping data based on the error rate and the usage weight comprises: traversing the at least two second edges; Determine the shortest path of the current second edge mapping in the quantum chip based on the mapping data; determining an error rate of the shortest path based on the error rate; 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; After the traversal is completed, the sub-fitness of each second edge is obtained, and the sum of the sub-fitnesses of all the second edges is determined as the fitness of the mapping data.
3. The method according to claim 2, characterized in that The determining, based on the mapping data, the shortest path of the current second edge mapping in the quantum chip comprises: Determine the two second nodes of the current second edge; Determine two first nodes corresponding to the two second nodes based on the mapping data; A path search algorithm is used to determine the shortest path between the two first nodes.
4. The method according to claim 2, characterized in that: The determining the error rate of the shortest path based on the error rate comprises: determining at least one first edge based on the shortest path; determining a corrected error rate of the first edge based on the error rate of the first edge and a corresponding correction factor; The inverse of the sum of the corrected error rates of the at least one first edge is determined as the error rate of the shortest path.
5. The method according to claim 2, characterized in that: The determining the error rate of the shortest path based on the error rate comprises: determining at least one first edge based on the shortest path; determining a corrected error rate of the first edge based on the inverse of the error rate of the first edge and a corresponding correction factor; The sum of the corrected error rates of the at least one first edge is determined as the error rate of the shortest path.
6. The method according to claim 5, characterized in that The 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: The sub-fitness of the current second edge is determined based on the inverse of the usage weight of the current second edge and the error rate of the shortest path.
7. The method according to claim 1, characterized in that The repeatedly performing a crossover operation and a mutation operation on the mapping data set to generate a new mapping data set includes: Repeatedly selecting mapping data to be processed from the mapping data set, and 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, thereby obtaining a new mapping data set.
8. The method according to claim 7, characterized in that The performing a cross operation on the mapping data to be processed includes: Selecting cross-mapping data from the mapping data set; 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; The first node corresponding to the cross node is replaced 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.
9. The method according to claim 8, characterized in that Performing a mutation operation on the mapping data to be processed includes: Determining whether to perform a mutation operation on the mapping data to be processed based on a preset probability; If yes, determining at least one second node in the to-be-processed mapping data as a mutated node; The first node corresponding to the mutated node is replaced by 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.
10. The method according to claim 7, characterized in that The selecting the mapping data to be processed from the mapping data set includes: determining individual probabilities based on fitness of the mapped data; Traversing the mapping data in the mapping data set; 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 probability of the mapping data that has been traversed; If yes, the current mapping data is determined as the mapping data to be processed.
11. A quantum bit mapping device, characterized in that: The device comprises: A collection module, used to obtain at least three first nodes, at least two first edges, and error rates of the first edges of the quantum chip and at least three second nodes, at least two second edges, and usage weights of the second edges of the quantum circuit; A processing module, configured to generate a mapping data set, wherein the mapping data set includes a plurality of mapping data, and the mapping data represents a mapping relationship between the first node and the second node; A calculation module is used to determine the fitness of the mapping data based on the error rate and the usage weight, wherein 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, wherein the target condition at least includes that the number of generation times reaches a preset number; and determine the mapping data with the highest fitness among all the mapping data sets as the target mapping data.
12. A chip, characterized in that: The chip includes a processor, and the processor is capable of executing the quantum bit mapping method described in any one of claims 1 to 10.
13. An electronic device, characterized in that: The electronic device comprises a chip, the chip comprises a processor, and the processor is capable of executing the quantum bit mapping method described in any one of claims 1 to 10.
14. 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 10.
15. 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 described in any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Quantum circuit processing method, device and equipment, storage medium and product
CN112668722A
Quantum bit mapping method, control system, storage medium and electronic equipment
CN118917429A
Method and apparatus for automated design of quantum circuits
US20060123363A1
Systems and methods that formulate problems for solving by a quantum processor using hardware graph decomposition
US20140324933A1
Method and apparatus for determining quantum circuit, and storage medium
US20220114313A1