Visual quantum computing programming method and device, server and storage medium
Through the visual quantum computing programming interface and quantum gate circuit editing interface, users can directly select and configure quantum gates, solving the complexity problem of traditional quantum circuit development and realizing intuitive quantum computing programming.
Patent Information
- Application Number
- CN202511213019.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-10-03
AI Technical Summary
Traditional quantum circuit development requires writing complex code logic, which increases development difficulty and verification time, and requires developers to master specialized quantum programming languages.
A visual quantum computing programming method is provided. Through the quantum computing programming interface, circuit selection box and quantum gate circuit editing interface, it allows users to select and configure alternative quantum gates, generate target quantum gate circuits and display the running results.
It reduces the development difficulty and learning cost of quantum computing programming, reduces the time to verify and test the correctness of quantum circuits, and makes programming clearer and more intuitive.
Smart Images

Figure CN120745870A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum computing, and in particular to a visual quantum computing programming method, device, server and storage medium. Background Art
[0002] Quantum computing is a new computing model based on the principles of quantum mechanics. It performs computations by manipulating units of quantum information (qubits). Unlike classical computers, which rely on the laws of classical physics, quantum computing can tackle complex problems that are difficult for classical computers. The potential advantages of quantum computing lie in its quantum mechanical properties, such as parallelism and superposition, making it particularly suitable for applications such as factorization, complex optimization, and materials simulation.
[0003] Traditional quantum circuit development typically requires writing complex code logic, which requires developers to master specialized quantum programming languages. This high barrier to entry not only increases development difficulty but also prolongs the time required to verify and test the correctness of quantum circuits. Summary of the Invention
[0004] The objects of the present invention include, for example, providing a visual quantum computing programming method, device, server and storage medium, which can at least partially solve the above-mentioned technical problems.
[0005] The embodiments of the present invention can be implemented as follows: In a first aspect, an embodiment of the present invention provides a visual quantum computing programming method, the method comprising: In response to a first operation of the user based on the user terminal, a quantum computing programming interface is displayed on the user terminal, wherein the quantum computing programming interface includes a quantum circuit search bar and a quantum circuit selection box, wherein the quantum circuit selection box includes a plurality of quantum circuits to be selected; receiving a quantum circuit selection instruction based on the quantum circuit search bar and / or the quantum circuit selection box, determining a target quantum circuit from each of the candidate quantum circuits, and displaying a quantum gate circuit editing interface corresponding to the target quantum circuit on the user terminal, wherein the quantum gate circuit editing interface includes a circuit setting box, a quantum gate circuit editing box, a quantum gate selection box, and a result display box, wherein the quantum gate selection box includes a plurality of candidate quantum gates, each of which encapsulates a section of quantum computing programming code; In response to a second operation of the user based on the user terminal, target quantum gate circuit setting parameters are obtained from the circuit setting box, at least one target quantum gate is determined from each candidate quantum gate, parameters of the initial quantum gate circuit in the quantum gate circuit editing box are configured based on the target quantum gate circuit setting parameters, and each target quantum gate is inserted at a target position on the parameter-configured initial quantum gate circuit to obtain a target quantum gate circuit; The target quantum gate circuit is received and executed based on the execution instruction, and the execution result corresponding to the target quantum gate circuit is displayed in the result display box.
[0006] Optionally, receiving a quantum circuit selection instruction based on the quantum circuit search bar and / or the quantum circuit selection box, determining a target quantum circuit from each of the candidate quantum circuits, and displaying a quantum gate circuit editing interface corresponding to the target quantum circuit on the user terminal includes: receiving the quantum circuit selection instruction based on the content input by the user in the quantum circuit search bar on the user terminal, determining a target quantum circuit from each of the candidate quantum circuits, and displaying a quantum gate circuit editing interface corresponding to the target quantum circuit on the user terminal; Alternatively, the quantum circuit selection instruction is received based on a user's clicking operation on the quantum circuit selection box by the user terminal, a target quantum circuit is determined from the candidate quantum circuits, and a quantum gate circuit editing interface corresponding to the target quantum circuit is displayed on the user terminal.
[0007] Optionally, in response to the second operation of the user based on the user terminal, obtaining target quantum gate circuit setting parameters from the circuit setting box, and determining at least one target quantum gate from each of the candidate quantum gates includes: Acquiring target quantum gate circuit setting parameters according to content input and / or selected by the user in the circuit setting box based on the user terminal, wherein the target quantum gate circuit setting parameters include the number of waveguides, calculation stages, number of photons, and number of quantum bits of the target quantum gate circuit; At least one target quantum gate is determined according to the content of the user operation in the quantum gate selection box based on the user terminal.
[0008] Optionally, inserting each target quantum gate at a target position on the initial quantum gate circuit after parameter configuration to obtain a target quantum gate circuit includes: inserting each of the target quantum gates from an initial position in the quantum gate candidate box to a target position on the initial quantum gate circuit after parameter configuration according to a user's click and / or drag operation in the quantum gate candidate box and the quantum gate circuit editing box based on the user terminal; According to the dragging and selecting operation of the user on the quantum gate circuit editing box based on the user terminal, a waveguide line is drawn between each of the target quantum gates to connect each of the target quantum gates to obtain the target quantum gate circuit.
[0009] Optionally, the quantum computing programming interface further includes a circuit example box; and the method further includes: When the user moves the cursor to any quantum circuit to be selected through the user terminal, an example diagram and a brief introduction corresponding to the quantum circuit to be selected are displayed in the circuit example box.
[0010] Optionally, the result display box includes an operation result display column and a code result display column; the method further includes: Determining a target result display column from the operation result display column and the code result display column according to a user's clicking operation on the result display frame based on the user terminal; If the target result display bar is the operation result display bar, the operation result corresponding to the target quantum gate circuit is displayed in the result display box; If the target result display column is the code result display column, the code corresponding to the target quantum gate circuit is displayed in the result display box.
[0011] Optionally, the quantum gate circuit editing interface further includes a chart display box; and the method further includes: Generating a measurement probability histogram, an amplitude histogram, and a density matrix diagram based on the operation results corresponding to the target quantum gate circuit; The measurement probability histogram, the amplitude histogram, and the density matrix graph are displayed in sequence in the graph display frame.
[0012] In a second aspect, an embodiment of the present invention provides a visual quantum computing programming device, comprising: a quantum computing programming interface display unit, configured to display a quantum computing programming interface on the user terminal in response to a first operation by the user based on the user terminal, wherein the quantum computing programming interface includes a quantum circuit search bar and a quantum circuit selection box, wherein the quantum circuit selection box includes a plurality of quantum circuits to be selected; a target quantum circuit determining unit, configured to receive a quantum circuit selection instruction based on the quantum circuit search bar and / or the quantum circuit selection box, determine a target quantum circuit from the candidate quantum circuits, and display a quantum gate circuit editing interface corresponding to the target quantum circuit on the user terminal, wherein the quantum gate circuit editing interface includes a circuit setting box, a quantum gate circuit editing box, a quantum gate selection box, and a result display box, wherein the quantum gate selection box includes a plurality of candidate quantum gates; a target quantum gate circuit editing unit, configured to, in response to a second operation by the user based on the user terminal, obtain target quantum gate circuit setting parameters from the circuit setting box, determine at least one target quantum gate from each of the candidate quantum gates, configure parameters of an initial quantum gate circuit in the quantum gate circuit editing box based on the target quantum gate circuit setting parameters, and insert each of the target quantum gates at a target position on the parameter-configured initial quantum gate circuit to obtain a target quantum gate circuit; The operation result output unit is used to receive and operate the target quantum gate circuit based on the operation instruction, and display the operation result corresponding to the target quantum gate circuit in the result display box.
[0013] In a third aspect, the present invention provides a server comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above methods when executing the program.
[0014] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a computer program, and when the computer program is executed, the server where the computer-readable storage medium is located is controlled to implement the steps of any of the above methods.
[0015] The beneficial effects of the embodiments of the present invention include, for example: By encapsulating quantum computing programming code into multiple candidate quantum gates, the system visually displays the quantum computing programming interface, including the candidate quantum gates, on the user terminal when receiving and responding to user operation requests and instructions. This allows users to directly select candidate quantum gates for clearer and more intuitive quantum computing programming, without having to write complex code logic or learn a specialized quantum programming language. This reduces development difficulty and learning costs, as well as the time required to verify and test the correctness of quantum circuits. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 A block diagram of a server provided in an embodiment of the present invention; Figure 2 A flowchart of the steps of a visual quantum computing programming method provided by an embodiment of the present invention; Figure 3 A schematic diagram of a quantum computing programming interface provided by an embodiment of the present invention; Figure 4 A schematic diagram of a quantum gate circuit editing interface provided by an embodiment of the present invention; Figure 5 A schematic diagram of a result display frame and a chart display frame provided by an embodiment of the present invention; Figure 6This is an architectural diagram of a visual quantum computing programming device provided by an embodiment of the present invention.
[0018] Icons: 100 - server; 110 - memory; 120 - processor; 130 - communication module; 300 - visual quantum computing programming device; 301 - quantum computing programming interface display unit; 302 - target quantum circuit determination unit; 303 - target quantum gate circuit editing unit; 304 - operation result output unit. DETAILED DESCRIPTION
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0020] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but merely represents selected embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort shall fall within the scope of protection of the present invention.
[0021] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.
[0022] In addition, the terms "first", "second", etc., if used, are merely used to distinguish and describe, and should not be understood as indicating or implying relative importance.
[0023] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.
[0024] Please refer to Figure 1 is a block diagram of a server 100 provided herein, comprising a memory 110, a processor 120, and a communication module 130. The memory 110, processor 120, and communication module 130 are electrically connected to each other, directly or indirectly, to enable data transmission or interaction. For example, these components may be electrically connected to each other via one or more communication buses or signal lines.
[0025] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0026] The processor 120 is used to read / write data or programs stored in the memory and execute corresponding functions.
[0027] The communication module 130 is used to establish a communication connection between the server and other communication terminals through the network, and to send and receive data through the network.
[0028] It should be understood that Figure 1 The structure shown is only a schematic diagram of the structure of the server 100. The server 100 may also include Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown. Figure 1 The components shown in the figure can be implemented by hardware, software or a combination thereof. The server 100 can be set in other devices or as an independent device.
[0029] An embodiment of the present invention provides a visual quantum computing programming method, the method comprising: Figure 2 The following steps are shown: Step S110: In response to a first operation of the user based on the user terminal, a quantum computing programming interface is displayed on the user terminal, wherein the quantum computing programming interface includes a quantum circuit search bar and a quantum circuit selection box, wherein the quantum circuit selection box includes a plurality of quantum circuits to be selected.
[0030] Step S120: receiving a quantum circuit selection instruction based on the quantum circuit search bar and / or the quantum circuit selection box, determining a target quantum circuit from the candidate quantum circuits, and displaying a quantum gate circuit editing interface corresponding to the target quantum circuit on the user terminal. The quantum gate circuit editing interface includes a circuit setting box, a quantum gate circuit editing box, a quantum gate selection box, and a result display box. The quantum gate selection box includes multiple candidate quantum gates, each of which encapsulates a section of quantum computing programming code.
[0031] Step S130: In response to the second operation of the user based on the user terminal, target quantum gate circuit setting parameters are obtained from the circuit setting box, at least one target quantum gate is determined from each of the candidate quantum gates, parameters of the initial quantum gate circuit in the quantum gate circuit editing box are configured based on the target quantum gate circuit setting parameters, and each of the target quantum gates is inserted at a target position on the initial quantum gate circuit after parameter configuration to obtain a target quantum gate circuit.
[0032] Step S140: receiving and executing the target quantum gate circuit based on the execution instruction, and displaying the execution result corresponding to the target quantum gate circuit in the result display box.
[0033] In step S110, in response to a first operation of the user based on the user terminal, a quantum computing programming interface is displayed on the user terminal, wherein the quantum computing programming interface includes a quantum circuit search bar and a quantum circuit selection box, wherein the quantum circuit selection box includes a plurality of quantum circuits to be selected.
[0034] The user terminal can be a terminal device that the user interacts with through an interactive interface, such as a computer, laptop, tablet, mobile phone, or other device. The server 100 can be a cloud server. The user accesses the target front-end page maintained by the server 100 through the user terminal device and accesses the quantum computing programming page by logging in to the target front-end page. Alternatively, the user downloads the quantum computing programming program package through the user terminal and accesses the quantum computing programming page by running the program package.
[0035] The first operation can be an operation such as a user clicking on the interactive interface through a finger, a stylus, a mouse, etc. After the user initiates the first operation based on the user terminal, the server 100 displays the quantum computing programming interface on the user terminal in response to the first operation. Figure 3 As shown, the quantum computing programming interface may include a quantum circuit search bar and a quantum circuit selection box, and the quantum circuit selection box includes multiple quantum circuits to be selected.
[0036] Optionally, in order to include more quantum circuits, the quantum computing programming interface can also be set as a switchable page, such as Figure 3 As shown in the figure, when the user clicks on "Optical Quantum Circuit", the quantum circuit selection box corresponding to the optical quantum circuit and the quantum circuit to be selected are displayed. When the user clicks on "Quantum Gate Circuit", the quantum circuit selection box corresponding to the quantum gate circuit and the quantum circuit to be selected are switched to.
[0037] Optionally, the quantum computing programming interface further includes a circuit example box; and the method further includes: When the user moves the cursor to any quantum circuit to be selected through the user terminal, an example diagram and a brief introduction corresponding to the quantum circuit to be selected are displayed in the circuit example box.
[0038] See Figure 3 When the user moves the mouse cursor to any quantum circuit to be selected through the user terminal, the server 100 will display the example diagram and introduction corresponding to the quantum circuit to be selected in the circuit example box. Figure 3 The following figure shows the corresponding example diagram and introduction displayed in the circuit example box when the user moves the mouse cursor over "Fock Backend (Basic Vector State)".
[0039] After the quantum computing programming interface is opened, step S120 is executed to receive a quantum circuit selection instruction based on the quantum circuit search bar and / or the quantum circuit selection box, determine a target quantum circuit from the candidate quantum circuits, and display a quantum gate circuit editing interface corresponding to the target quantum circuit on the user terminal. The quantum gate circuit editing interface includes a circuit setting box, a quantum gate circuit editing box, a quantum gate selection box, and a result display box. The quantum gate selection box includes multiple candidate quantum gates, each of which encapsulates a section of quantum computing programming code.
[0040] The quantum circuit selection instruction can be an instruction sent by the user to the server 100 through the interactive page of the user terminal, which is used to select the quantum circuit required by the user (ie, the target quantum circuit). Figure 4 As shown, after the user selects a target quantum circuit, server 100 displays the quantum gate circuit editing interface corresponding to the target quantum circuit on the user terminal. This interface includes a circuit setting box for setting the target quantum gate circuit parameters, a quantum gate circuit editing box for editing the quantum gate circuit, a quantum gate selection box for providing candidate quantum gates, and a result display box showing the quantum gate circuit execution results. The quantum gate selection box includes multiple candidate quantum gates. Each quantum gate is equivalent to a small code segment module, which encapsulates a quantum computing programming code.
[0041] Optionally, receiving a quantum circuit selection instruction based on the quantum circuit search bar and / or the quantum circuit selection box, determining a target quantum circuit from each of the candidate quantum circuits, and displaying a quantum gate circuit editing interface corresponding to the target quantum circuit on the user terminal includes: The quantum circuit selection instruction is received according to the content input by the user in the quantum circuit search bar of the user terminal, a target quantum circuit is determined from each of the candidate quantum circuits, and a quantum gate circuit editing interface corresponding to the target quantum circuit is displayed on the user terminal.
[0042] Alternatively, the quantum circuit selection instruction is received based on a user's clicking operation on the quantum circuit selection box by the user terminal, a target quantum circuit is determined from the candidate quantum circuits, and a quantum gate circuit editing interface corresponding to the target quantum circuit is displayed on the user terminal.
[0043] As an optional implementation, the user can issue a quantum circuit selection instruction by entering the target quantum circuit name in the quantum circuit search bar, causing the server 100 to determine the target quantum circuit and display the corresponding quantum gate circuit editing interface on the user terminal interface. Alternatively, the user can select the target quantum circuit from the quantum circuit selection box by moving the mouse cursor and clicking the left mouse button, sliding a finger, and clicking on the interactive interface, and then issue a quantum circuit selection instruction. After receiving the quantum circuit selection instruction, the server 100 determines the target quantum circuit and displays the corresponding quantum gate circuit editing interface on the user terminal interface.
[0044] In step S130, in response to the second operation of the user based on the user terminal, target quantum gate circuit setting parameters are obtained from the circuit setting box, at least one target quantum gate is determined from each of the candidate quantum gates, parameters of the initial quantum gate circuit in the quantum gate circuit editing box are configured based on the target quantum gate circuit setting parameters, and each of the target quantum gates is inserted at a target position in the initial quantum gate circuit after parameter configuration to obtain a target quantum gate circuit.
[0045] The quantum gate circuit editing interface opens, allowing users to edit quantum gate circuits through the user terminal. The second operation can be the entire set of operations for editing the quantum gate circuit. By performing the second operation on the interactive interface, the entire quantum gate circuit editing process can be completed, resulting in the target quantum gate circuit.
[0046] For example, if the user terminal is a computer, the user moves the mouse cursor to the circuit setting box and enters the target quantum gate circuit setting parameters using the keyboard. Then, the user moves the mouse cursor to the quantum gate selection box, selects at least one target quantum gate from each candidate quantum gate, and drags it to the target position in the quantum gate circuit edit box where the target quantum gate circuit setting parameters have been set. The user then connects and combines the target quantum gates to obtain the target quantum gate circuit.
[0047] Optionally, in response to the second operation of the user based on the user terminal, obtaining target quantum gate circuit setting parameters from the circuit setting box, and determining at least one target quantum gate from each of the candidate quantum gates includes: According to the content input and / or selected by the user in the circuit setting box based on the user terminal, the target quantum gate circuit setting parameters are acquired, where the target quantum gate circuit setting parameters include the number of waveguides, the calculation stage, the number of photons, and the number of quantum bits.
[0048] At least one target quantum gate is determined according to the content of the user operation in the quantum gate selection box based on the user terminal.
[0049] In an optional implementation, the user can enter the target quantum gate circuit parameters, such as the number of qubits, waveguides, or photons (when the user selects an optical quantum circuit), in the circuit settings box. They can also select whether to perform full-amplitude sampling by checking a box and select the simulation method by clicking. Once the circuit settings are complete, the server 100 generates the initial quantum gate circuit in the quantum gate circuit edit box. Alternatively, the user can select the target quantum gate by clicking or dragging within the quantum gate selection box.
[0050] Optionally, inserting each target quantum gate at a target position on the initial quantum gate circuit after parameter configuration to obtain a target quantum gate circuit includes: According to the user's click and / or drag operation in the quantum gate selection box and the quantum gate circuit editing box based on the user terminal, each of the target quantum gates is inserted from the initial position in the quantum gate selection box to the target position on the initial quantum gate circuit after parameter configuration.
[0051] According to the dragging and selecting operation of the user on the quantum gate circuit editing box based on the user terminal, a waveguide line is drawn between each of the target quantum gates to connect each of the target quantum gates to obtain the target quantum gate circuit.
[0052] In one feasible implementation, the user can click and drag a candidate quantum gate in the quantum gate selection box by moving the mouse cursor, moving the candidate quantum gate from its original position (initial position) to the target position on the initial quantum gate circuit in the quantum gate circuit edit box. The candidate quantum gate dragged to the target position then becomes the target quantum gate. The user can then draw waveguide lines between the target quantum gates by drawing connecting lines or clicking on them, connecting them to form the target quantum gate circuit.
[0053] Optionally, in order to facilitate user editing and save operation time, the user can also select multiple target quantum gates at a time by box selection, and copy, delete, move, etc. the selected target quantum gates through instructions of the user terminal (such as typing on the keyboard).
[0054] In step S140, the target quantum gate circuit is received and executed based on the execution instruction, and the execution result corresponding to the target quantum gate circuit is displayed in the result display box.
[0055] The operation instruction can be an instruction issued by the user through the operation of the user terminal (such as clicking on the interactive interface). After receiving the operation instruction, the server 100 runs and compiles the target quantum gate circuit edited by the user, obtains the corresponding operation result, and displays the operation result on the display screen. Figure 5 The result is shown in the display box.
[0056] Optionally, the result display box includes an operation result display column and a code result display column; the method further includes: According to a user's clicking operation on the result display frame based on the user terminal, a target result display column is determined from the operation result display column and the code result display column.
[0057] If the target result display column is the operation result display column, the operation result corresponding to the target quantum gate circuit is displayed in the result display box. If the target result display column is the code result display column, the code corresponding to the target quantum gate circuit is displayed in the result display box.
[0058] In an optional embodiment, in order to improve the intuitiveness, as Figure 5 As shown, you can also set up a run result display bar and a code result display bar. After the user edits the target quantum gate circuit, selecting the code result display bar will display the code corresponding to the target quantum gate circuit in the result display box. In addition, you can set it so that when the user moves the cursor to a target quantum gate, the code segment corresponding to the target quantum gate will be highlighted in the result display box.
[0059] When the user selects the operation result display bar, after the target quantum gate circuit is completed, the operation results, operation report, operation log, etc. corresponding to the target quantum gate circuit are displayed in the result display box.
[0060] Optionally, the quantum gate circuit editing interface further includes a chart display box. The method further includes: A measurement probability histogram, an amplitude histogram, and a density matrix diagram are generated based on the operation results corresponding to the target quantum gate circuit, and the measurement probability histogram, the amplitude histogram, and the density matrix diagram are sequentially displayed in the diagram display frame.
[0061] Still Figure 5For example, to further facilitate user analysis, a chart display box can be set. When the target quantum gate circuit is run and the operation results are obtained, the server 100 can generate a measurement probability histogram, an amplitude histogram, and a density matrix diagram based on the operation results, and display the measurement probability histogram, amplitude histogram, and density matrix diagram in the chart display box in sequence for user analysis and processing.
[0062] Based on the same inventive concept, Figure 6 As shown, the embodiment of the present invention provides a visual quantum computing programming device 300, including: The quantum computing programming interface display unit 301 is configured to display a quantum computing programming interface on the user terminal in response to a first operation by the user based on the user terminal, wherein the quantum computing programming interface includes a quantum circuit search bar and a quantum circuit selection box, wherein the quantum circuit selection box includes a plurality of quantum circuits to be selected.
[0063] The target quantum circuit determining unit 302 is configured to receive a quantum circuit selection instruction based on the quantum circuit search bar and / or the quantum circuit selection box, determine a target quantum circuit from the candidate quantum circuits, and display a quantum gate circuit editing interface corresponding to the target quantum circuit on the user terminal. The quantum gate circuit editing interface includes a circuit setting box, a quantum gate circuit editing box, a quantum gate selection box, and a result display box. The quantum gate selection box includes multiple candidate quantum gates.
[0064] The target quantum gate circuit editing unit 303 is configured to, in response to a second operation by the user based on the user terminal, obtain target quantum gate circuit setting parameters from the circuit setting box, determine at least one target quantum gate from each of the candidate quantum gates, configure parameters of the initial quantum gate circuit in the quantum gate circuit editing box based on the target quantum gate circuit setting parameters, and insert each of the target quantum gates at a target position on the parameter-configured initial quantum gate circuit to obtain a target quantum gate circuit.
[0065] The operation result output unit 304 is configured to receive and operate the target quantum gate circuit based on the operation instruction, and display the operation result corresponding to the target quantum gate circuit in the result display box.
[0066] Regarding the above-mentioned visual quantum computing programming device 300, the specific functions of each unit therein have been described in detail in the embodiment of the visual quantum computing programming method provided in this specification, and will not be elaborated here.
[0067] Based on the same inventive concept, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the aforementioned visual quantum computing programming methods.
[0068] The present invention has at least the following beneficial effects: By encapsulating quantum computing programming code into multiple candidate quantum gates, the system visually displays the quantum computing programming interface, including the candidate quantum gates, on the user terminal when receiving and responding to user operation requests and instructions. This allows users to directly select candidate quantum gates for clearer and more intuitive quantum computing programming, without having to write complex code logic or learn a specialized quantum programming language. This reduces development difficulty and learning costs, as well as the time required to verify and test the correctness of quantum circuits.
[0069] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of the devices, methods, and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, which contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the boxes can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, as well as the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified functions or actions, or can be implemented using a combination of dedicated hardware and computer instructions.
[0070] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0071] If the functions are implemented as software modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or the portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.
[0072] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A visual quantum computing programming method, characterized in that: The method comprises: In response to a first operation of the user based on the user terminal, a quantum computing programming interface is displayed on the user terminal, wherein the quantum computing programming interface includes a quantum circuit search bar and a quantum circuit selection box, wherein the quantum circuit selection box includes a plurality of quantum circuits to be selected; receiving a quantum circuit selection instruction based on the quantum circuit search bar and / or the quantum circuit selection box, determining a target quantum circuit from each of the candidate quantum circuits, and displaying a quantum gate circuit editing interface corresponding to the target quantum circuit on the user terminal, wherein the quantum gate circuit editing interface includes a circuit setting box, a quantum gate circuit editing box, a quantum gate selection box, and a result display box, wherein the quantum gate selection box includes a plurality of candidate quantum gates, each of which encapsulates a section of quantum computing programming code; In response to a second operation of the user based on the user terminal, target quantum gate circuit setting parameters are obtained from the circuit setting box, at least one target quantum gate is determined from each candidate quantum gate, parameters of the initial quantum gate circuit in the quantum gate circuit editing box are configured based on the target quantum gate circuit setting parameters, and each target quantum gate is inserted at a target position on the parameter-configured initial quantum gate circuit to obtain a target quantum gate circuit; The target quantum gate circuit is received and executed based on the execution instruction, and the execution result corresponding to the target quantum gate circuit is displayed in the result display box.
2. The visual quantum computing programming method according to claim 1, wherein: The receiving a quantum circuit selection instruction based on the quantum circuit search bar and / or the quantum circuit selection box, determining a target quantum circuit from each of the candidate quantum circuits, and displaying a quantum gate circuit editing interface corresponding to the target quantum circuit on the user terminal includes: receiving the quantum circuit selection instruction based on the content input by the user in the quantum circuit search bar on the user terminal, determining a target quantum circuit from each of the candidate quantum circuits, and displaying a quantum gate circuit editing interface corresponding to the target quantum circuit on the user terminal; Alternatively, the quantum circuit selection instruction is received based on a user's clicking operation on the quantum circuit selection box by the user terminal, a target quantum circuit is determined from the candidate quantum circuits, and a quantum gate circuit editing interface corresponding to the target quantum circuit is displayed on the user terminal.
3. The visual quantum computing programming method according to claim 1, wherein: The step of obtaining target quantum gate circuit setting parameters from the circuit setting frame in response to a second operation of the user based on the user terminal, and determining at least one target quantum gate from the candidate quantum gates, comprises: Acquiring target quantum gate circuit setting parameters according to content input and / or selected by the user in the circuit setting box based on the user terminal, wherein the target quantum gate circuit setting parameters include the number of waveguides, calculation stages, number of photons, and number of quantum bits of the target quantum gate circuit; At least one target quantum gate is determined according to the content of the user operation in the quantum gate selection box based on the user terminal.
4. The visual quantum computing programming method according to claim 1, wherein: Inserting each target quantum gate at a target position on the initial quantum gate circuit after parameter configuration to obtain a target quantum gate circuit includes: inserting each of the target quantum gates from an initial position in the quantum gate candidate box to a target position on the initial quantum gate circuit after parameter configuration according to a user's click and / or drag operation in the quantum gate candidate box and the quantum gate circuit editing box based on the user terminal; According to the dragging and selecting operation of the user on the quantum gate circuit editing box based on the user terminal, a waveguide line is drawn between each of the target quantum gates to connect each of the target quantum gates to obtain the target quantum gate circuit.
5. The visual quantum computing programming method according to claim 1, wherein: The quantum computing programming interface further includes a circuit example box; the method further includes: When the user moves the cursor to any quantum circuit to be selected through the user terminal, an example diagram and a brief introduction corresponding to the quantum circuit to be selected are displayed in the circuit example box.
6. The visual quantum computing programming method according to claim 1, wherein: The result display box includes an operation result display column and a code result display column; the method further includes: Determining a target result display column from the operation result display column and the code result display column according to a user's clicking operation on the result display frame based on the user terminal; If the target result display bar is the operation result display bar, the operation result corresponding to the target quantum gate circuit is displayed in the result display box; If the target result display column is the code result display column, the code corresponding to the target quantum gate circuit is displayed in the result display box.
7. The visual quantum computing programming method according to claim 1, wherein: The quantum gate circuit editing interface further includes a chart display box; the method further includes: Generating a measurement probability histogram, an amplitude histogram, and a density matrix diagram based on the operation results corresponding to the target quantum gate circuit; The measurement probability histogram, the amplitude histogram, and the density matrix graph are displayed in sequence in the graph display frame.
8. A visual quantum computing programming device, characterized in that: include: a quantum computing programming interface display unit, configured to display a quantum computing programming interface on the user terminal in response to a first operation by the user based on the user terminal, wherein the quantum computing programming interface includes a quantum circuit search bar and a quantum circuit selection box, wherein the quantum circuit selection box includes a plurality of quantum circuits to be selected; a target quantum circuit determining unit, configured to receive a quantum circuit selection instruction based on the quantum circuit search bar and / or the quantum circuit selection box, determine a target quantum circuit from the candidate quantum circuits, and display a quantum gate circuit editing interface corresponding to the target quantum circuit on the user terminal, wherein the quantum gate circuit editing interface includes a circuit setting box, a quantum gate circuit editing box, a quantum gate selection box, and a result display box, wherein the quantum gate selection box includes a plurality of candidate quantum gates; a target quantum gate circuit editing unit, configured to, in response to a second operation by the user based on the user terminal, obtain target quantum gate circuit setting parameters from the circuit setting box, determine at least one target quantum gate from each of the candidate quantum gates, configure parameters of an initial quantum gate circuit in the quantum gate circuit editing box based on the target quantum gate circuit setting parameters, and insert each of the target quantum gates at a target position on the parameter-configured initial quantum gate circuit to obtain a target quantum gate circuit; The operation result output unit is used to receive and operate the target quantum gate circuit based on the operation instruction, and display the operation result corresponding to the target quantum gate circuit in the result display box.
9. A server, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a computer program, and when the computer program is executed, the server where the computer-readable storage medium is located is controlled to implement the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Implementation system based on quantum cloud computing
CN112800703A
Visual representation of qubit stochastic errors and the impact on performance of a quantum circuit
US20210216898A1
Methods and systems for fault tolerant quantum circuit design
WO2024181918A1