Layout method and quantum computing low-code platform for quantum computing low-code programming
By employing a layout method based on low-code quantum computing programming, the layout updates of quantum circuits are automatically processed, solving the problem of high difficulty in quantum computing programming and enabling efficient quantum circuit design and modification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 中电信量子信息科技集团有限公司
- Filing Date
- 2024-11-04
- Publication Date
- 2026-04-28
AI Technical Summary
Quantum computing programming requires highly skilled technical personnel, has low programming efficiency, and makes it difficult for users to design and modify quantum circuits.
This paper provides a layout method for low-code programming in quantum computing. By acquiring the position information of the target quantum gate, and utilizing the node position information set and collision detection technology, the layout update of the quantum circuit is automatically processed to ensure the correctness and physical realizability of the circuit.
It reduces the difficulty of quantum computing programming, improves development efficiency, and ensures the logical correctness and physical realizability of quantum circuits. Users can design and modify quantum circuits through simple operations.
Smart Images

Figure CN119578572B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of quantum computing, and more specifically, to a layout method and a quantum computing low-code platform for low-code programming. Background Technology
[0002] Quantum computers, which utilize qubits for computation, can perform computational tasks that are difficult or impossible for classical computers. However, programming and operating quantum computing places extremely high demands on the expertise of relevant personnel, requiring a deep foundation of professional knowledge. The practical application of quantum computing is quite challenging, and its programming efficiency is relatively low. Summary of the Invention
[0003] This application provides a layout method and a low-code platform for quantum computing low-code programming.
[0004] This application provides a layout method for low-code programming in quantum computing, the method comprising:
[0005] In response to an input operation, the position information of the first target node in the first quantum circuit where the target quantum gate is placed is obtained;
[0006] The first quantum gate to be processed is determined based on the first target node position information and the set of node position information, wherein the set of node position information is used to indicate the set of node position information of the quantum gate in the first quantum circuit;
[0007] A second quantum circuit is obtained based on the target quantum gate and the first quantum gate to be processed, so as to realize the layout update of the first quantum circuit.
[0008] Thus, this application provides a layout method for low-code programming of quantum computing. First, in response to an input operation, the position information of a first target node in a first quantum circuit is obtained, indicating the placement of a target quantum gate. Next, a first quantum gate to be processed is determined based on the first target node position information and a set of node position information, where the set of node position information indicates the set of node position information for quantum gates in the first quantum circuit. Finally, a second quantum circuit is obtained based on the target quantum gate and the first quantum gate to be processed, thereby updating the layout of the first quantum circuit. In this way, the low-code platform can automatically handle the layout update of the quantum circuit, ensuring the correctness and physical realizability of the circuit. Users can design and modify quantum circuits through simple operations, such as selecting and placing quantum gates, without needing to delve into the details of the quantum circuit layout. This significantly reduces the difficulty of quantum computing programming and improves development efficiency.
[0009] In some implementations, determining the first quantum gate to be processed based on the first target node location information and the set of node location information includes:
[0010] Based on the preset collision detection processing technology, according to the first target node position information and the position information of each node, the quantum gate in the first quantum circuit that is consistent with the first target node position information is determined as the first quantum gate to be processed.
[0011] Thus, based on the preset collision detection and processing technology, and according to the location information of the first target node and the location information of each node, the quantum gate in the first quantum circuit that matches the location information of the first target node is identified as the first quantum gate to be processed. In this way, the quantum computing low-code platform can intelligently identify and handle collision problems in quantum circuits, ensuring the rationality of circuit layout and physical realizability, thereby helping to avoid logical errors and physical constraint conflicts, and realizing automated quantum circuit design and optimization.
[0012] In some embodiments, obtaining the second quantum circuit based on the target quantum gate and the first quantum gate to be processed includes:
[0013] If there is no quantum gate in the first quantum circuit that is consistent with the position information of the first target node, the target quantum gate is placed at the first target node to obtain the second quantum circuit, where the first target node is the node corresponding to the position information of the first target node.
[0014] If a quantum gate exists in the first quantum circuit that is consistent with the location information of the first target node, a second quantum circuit is obtained based on the target quantum gate and the first quantum gate to be processed.
[0015] Thus, firstly, if no quantum gate with the same position information as the first target node exists in the first quantum circuit, the target quantum gate is placed on the first target node to obtain the second quantum circuit. The first target node is the node corresponding to the position information of the first target node. Next, if a quantum gate with the same position information as the first target node exists in the first quantum circuit, the second quantum circuit is obtained based on the target quantum gate and the first quantum gate to be processed. In this way, users can design and modify quantum circuits on a low-code platform through simple operations, while the low-code platform automatically handles complex layout and collision detection problems, thereby reducing the difficulty of quantum computing programming, improving development efficiency, and ensuring the logical correctness and physical realizability of the quantum circuits.
[0016] In some embodiments, obtaining the second quantum circuit based on the target quantum gate and the first quantum gate to be processed includes:
[0017] Move the first quantum gate to be processed from the first target node a preset distance in a preset moving direction, and obtain the position information of the second target node of the first quantum gate to be processed after the movement;
[0018] Place the target quantum gate on the first target node;
[0019] The second quantum gate to be processed is determined based on the second target node location information and the set of node location information.
[0020] The first quantum gate to be processed and the second quantum gate to be processed are processed until the node position information of all quantum gates in the first quantum circuit is different, so as to obtain the second quantum circuit.
[0021] Thus, firstly, the first quantum gate to be processed is moved a predetermined distance from the first target node in a predetermined direction, and the position information of the second target node of the first quantum gate to be processed after the movement is obtained. Next, the target quantum gate is placed on the first target node. Then, the second quantum gate to be processed is determined based on the position information of the second target node and the set of node position information. Finally, the first and second quantum gates to be processed are processed until the node position information of all quantum gates in the first quantum circuit is different, thus obtaining the second quantum circuit. In this way, through automated layout updates and collision handling, users can more easily design and modify quantum circuits without needing to delve into the underlying details, thereby improving the efficiency of circuit design and user experience, and ensuring the logical correctness and physical realizability of the quantum circuit.
[0022] In some embodiments, the method further includes:
[0023] The node position information set is updated based on the node position information of the quantum gates in the second quantum circuit.
[0024] Thus, the node position information set is updated based on the node position information of the quantum gates in the second quantum circuit. This allows the low-code platform to track the position changes of quantum gates in the quantum circuit in real time, ensuring the accuracy of the quantum circuit layout and logical consistency.
[0025] In some embodiments, the method further includes:
[0026] Based on the obtained quantum hardware structure, a quantum hardware coupling diagram is constructed, wherein the quantum hardware structure is the hardware structure of the quantum device that executes the second quantum circuit;
[0027] Based on the quantum hardware coupling diagram, the second quantum circuit is optimized according to a preset quantum gate to obtain the third quantum circuit.
[0028] Thus, firstly, based on the obtained quantum hardware structure, a quantum hardware coupling diagram is constructed, whereby the quantum hardware structure represents the hardware structure of the quantum device executing the second quantum circuit. Next, based on the quantum hardware coupling diagram, the second quantum circuit is optimized according to preset quantum gates to obtain the third quantum circuit. This ensures that the quantum circuit is not only theoretically valid but also feasible on practical quantum hardware, thereby designing a quantum circuit that meets theoretical requirements and can run on existing hardware.
[0029] In some embodiments, the step of optimizing the second quantum circuit based on the quantum hardware coupling diagram and according to preset quantum gates to obtain the third quantum circuit includes:
[0030] Based on the quantum hardware coupling diagram, the interacting but non-adjacent qubits in the second quantum circuit are identified as the target qubits;
[0031] The target qubit is optimized according to a preset quantum gate to obtain a third quantum circuit.
[0032] Thus, firstly, based on the quantum hardware coupling diagram, the interacting but non-adjacent qubits in the second quantum circuit are identified as target qubits. Next, the target qubits are optimized according to preset quantum gates to obtain the third quantum circuit. This third quantum circuit is designed to better fit the actual structure of quantum hardware, thereby improving its feasibility on quantum devices.
[0033] In some embodiments, the method further includes:
[0034] The third quantum circuit is analyzed to obtain its dependencies.
[0035] The third quantum circuit is optimized based on the aforementioned dependency relationship to obtain the fourth quantum circuit.
[0036] Therefore, firstly, the third quantum circuit is analyzed to obtain its dependencies. Then, based on these dependencies, the third quantum circuit is optimized to obtain the fourth quantum circuit. In this way, by optimizing the dependencies between qubits, the number of quantum logic gates can be reduced, lowering the complexity of quantum computing, thereby increasing computational speed and reducing the required computational resources.
[0037] In some embodiments, the method further includes:
[0038] Based on a preset rendering algorithm, a quantum circuit diagram in a graphical interface is generated according to the fourth quantum circuit to ensure timely updates of the quantum circuit diagram.
[0039] Thus, based on a preset rendering algorithm, a quantum circuit diagram in the graphical interface is generated according to the fourth quantum circuit, ensuring the timely updating of the quantum circuit diagram. This allows users to intuitively design and modify quantum circuits on a low-code platform, while the quantum computing low-code platform automatically handles circuit rendering and updates, ensuring consistency in the user interface and user experience.
[0040] This application provides a low-code quantum computing platform, which includes a quantum circuit layout module configured as follows:
[0041] In response to an input operation, the position information of the first target node in the first quantum circuit where the target quantum gate is placed is obtained;
[0042] The first quantum gate to be processed is determined based on the first target node position information and the set of node position information, wherein the set of node position information is used to indicate the set of node position information of the quantum gate in the first quantum circuit;
[0043] A second quantum circuit is obtained based on the target quantum gate and the first quantum gate to be processed, so as to realize the layout update of the first quantum circuit.
[0044] Thus, this application provides a low-code quantum computing platform, including a quantum circuit layout module. This module, in response to an input operation, acquires the position information of a first target node within a first quantum circuit, placing a target quantum gate. It can also determine a first quantum gate to be processed based on the first target node position information and a set of node position information, where the set of node position information indicates the set of node position information for quantum gates within the first quantum circuit. Furthermore, the quantum circuit layout module can derive a second quantum circuit based on the target quantum gate and the first quantum gate to be processed, thereby updating the layout of the first quantum circuit. In this way, the quantum circuit layout module enables the low-code quantum computing platform to provide an intuitive and user-friendly circuit design experience. Users can construct and modify quantum circuits through simple drag-and-drop operations, while complex layout updates and collision detection are handled automatically by the module, ensuring the correctness and physical realizability of the circuit.
[0045] Additional aspects and advantages of embodiments of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of this application. Attached Figure Description
[0046] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, wherein:
[0047] Figure 1This is one of the flowcharts illustrating a low-code implementation method for quantum computing programming according to certain embodiments of this application;
[0048] Figure 2 This is a schematic diagram of the structure of a quantum computing low-code platform according to certain embodiments of this application;
[0049] Figure 3 This is a second flowchart illustrating a low-code implementation method for quantum computing programming according to certain embodiments of this application.
[0050] Figure 4 This is a schematic diagram of collision detection processing in some embodiments of this application;
[0051] Figure 5 This is the third flowchart illustrating a low-code implementation method for quantum computing programming according to certain embodiments of this application;
[0052] Figure 6 This is the fourth flowchart illustrating a low-code implementation method for quantum computing programming according to certain embodiments of this application;
[0053] Figure 7 This is the fifth flowchart illustrating a low-code implementation method for quantum computing programming according to certain embodiments of this application;
[0054] Figure 8 This is the sixth flowchart illustrating a low-code implementation method for quantum computing programming according to certain embodiments of this application;
[0055] Figure 9 This is the seventh flowchart illustrating a low-code implementation method for quantum computing programming according to certain embodiments of this application;
[0056] Figure 10 This is the eighth flowchart illustrating a low-code implementation method for quantum computing programming according to certain embodiments of this application;
[0057] Figure 11 This is the ninth flowchart illustrating a low-code implementation method for quantum computing programming according to certain embodiments of this application;
[0058] Figure 12 This is a schematic diagram of an example quantum circuit for certain embodiments of this application;
[0059] Figure 13 This is one of the schematic diagrams illustrating the addition of quantum gates to an example quantum circuit in certain embodiments of this application;
[0060] Figure 14 This is the second schematic diagram of adding quantum gates to an example quantum circuit in certain embodiments of this application. Detailed Implementation
[0061] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of this application, and should not be construed as limiting the embodiments of this application.
[0062] Quantum computers use qubits for computation, fundamentally different from traditional bit-based computers. The unique feature of qubits is that they can simultaneously exist in a superposition of 0 and 1 states, a property known as quantum superposition. Furthermore, qubits exhibit a phenomenon called quantum entanglement, where two or more qubits can form a tight connection even when separated by spacetime. These principles of quantum mechanics enable quantum computers to demonstrate enormous potential to surpass conventional computers in certain types of computational tasks.
[0063] For example, quantum computers can significantly improve computational efficiency when handling massively parallel computing tasks, executing specific search algorithms such as Grover's algorithm, and solving optimization problems such as quantum annealing. Furthermore, quantum computers have the potential to play a crucial role in quantum simulation, such as simulating chemical reactions and complex quantum phenomena in materials science—tasks that are typically extremely difficult, or even impossible, for classical computers.
[0064] However, programming and operating quantum computing places extremely high demands on the expertise of relevant personnel. Quantum programming requires not only a grasp of the fundamental principles of quantum mechanics but also a deep understanding of quantum algorithms and quantum programming languages. The design and optimization of quantum algorithms typically require a strong mathematical foundation, including knowledge of linear algebra, probability theory, and numerical analysis. Furthermore, the physical implementation and operation of quantum computers also require specialized knowledge and skills, such as the fabrication, maintenance, and measurement techniques of qubits. This makes the practical application of quantum computing quite difficult, and the programming efficiency of quantum computing is relatively low.
[0065] Based on the above issues, please refer to Figure 1 This application provides a low-code implementation method for quantum computing programming, the method comprising:
[0066] 01: In response to the input operation, obtain the position information of the first target node in the first quantum circuit where the target quantum gate is placed;
[0067] 02: Determine the first quantum gate to be processed based on the location information of the first target node and the set of node location information;
[0068] 03: Based on the target quantum gate and the first quantum gate to be processed, a second quantum circuit is obtained to update the layout of the first quantum circuit.
[0069] This application also provides a low-code implementation server, including a memory and a processor. The layout method for low-code programming of quantum computing according to this application can be implemented by the low-code implementation server of this application. Specifically, the memory stores a computer program, and the processor is used to, in response to an input operation, acquire the position information of a first target node in a first quantum circuit, and determine a first quantum gate to be processed based on the first target node position information and a set of node position information. Furthermore, it obtains a second quantum circuit based on the target quantum gate and the first quantum gate to be processed, thereby updating the layout of the first quantum circuit.
[0070] This application also provides a low-code quantum computing platform. The low-code implementation method for quantum computing programming in this application can be implemented using the low-code quantum computing platform. Specifically, the low-code quantum computing platform includes a quantum circuit layout module, which further includes an information acquisition submodule, a determination submodule, and a layout update module. The information acquisition submodule, in response to an input operation, acquires the position information of a first target node placed in a first quantum circuit. The determination submodule determines a first quantum gate to be processed based on the first target node position information and a set of node position information. The layout update module obtains a second quantum circuit based on the target quantum gate and the first quantum gate to be processed, thereby updating the layout of the first quantum circuit.
[0071] Specifically, input operations refer to actions such as clicking, dragging, and selecting performed by users when designing quantum circuits.
[0072] A target quantum gate refers to a specific quantum gate that a user wishes to add to a quantum circuit when designing and building the circuit.
[0073] The first target node location information refers to the specific location selected by the user in the quantum circuit layout in the graphical interface, which is used to place a quantum gate.
[0074] A quantum state is an abstract mathematical object, usually represented by a wave function or density matrix, used to describe all possible states of a quantum system and their probabilities.
[0075] A quantum circuit refers to the sequential application of quantum gates. Quantum circuits are commonly used to implement quantum algorithms and manipulate quantum states.
[0076] Quantum gates are fundamental operations in quantum computing, used to perform specific mathematical transformations on qubits. Similar to logic gates in traditional computers, quantum gates are the building blocks for more complex computational operations. However, unlike classical bits, which can only exist in a 0 or 1 state, qubits can exist in a superposition of 0 and 1.
[0077] Entanglement refers to a magical connection between two or more quantum systems that transcends the scope of classical physics and is a purely quantum phenomenon.
[0078] Low-code refers to the practice of developers using graphical interfaces and pre-built templates to create applications instead of manually writing large amounts of code. This accelerates the application development process while reducing development difficulty and costs. Low-code platforms typically provide visual design tools that allow developers to build user interfaces by dragging and dropping components and elements.
[0079] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of a quantum computing low-code platform 100. The quantum computing low-code platform 100 includes a quantum circuit layout module 10, a quantum circuit optimization module 20, and a rendering module 30. The quantum circuit layout module 10 is responsible for processing user input, such as dragging and dropping quantum gates to specific positions in the circuit diagram, and managing the layout of the quantum circuits. It acquires the position information of the first target node in the first quantum circuit where the target quantum gate is placed, and determines the first quantum gate to be processed based on this information. Furthermore, it is also responsible for obtaining the second quantum circuit based on the target quantum gate and the first quantum gate to be processed, thereby updating the layout of the first quantum circuit. The quantum circuit layout module 10 is the direct interface for user interaction with the quantum circuits. It receives user operation commands and translates these commands into layout changes for the quantum circuits.
[0080] The quantum circuit optimization module 20 is responsible for optimizing quantum circuits to improve computational efficiency, reduce error rates, enhance scalability, and improve algorithm performance. Based on quantum hardware coupling graphs and preset quantum gates, it analyzes the quantum circuits to obtain their dependencies and optimizes them accordingly, resulting in a more efficient version of the quantum circuit. The quantum circuit optimization module 20 is closely connected to the quantum circuit layout module 10 because it needs to receive quantum circuit data from the layout module and optimize it. The optimized circuit data is then fed back to the quantum circuit layout module 10 to update the quantum circuit layout. Simultaneously, the quantum circuit optimization module 20 also needs to work in conjunction with the rendering module 30 to ensure that the optimized circuit is correctly displayed to the user.
[0081] The rendering module 30 is responsible for converting quantum circuit data into a quantum circuit diagram in a graphical interface, allowing users to intuitively see the design effect of the quantum circuit. Based on a preset rendering algorithm, it generates the quantum circuit diagram according to the state of the quantum circuit and ensures that the quantum circuit diagram is updated in a timely manner to reflect the latest state of the quantum circuit. The rendering module 30 receives data from the quantum circuit layout module 10 and the optimization module and converts it into a graphical representation that users can intuitively understand. The rendering module 30 needs to be synchronized with the layout and optimization modules to ensure that the circuit diagram seen by the user always reflects the latest state and optimization results of the circuit.
[0082] Users perform input operations on the quantum computing low-code platform 100, such as selecting and placing a target quantum gate at a certain location in the first quantum circuit. The quantum computing low-code platform 100 records the position information of the target quantum gate as a first target node in the first quantum circuit, including row and column coordinates.
[0083] Then, the quantum computing low-code platform 100 uses a set of node location information to determine the first quantum gate to be processed. This set of node location information contains the node location information of all quantum gates in the first quantum circuit. By comparing the first target node location information with the node location information in the set, the quantum computing low-code platform 100 can determine which quantum gates need to be processed to accommodate the new quantum circuit layout.
[0084] Finally, the quantum computing low-code platform 100 generates a second quantum circuit based on the information of the target quantum gate and the first quantum gate to be processed. The second quantum circuit takes into account the position of the target quantum gate input by the user and performs necessary layout updates on the first quantum circuit.
[0085] In summary, the layout method and low-code quantum computing platform 100 provided in this application for low-code quantum computing firstly acquire the position information of a first target node in a first quantum circuit, in response to an input operation. Next, a first quantum gate to be processed is determined based on the first target node position information and a set of node position information, where the set of node position information indicates the set of node position information for quantum gates in the first quantum circuit. Finally, a second quantum circuit is obtained based on the target quantum gate and the first quantum gate to be processed, thereby updating the layout of the first quantum circuit. In this way, the low-code platform can automatically handle the layout update of the quantum circuit, ensuring the correctness and physical realizability of the circuit. Users can design and modify quantum circuits through simple operations, such as selecting and placing quantum gates, without needing to delve into the details of the quantum circuit layout. This significantly reduces the difficulty of quantum computing programming and improves development efficiency.
[0086] Please see Figure 3In some implementations, step 02 (determining the first quantum gate to be processed based on the first target node location information and the set of node location information) includes:
[0087] 021: Based on the preset collision detection processing technology, according to the first target node position information and the position information of each node, the quantum gate in the first quantum circuit that is consistent with the first target node position information is determined as the first quantum gate to be processed.
[0088] In some implementations, the information acquisition submodule is further configured to, based on a preset collision detection processing technique, determine the quantum gate in the first quantum circuit that is consistent with the position information of the first target node as the first quantum gate to be processed, according to the position information of the first target node and the position information of each node.
[0089] In some implementations, the processor is further configured to, based on a preset collision detection processing technique, determine the quantum gate in the first quantum circuit that is consistent with the position information of the first target node as the first quantum gate to be processed, according to the position information of the first target node and the position information of each node.
[0090] Specifically, the pre-defined collision detection and handling technology refers to a technique used in quantum computing low-code programming platforms to detect and resolve potential conflicts and collisions in quantum circuit design, ensuring the correctness of the quantum circuit design. Please refer to [link to relevant documentation]. Figure 4 In some implementations, it is assumed that the placement location of the target quantum gate A1, i.e., the location information of the first target node, is A. Both the target quantum gate A1 and the location information A are simply coordinate points in the graphical interface. Typically, to place A1 within the location information A, A and A1 must completely overlap, a rather stringent condition. To avoid this, an attribute-based boundary value adsorption process is introduced. Specifically, a circle C with center A and radius R is set for A, and a circle C1 with center A1 and radius R is set for A1. When the center A1 of circle C1 enters the range of circle C, it is considered that the target quantum gate A1 needs to be placed at the location information A of the first target node.
[0091] First, the quantum computing low-code platform 100 acquires the first target node position information of the target quantum gate placed by the user in the quantum circuit. Then, the quantum computing low-code platform 100 uses a last-in-first-out (LIFO) approach to compare the acquired first target node position with the position information of each quantum gate in the node position information set. Specifically, it uses the aforementioned preset collision detection processing technology to determine whether a quantum gate already exists at the desired placement location. If the first target node position information matches the position information of a quantum gate in the node position information set, a collision has occurred. The quantum gate whose node position information matches the first target node position information is then identified as the first quantum gate to be processed.
[0092] In this way, the quantum computing low-code platform 100 can intelligently identify and handle collision problems in quantum circuits, ensuring the rationality of circuit layout and physical realizability, thereby helping to avoid logical errors and physical constraint conflicts, and realizing automated quantum circuit design and optimization.
[0093] Please see Figure 5 In some implementations, step 03 (obtaining the second quantum circuit based on the target quantum gate and the first quantum gate to be processed) includes:
[0094] 031: If there is no quantum gate in the first quantum circuit that is consistent with the position information of the first target node, place the target quantum gate at the first target node to obtain the second quantum circuit;
[0095] 032: If there is a quantum gate in the first quantum circuit that is consistent with the position information of the first target node, the second quantum circuit is obtained based on the target quantum gate and the first quantum gate to be processed.
[0096] In some implementations, the layout update module is used to place a target quantum gate on the first target node to obtain a second quantum circuit when no quantum gate with the same position information as the first target node exists in the first quantum circuit, where the first target node is the node corresponding to the position information of the first target node. Alternatively, when a quantum gate with the same position information as the first target node exists in the first quantum circuit, the second quantum circuit is obtained based on the target quantum gate and the first quantum gate to be processed.
[0097] In some embodiments, the processor further includes placing a target quantum gate at the first target node to obtain a second quantum circuit when no quantum gate with the same position information as the first target node exists in the first quantum circuit, wherein the first target node is the node corresponding to the position information of the first target node. Alternatively, when a quantum gate with the same position information as the first target node exists in the first quantum circuit, the processor obtains the second quantum circuit based on the target quantum gate and the first quantum gate to be processed.
[0098] Specifically, a preset function is invoked to check whether there are other quantum gates to the right of the dragged position of the current target quantum gate. In the layout method for low-code programming of quantum computing provided in this application, the placement of the target quantum gate in the first quantum circuit is divided into two cases.
[0099] First, there is no positional conflict. The system checks if there is a quantum gate in the first quantum circuit that matches the position information of the first target node. Finding no conflict, meaning there is no quantum gate at the desired target node position, the system directly places the target quantum gate at that position. After placing the target quantum gate, the system obtains the second quantum circuit, where the first target node position becomes the position of the target quantum gate within the circuit.
[0100] Second, there is a situation where there is a position conflict. The system checks whether there is a quantum gate in the first quantum circuit that is consistent with the position information of the first target node. If a conflict is found, that is, a quantum gate already exists at the position of the first target node where the target quantum gate is to be placed. The system needs to determine how to update the quantum circuit layout based on the information of the target quantum gate and the first quantum gate to be processed.
[0101] In some implementations, if the target quantum gate is a two-qubit quantum gate or a more complex quantum gate, then the first target node position information includes multiple node position information. It is necessary to compare all node position information in the first target node position information with the node position information in the node position information set. The first quantum gate to be processed may include multiple quantum gates to be processed. If the quantum gate to be processed in the first quantum gate to be processed is a two-qubit quantum gate or a more complex quantum gate, and one or a portion of its node information is identical to the node information in the first target node information, then all nodes in the quantum gate to be processed need to be processed accordingly.
[0102] In this way, users can design and modify quantum circuits on a low-code platform with simple operations, while the low-code platform automatically handles complex layout and collision detection problems, thereby reducing the difficulty of quantum computing programming, improving development efficiency, and ensuring the logical correctness and physical realizability of quantum circuits.
[0103] Please see Figure 6 In some embodiments, step 032 (obtaining the second quantum circuit based on the target quantum gate and the first quantum gate to be processed) includes:
[0104] 0321: Move the first quantum gate to be processed from the first target node a preset distance in a preset moving direction, and obtain the position information of the second target node of the first quantum gate to be processed after the movement;
[0105] 0322: Place the target quantum gate at the first target node;
[0106] 0323: Determine the second quantum gate to be processed based on the location information of the second target node and the set of node location information;
[0107] 0324: Process the first and second quantum gates to be processed until the node position information of all quantum gates in the first quantum circuit is different, so as to obtain the second quantum circuit.
[0108] In some implementations, the layout update submodule is further configured to move the first quantum gate to be processed from the first target node by a preset distance in a preset moving direction, and obtain the second target node position information of the moved first quantum gate to be processed. The target quantum gate is then placed on the first target node. The layout update submodule is further configured to determine the second quantum gate to be processed based on the second target node position information and the set of node position information. The first and second quantum gates to be processed are then processed until the node position information of all quantum gates in the first quantum circuit is different, thereby obtaining the second quantum circuit.
[0109] In some embodiments, the processor is further configured to move the first quantum gate to be processed from the first target node a preset distance in a preset moving direction, and acquire the second target node position information of the moved first quantum gate to be processed. The processor is also configured to place the target quantum gate on the first target node. The processor is further configured to determine the second quantum gate to be processed based on the second target node position information and a set of node position information. The processor then processes the first and second quantum gates to be processed until the node position information of all quantum gates in the first quantum circuit is different, thereby obtaining the second quantum circuit.
[0110] Specifically, the preset movement direction refers to the direction predetermined in the quantum computing low-code platform 100, such as horizontal to the right, diagonally to the left, etc. The specific direction is determined according to the actual situation and is not limited here. In the implementation of this application, horizontal to the right is taken as an example.
[0111] The preset distance refers to the distance that the quantum gate to be processed will adjust its layout each time, which is predetermined in the quantum computing low-code platform 100. The specific moving distance is determined according to the actual situation and is not limited here. In the implementation of this application, distance K is taken as an example.
[0112] After the user determines to place the target quantum gate at the first target node, the system moves the first quantum gate to be processed a distance K horizontally to the right from the first target node. Then, the system obtains the position information of the second target node for the moved first quantum gate, i.e., the node position where the first quantum gate needs to be moved. Next, the system places the target quantum gate at the first target node, which is the position initially chosen by the user.
[0113] Then, the system needs to determine whether a quantum gate already exists at the node position to which the first quantum gate to be processed needs to be moved. This involves searching the node position information set to confirm if there is any node information consistent with the second target node position information. If no node information consistent with the second target node position information exists, the first quantum gate to be processed is directly placed at the node position to be moved to, completing this quantum circuit layout update and obtaining the second quantum circuit. If node information consistent with the second target node position information exists, the quantum gate corresponding to that node information is identified as the second quantum gate to be processed. Following the steps for processing the target quantum gate and the first quantum gate to be processed, the first and second quantum gates are processed, i.e., the first quantum gate to be processed is used as the new target quantum gate, and the second quantum gate to be processed is used as the new first quantum gate to be processed. This iterative process continues until the node position information of all quantum gates in the first quantum circuit is different, resulting in the second quantum circuit.
[0114] Thus, through automated layout updates and collision handling, users can more easily design and modify quantum circuits without delving into the underlying details, thereby improving the efficiency of circuit design and user experience, and ensuring the logical correctness and physical realizability of quantum circuits.
[0115] Please see Figure 7 In some implementations, the method further includes:
[0116] 04: Update the node position information set based on the node position information of the quantum gates in the second quantum circuit.
[0117] In some embodiments, the quantum circuit layout module 10 further includes a position information update submodule, which is used to update the node position information set according to the node position information of the quantum gates in the second quantum circuit.
[0118] In some implementations, the processor is also configured to update the set of node position information based on the node position information of the quantum gates in the second quantum circuit.
[0119] Specifically, after the second quantum circuit is generated, the system needs to acquire the node position information of all quantum gates in the circuit. Then, the system compares the quantum gate node position information in the second quantum circuit with the existing set of node position information. The system then updates the node position information set according to the existing node position information of the second quantum circuit, ensuring that the information in the set remains consistent with the actual layout of the second quantum circuit.
[0120] In this way, the low-code platform can track the position changes of quantum gates in quantum circuits in real time, ensuring the accuracy of quantum circuit layout and logical consistency.
[0121] Please see Figure 8 In some implementations, the method further includes:
[0122] 05: Construct a quantum hardware coupling diagram based on the obtained quantum hardware structure;
[0123] 06: Based on the quantum hardware coupling diagram, the second quantum circuit is optimized according to the preset quantum gates to obtain the third quantum circuit.
[0124] In some implementations, the quantum computing low-code platform 100 also includes a quantum circuit optimization module 20, which is used to construct a quantum hardware coupling graph based on the acquired quantum hardware structure, and to optimize a second quantum circuit according to preset quantum gates based on the quantum hardware coupling graph to obtain a third quantum circuit.
[0125] In some implementations, the processor is further configured to construct a quantum hardware coupling graph based on the acquired quantum hardware structure, and to optimize the second quantum circuit according to preset quantum gates based on the quantum hardware coupling graph to obtain a third quantum circuit.
[0126] Specifically, quantum hardware architecture refers to the physical realization of a quantum computer, including the fabrication, maintenance, and measurement techniques of qubits, as well as the connection methods between qubits.
[0127] A quantum hardware coupling diagram is an abstract representation of the hardware structure of a quantum computer, which describes the connection and interaction between qubits.
[0128] Preset quantum gates refer to quantum gates used to change quantum states, such as the SWAP gate.
[0129] The system constructs a quantum hardware coupling graph based on the physical structure of the quantum hardware. This graph represents the connections and interactions between qubits in the quantum device. Next, the system uses this quantum hardware coupling graph as a reference to optimize the second quantum circuit. This optimization involves adjusting the position and type of quantum gates according to the physical constraints of the hardware to ensure that the second quantum circuit can execute on the quantum hardware. For example, if the quantum hardware coupling graph indicates that there are no direct connections between some qubits, but the quantum circuit needs to perform operations between these qubits, it may be necessary to insert additional quantum gates (such as SWAP gates) to change the state of the qubits, thereby achieving the desired operation. Finally, a third quantum circuit that is better adapted to the physical constraints of the quantum hardware is obtained.
[0130] This ensures that quantum circuits are not only theoretically valid but also feasible on actual quantum hardware, thus enabling the design of quantum circuits that meet theoretical requirements and can run on existing hardware.
[0131] Please see Figure 9 In some implementations, step 06 (optimizing the second quantum circuit according to preset quantum gates based on the quantum hardware coupling diagram to obtain the third quantum circuit) includes:
[0132] 061: Based on the quantum hardware coupling diagram, the interacting but non-adjacent qubits in the second quantum circuit are identified as the target qubits;
[0133] 062: Based on the preset quantum gate, the target qubit is optimized to obtain the third quantum circuit.
[0134] In some embodiments, the quantum circuit optimization module 20 is further configured to determine, based on the quantum hardware coupling diagram, the interacting but non-adjacent qubits in the second quantum circuit as target qubits, and to optimize the target qubits according to preset quantum gates to obtain a third quantum circuit.
[0135] In some implementations, the processor is further configured to identify target qubits that interact with each other but are not adjacent in the second quantum circuit based on a quantum hardware coupling graph, and to optimize the target qubits according to preset quantum gates to obtain a third quantum circuit.
[0136] Specifically, the system monitors the real-time state information of the current quantum computing simulator or physical machine, including the number of qubits, connectivity, and execution speed. Based on the real-time quantum hardware coupling graph of the current quantum computing simulator or physical machine, it identifies interacting but non-adjacent qubits in the second quantum circuit and designates these qubits as target qubits. For example, if the quantum hardware coupling graph shows that there are no direct connections between some qubits, but the quantum circuit needs to perform operations between these qubits, then these qubits will become target qubits.
[0137] Then, pre-defined quantum gates, such as SWAP gates, are inserted between the target qubits to change their states, resulting in a third quantum circuit. This ensures that all operations within the quantum circuit can be executed effectively under the physical constraints of the quantum hardware. Furthermore, based on the hardware state information, the system automatically selects the layout strategy best suited to the current hardware environment. For example, in cases of poor hardware connectivity, the system prioritizes a layout that reduces the distance between quantum gates to minimize latency caused by cross-qubit operations. When hardware resources are abundant, the system can choose a more uniformly distributed layout strategy to reduce the operation density in the same area.
[0138] Thus, the resulting third quantum circuit is designed to better fit the actual structure of quantum hardware, thereby improving the feasibility of quantum circuits on quantum devices.
[0139] Please see Figure 10 In some implementations, the method further includes:
[0140] 07: Perform analytical processing on the third quantum circuit to obtain its dependencies;
[0141] 08: Optimize the third quantum circuit based on the dependency relationship to obtain the fourth quantum circuit.
[0142] In some embodiments, the quantum circuit optimization module 20 is further configured to perform analytical processing on the third quantum circuit to obtain the dependencies of the third quantum circuit, and to optimize the third quantum circuit based on the dependencies to obtain the fourth quantum circuit.
[0143] In some implementations, the processor is further configured to perform analytical processing on the third quantum circuit to obtain its dependencies, and to optimize the third quantum circuit based on these dependencies to obtain the fourth quantum circuit.
[0144] Specifically, analytical processing refers to a depth-first or breadth-first search of the third quantum circuit to determine the dependencies between quantum gates.
[0145] Dependency refers to the interaction and dependence between different qubits or quantum gates in a quantum circuit. Dependency includes the execution order of quantum gates, the interaction between qubits, etc.
[0146] Optimization refers to rearranging the execution order of quantum gates in the third quantum circuit, reducing conflicts between qubits in the third quantum circuit, and reducing unnecessary quantum gate operations in the third quantum circuit.
[0147] A depth-first search or breadth-first search is performed on the third quantum circuit to obtain the dependencies between the quantum gates. Then, based on these dependencies, the execution order of the quantum gates in the third quantum circuit is rearranged to reduce collisions between qubits and unnecessary quantum gate operations, resulting in a fourth quantum circuit. This fourth quantum circuit is designed to better suit the actual structure and execution efficiency of quantum hardware, thereby increasing the likelihood of execution on quantum devices. For example, by swapping the order of quantum gates or merging multiple quantum gates, the circuit depth can be reduced, thus improving the circuit's execution efficiency.
[0148] In this way, by optimizing the dependencies between qubits, the number of quantum logic gates can be reduced, the complexity of quantum computing can be lowered, thereby increasing computing speed and reducing the required computing resources.
[0149] Please see Figure 11 In some implementations, the method further includes:
[0150] 09: Based on the preset rendering algorithm, the quantum circuit diagram in the graphical interface is generated according to the fourth quantum circuit to ensure the timely updating of the quantum circuit diagram.
[0151] In some implementations, the rendering module 30 is used to generate a quantum circuit diagram in the graphical interface based on a preset rendering algorithm and the fourth quantum circuit, so as to ensure timely updates of the quantum circuit diagram.
[0152] In some implementations, the processor is used to generate a quantum circuit diagram in a graphical interface based on a preset rendering algorithm, according to the fourth quantum circuit, to ensure timely updates of the quantum circuit diagram.
[0153] Specifically, the preset rendering algorithm refers to the algorithm used to convert the abstract representation of quantum circuits into a quantum circuit diagram that can be displayed in a graphical interface, ensuring that the design and layout of quantum circuits can be presented to users in an intuitive and easy-to-understand way.
[0154] First, the system needs to parse the data structure of the fourth quantum circuit, including the number of qubits, the types and locations of quantum gates, and the dependencies between quantum gates. Then, based on a preset rendering algorithm, the system converts the data structure of the fourth quantum circuit into a quantum circuit diagram in a graphical interface and updates the CSS transform property of each node in the fourth quantum circuit in batches. The rendering algorithm takes into account the layout of the qubits, the visual representation of the quantum gates, and the connections between them.
[0155] Next, the rendering algorithm generates a graphical interface that includes qubits, quantum gates, and the connections between them. This interface can be interactive, allowing users to perform actions such as adding or deleting quantum gates and adjusting the positions of qubits. Furthermore, when the user modifies the quantum circuit, the system needs to update the quantum circuit diagram in the graphical interface in a timely manner to reflect the latest circuit state.
[0156] In this way, users can intuitively design and modify quantum circuits on the low-code platform, while the quantum computing low-code platform 100 can automatically handle the rendering and updating of circuits, ensuring the consistency of the user interface and user experience.
[0157] This application provides a quantum computing low-code platform 100, which includes a quantum circuit layout module 10. The quantum circuit layout module 10 is configured as follows:
[0158] In response to the input operation, the position information of the first target node in the first quantum circuit is obtained.
[0159] The first quantum gate to be processed is determined based on the first target node location information and the set of node location information. The set of node location information is used to indicate the set of node location information of the quantum gate in the first quantum circuit.
[0160] The second quantum circuit is obtained based on the target quantum gate and the first quantum gate to be processed, so as to realize the layout update of the first quantum circuit.
[0161] Specifically, the quantum computing low-code platform 100 includes a quantum circuit layout module 10. The quantum circuit layout module 10 is capable of acquiring, in response to an input operation, the position information of a first target node placed in a first quantum circuit. It can also determine a first quantum gate to be processed based on the first target node position information and a set of node position information, where the set of node position information indicates the set of node position information for quantum gates in the first quantum circuit. Furthermore, the quantum circuit layout module 10 can obtain a second quantum circuit based on the target quantum gate and the first quantum gate to be processed, thereby updating the layout of the first quantum circuit.
[0162] In summary, this application provides a quantum computing low-code platform 100, which includes a quantum circuit layout module 10. The quantum circuit layout module 10 is capable of acquiring the position information of a first target node in a first quantum circuit in response to an input operation. It can also determine a first quantum gate to be processed based on the first target node position information and a set of node position information, where the set of node position information indicates the set of node position information for quantum gates in the first quantum circuit. Furthermore, the quantum circuit layout module 10 can obtain a second quantum circuit based on the target quantum gate and the first quantum gate to be processed, thereby updating the layout of the first quantum circuit. Thus, the quantum circuit layout module 10 enables the quantum computing low-code platform 100 to provide an intuitive and easy-to-use circuit design experience. Users can build and modify quantum circuits through simple drag-and-drop operations, while complex layout updates and collision detection are handled automatically by the module, ensuring the correctness and physical realizability of the circuit.
[0163] The following example illustrates the low-code implementation of the quantum computing programming described above. Please refer to... Figure 13 , Figure 12 The diagram below illustrates a quantum circuit, hereinafter referred to as quantum circuit F. Quantum circuit F has four single-qubit quantum gates H1-H4 and two two-qubit quantum gates CZ1 and CZ2. Now, we will add new quantum gates to quantum circuit F. It should be noted that the following example only illustrates the externally apparent situation; the corresponding processing and operations performed internally by the quantum computing low-code platform 100 will not be described.
[0164] Please see Figure 13In the first case, the added quantum gate is a single-qubit quantum gate H5. If the added position is the second position of quantum bit Q0, such as... Figure 13 If we find that there is no quantum gate at that position, we can simply add H5 to that position.
[0165] Please see Figure 14 In the second scenario, the added quantum gate is a two-qubit quantum gate CZ3. One node of the two-qubit quantum gate CZ3 is added to the second position of qubit Q0, and the other node is added to the second position of qubit Q1. It can be observed that there is no quantum gate in the second position of qubit Q0, so it can be added directly. However, there is a single-qubit gate H2 in the second position of qubit Q1, so H2 needs to be moved horizontally one unit to the right. Then, it can be seen that a node CZ1-2 of the two-qubit quantum gate CZ1 already exists one unit distance after H2. Similarly, node CZ1-2 of the two-qubit quantum gate CZ1 also needs to be moved horizontally one unit distance to the right. Since node CZ1-2 of the two-qubit quantum gate CZ1 has moved, the other node CZ1-1 of the two-qubit quantum gate CZ1 also needs to be moved horizontally one unit distance to the right. Thus, it can be seen that a single-qubit quantum gate H3 already exists one unit distance to the right of node CZ1-1. Similarly, the single-qubit quantum gate H3 also needs to be processed. This continues until the node position information of all quantum gates in the entire quantum circuit F is different, resulting in the quantum circuit G, and the set of node position information of the quantum circuit is updated.
[0166] Next, the low-code quantum computing platform 100 acquires the real-time physical structure, generates a quantum hardware coupling graph, and optimizes the quantum circuit G. Subsequently, based on the dependencies between the various parts of the quantum circuit G, it is optimized again. Finally, the rendering module 30 renders the final quantum circuit G onto a graphical interface.
[0167] This application also provides a computer-readable storage medium containing a computer program. When the computer program is executed by one or more processors, it causes the one or more processors to perform the method of this application.
[0168] It is understood that a computer program includes computer program code. Computer program code can be in the form of source code, object code, executable files, or some intermediate form. Computer-readable storage media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, external hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution media, etc.
[0169] In this specification, the terms "specifically," "furthermore," "particularly," "understandably," etc., refer to specific features, structures, materials, or characteristics described in connection with embodiments or examples that are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0170] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the function involved, as will be understood by those skilled in the art to which embodiments of this application pertain.
[0171] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A layout method for low-code programming in quantum computing, characterized in that, The method includes: In response to an input operation, the position information of the first target node in the first quantum circuit where the target quantum gate is placed is obtained; The first quantum gate to be processed is determined based on the first target node position information and the set of node position information, wherein the set of node position information is used to indicate the set of node position information of the quantum gate in the first quantum circuit; A second quantum circuit is obtained based on the target quantum gate and the first quantum gate to be processed, so as to realize the layout update of the first quantum circuit; The step of determining the first quantum gate to be processed based on the first target node location information and the set of node location information includes: Based on the preset collision detection processing technology, according to the first target node position information and the position information of each node, the quantum gate in the first quantum circuit that is consistent with the first target node position information is determined as the first quantum gate to be processed; The process of obtaining the second quantum circuit based on the target quantum gate and the first quantum gate to be processed includes: If there is no quantum gate in the first quantum circuit that is consistent with the position information of the first target node, the target quantum gate is placed at the first target node to obtain the second quantum circuit, where the first target node is the node corresponding to the position information of the first target node. If a quantum gate exists in the first quantum circuit that is consistent with the location information of the first target node, a second quantum circuit is obtained based on the target quantum gate and the first quantum gate to be processed.
2. The method according to claim 1, characterized in that, The process of obtaining the second quantum circuit based on the target quantum gate and the first quantum gate to be processed includes: Move the first quantum gate to be processed from the first target node a preset distance in a preset moving direction, and obtain the position information of the second target node of the first quantum gate to be processed after the movement; Place the target quantum gate on the first target node; The second quantum gate to be processed is determined based on the second target node location information and the set of node location information. The first quantum gate to be processed and the second quantum gate to be processed are processed until the node position information of all quantum gates in the first quantum circuit is different, so as to obtain the second quantum circuit.
3. The method according to claim 1, characterized in that, The method further includes: The node position information set is updated based on the node position information of the quantum gates in the second quantum circuit.
4. The method according to claim 1, characterized in that, The method further includes: Based on the obtained quantum hardware structure, a quantum hardware coupling diagram is constructed, wherein the quantum hardware structure is the hardware structure of the quantum device that executes the second quantum circuit; Based on the quantum hardware coupling diagram, the second quantum circuit is optimized according to a preset quantum gate to obtain the third quantum circuit.
5. The method according to claim 4, characterized in that, The process of optimizing the second quantum circuit based on the quantum hardware coupling diagram and according to preset quantum gates to obtain the third quantum circuit includes: Based on the quantum hardware coupling diagram, the interacting but non-adjacent qubits in the second quantum circuit are identified as the target qubits; The target qubit is optimized according to a preset quantum gate to obtain a third quantum circuit.
6. The method according to claim 4, characterized in that, The method further includes: The third quantum circuit is analyzed to obtain its dependencies. The third quantum circuit is optimized based on the aforementioned dependency relationship to obtain the fourth quantum circuit.
7. The method according to claim 6, characterized in that, The method further includes: Based on a preset rendering algorithm, a quantum circuit diagram in a graphical interface is generated according to the fourth quantum circuit to ensure timely updates of the quantum circuit diagram.
8. A low-code quantum computing platform, characterized in that, The quantum computing low-code platform includes a quantum circuit layout module, which is configured to: In response to an input operation, the position information of the first target node in the first quantum circuit where the target quantum gate is placed is obtained; The first quantum gate to be processed is determined based on the first target node position information and the set of node position information, wherein the set of node position information is used to indicate the set of node position information of the quantum gate in the first quantum circuit; A second quantum circuit is obtained based on the target quantum gate and the first quantum gate to be processed, so as to realize the layout update of the first quantum circuit; The step of determining the first quantum gate to be processed based on the first target node location information and the set of node location information includes: Based on the preset collision detection processing technology, according to the first target node position information and the position information of each node, the quantum gate in the first quantum circuit that is consistent with the first target node position information is determined as the first quantum gate to be processed; The process of obtaining the second quantum circuit based on the target quantum gate and the first quantum gate to be processed includes: If there is no quantum gate in the first quantum circuit that is consistent with the position information of the first target node, the target quantum gate is placed at the first target node to obtain the second quantum circuit, where the first target node is the node corresponding to the position information of the first target node. If a quantum gate exists in the first quantum circuit that is consistent with the location information of the first target node, a second quantum circuit is obtained based on the target quantum gate and the first quantum gate to be processed.
Citation Information
Patent Citations
Quantum computing processing method and device and electronic equipment
CN114881237A
Quantum circuit mapping method and device and electronic equipment
CN117436536A