Quantum bit mapping method, control system, storage medium and electronic equipment
By constructing directed acyclic graphs and heuristic search to optimize SWAP operations, the problem of low quantum line mapping efficiency on NISQ hardware devices is solved, and more efficient qubit mapping is achieved, suitable for irregularly coupled connected devices.
Patent Information
- Application Number
- CN202411420606.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2024-11-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology has low efficiency and limited application scope on NISQ hardware devices. The main reason is that the initial mapping strategy selection affects the quality of quantum circuits. The current solution adopts random mapping and exhaustive search to cause high time and space costs and is not applicable to Devices with irregularly coupled coupling.
By constructing a directed acyclic graph, filtering SWAP gates using search algorithms, generating mapping strategies symmetrically with quantum lines, traversing quantum lines, updating mapping strategies, using heuristic search to optimize SWAP operations, selecting exchange operations with the smallest cost function, and realizing quantum bitmap.
The quality of quantum circuit mapping is improved, the search space and time complexity is reduced, the global optimal solution is selected, and the complexity of the dual quantum gate is reduced. It is suitable for NISQ devices with irregularly coupled connections.
Smart Images

Figure CN118917429A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum computer technology, and in particular to a quantum bit mapping method, a control system, a storage medium and an electronic device. Background Art
[0002] In order to use NISQ hardware devices, quantum circuit programs must be compiled to the target device, which includes mapping logical qubits to the physical qubits of the device. In fact, for physical qubits on NISQ devices, a qubit can only be directly coupled to its adjacent qubits. Therefore, for a specific mapping, the two-qubit gate can only be applied to a limited number of logical qubit pairs, that is, their corresponding physical qubit pairs are directly coupled, which makes it impossible for quantum circuits to be executed directly on NISQ devices. By using heuristic search to find suitable SWAP operations and inserting a series of SWAP operations to exchange logical qubits, quantum programs can be executed on NISQ devices. However, the current scheme has shortcomings in quantum circuit execution efficiency, scope of application, and time and space costs. The main reason is that the choice of the initial mapping strategy will affect the quality of the generated quantum circuit. The current scheme uses a random mapping strategy, which leads to low overall circuit execution efficiency; secondly, the current scheme uses an exhaustive mapping search, which requires a larger search space and longer running time. Summary of the invention
[0003] The purpose of the present invention is to solve the shortcomings of the prior art and to propose a quantum bit mapping method, control system, storage medium and electronic device.
[0004] In order to achieve the above object, the present invention adopts the following technical solution: a quantum bit mapping method, comprising: Traversing the double quantum gates in the first quantum circuit of the logical quantum bit to construct a directed acyclic graph and generate a first mapping strategy; Traversing the first quantum circuit according to the first mapping strategy through a search algorithm, screening the SWAP gates to be inserted, selecting the lowest SWAP operation, adding it to the first quantum circuit for exchange, and obtaining a second mapping strategy; A second quantum circuit symmetrical to the first quantum circuit is generated, the second quantum circuit is traversed according to a second mapping strategy, and the first mapping strategy is updated according to the obtained mapping result, and the first quantum circuit is controlled to map the physical quantum bit.
[0005] As a further description of the above technical solution: when all the preceding gates in the leading edge of the double quantum gate have been executed, the double quantum gate is placed in the preceding layer of the directed acyclic graph, and the preceding layer is initialized.
[0006] As a further description of the above technical solution: the directed acyclic graph is scanned from the preceding layer to generate an execution gate list, and according to the first mapping strategy, quantum bit pairs that can execute a double quantum gate are found and added to the execution gate list.
[0007] As a further description of the above technical solution: determine whether the execution gate list is empty, if not, traverse the execution gate list, delete the gates in the execution gate list from the previous layer, obtain the successor gate from the directed acyclic graph, add the successor gate to the previous layer, and judge the execution gate list again; If yes, obtain the SWAP candidate list, traverse the SWAP gates in the SWAP candidate list, and select the SWAP operation with the smallest cost function value by calculating the cost function.
[0008] As a further description of the above technical solution: the first quantum circuit is traversed in reverse to generate the second quantum circuit, the first quantum circuit is traversed in forward direction through heuristic search according to the SWAP operation to obtain the second mapping strategy, and the second quantum circuit is traversed according to the second mapping strategy.
[0009] As a further description of the above technical solution: the sum of the distances between all quantum bit pairs in the previous layer is used as the cost function, the cost function value is obtained by cumulative summation, and the SWAP operation with the smallest cost function value is screened.
[0010] As a further description of the above technical solution: the successor gates in the preceding layer are taken as an extended set, the quantum gates in the extended set and the preceding layer are summed, and an attenuation parameter is added, and the cost function is used for calculation to select the SWAP operation to be executed in parallel.
[0011] Also included is a quantum bit mapping control system, which is applicable to the mapping method described in any one of the above technical solutions, including: A mapping module, traversing the first quantum circuit to construct a directed acyclic graph, generating a second quantum circuit symmetrical to the first quantum circuit, controlling the first quantum circuit or the second quantum circuit to perform mapping, and generating a first mapping strategy; A search module, which screens the SWAP gates of the first quantum circuit through a search algorithm and searches for a quantum bit pair that executes a double quantum gate according to a first mapping strategy; The calculation module calculates the SWAP operation with the minimum cost function value and adds it to the first quantum circuit to obtain the second mapping strategy after the quantum bit exchange; An updating module controls the second quantum circuit to traverse according to the second mapping strategy, and updates the first mapping strategy according to the obtained mapping result.
[0012] It also includes a computer-readable storage medium storing a computer program for running the mapping method, wherein the computer program enables a computer to execute the mapping method as described in any one of the above technical solutions.
[0013] Also included is an electronic device, comprising: one or more processors; memory; and One or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the programs include a method for executing a mapping method as described in any one of the above technical solutions.
[0014] The above technical solution has the following advantages or beneficial effects: 1. The first mapping strategy for traversing the first quantum circuit is determined through a directed acyclic graph, and the second mapping strategy is obtained by screening and exchanging the SWAP gates through a search algorithm. The second quantum circuit is traversed according to the second mapping strategy, and the mapping result obtained updates the first mapping strategy, controls the first quantum circuit to map, and improves the quality impact of the initial mapping on the mapping of the entire quantum circuit.
[0015] 2. The quantum circuit is traversed according to the heuristic search. Compared with the exhaustive search method, the search space is greatly reduced. The SWAP candidate queue is effectively evaluated by constructing a cost function. The selected SWAP operation is based on global considerations, and the global optimal solution is selected to realize the quantum bit mapping process, which reduces the complexity of searching each dual quantum gate. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 The process of the mapping method proposed by the present invention Figure 1 ; Figure 2 The process of the mapping method proposed by the present invention Figure 2 ; Figure 3 The process of the mapping method proposed by the present invention Figure 3 ; Figure 4 It is a structural schematic diagram of the control system proposed by the present invention; Figure 5 A schematic diagram of a directed acyclic graph generated in the present invention; Figure 6 It is a schematic diagram of the structure of the first quantum circuit and the second quantum circuit in the present invention; Figure 7 It is a structural diagram of the heuristic search algorithm based on SWAP in the present invention.
[0017] Legend: 1. Mapping module; 2. Search module; 3. Calculation module; 4. Update module. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] Reference Figure 1 An embodiment of the present invention provides: a quantum bit mapping method, comprising: traversing the double quantum gates in the first quantum circuit to construct a directed acyclic graph, generating a first mapping strategy as a starting point; traversing the first quantum circuit according to the first mapping strategy through a search algorithm, screening the SWAP gates to be inserted, selecting the lowest SWAP operation, adding it to the first quantum circuit for exchange, and obtaining a second mapping strategy; generating a second quantum circuit symmetrical to the first quantum circuit, traversing the second quantum circuit according to the second mapping strategy, and updating the first mapping strategy according to the obtained mapping result, and controlling the first quantum circuit to perform mapping.
[0020] The applicant discovered in the study that in order to use NISQ hardware devices, the quantum circuit program must be compiled into the target device, which includes mapping logical qubits to the physical qubits of the device. In fact, for physical qubits on NISQ devices, a qubit can only be directly coupled to its adjacent qubits. Therefore, for a specific mapping, the two-qubit gate can only be applied to a limited number of logical qubit pairs, that is, their corresponding physical qubit pairs are directly coupled, which makes it impossible for quantum circuits to be executed directly on NISQ devices. By using heuristic search to find suitable SWAP operations and inserting a series of SWAP operations to exchange logical qubits, the quantum program can be executed on the NISQ device.
[0021] The current scheme has shortcomings in terms of quantum circuit execution efficiency, scope of application, and time and space costs. The main reasons for these shortcomings are as follows: First, the choice of the initial mapping strategy will affect the quality of the generated quantum circuit. The current scheme uses a random mapping strategy, which leads to low efficiency of overall circuit execution.
[0022] Second, most of the current schemes are developed on ideal one-dimensional or two-dimensional lattice models and are not suitable for NISQ devices with irregular or limited coupling connections.
[0023] Third, the current scheme uses an exhaustive mapping search, which requires a larger search space, and the initial mapping solution lacks global optimization capabilities and requires a longer running time.
[0024] Due to the unbalanced development of quantum hardware and software technology, there is a gap between quantum hardware and software. On NISQ devices, the mapping of logical qubits to physical qubits becomes complicated due to noise and connection limitations. To solve this problem, we will start with the structural characteristics of quantum circuits, use the symmetry principle of quantum circuits and combine the nearest neighbor optimization strategy to design a more efficient mapping strategy to improve the fault tolerance and performance of quantum computers.
[0025] Starting from the efficiency of the algorithm, the present invention introduces an efficient search algorithm, such as a genetic algorithm, simulated annealing or heuristic search algorithm, to improve the search efficiency and global optimization capability. Through the efficient search algorithm, a better mapping scheme can be found in a shorter time, the search space can be reduced, and the mapping efficiency can be improved; the present invention abandons the exhaustive mapping search, reduces the search space and execution time. The heuristic search method is adopted to obtain the mapping relationship between the logical bit and the physical bit through two traversal processes.
[0026] The specific method is as follows: S1: Calculate the distance matrix, traverse the double quantum gates in the first quantum circuit of the logical quantum bit to construct a directed acyclic graph, and generate the first mapping strategy; S2: Determine whether the preceding layer is empty. If not, traverse the first quantum circuit according to the first mapping strategy through the search algorithm, screen the SWAP gate to be inserted, select the lowest SWAP operation, add it to the first quantum circuit for exchange, and obtain the second mapping strategy; S3: Generate a second quantum circuit symmetrical to the first quantum circuit, traverse the second quantum circuit according to the second mapping strategy, and update the first mapping strategy according to the obtained mapping result, and control the first quantum circuit to map the physical quantum bit.
[0027] In this embodiment, a first mapping strategy for traversing the first quantum circuit is determined by a directed acyclic graph, a second mapping strategy is obtained by screening and exchanging SWAP gates through a search algorithm, the second quantum circuit is traversed according to the second mapping strategy, the obtained mapping result updates the first mapping strategy, and the first quantum circuit is controlled to perform mapping, thereby improving the quality influence of the initial mapping on the mapping of the entire quantum circuit.
[0028] By traversing the quantum circuit according to the heuristic search, the search space is greatly reduced compared with the exhaustive search method. By constructing a cost function to effectively evaluate the SWAP candidate queue, the selected SWAP operation is based on global considerations, the global optimal solution is selected, and the quantum bit mapping process is implemented, which reduces the complexity of searching each dual quantum gate.
[0029] When all the preceding gates in the leading edge of the double quantum gate have been executed, the double quantum gate is placed in the preceding layer of the directed acyclic graph and the preceding layer is initialized.
[0030] In this embodiment, first, the distance matrix is calculated. Through the given quantum device coupling graph, the Floyd-Warshall algorithm is used to calculate the shortest paths of all quantum bit pairs to obtain the distance matrix D. In the coupling graph, exchanging a pair of quantum bits requires a SWAP operation, and the distance of each edge in the distance matrix D is set to 1. Therefore, the distance matrix D[i][j] represents the distance between the first and second quantum bits. Line The column elements represent the conversion of logical qubits from physical qubits Moving to physical qubits Minimum number of SWAP operations required.
[0031] Secondly, a directed acyclic graph (DAG) is used to represent the constraints between the double quantum gates in the first quantum circuit. A directed acyclic graph is constructed by traversing the double quantum gate sequence in the first quantum circuit, and the directed acyclic graph is generated based on the first quantum circuit.
[0032] Then, the predecessor layer (denoted as F) is defined as the set of all two-quantum gates in the directed acyclic graph that have no unexecuted predecessors (refer to Figure 5 ). For a double quantum gate, when all the previous order gates in its leading edge have been executed, it can be placed in the previous order layer F. By checking the directed acyclic graph, all vertices with in-degree 0 in the graph are selected, that is, the corresponding double quantum gates have no dependencies, so as to initialize the previous order layer.
[0033] Finally, in the preprocessing stage, since there is no initial mapping strategy, it is necessary to randomly generate the first mapping strategy π as the starting point. For example, the physical quantum bit Corresponding logical qubit , correspond wait.
[0034] Scan the directed acyclic graph from the previous layer to generate an execution gate list. According to the first mapping strategy, find the quantum bit pair that can execute the double quantum gate and add it to the execution gate list. Determine whether the execution gate list is empty. If not, traverse the execution gate list, delete the gates in the execution gate list from the previous layer, and obtain the successor gate from the directed acyclic graph. Add the successor gate to the previous layer and judge the execution gate list again; if yes, obtain the SWAP candidate list, traverse the SWAP gates in the SWAP candidate list, and select the SWAP operation with the smallest cost function value by calculating the cost function.
[0035] Reference Figure 2 In this embodiment, the entire directed acyclic graph is scanned from the previous layer, and a SWAP operation is inserted to ensure that all double quantum gates can be executed. The specific steps are as follows: S21: Determine whether the previous layer is empty. If yes, end. If no, initialize the execution gate list, traverse the gates in the previous layer, and determine whether the quantum gate can be executed on the hardware. If yes, add the quantum gate to the execution gate list. If no, traverse the previous layer again. S22: After adding the quantum gate to the execution gate list, determine whether the previous layer is empty again. If yes, determine whether the execution gate list is empty. If no, proceed to step S23, traverse the execution gate list, delete the corresponding gate in the previous layer, and obtain the successor gate from the directed acyclic graph. If yes, proceed to step S24; S23: Determine whether the successor gate has no correlation. If yes, add the successor gate to the previous layer, and determine again whether the execution gate list is empty. If no, return to step S22 and traverse the execution gate list again. If yes, update the second mapping strategy and enter step S25. S24: Initialize the cost function value, obtain the SWAP candidate list through the previous layer and the coupling graph, and traverse the SWAP gates in the SWAP candidate list, update the first mapping strategy, obtain each SWAP score by the cost function, and determine whether the SWAP candidate list is empty. If yes, select the SWAP operation with the smallest cost function value. If no, continue to traverse the SWAP gates in the SWAP candidate list; S25: Update the second mapping strategy according to the SWAP operation with the smallest cost function value, and determine whether the preceding layer is empty. If yes, end the process; if no, return to step S21.
[0036] Extracting logical qubits in a double quantum gate and , find the corresponding physical quantum bit according to the first mapping strategy π and ,Right now In the coupling diagram, if and If connected, and The double quantum gate on can be executed on the hardware device, adding it to the list of executable gates.
[0037] Check the successor gates. If the execution gate list is not empty, delete all gates in the execution list from the previous layer. Then, check the successor gates of these executed gates. and If no gate in the previous layer is applied to any of them, the subsequent gate is executable and is added to the previous layer. After one round of execution, the list of executed gates is checked from the beginning.
[0038] If the execution gate list is empty, all gates in the previous layer can be executed at the software level but cannot be executed on the hardware device, so a SWAP gate needs to be inserted to "swap" the physical qubit positions to ensure that the target qubits are adjacent.
[0039] Filter the SWAP candidate list and only search for SWAP gates associated with qubits in the previous layer, rather than searching for mappings, which would require exponential time and space. For example, a double quantum gate in the previous layer can find the corresponding physical qubit in the coupling map. , and then find its three adjacent qubits By finding the logical qubit corresponding to the physical qubit If the logical qubit pair As long as the two qubits are connected by an edge in the coupling graph and the hardware can implement a double quantum gate between the two qubits, the SWAP gate can be inserted. Add the SWAP operation to the SWAP candidate list and repeat the above operation for all qubits involved in the previous layer.
[0040] Use the heuristic cost function to evaluate each SWAP operation in the SWAP candidate list, select the lowest SWAP operation, add it to the quantum circuit to obtain the mapping result after the quantum bit exchange, and update the first mapping π. After the update, if the previous layer is not empty, it will continue to check the gates in the executable list; otherwise, the process ends.
[0041] Reference Figure 6 , the first quantum circuit is traversed in reverse to generate the second quantum circuit. The first quantum circuit is traversed in forward direction through heuristic search according to the SWAP operation to obtain the second mapping strategy, and the second quantum circuit is traversed according to the second mapping strategy.
[0042] In this embodiment, due to the reversibility of the quantum circuit, a second quantum circuit symmetrical to the first quantum circuit can be generated. The quantum gate that is executed last in the first quantum circuit becomes the first gate executed in the second quantum circuit through reverse traversal. This symmetry provides a new idea for optimizing the initial mapping: if the final mapping of the first quantum circuit is obtained through traversal, the final mapping can be used as the initial mapping to solve the quantum bit mapping problem of the second quantum circuit, and the final mapping result of the second quantum circuit will become the initial mapping result of the first quantum circuit. Because it is considered from the perspective of the entire quantum circuit, which contains all quantum gates, a quantum circuit of better quality will be obtained after updating the mapping.
[0043] The gates close to the starting point of the quantum circuit have a greater impact on the initial mapping optimization, while the gates far from the starting point have less impact, but still affect the forward and backward traversal process. The reverse traversal technique is used to generate a high-quality mapping strategy that takes global information into account.
[0044] The sum of the distances between all quantum bit pairs in the previous layer is taken as the cost function, and the cost function value is obtained by cumulative summation. The SWAP operation with the smallest cost function value is selected, and the successor gates in the previous layer are taken as the extended set. The quantum gates in the extended set and the previous layer are summed, and the attenuation parameter is added. The cost function is used for calculation, and the SWAP operations to be executed in parallel are selected.
[0045] In this embodiment, the heuristic cost function is used as a consideration to evaluate each SWAP operation to determine whether it can move the quantum bits in the previous layer closer to the target position to ensure that the double quantum gates in the previous layer can be successfully executed on the physical quantum bits. Secondly, in addition to considering the double quantum gates in the previous layer, the cost function should also consider more subsequent unexecuted double quantum gates to achieve more efficient and forward-looking quantum bit movement operations. In addition, the cost function needs to have the ability to control the parallelism of the inserted SWAP operation to achieve a trade-off between the depth of the quantum circuit and the number of quantum gates.
[0046] Reference Figure 3 , the specific design steps of the heuristic cost function are: S31: Calculate the minimum number of SWAPs required to move two adjacent physical quantum bits on the quantum device based on the nearest neighbor cost function; S32: Introduce the extended set E, and sum the quantum gates in the extended set and the previous layer; S33: Introducing a decay parameter in the heuristic cost function enables selecting more SWAP operations that can be executed in parallel, thereby reducing the circuit depth or the number of additional gates.
[0047] The minimum number of SWAPs required to move two adjacent physical qubits on the quantum device is calculated based on the nearest neighbor cost function (NNC). On NISQ devices with irregular chip coupling, the nearest neighbor cost function corresponds to the shortest path length between two physical qubits on the coupling graph, that is, the distance matrix D. In the algorithm design, the sum of the distances between all qubit pairs in the previous layer is used as the basic heuristic cost function, and the basic heuristic cost function value is obtained by cumulative summation. .if is very small, which usually means that the two qubits from a pair of qubits in the previous layer are very close to each other on the coupling graph, and the candidate SWAP operation is more likely to make the gate in the previous layer become executable.
[0048] ; in, represents the first mapping strategy, represents a logical double quantum gate, and express The logical qubit position of the action, Reference Figure 7 Although the nearest neighbor cost function can guide the heuristic search and solve the movement of quantum bits, it does not take into account the remaining double quantum gates except those in the previous layer. Therefore, the movement of local quantum bits will not only affect the gates in the previous layer, but also its successor gates. To realize the quantum gate sequence of the previous layer, it is necessary to select the appropriate SWAP operation in the coupling diagram. The red bit pairs represent the bit sequences that can be exchanged. After screening, and SWAP between is a better choice because it not only solves the dependency of the gates in the previous layer, but also makes and The successor gate is closer, so the extended set E is introduced. Since both the extended set and the previous layer will affect the heuristic cost function, the updated heuristic cost function sums the quantum gates in the extended set and the previous layer to achieve forward-looking capability. The size setting of the extended set will affect the effectiveness of the heuristic cost function. Therefore, the present invention adds the current related successor gates in the previous layer to the extended set. If the circuit has n quantum bits, the size of the extended set E is set to be equal to the current or The associated n-1 number of quantum gates gives a practical expansion set.
[0049] The decay parameter is introduced into the heuristic cost function, which indicates that a qubit has recently participated in the execution of the SWAP operation. The purpose of the introduction is to be able to select more SWAP operations that can be executed in parallel, so as to reduce the circuit depth or the number of additional gates. When a qubit has recently participated in the SWAP operation, its decay parameter will increase. , thereby reducing the priority of participating in subsequent SWAP operations. Therefore, this decay parameter makes the heuristic search more inclined to select non-overlapping SWAP operations, and the generated lines have better parallelism.
[0050] The designed heuristic cost function is:
[0051] By designing a heuristic cost function to effectively evaluate the SWAP candidate queue, the selected SWAP operation is based on global considerations and the global optimal solution is selected. The quantum bit mapping process is implemented by traversal, which reduces the complexity of searching each dual quantum gate.
[0052] Example 2 Reference Figure 4 , a quantum bit mapping control system, the control system is applicable to the mapping method of any one of the above technical solutions, including: Mapping module 1, traversing the first quantum circuit to construct a directed acyclic graph, generating a second quantum circuit symmetrical to the first quantum circuit, controlling the first quantum circuit or the second quantum circuit to perform mapping, and generating a first mapping strategy; Search module 2, screening the SWAP gates of the first quantum circuit through a search algorithm, and finding a quantum bit pair that executes a double quantum gate according to a first mapping strategy; The calculation module 3 calculates the SWAP operation with the minimum cost function value and adds it to the first quantum circuit to obtain the second mapping strategy after the quantum bit exchange; The updating module 4 controls the second quantum circuit to traverse according to the second mapping strategy, and updates the first mapping strategy according to the obtained mapping result.
[0053] It is understandable that the control system provided by the embodiment of the present invention corresponds to the above-mentioned mapping method, and the explanations, examples, beneficial effects and other parts of the relevant contents can refer to the corresponding contents in the mapping method, which will not be repeated here.
[0054] Example 3 A computer-readable storage medium stores a computer program for executing a mapping method, wherein the computer program causes a computer to execute the following steps: S1: Calculate the distance matrix, traverse the double quantum gates in the first quantum circuit of the logical quantum bit to construct a directed acyclic graph, and generate the first mapping strategy; S2: Determine whether the preceding layer is empty. If not, traverse the first quantum circuit according to the first mapping strategy through the search algorithm, screen the SWAP gate to be inserted, select the lowest SWAP operation, add it to the first quantum circuit for exchange, and obtain the second mapping strategy; S3: Generate a second quantum circuit symmetrical to the first quantum circuit, traverse the second quantum circuit according to the second mapping strategy, and update the first mapping strategy according to the obtained mapping result, and control the first quantum circuit to map the physical quantum bit.
[0055] Example 4 An electronic device, comprising: one or more processors; memory; and One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the programs comprising steps for performing the following steps: S1: Calculate the distance matrix, traverse the double quantum gates in the first quantum circuit of the logical quantum bit to construct a directed acyclic graph, and generate the first mapping strategy; S2: Determine whether the preceding layer is empty. If not, traverse the first quantum circuit according to the first mapping strategy through the search algorithm, screen the SWAP gate to be inserted, select the lowest SWAP operation, add it to the first quantum circuit for exchange, and obtain the second mapping strategy; S3: Generate a second quantum circuit symmetrical to the first quantum circuit, traverse the second quantum circuit according to the second mapping strategy, and update the first mapping strategy according to the obtained mapping result, and control the first quantum circuit to map the physical quantum bit.
[0056] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A quantum bit mapping method, characterized in that: include: Traversing the double quantum gates in the first quantum circuit of the logical quantum bit to construct a directed acyclic graph and generate a first mapping strategy; Traversing the first quantum circuit according to the first mapping strategy through a search algorithm, screening the SWAP gates to be inserted, selecting the lowest SWAP operation, adding it to the first quantum circuit for exchange, and obtaining a second mapping strategy; A second quantum circuit symmetrical to the first quantum circuit is generated, the second quantum circuit is traversed according to a second mapping strategy, and the first mapping strategy is updated according to the obtained mapping result, and the first quantum circuit is controlled to map the physical quantum bit.
2. The mapping method according to claim 1, characterized in that: When all the preceding gates in the leading edge of the double quantum gate have been executed, the double quantum gate is placed in the preceding layer of the directed acyclic graph and the preceding layer is initialized.
3. The mapping method according to claim 2, characterized in that: The directed acyclic graph is scanned from the preceding layer to generate an execution gate list, and according to the first mapping strategy, a quantum bit pair capable of executing a double quantum gate is searched and added to the execution gate list.
4. The mapping method according to claim 3, characterized in that: Determine whether the execution gate list is empty. If not, traverse the execution gate list, delete the gates in the execution gate list from the previous layer, obtain the successor gates from the directed acyclic graph, add the successor gates to the previous layer, and determine the execution gate list again; If yes, obtain the SWAP candidate list, traverse the SWAP gates in the SWAP candidate list, and select the SWAP operation with the smallest cost function value by calculating the cost function.
5. The mapping method according to claim 1, characterized in that: The first quantum circuit is traversed in reverse to generate the second quantum circuit. The first quantum circuit is traversed in forward direction through heuristic search according to the SWAP operation to obtain the second mapping strategy, and the second quantum circuit is traversed according to the second mapping strategy.
6. The mapping method according to claim 1, characterized in that: The sum of the distances between all quantum bit pairs in the previous layer is used as the cost function, the cost function value is obtained by cumulative summation, and the SWAP operation with the smallest cost function value is selected.
7. The mapping method according to claim 2, characterized in that: The successor gates in the preceding layer are taken as an extended set, the quantum gates in the extended set and the preceding layer are summed, and an attenuation parameter is added, and the cost function is used for calculation to select the SWAP operation to be executed in parallel.
8. A quantum bit mapping control system, characterized in that: The control system is applicable to the mapping method according to any one of claims 1 to 7, including: A mapping module, traversing the first quantum circuit to construct a directed acyclic graph, generating a second quantum circuit symmetrical to the first quantum circuit, controlling the first quantum circuit or the second quantum circuit to perform mapping, and generating a first mapping strategy; A search module, which screens the SWAP gates of the first quantum circuit through a search algorithm and searches for a quantum bit pair that executes a double quantum gate according to a first mapping strategy; The calculation module calculates the SWAP operation with the minimum cost function value and adds it to the first quantum circuit to obtain the second mapping strategy after the quantum bit exchange; An updating module controls the second quantum circuit to traverse according to the second mapping strategy, and updates the first mapping strategy according to the obtained mapping result.
9. A computer-readable storage medium, characterized in that: It stores a computer program for running the mapping method, wherein the computer program enables a computer to execute the mapping method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: include: one or more processors; Memory; as well as One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the programs comprising instructions for executing the mapping method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Systems and methods for quantum processor topology
CN109964239A
Quantum circuit mapping method and device and electronic equipment
CN117436535A
Quantum state transmission regulation and control parameter determination method and related device
CN118133975A
Cited By
Quantum bit mapping method and device, chip, electronic equipment, storage medium and computer program product
CN119918685A
Efficient quantum circuit mapping method and system based on local search algorithm
CN120031146A
Quantum bit mapping method based on cross-graph attention mechanism and universal compiler
CN120525073A
Quantum bit mapping method based on cross-graph attention mechanism and general compiler
CN120525073B
Quantum bit mapping method, device, equipment, medium and computer program product
CN120851234A
