[go: up one dir, main page]

CN116562386B - Quantum program debugging method, device, storage medium, electronic device and system - Google Patents

Quantum program debugging method, device, storage medium, electronic device and system Download PDF

Info

Publication number
CN116562386B
CN116562386B CN202210104096.0A CN202210104096A CN116562386B CN 116562386 B CN116562386 B CN 116562386B CN 202210104096 A CN202210104096 A CN 202210104096A CN 116562386 B CN116562386 B CN 116562386B
Authority
CN
China
Prior art keywords
quantum
target
computing
breakpoint
logic gate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210104096.0A
Other languages
Chinese (zh)
Other versions
CN116562386A (en
Inventor
窦猛汉
张嵩昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Benyuan Quantum Computing Technology Hefei Co ltd
Original Assignee
Benyuan Quantum Computing Technology Hefei Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Benyuan Quantum Computing Technology Hefei Co ltd filed Critical Benyuan Quantum Computing Technology Hefei Co ltd
Priority to CN202210104096.0A priority Critical patent/CN116562386B/en
Publication of CN116562386A publication Critical patent/CN116562386A/en
Application granted granted Critical
Publication of CN116562386B publication Critical patent/CN116562386B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena

Landscapes

  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a quantum program debugging method, a device, a storage medium and an electronic device, wherein the method responds to an execution instruction sent by a user through front-end display equipment and sends a quantum program, a breakpoint set in the quantum program and a current running point to background processing equipment; the background processing equipment creates a target computing task based on the received quantum program, the breakpoint and the current running point, and sends the target computing task to the quantum computing equipment; the quantum computing device calculates a target computing result aiming at a target computing task, and sends the target computing result to the background processing device, the background processing device sends the target computing result to the front-end processing device, and the front-end processing device displays the received target computing result, so that the quantum program is debugged.

Description

Quantum program debugging method, device, storage medium, electronic device and system
Technical Field
The invention belongs to the technical field of quantum computing, and particularly relates to a quantum program debugging method, a device, a storage medium, an electronic device and a system.
Background
The quantum computer is a kind of physical device which performs high-speed mathematical and logical operation, stores and processes quantum information according to the law of quantum mechanics. When a device processes and calculates quantum information and operates on a quantum algorithm, the device is a quantum computer. Quantum computers are a key technology under investigation because of their ability to handle mathematical problems more efficiently than ordinary computers, for example, to accelerate the time to crack RSA keys from hundreds of years to hours.
The quantum computing simulation is a simulation computation which simulates and follows the law of quantum mechanics by means of numerical computation and computer science, and is taken as a simulation program, and the high-speed computing capability of a computer is utilized to characterize the space-time evolution of the quantum state according to the basic law of quantum bits of the quantum mechanics.
The program debugging is a process of testing by manual or compiling program and correcting grammar error and logic error before the programmed program is put into actual operation. Currently, a breakpoint is set in a classical program, the program is executed to a code of the breakpoint, and then variable contents, stack conditions and the like at the breakpoint are output, so as to help a user to debug based on the output contents. However, if a breakpoint is set in the middle of a quantum program based on quantum mechanics axiom, measuring a qubit output quantum state here must result in collapse of the quantum state, and the result of subsequent program operation based on the collapsed quantum state is inaccurate. How to realize the debugging of the quantum program is a technical problem which must be solved in the quantum computing engineering and commercialization process.
Disclosure of Invention
The invention aims to provide a method, a device, a storage medium, electronic equipment and a system for debugging a quantum program, which aim to realize the debugging of the quantum program.
In a first aspect, an embodiment of the present invention provides a quantum program debugging method, applied to a front-end display device, the method including:
responding to an execution instruction sent by a user, and sending a quantum program, a breakpoint set in the quantum program and a current operating point to background processing equipment;
And receiving and displaying a target calculation result sent by the background processing equipment, wherein the target calculation result is calculated by quantum computing equipment aiming at a target calculation task and is sent to the background processing equipment, and the target calculation task is created by the background processing equipment based on the quantum program, the breakpoint and the current running point and is sent to the quantum computing equipment.
Optionally, the target computing task is a computing task corresponding to a target breakpoint in a plurality of computing tasks created by the background processing device based on the quantum program, and the target breakpoint is determined by the background processing device based on the breakpoint and the current running point.
Optionally, the quantum logic gate corresponding to the position of the target breakpoint is a quantum logic gate corresponding to the position of the breakpoint, which is operated after the quantum logic gate corresponding to the position of the current operating point.
Optionally, a plurality of the computing tasks are sent to the quantum computing device in order of priority of the plurality of computing tasks from high to low.
Optionally, the calculation task corresponding to the quantum logic gate operated before and the quantum logic gate operated after the quantum logic gate at the position where the target breakpoint is located is a secondary target calculation task, and the priority of the secondary target calculation task is lower than that of the target calculation task and higher than that of other calculation tasks.
Optionally, after the receiving and displaying the target calculation result sent by the background processing device, the method further includes:
Responding to a single step forward instruction or a single step backward instruction sent by the user, and receiving and displaying a secondary target calculation result sent by the background processing equipment; and the secondary target calculation result is calculated by the quantum computing device aiming at the secondary target calculation task and is sent to the background processing device.
Optionally, after the receiving and displaying the target calculation result sent by the background processing device, the method further includes:
And responding to a single-step forward instruction or a single-step backward instruction sent by the user, updating the current execution point, and sending the updated current execution point to the background processing equipment so that the background processing equipment adjusts the priorities of other computing tasks based on the new current execution point.
Optionally, the quantum computing device is a real quantum chip and/or a quantum virtual machine.
Optionally, the quantum computing device is the real quantum chip and the quantum virtual machine, and the target computing result includes a real computing result calculated by the real quantum chip and a simulation computing result calculated by the quantum virtual machine.
In a second aspect, an embodiment of the present invention provides a quantum program debugging method, applied to a background processing apparatus, the method comprising:
Receiving a quantum program sent by front-end display equipment, a breakpoint set in the quantum program and a current operating point;
creating a target computing task based on the quantum program, the breakpoint, and the current operating point, and sending the target computing task to a quantum computing device;
Receiving a target calculation result calculated by the quantum computing device aiming at the target calculation task;
And sending the target calculation result to the front-end display device, so that the front-end display device responds to an execution instruction sent by a user and displays the target calculation result.
Optionally, the creating a target computing task based on the quantum program, the breakpoint, and the current running point includes:
creating a plurality of computing tasks based on the quantum program, and determining a target breakpoint based on the breakpoint and the current operating point;
And determining a target computing task corresponding to the target breakpoint from a plurality of computing tasks.
Optionally, the determining the target breakpoint based on the breakpoint and the current operation point includes:
And determining the quantum logic gate corresponding to the position of the breakpoint, which is operated after the quantum logic gate corresponding to the position of the current operating point, as the quantum logic gate corresponding to the position of the target breakpoint, and determining the first breakpoint as the target breakpoint.
Optionally, the sending the target computing task to a quantum computing device includes:
and sequentially sending the plurality of computing tasks to the quantum computing device according to the order of the priorities of the plurality of computing tasks from high to low.
Optionally, before the sending the plurality of computing tasks to the quantum computing device in order of priority of the plurality of computing tasks from high to low, the method further includes:
And determining a calculation task corresponding to the quantum logic gate operated before and the quantum logic gate operated after the quantum logic gate at the position of the target breakpoint as a secondary target calculation task, wherein the priority of the secondary target calculation task is lower than that of the target calculation task and higher than that of other calculation tasks.
Optionally, after receiving the target calculation result calculated by the quantum computing device for the target calculation task, the method further includes:
receiving a secondary target calculation result calculated by the quantum computing device aiming at the secondary target calculation task;
And sending the secondary target calculation result to the front-end display device, so that the front-end display device responds to a single-step forward instruction or a single-step backward instruction sent by a user to display the secondary target calculation result.
Optionally, after receiving the target calculation result calculated by the quantum computing device for the target calculation task, the method further includes:
Receiving a new current execution point sent by the front-end display device, wherein the new current execution point is updated by the front-end display device in response to a single-step forward instruction or a single-step backward instruction sent by a user;
And adjusting the priorities of other computing tasks based on the new current execution point.
Optionally, the quantum computing device is a real quantum chip and/or a quantum virtual machine.
Optionally, the quantum computing device is the real quantum chip and the quantum virtual machine, and the target computing result includes a real computing result calculated by the real quantum chip and a simulation computing result calculated by the quantum virtual machine.
In a third aspect, an embodiment of the present invention provides a quantum program debugging apparatus, applied to a front-end display device, the apparatus comprising:
The communication unit is used for responding to an execution instruction sent by a user and sending a quantum program, a breakpoint set in the quantum program and a current running point to the background processing equipment;
The display unit is further used for receiving and displaying a target calculation result sent by the background processing device, wherein the target calculation result is calculated by the quantum computing device according to a target calculation task and sent to the background processing device, and the target calculation task is created by the background processing device based on the quantum program, the breakpoint and the current running point and sent to the quantum computing device.
Optionally, the target computing task is a computing task corresponding to a target breakpoint in a plurality of computing tasks created by the background processing device based on the quantum program, and the target breakpoint is determined by the background processing device based on the breakpoint and the current running point.
Optionally, the quantum logic gate corresponding to the position of the target breakpoint is a quantum logic gate corresponding to the position of the breakpoint, which is operated after the quantum logic gate corresponding to the position of the current operating point.
Optionally, a plurality of the computing tasks are sent to the quantum computing device in order of priority of the plurality of computing tasks from high to low.
Optionally, the calculation task corresponding to the quantum logic gate operated before and the quantum logic gate operated after the quantum logic gate at the position where the target breakpoint is located is a secondary target calculation task, and the priority of the secondary target calculation task is lower than that of the target calculation task and higher than that of other calculation tasks.
Optionally, after receiving and displaying the target calculation result sent by the background processing device, the display unit is further configured to:
Responding to a single step forward instruction or a single step backward instruction sent by the user, and receiving and displaying a secondary target calculation result sent by the background processing equipment; and the secondary target calculation result is calculated by the quantum computing device aiming at the secondary target calculation task and is sent to the background processing device.
Optionally, after receiving and displaying the target calculation result sent by the background processing device, the communication unit is further configured to:
And responding to a single-step forward instruction or a single-step backward instruction sent by the user, updating the current execution point, and sending the updated current execution point to the background processing equipment so that the background processing equipment adjusts the priorities of other computing tasks based on the new current execution point.
Optionally, the quantum computing device is a real quantum chip and/or a quantum virtual machine.
Optionally, the quantum computing device is the real quantum chip and the quantum virtual machine, and the target computing result includes a real computing result calculated by the real quantum chip and a simulation computing result calculated by the quantum virtual machine.
In a fourth aspect, an embodiment of the present invention provides a quantum program debugging apparatus, applied to a background processing device, the apparatus comprising:
The communication unit is used for receiving the quantum program sent by the front-end display device, the breakpoint set in the quantum program and the current running point;
A processing unit for creating a target computing task based on the quantum program, the breakpoint, and the current operating point, and sending the target computing task to a quantum computing device;
the communication unit is further used for receiving a target calculation result calculated by the quantum computing device aiming at the target calculation task;
The communication unit is further configured to send the target calculation result to the front-end display device, so that the front-end display device responds to an execution instruction sent by a user and displays the target calculation result.
Optionally, the creating a target computing task based on the quantum program, the breakpoint, and the current running point, and the processing unit is specifically configured to:
creating a plurality of computing tasks based on the quantum program, and determining a target breakpoint based on the breakpoint and the current operating point;
And determining a target computing task corresponding to the target breakpoint from a plurality of computing tasks.
Optionally, the determining a target breakpoint based on the breakpoint and the current operating point, where the processing unit 602 is specifically configured to:
And determining the quantum logic gate corresponding to the position of the breakpoint, which is operated after the quantum logic gate corresponding to the position of the current operating point, as the quantum logic gate corresponding to the position of the target breakpoint, and determining the first breakpoint as the target breakpoint.
Optionally, the sending the target computing task to a quantum computing device, and the communication unit is specifically configured to:
and sequentially sending the plurality of computing tasks to the quantum computing device according to the order of the priorities of the plurality of computing tasks from high to low.
Optionally, before the sending the plurality of computing tasks to the quantum computing device in order of priority of the plurality of computing tasks from high to low, the processing unit is further configured to:
And determining a calculation task corresponding to the quantum logic gate operated before and the quantum logic gate operated after the quantum logic gate at the position of the target breakpoint as a secondary target calculation task, wherein the priority of the secondary target calculation task is lower than that of the target calculation task and higher than that of other calculation tasks.
Optionally, after receiving the target calculation result calculated by the quantum computing device for the target calculation task, the communication unit is further configured to:
receiving a secondary target calculation result calculated by the quantum computing device aiming at the secondary target calculation task;
And sending the secondary target calculation result to the front-end display device, so that the front-end display device responds to a single-step forward instruction or a single-step backward instruction sent by a user to display the secondary target calculation result.
Optionally, after receiving the target calculation result calculated by the quantum computing device for the target calculation task, the method includes:
The communication unit is further configured to receive a new current execution point sent by the front-end display device, where the new current execution point is updated by the front-end display device in response to a single-step forward instruction or a single-step backward instruction sent by a user;
the processing unit is further configured to adjust priorities of other computing tasks based on the new current execution point.
Optionally, the quantum computing device is a real quantum chip and/or a quantum virtual machine.
Optionally, the quantum computing device is the real quantum chip and the quantum virtual machine, and the target computing result includes a real computing result calculated by the real quantum chip and a simulation computing result calculated by the quantum virtual machine.
In a fifth aspect, a further embodiment of the invention provides a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the method of any of the first or second aspects above when run.
In a sixth aspect, a further embodiment of the invention provides an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the method of any of the first or second aspects above.
In a seventh aspect, a further embodiment of the invention provides a quantum program debugging system, the system comprising a front-end display device comprising quantum program debugging means as described in the third aspect and a background processing device comprising quantum program debugging means as described in the fourth aspect.
Compared with the prior art, the front-end display device responds to an execution instruction sent by a user, sends the quantum program, the breakpoint and the current running point set in the quantum program to the background processing device, creates a target calculation task based on the received quantum program, the breakpoint and the current running point, then sends the target calculation task to the quantum calculation device, calculates the target calculation task to obtain a target calculation result, and forwards the target calculation result to the front-end display device through the background quantum calculation device for display, so that the user can debug the quantum program based on the displayed target calculation result.
Drawings
Fig. 1 is a hardware block diagram of a computer terminal of a quantum program debugging method according to an embodiment of the present invention;
fig. 2 is a flow chart of a quantum program debugging method according to an embodiment of the present invention;
FIG. 3 is an interface schematic diagram of a quantum program debugging interface according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating another method for debugging a quantum program according to an embodiment of the present invention;
Fig. 5 is a schematic structural diagram of a quantum program debugging device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of another quantum program debugging device according to an embodiment of the present invention.
Detailed Description
The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention.
The embodiment of the invention firstly provides a quantum program debugging method which can be applied to electronic equipment such as computer terminals, in particular to common computers, quantum computers and the like.
The following describes the operation of the computer terminal in detail by taking it as an example. Fig. 1 is a hardware block diagram of a computer terminal of a quantum program debugging method according to an embodiment of the present invention. As shown in fig. 1, the computer terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing a quantum program debugging method, and optionally, a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the computer terminal described above. For example, the computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store software programs and modules of application software, such as program instructions/modules corresponding to the method of quantum program debugging in the embodiment of the present invention, and the processor 102 executes the software programs and modules stored in the memory 104 to perform various functional applications and data processing, i.e., implement the method described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the computer terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 106 is arranged to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module for communicating with the internet wirelessly.
It should be noted that a real quantum computer is a hybrid structure, which includes two major parts: part of the computers are classical computers and are responsible for performing classical computation and control; the other part is quantum equipment, which is responsible for running quantum programs so as to realize quantum computation. The quantum program is a series of instruction sequences written in a quantum language such as QRunes language and capable of running on a quantum computer, so that the support of quantum logic gate operation is realized, and finally, quantum computing is realized. Specifically, the quantum program is a series of instruction sequences for operating the quantum logic gate according to a certain time sequence.
In practical applications, quantum computing simulations are often required to verify quantum algorithms, quantum applications, etc., due to the development of quantum device hardware. Quantum computing simulation is a process of realizing simulated operation of a quantum program corresponding to a specific problem by means of a virtual architecture (namely a quantum virtual machine) built by resources of a common computer. In general, it is necessary to construct a quantum program corresponding to a specific problem. The quantum program, namely the program for representing the quantum bit and the evolution thereof written in the classical language, wherein the quantum bit, the quantum logic gate and the like related to quantum computation are all represented by corresponding classical codes.
Quantum circuits, which are one embodiment of quantum programs and weigh sub-logic circuits as well, are the most commonly used general quantum computing models, representing circuits that operate on qubits under an abstract concept, and their composition includes qubits, circuits (timelines), and various quantum logic gates, and finally the result often needs to be read out through quantum measurement operations.
Unlike conventional circuits, which are connected by metal lines to carry voltage or current signals, in a quantum circuit, the circuit can be seen as being connected by time, i.e., the state of the qubit naturally evolves over time, as indicated by the hamiltonian operator, during which it is operated until a logic gate is encountered.
One quantum program is corresponding to one total quantum circuit, and the quantum program refers to the total quantum circuit, wherein the total number of quantum bits in the total quantum circuit is the same as the total number of quantum bits of the quantum program. It can be understood that: one quantum program may consist of a quantum circuit, a measurement operation for the quantum bits in the quantum circuit, a register to hold the measurement results, and a control flow node (jump instruction), and one quantum circuit may contain several tens of hundreds or even thousands of quantum logic gate operations. The execution process of the quantum program is a process of executing all quantum logic gates according to a certain time sequence. Note that the timing is the time sequence in which a single quantum logic gate is executed.
It should be noted that in classical computation, the most basic unit is a bit, and the most basic control mode is a logic gate, and the purpose of the control circuit can be achieved by a combination of logic gates. Similarly, the way in which the qubits are handled is a quantum logic gate. Quantum logic gates are used, which are the basis for forming quantum circuits, and include single-bit quantum logic gates, such as Hadamard gates (H gates, ada Ma Men), bery-X gates (X gates), bery-Y gates (Y gates), bery-Z gates (Z gates), RX gates, RY gates, RZ gates, and the like; multi-bit quantum logic gates such as CNOT gates, CR gates, iSWAP gates, toffoli gates, and the like. Quantum logic gates are typically represented using unitary matrices, which are not only in matrix form, but also an operation and transformation. The general function of a quantum logic gate on a quantum state is to calculate through a unitary matrix multiplied by a matrix corresponding to the right vector of the quantum state.
Referring to fig. 2, fig. 2 is a flow chart of a quantum program debugging method provided by an embodiment of the present invention, which is applied to a front-end display device, and the method includes:
Step 201: responding to an execution instruction sent by a user, and sending a quantum program, a breakpoint set in the quantum program and a current operating point to background processing equipment;
the executing instruction and the single step forward instruction or the single step backward instruction described below may be triggered by detecting a click or a touch operation of a user on a certain target area of the front-end display device. For example, the front-end display device includes a display screen or touch screen on which a debugging interface for the quantum program is displayed, the interface including execution buttons. And triggering the execution instruction when detecting the clicking or touch operation of the execution button by the user.
The execution instructions may include breakpoint execution instructions and execution instructions. The running instruction refers to the running from the first quantum logic gate to the quantum logic gate where the first breakpoint is located in the quantum circuit, and the breakpoint executing instruction refers to the running from the quantum logic gate where the current running point is located in the quantum circuit to the quantum logic gate where the next breakpoint is located.
The quantum program may be a patterned quantum program or a quantum program formed by codes written in a quantum programming language, and is not limited herein.
Wherein, the breakpoint is a mark that the debugger sets the source program to automatically enter an interrupt mode during execution. When the program runs to the breakpoint, the program is interrupted to execute and enters a debugging state. Errors in the running of the program can be found by setting breakpoints. The break point set in the quantum program may be on a quantum logic gate in the quantum wire.
The current execution point may be located on the last quantum logic gate that is currently executed.
Step 202: and receiving and displaying a target calculation result sent by the background processing equipment, wherein the target calculation result is calculated by quantum computing equipment aiming at a target calculation task and is sent to the background processing equipment, and the target calculation task is created by the background processing equipment based on the quantum program, the breakpoint and the current running point and is sent to the quantum computing equipment.
The quantum computing device is a real quantum chip and/or a quantum virtual machine.
The quantum computing device is the real quantum chip and the quantum virtual machine, and the target computing result comprises a real computing result computed by the real quantum chip and a simulation computing result computed by the quantum virtual machine.
It can be seen that the user can comprehensively judge the bug of the quantum program by combining the real calculation result and the simulation calculation result, and debug the bug, namely the debugging of the quantum program is realized.
Specifically, the target computing task created by the background processing device based on the quantum program, the breakpoint, and the current running point and sent to the quantum computing device may be:
The target computing task is a computing task corresponding to a target breakpoint in a plurality of computing tasks created by the background processing equipment based on the quantum program, and the target breakpoint is determined by the background processing equipment based on the breakpoint and the current running point.
Further, the background processing device creates a plurality of computing tasks based on the quantum program, which may be:
the background processing device determines all quantum logic gates included in the quantum program;
the background processing device determines each of the quantum logic gates and a quantum logic gate preceding each of the quantum logic gates;
The background processing equipment adds measurement operation on each quantum logic gate and a quantum bit acted by a quantum logic gate before each quantum logic gate to construct a plurality of quantum circuits;
The background processing equipment creates a plurality of quantum computing tasks corresponding to the quantum circuits.
For example, assume that the quantum wires are cir0 < H q <1 > - > H q <2 > - > CNOT q 1, q 2 > - > MEASURE q 1, q 2. Wherein H, CNOT is a quantum logic gate, q 1, q 2 are qubits, and measurement is a measurement operation. The first quantum circuit is cir1 < Hq 1 > - > MEASURE q 1, q 2, the second quantum circuit is cir2 < H q [1] - > H q [2] - > MEASURE q 1, q 2, the third quantum circuit is cir3 < H q [1] - > H q [2] - > MEASURE q 1, q 2, the quantum circuit is constructed by accumulating the current quantum logic gate with the previous quantum logic gate and then adding measurement works, and the number of the quantum circuits is the same as that of the quantum logic gates.
It should be noted that the addition of a measurement operation to all the qubits may be performed by adding a measurement operation to only the qubits having the quantum logic gate function. For example, quantum circuit cir1 has only H q [1], and the added measurement operation can also be M q [1].
Further, the target breakpoint is determined by the background processing device based on the breakpoint and the current running point, including:
the quantum logic gate corresponding to the position of the target breakpoint is the quantum logic gate corresponding to the position of the breakpoint, which is operated after the quantum logic gate corresponding to the position of the current operating point.
For example, as shown in fig. 3, fig. 3 is an interface schematic diagram of a quantum program debugging interface according to an embodiment of the present invention. The interface includes a patterned quantum circuit and a quantum circuit written by a code in a code compiler, and related buttons for debugging the interface, such as a reset button indicated by "<",An execute button represented, ">" a single step forward button represented, ">" a full execute button represented, and a clear breakpoint button. When the related operation is carried out on the graphical quantum circuit, the quantum circuit written by the code in the code compiler can also carry out the corresponding operation at the same time, and similarly, when the related operation is carried out on the quantum circuit written by the code in the code compiler, the graphical quantum circuit carries out the corresponding operation.
In fig. 3, the quantum logic gate corresponding to the current execution point is T q [1], which includes two break points, wherein one of the break points corresponds to a quantum logic gate of CNOT q [1], q [0], and the other of the break points corresponds to a quantum logic gate of CNOT q [2], q [0]. The quantum logic gate corresponding to the position of the target breakpoint is the quantum logic gate corresponding to the position of the first breakpoint operated after the quantum logic gate corresponding to the position of the current operating point, and the quantum logic gate corresponding to the target breakpoint can be determined to be CNOT q [1], q [0].
Further, the plurality of computing tasks are sent to the quantum computing device in order of priority of the plurality of computing tasks from high to low.
The quantum logic gate of the position of the target breakpoint and the calculation task corresponding to the quantum logic gate of the next operation are secondary target calculation tasks, and the priority of the secondary target calculation tasks is lower than that of the target calculation tasks and higher than that of other calculation tasks.
Also illustrated in FIG. 3, the quantum logic gates at the locations of the target break points in FIG. 3 are CNOT q [1], q [0], which correspond to the target computing tasks of: h q [0] - > T q [1] - > S q [2] - > CNOT q [1], q [0] - > MEASURE q [0], q [1], q [2]. The former one is S q [2], and the latter one is CNOT q [2], q [1]. Thus, the secondary target computing task is: h q < 0 > T q < 1 > S q < 2 > MEASURE q < 0 >, q < 1 >, q < 2 >; and H q [0] - > T q [1] - > S q [2] - > CNOT q [1], q [0] - > CNOT q [2], q [1] - > MEASURE q [0], q [1], q [2].
Further, after receiving and displaying the target calculation result sent by the background processing device, the method further includes:
Responding to a single step forward instruction or a single step backward instruction sent by the user, and receiving and displaying a secondary target calculation result sent by the background processing equipment; and the secondary target calculation result is calculated by the quantum computing device aiming at the secondary target calculation task and is sent to the background processing device.
The order of priority from high to low is: target computing tasks, sub-target computing tasks, and other computing tasks. The quantum computing device sequentially calculates the target computing task, the sub-target computing task and other computing tasks according to the computing sequence of the priority. Therefore, when the front-end display device displays the target calculation result corresponding to the target calculation task, the single-step forward button (single-step backward button) is used for further knowing the calculation result of the calculation task corresponding to the quantum logic gate (the next quantum logic gate) before the target breakpoint, namely the secondary target calculation result of the secondary target calculation task, as the quantum calculation device has already calculated in advance according to the priority, the quantum calculation device does not need to wait for calculation and feedback of the quantum calculation device, so that the secondary target calculation result corresponding to the secondary target calculation task is displayed on the front-end display device in time, and a user can conveniently debug the quantum program according to the target calculation result of the target calculation task and the secondary target calculation result of the secondary target calculation task.
Further, after receiving and displaying the target calculation result sent by the background processing device, the method further includes:
And responding to a single-step forward instruction or a single-step backward instruction sent by the user, updating the current execution point, and sending the updated current execution point to the background processing equipment so that the background processing equipment adjusts the priorities of other computing tasks based on the new current execution point.
It should be noted that, the step of receiving and displaying the secondary target calculation result sent by the background processing device, and the step of updating the current execution point and sending the updated current execution point to the background processing device may be performed simultaneously or not simultaneously, which is not limited herein.
As illustrated in fig. 3, when the user clicks the execute button in fig. 3When the execution instruction is triggered, the quantum program runs to the target breakpoint CNOT q [1], q [0]. Then when the user clicks the single step forward button ">" in fig. 3 to trigger the single step forward instruction, the current running point is updated to become the target breakpoint, the priority of the computing task needs to be determined again according to the updated current running point, that is, the target breakpoint, and the computing task does not need to be re-created. Then the new target computing task is the computing task corresponding to the quantum logic gate (CNOT q2, q 1) of the quantum logic gate (CNOT q2, q 0) of the next execution corresponding to the target breakpoint, and the new sub-target computing task is the computing task corresponding to the target breakpoint and the computing task corresponding to the quantum logic gate (CNOT q2, q 0) of the next execution. The priority of the target computing task is then again set to be higher than the priority of the secondary target computing task over the priority of the other computing tasks.
Compared with the prior art, the front-end display device responds to an execution instruction sent by a user, sends the quantum program, the breakpoint and the current running point set in the quantum program to the background processing device, creates a target calculation task based on the received quantum program, the breakpoint and the current running point, then sends the target calculation task to the quantum calculation device, calculates the target calculation task to obtain a target calculation result, and forwards the target calculation result to the front-end display device through the background quantum calculation device for display, so that the user can debug the quantum program based on the displayed target calculation result.
Referring to fig. 4, fig. 4 is a flow chart of a quantum program debugging method provided by an embodiment of the present invention, which is applied to a background processing device, and the method includes:
step 401: receiving a quantum program sent by front-end display equipment, a breakpoint set in the quantum program and a current operating point;
step 402: creating a target computing task based on the quantum program, the breakpoint, and the current operating point, and sending the target computing task to a quantum computing device;
Step 403: receiving a target calculation result calculated by the quantum computing device aiming at the target calculation task;
Step 404: and sending the target calculation result to the front-end display device, so that the front-end display device responds to an execution instruction sent by a user and displays the target calculation result.
Optionally, the creating a target computing task based on the quantum program, the breakpoint, and the current running point includes:
creating a plurality of computing tasks based on the quantum program, and determining a target breakpoint based on the breakpoint and the current operating point;
And determining a target computing task corresponding to the target breakpoint from a plurality of computing tasks.
Optionally, the determining the target breakpoint based on the breakpoint and the current operation point includes:
And determining the quantum logic gate corresponding to the position of the breakpoint, which is operated after the quantum logic gate corresponding to the position of the current operating point, as the quantum logic gate corresponding to the position of the target breakpoint, and determining the first breakpoint as the target breakpoint.
Optionally, the sending the target computing task to a quantum computing device includes:
and sequentially sending the plurality of computing tasks to the quantum computing device according to the order of the priorities of the plurality of computing tasks from high to low.
Optionally, before the sending the plurality of computing tasks to the quantum computing device in order of priority of the plurality of computing tasks from high to low, the method further includes:
And determining a calculation task corresponding to the quantum logic gate operated before and the quantum logic gate operated after the quantum logic gate at the position of the target breakpoint as a secondary target calculation task, wherein the priority of the secondary target calculation task is lower than that of the target calculation task and higher than that of other calculation tasks.
Optionally, after receiving the target calculation result calculated by the quantum computing device for the target calculation task, the method further includes:
receiving a secondary target calculation result calculated by the quantum computing device aiming at the secondary target calculation task;
And sending the secondary target calculation result to the front-end display device, so that the front-end display device responds to a single-step forward instruction or a single-step backward instruction sent by a user to display the secondary target calculation result.
Optionally, after receiving the target calculation result calculated by the quantum computing device for the target calculation task, the method further includes:
Receiving a new current execution point sent by the front-end display device, wherein the new current execution point is updated by the front-end display device in response to a single-step forward instruction or a single-step backward instruction sent by a user;
And adjusting the priorities of other computing tasks based on the new current execution point.
Optionally, the quantum computing device is a real quantum chip and/or a quantum virtual machine.
Optionally, the quantum computing device is the real quantum chip and the quantum virtual machine, and the target computing result includes a real computing result calculated by the real quantum chip and a simulation computing result calculated by the quantum virtual machine.
It should be noted that, referring to the specific implementation manner of the embodiment of the present invention shown in fig. 2 and fig. 3, no further description is given here.
Compared with the prior art, the front-end display device responds to an execution instruction sent by a user, sends the quantum program, the breakpoint and the current running point set in the quantum program to the background processing device, creates a target calculation task based on the received quantum program, the breakpoint and the current running point, then sends the target calculation task to the quantum calculation device, calculates the target calculation task to obtain a target calculation result, and forwards the target calculation result to the front-end display device through the background quantum calculation device for display, so that the user can debug the quantum program based on the displayed target calculation result.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a quantum program debugging device according to an embodiment of the present invention, which is applied to a front-end display device, and the device includes:
a communication unit 501, configured to respond to an execution instruction sent by a user, and send a quantum program, a breakpoint set in the quantum program, and a current operating point to a background processing device;
The display unit 502 is further configured to receive and display a target calculation result sent by the background processing device, where the target calculation result is calculated by a quantum computing device for a target calculation task and sent to the background processing device, and the target calculation task is created by the background processing device based on the quantum program, the breakpoint, and the current running point and sent to the quantum computing device.
Optionally, the target computing task is a computing task corresponding to a target breakpoint in a plurality of computing tasks created by the background processing device based on the quantum program, and the target breakpoint is determined by the background processing device based on the breakpoint and the current running point.
Optionally, the quantum logic gate corresponding to the position of the target breakpoint is a quantum logic gate corresponding to the position of the breakpoint, which is operated after the quantum logic gate corresponding to the position of the current operating point.
Optionally, a plurality of the computing tasks are sent to the quantum computing device in order of priority of the plurality of computing tasks from high to low.
Optionally, the calculation task corresponding to the quantum logic gate operated before and the quantum logic gate operated after the quantum logic gate at the position where the target breakpoint is located is a secondary target calculation task, and the priority of the secondary target calculation task is lower than that of the target calculation task and higher than that of other calculation tasks.
Optionally, after receiving and displaying the target calculation result sent by the background processing device, the display unit 502 is further configured to:
Responding to a single step forward instruction or a single step backward instruction sent by the user, and receiving and displaying a secondary target calculation result sent by the background processing equipment; and the secondary target calculation result is calculated by the quantum computing device aiming at the secondary target calculation task and is sent to the background processing device.
Optionally, after receiving and displaying the target calculation result sent by the background processing device, the communication unit 501 is further configured to:
And responding to a single-step forward instruction or a single-step backward instruction sent by the user, updating the current execution point, and sending the updated current execution point to the background processing equipment so that the background processing equipment adjusts the priorities of other computing tasks based on the new current execution point.
Optionally, the quantum computing device is a real quantum chip and/or a quantum virtual machine.
Optionally, the quantum computing device is the real quantum chip and the quantum virtual machine, and the target computing result includes a real computing result calculated by the real quantum chip and a simulation computing result calculated by the quantum virtual machine.
Compared with the prior art, the front-end display device responds to an execution instruction sent by a user, sends the quantum program, the breakpoint and the current running point set in the quantum program to the background processing device, creates a target calculation task based on the received quantum program, the breakpoint and the current running point, then sends the target calculation task to the quantum calculation device, calculates the target calculation task to obtain a target calculation result, and forwards the target calculation result to the front-end display device through the background quantum calculation device for display, so that the user can debug the quantum program based on the displayed target calculation result.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a quantum program debugging device according to an embodiment of the present invention, which is applied to a background processing apparatus, and the device includes:
A communication unit 601, configured to receive a quantum program sent by a front-end display device, a breakpoint set in the quantum program, and a current operating point;
A processing unit 602 for creating a target computing task based on the quantum program, the breakpoint, and the current operating point, and sending the target computing task to a quantum computing device;
The communication unit 601 is further configured to receive a target calculation result calculated by the quantum computing device for the target calculation task;
The communication unit 601 is further configured to send the target calculation result to the front-end display device, so that the front-end display device responds to an execution instruction sent by a user to display the target calculation result.
Optionally, the creating a target computing task based on the quantum program, the breakpoint, and the current running point, and the processing unit 602 is specifically configured to:
creating a plurality of computing tasks based on the quantum program, and determining a target breakpoint based on the breakpoint and the current operating point;
And determining a target computing task corresponding to the target breakpoint from a plurality of computing tasks.
Optionally, the determining a target breakpoint based on the breakpoint and the current operating point, where the processing unit 602 is specifically configured to:
And determining the quantum logic gate corresponding to the position of the breakpoint, which is operated after the quantum logic gate corresponding to the position of the current operating point, as the quantum logic gate corresponding to the position of the target breakpoint, and determining the first breakpoint as the target breakpoint.
Optionally, the sending the target computing task to a quantum computing device, and the communication unit 601 is specifically configured to:
and sequentially sending the plurality of computing tasks to the quantum computing device according to the order of the priorities of the plurality of computing tasks from high to low.
Optionally, before the sending the plurality of computing tasks to the quantum computing device in order of priority of the plurality of computing tasks from high to low, the processing unit 602 is specifically configured to:
And determining a calculation task corresponding to the quantum logic gate operated before and the quantum logic gate operated after the quantum logic gate at the position of the target breakpoint as a secondary target calculation task, wherein the priority of the secondary target calculation task is lower than that of the target calculation task and higher than that of other calculation tasks.
Optionally, after receiving the target calculation result calculated by the quantum computing device for the target calculation task, the communication unit 601 is further configured to:
receiving a secondary target calculation result calculated by the quantum computing device aiming at the secondary target calculation task;
And sending the secondary target calculation result to the front-end display device, so that the front-end display device responds to a single-step forward instruction or a single-step backward instruction sent by a user to display the secondary target calculation result.
Optionally, after receiving the target calculation result calculated by the quantum computing device for the target calculation task, the method includes:
the communication unit 601 is further configured to receive a new current execution point sent by the front-end display device, where the new current execution point is updated by the front-end display device in response to a single-step forward instruction or a single-step backward instruction sent by a user;
the processing unit 602 is further configured to adjust priorities of other computing tasks based on the new current execution point.
Optionally, the quantum computing device is a real quantum chip and/or a quantum virtual machine.
Optionally, the quantum computing device is the real quantum chip and the quantum virtual machine, and the target computing result includes a real computing result calculated by the real quantum chip and a simulation computing result calculated by the quantum virtual machine.
Compared with the prior art, the front-end display device responds to an execution instruction sent by a user, sends the quantum program, the breakpoint and the current running point set in the quantum program to the background processing device, creates a target calculation task based on the received quantum program, the breakpoint and the current running point, then sends the target calculation task to the quantum calculation device, calculates the target calculation task to obtain a target calculation result, and forwards the target calculation result to the front-end display device through the background quantum calculation device for display, so that the user can debug the quantum program based on the displayed target calculation result.
The embodiment of the invention also provides a storage medium in which a computer program is stored, wherein the computer program is arranged to perform the steps of the method embodiment of any of the above figures 2 or 4 when run.
Specifically, in the present embodiment, the above-described storage medium may be configured to store a computer program for executing the steps of:
responding to an execution instruction sent by a user, and sending a quantum program, a breakpoint set in the quantum program and a current operating point to background processing equipment;
And receiving and displaying a target calculation result sent by the background processing equipment, wherein the target calculation result is calculated by quantum computing equipment aiming at a target calculation task and is sent to the background processing equipment, and the target calculation task is created by the background processing equipment based on the quantum program, the breakpoint and the current running point and is sent to the quantum computing equipment.
Or the above-mentioned storage medium may be arranged to store a computer program for performing the steps of:
Receiving a quantum program sent by front-end display equipment, a breakpoint set in the quantum program and a current operating point;
creating a target computing task based on the quantum program, the breakpoint, and the current operating point, and sending the target computing task to a quantum computing device;
Receiving a target calculation result calculated by the quantum computing device aiming at the target calculation task;
And sending the target calculation result to the front-end display device, so that the front-end display device responds to an execution instruction sent by a user and displays the target calculation result.
Specifically, in the present embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
Still another embodiment of the present invention provides an electronic device comprising a memory having a computer program stored therein and a processor configured to run the computer program to perform the steps of the method embodiment of any of the above.
Specifically, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Specifically, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
responding to an execution instruction sent by a user, and sending a quantum program, a breakpoint set in the quantum program and a current operating point to background processing equipment;
And receiving and displaying a target calculation result sent by the background processing equipment, wherein the target calculation result is calculated by quantum computing equipment aiming at a target calculation task and is sent to the background processing equipment, and the target calculation task is created by the background processing equipment based on the quantum program, the breakpoint and the current running point and is sent to the quantum computing equipment.
Or the processor may be arranged to perform the following steps by means of a computer program:
Receiving a quantum program sent by front-end display equipment, a breakpoint set in the quantum program and a current operating point;
creating a target computing task based on the quantum program, the breakpoint, and the current operating point, and sending the target computing task to a quantum computing device;
Receiving a target calculation result calculated by the quantum computing device aiming at the target calculation task;
And sending the target calculation result to the front-end display device, so that the front-end display device responds to an execution instruction sent by a user and displays the target calculation result.
Yet another embodiment of the present invention also provides a quantum program debugging system, the system comprising a front-end display device comprising a quantum program debugging apparatus as shown in fig. 5 and a background processing device comprising a quantum program debugging apparatus as shown in fig. 6.
While the foregoing is directed to embodiments of the present invention, other and further embodiments of the invention may be devised without departing from the basic scope thereof, and the scope thereof is determined by the claims that follow.

Claims (21)

1. A quantum program debugging method, applied to a front-end display device, the method comprising:
responding to an execution instruction sent by a user, and sending a quantum program, a breakpoint set in the quantum program and a current operating point to background processing equipment;
Receiving and displaying a target calculation result sent by the background processing equipment, wherein the target calculation result is calculated by quantum computing equipment aiming at a target calculation task and is sent to the background processing equipment, the target calculation task is a calculation task corresponding to a target breakpoint in a plurality of calculation tasks created by the background processing equipment based on the quantum program, and the target breakpoint is determined by the background processing equipment based on the breakpoint and the current running point; the plurality of computing tasks correspond to a plurality of quantum circuits; the plurality of quantum circuits are constructed by adding measurement operations to each quantum logic gate included in the quantum program and a quantum bit acted by a quantum logic gate before each quantum logic gate by the background processing device.
2. The method of claim 1, wherein the quantum logic gate corresponding to the location of the target breakpoint is a quantum logic gate corresponding to a location of the breakpoint that is the first of the quantum logic gates that operates after the quantum logic gate corresponding to the location of the current operating point.
3. The method of claim 1, wherein a plurality of the computing tasks are sent to the quantum computing device in a high-to-low order of priority for a plurality of the computing tasks.
4. The method of claim 3, wherein the computation task corresponding to the quantum logic gate of the previous run and the quantum logic gate of the next run of the quantum logic gate of the location of the target breakpoint is a secondary target computation task, and the secondary target computation task has a priority lower than the target computation task and higher than other computation tasks.
5. The method of claim 4, wherein after receiving and displaying the target calculation result sent by the background processing device, the method further comprises:
Responding to a single step forward instruction or a single step backward instruction sent by the user, and receiving and displaying a secondary target calculation result sent by the background processing equipment; and the secondary target calculation result is calculated by the quantum computing device aiming at the secondary target calculation task and is sent to the background processing device.
6. The method of claim 4, wherein after receiving and displaying the target calculation result sent by the background processing device, the method further comprises:
and responding to a single-step forward instruction or a single-step backward instruction sent by the user, updating a current execution point, and sending the updated current execution point to the background processing equipment so that the background processing equipment adjusts the priorities of other computing tasks based on the new current execution point.
7. The method of any of claims 1-6, wherein the quantum computing device is a real quantum chip or a quantum virtual machine.
8. The method of any of claims 1-6, wherein the quantum computing device is a real quantum chip and a quantum virtual machine, the target computing result comprising a real computing result of the real quantum chip computing and a simulated computing result of the quantum virtual machine computing.
9. A quantum program debugging method, applied to a background processing device, the method comprising:
Receiving a quantum program sent by front-end display equipment, a breakpoint set in the quantum program and a current operating point;
Adding measurement operation on each quantum logic gate and a quantum bit acted by the quantum logic gate before each quantum logic gate included in the quantum program to construct a plurality of quantum circuits; creating a plurality of computing tasks corresponding to the quantum circuits, and determining a target breakpoint based on the breakpoint and the current running point;
Determining a target computing task corresponding to the target breakpoint from a plurality of computing tasks, and sending the target computing task to a quantum computing device;
Receiving a target calculation result calculated by the quantum computing device aiming at the target calculation task;
And sending the target calculation result to the front-end display device, so that the front-end display device responds to an execution instruction sent by a user and displays the target calculation result.
10. The method of claim 9, wherein the determining a target breakpoint based on the breakpoint and the current operating point comprises:
And determining the quantum logic gate corresponding to the position of the breakpoint, which is operated after the quantum logic gate corresponding to the position of the current operating point, as the quantum logic gate corresponding to the position of the target breakpoint, and determining the first breakpoint as the target breakpoint.
11. The method of claim 9, wherein the sending the target computing task to a quantum computing device comprises:
and sequentially sending the plurality of computing tasks to the quantum computing device according to the order of the priorities of the plurality of computing tasks from high to low.
12. The method of claim 11, wherein before the sending the plurality of computing tasks to the quantum computing device in order of priority of the plurality of computing tasks from high to low, the method further comprises:
And determining a calculation task corresponding to the quantum logic gate operated before and the quantum logic gate operated after the quantum logic gate at the position of the target breakpoint as a secondary target calculation task, wherein the priority of the secondary target calculation task is lower than that of the target calculation task and higher than that of other calculation tasks.
13. The method of claim 12, wherein after receiving the target computing result calculated by the quantum computing device for the target computing task, the method further comprises:
receiving a secondary target calculation result calculated by the quantum computing device aiming at the secondary target calculation task;
And sending the secondary target calculation result to the front-end display device, so that the front-end display device responds to a single-step forward instruction or a single-step backward instruction sent by a user to display the secondary target calculation result.
14. The method of claim 12, wherein after receiving the target computing result calculated by the quantum computing device for the target computing task, the method further comprises:
receiving a new current execution point sent by the front-end display device, wherein the new current execution point is updated by the front-end display device in response to a single-step forward instruction or a single-step backward instruction sent by a user;
And adjusting the priorities of other computing tasks based on the new current execution point.
15. The method of any of claims 9-14, wherein the quantum computing device is a real quantum chip or a quantum virtual machine.
16. The method of any of claims 9-14, wherein the quantum computing device is a real quantum chip and a quantum virtual machine, the target computing result comprising a real computing result of the real quantum chip computing and a simulated computing result of the quantum virtual machine computing.
17. A quantum program debugging apparatus, for use with a front-end display device, the apparatus comprising:
The communication unit is used for responding to an execution instruction sent by a user and sending a quantum program, a breakpoint set in the quantum program and a current running point to the background processing equipment;
The display unit is further used for receiving and displaying a target calculation result sent by the background processing equipment, wherein the target calculation result is calculated by the quantum computing equipment aiming at a target calculation task and is sent to the background processing equipment, the target calculation task is a calculation task corresponding to a target breakpoint in a plurality of calculation tasks created by the background processing equipment based on the quantum program, and the target breakpoint is determined by the background processing equipment based on the breakpoint and the current running point; the plurality of computing tasks correspond to a plurality of quantum circuits; the plurality of quantum circuits are constructed by adding measurement operations to each quantum logic gate included in the quantum program and a quantum bit acted by a quantum logic gate before each quantum logic gate by the background processing device.
18. A quantum program debugging apparatus for use with a background processing device, the apparatus comprising:
The communication unit is used for receiving the quantum program sent by the front-end display device, the breakpoint set in the quantum program and the current running point;
The processing unit is used for adding measurement operation on each quantum logic gate included in the quantum program and a quantum bit acted by the quantum logic gate before each quantum logic gate to construct a plurality of quantum circuits; creating a plurality of computing tasks corresponding to the quantum circuits, and determining a target breakpoint based on the breakpoint and the current running point; determining a target computing task corresponding to the target breakpoint from a plurality of computing tasks, and sending the target computing task to a quantum computing device;
the communication unit is further used for receiving a target calculation result calculated by the quantum computing device aiming at the target calculation task;
The communication unit is further configured to send the target calculation result to the front-end display device, so that the front-end display device responds to an execution instruction sent by a user and displays the target calculation result.
19. A storage medium having stored therein a computer program, wherein the computer program is arranged to perform the method of any of claims 1 to 8 or to perform the method of any of claims 9 to 16 when run.
20. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of the claims 1 to 8 or to run the computer program to perform the method of any of the claims 9 to 16.
21. A quantum program debugging system, characterized in that the system comprises a front-end display device comprising the quantum program debugging means as claimed in claim 15 and a background processing device comprising the quantum program debugging means as claimed in claim 16.
CN202210104096.0A 2022-01-27 2022-01-27 Quantum program debugging method, device, storage medium, electronic device and system Active CN116562386B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210104096.0A CN116562386B (en) 2022-01-27 2022-01-27 Quantum program debugging method, device, storage medium, electronic device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210104096.0A CN116562386B (en) 2022-01-27 2022-01-27 Quantum program debugging method, device, storage medium, electronic device and system

Publications (2)

Publication Number Publication Date
CN116562386A CN116562386A (en) 2023-08-08
CN116562386B true CN116562386B (en) 2024-07-16

Family

ID=87488512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210104096.0A Active CN116562386B (en) 2022-01-27 2022-01-27 Quantum program debugging method, device, storage medium, electronic device and system

Country Status (1)

Country Link
CN (1) CN116562386B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113222164A (en) * 2021-05-10 2021-08-06 中国科学技术大学 Method for generating quantum computing program and expression form thereof
CN113742237A (en) * 2021-09-13 2021-12-03 北京奕斯伟计算技术有限公司 Program debugging method, device, equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6892325B2 (en) * 2001-11-27 2005-05-10 International Business Machines Corporation Method for displaying variable values within a software debugger
US8990780B2 (en) * 2012-03-29 2015-03-24 International Business Machines Corporation Setting breakpoints in optimized instructions
US11366741B2 (en) * 2017-12-08 2022-06-21 Microsoft Technology Licensing, Llc Debugging quantum programs

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113222164A (en) * 2021-05-10 2021-08-06 中国科学技术大学 Method for generating quantum computing program and expression form thereof
CN113742237A (en) * 2021-09-13 2021-12-03 北京奕斯伟计算技术有限公司 Program debugging method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN116562386A (en) 2023-08-08

Similar Documents

Publication Publication Date Title
US20240160977A1 (en) Quantum circuit compilation method, device, compilation framework and quantum operating system
CN111401562B (en) A method and device for operating quantum circuits in terminal interfaces
CN102246471A (en) Testing apparatus and test method
CN112230818A (en) A method and device for editing quantum logic gates at a terminal interface
WO2020113526A1 (en) Chip verification method and device
CN111078579A (en) Monkey testing method and device and terminal equipment
CN112765018A (en) Instrument and meter debugging system and method
US7225429B2 (en) Breakpoint groups based on control flow
CN116402149B (en) Quantum circuit optimization method and device, storage medium and electronic device
CN116050528B (en) Method and device for constructing amplitude amplification circuit, medium and electronic device
CN116562386B (en) Quantum program debugging method, device, storage medium, electronic device and system
CN103455417B (en) A kind of software error alignment system based on Markov model and location of mistake method
CN116541947B (en) Grover solution method and device for SAT or MAX-SAT problem of vehicle configuration
CN111474894A (en) Variable target P L C simulation debugging method, storage medium and functional module
CN114912619B (en) A quantum computing task scheduling method, device and quantum computer operating system
CN116090568B (en) Method and device for determining size relation between quantum data and classical floating point data
CN119336488A (en) Multitasking processing method, device and storage medium for batch mobile equipment
CN115510782B (en) Method for locating verification errors, electronic device and storage medium
CN115775029B (en) Quantum circuit conversion method, device, medium and electronic device
CN115131119A (en) Quantum option estimation method based on Fourier expansion and related device
CN116562378A (en) Graphical quantum circuit construction method and related equipment based on real quantum chips
CN115879560B (en) A method and device for judging the equivalent relationship between quantum data and classical data
CN115730670B (en) Method, device, medium and electronic device for generating pattern file
CN114968751A (en) A program debugging method and program debugging device of a codeless development platform
CN115713122B (en) A method and device for determining the size relationship between quantum data and classical data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: 230088 Anhui Province, Hefei City, Gaoxin District, Chengxiqiao Community Service Center, No. 900 Wangjiang West Road, Zhong'an Chuanggu Science and Technology Park Phase I, Building D8

Patentee after: Benyuan Quantum Computing Technology (Hefei) Co.,Ltd.

Country or region after: China

Address before: 230088 6th floor, E2 building, phase II, innovation industrial park, 2800 innovation Avenue, high tech Zone, Hefei City, Anhui Province

Patentee before: Benyuan Quantum Computing Technology (Hefei) Co.,Ltd.

Country or region before: China

CP03 Change of name, title or address