Implementation method of CNOT gate flipping function in quantum computing cloud platform
By dragging the CNOT gate to the register in the quantum computing cloud platform and editing the start and end positions, the flipping of the CNOT gate is realized, which solves the functional problem of not realizing the flipping of the CNOT gate in the existing technology, meets user needs and ensures Correct presentation of graphics.
Patent Information
- Application Number
- CN202110640966.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-09
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-06-09
AI Technical Summary
The existing quantum computing cloud platform has not implemented the function of dragging the CNOT gate to the register and then flipping it, resulting in the inability to meet users' unique needs for this function.
Drag the CNOT gate to the horizontal line representing the quantum register, add a cross-line entanglement editing event, use the pop-up window to edit the start and end positions, and use native JavaScript to reshape and render the graphics to achieve the flip of the CNOT gate.
The drag-and-flip function of the CNOT gate in the quantum computing cloud platform is implemented to meet the unique needs of users, and the correct display of graphics is ensured through dynamic adjustment and rendering.
Smart Images

Figure CN115526324B
Abstract
Description
Technical Field
[0001] The present invention relates to a method for realizing a CNOT gate flipping function in a quantum computing cloud platform, and belongs to the technical fields of web front-end and quantum computing. Background Art
[0002] The idea of quantum computing was first proposed by Feynman in the 1980s. It is considered to be a new computing model with a disruptive impact on the future. A quantum computer is a computing system composed of a quantum chip and an external measurement and control system. The operation of quantum requires the front-end and back-end to interact with each other through data to make the results of each experiment more intuitively displayed to users and to realize the operation of data. Some of the key functions are quantum cross-line entanglement editing, and the flipping of the CNOT gate is an indispensable part of it. However, there is no component that implements this method available for use. Therefore, the writing of this method is particularly important. Summary of the invention
[0003] In order to solve the problem of the unique requirement of flipping a CNOT gate after dragging it onto a register in a quantum computing cloud platform, the present invention provides a method for realizing the flippable function of a CNOT gate in a quantum computing cloud platform.
[0004] In order to achieve the above object, the present invention is implemented through the following technical solutions:
[0005] A method for implementing a CNOT gate flipping function in a quantum computing cloud platform comprises the following steps:
[0006] (1) Drag the CNOT gate to the horizontal line representing the quantum register. The CNOT gate should occupy at least two lines.
[0007] (2) Add an event for editing cross-line entanglement quantum when clicking on a cross-line quantum;
[0008] (3) Make the starting position data in the pop-up window smaller than the ending position data, which will cause the CNOT gate to flip its head and tail;
[0009] (4) After obtaining the information of the start and end positions, the graphics are re-rendered. CNOTs flip according to the position information and use native JavaScript to reshape the graphics and render them to the correct position.
[0010] The preferred solution for realizing the CNOT gate flipping function in the quantum computing cloud platform, and the specific contents of cross-line entanglement editing are as follows:
[0011] (1) You need to drag and drop the cross-line quantum onto the horizontal line representing the quantum register. At this time, add the symbol representing the cross-line quantum to the array representing the quantum register in the back-end code, and then dynamically create a cross-line quantum graphic online using the js language. At this time, the width of the cross-line line is the width of the line represented by a quantum register, and use the relative positioning method to position it on the dragged and dropped line graphic to ensure that it follows the movement of the graphic. When setting it to cross multiple lines, directly set its width to achieve the control effect;
[0012] (2) When the cross-line quantum is dragged and dropped onto the quantum register at the specified position, the cross-line quantum is in the initial state. In the initial state, the quantum entanglement cross-line is the quantum cross-line effect of two adjacent quantum registers. A click event is added to this cross-line quantum. When clicked, an edit button appears on the cross-line quantum, and the cross-line entanglement setting is performed for this quantum.
[0013] (3) When you click the edit icon, use the pop-up window to edit the start and end positions, and re-render the cross-line sub-item on the page based on the entered start and end positions;
[0014] (4) Each time you edit a cross-line quantum, you need to determine whether there are other positions on the quantum register in the column that it is going to occupy. If so, you need to terminate the adjustment and pop up an error prompt. If there are no other placeholder quantum elements, the page will be re-rendered normally.
[0015] The advantage of the present invention is that it can realize the unique requirement of flipping a CNOT gate after dragging it onto a register in a quantum computing cloud platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0017] Figure 1 This is a schematic diagram of the CNOT door dragging state according to an embodiment of the present invention;
[0018] Figure 2 A schematic diagram of a CNOT gate according to an embodiment of the present invention being dragged onto a horizontal line representing a quantum register;
[0019] Figure 3 A schematic diagram of quantum cross-line entanglement editing according to an embodiment of the present invention;
[0020] Figure 4 Schematic diagram of the head-to-tail flipping of the CNOT gate according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] A method for implementing a CNOT gate flipping function in a quantum computing cloud platform comprises the following steps:
[0023] (1) Reference Figure 1 and Figure 2 Drag the CNOT gate to the horizontal line representing the quantum register. The CNOT gate will occupy at least two lines.
[0024] (2) Reference Figure 3 , add the event of cross-line entanglement editing quantum when clicking cross-line quantum;
[0025] (3) Make the starting position data in the pop-up window smaller than the ending position data, which will cause the CNOT gate to flip its head and tail;
[0026] (4) Reference Figure 4 After obtaining the information of the start and end positions, the graphics are re-rendered. CNOTs flip according to the position information, use native JavaScript to reshape the graphics, and render them to the correct position.
[0027] In this embodiment, the specific contents of cross-line entanglement editing are as follows:
[0028] (1) You need to drag and drop the cross-line quantum onto the horizontal line representing the quantum register. At this time, add the symbol representing the cross-line quantum to the array representing the quantum register in the back-end code, and then dynamically create a cross-line quantum graphic online using the js language. At this time, the width of the cross-line line is the width of the line represented by a quantum register, and use the relative positioning method to position it on the dragged and dropped line graphic to ensure that it follows the movement of the graphic. When setting it to cross multiple lines, directly set its width to achieve the control effect;
[0029] (2) When the cross-line quantum is dragged and dropped onto the quantum register at the specified position, the cross-line quantum is in the initial state. In the initial state, the quantum entanglement cross-line is the quantum cross-line effect of two adjacent quantum registers. A click event is added to this cross-line quantum. When clicked, an edit button appears on the cross-line quantum, and the cross-line entanglement setting is performed for this quantum.
[0030] (3) When the edit icon is clicked, a pop-up window is used to edit the start and end positions. The page is re-rendered based on the input start and end positions. At the same time, there are strict rules for the start and end positions. For example, the start position cannot be greater than the end position, otherwise nothing will be done and an error prompt box will pop up. When everything is correct, the code is executed. The length of the line of the cross-line quantum is controlled by the difference between the end position and the start position and the length of the line when crossing a line.
[0031] (4) Each time you edit a cross-line quantum, you need to determine whether there are other positions on the quantum register in the column that it is going to occupy. If so, you need to terminate the adjustment and pop up an error prompt. If there are no other placeholder quantum elements, the page will be re-rendered normally.
[0032] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for a person skilled in the art to modify the technical solutions described in the aforementioned embodiments or to replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for implementing the CNOT gate flipping function in a quantum computing cloud platform. It is characterized in that The following steps are involved: (1) Drag the CNOT gate to the horizontal line representing the quantum register. The CNOT gate should occupy at least two lines. (2) Add an event for editing cross-line entanglement quantum when clicking on a cross-line quantum; (3) Make the starting position data in the pop-up window smaller than the ending position data, which will cause the CNOT gate to flip its head and tail; (4) After obtaining the information of the start and end positions, the graphics are re-rendered. CNOTs flip according to the position information, use native JavaScript to reshape the graphics, and render them to the correct position; The specific contents of cross-line entanglement editing are as follows: (1) You need to drag and drop the cross-line quantum onto the horizontal line representing the quantum register. At this time, add the symbol representing the cross-line quantum to the array representing the quantum register in the back-end code, and then dynamically create a cross-line quantum graphic online using the js language. At this time, the width of the cross-line line is the width of the line represented by a quantum register, and use the relative positioning method to position it on the dragged and dropped line graphic to ensure that it follows the movement of the graphic. When setting it to cross multiple lines, directly set its width to achieve the control effect; (2) When the cross-line quantum is dragged and dropped onto the quantum register at the specified position, the cross-line quantum is in the initial state. In the initial state, the quantum entanglement cross-line is the quantum cross-line effect of two adjacent quantum registers. A click event is added to this cross-line quantum. When clicked, an edit button appears on the cross-line quantum, and the cross-line entanglement setting is performed for this quantum. (3) When you click the edit icon, use the pop-up window to edit the start and end positions, and re-render the cross-line sub-item on the page based on the entered start and end positions; (4) Each time you edit a cross-line quantum, you need to determine whether there are other positions on the quantum register in the column that it is going to occupy. If so, you need to terminate the adjustment and pop up an error prompt. If there are no other placeholder quantum elements, the page will be re-rendered normally.
