A method for implementing quantum gate radians that can be edited in expressions

By using the VUE front-end development framework and JavaScript in the quantum computing cloud platform to verify and process user-input expressions, it solves the problem of users having difficulty editing the arc of the quantum gate, and achieves more efficient and accurate quantum computing operations.

CN114528997BActive Publication Date: 2024-08-30SHANDONG INSPUR SCI RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210149978.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-18
Publication Date
2024-08-30
Estimated Expiration
2042-02-18

AI Technical Summary

Technical Problem

In the quantum computing cloud platform, it is difficult for users to directly and accurately edit the quantum gate arc, resulting in low computing efficiency and a high probability of misoperation.

Method used

A method based on the VUE front-end development framework and JavaScript programming language is used to verify and process the expression entered by the user through regular expressions, ensure that it complies with the rules and then perform the operation, and update the radian value to the properties of the quantum gate to achieve the accuracy of the radian. control.

Benefits of technology

It simplifies user operations, improves calculation accuracy and efficiency, and reduces the probability of user calculation errors and erroneous operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114528997B
    Figure CN114528997B
Patent Text Reader

Abstract

The present invention provides a method for implementing the editing of expressions for the radian of a quantum gate, which belongs to the fields of web front-end and quantum computing. The present invention is based on the VUE front-end development framework and is completed using the JavaScript programming language. This method is aimed at the development requirements of using expressions to express the editing of the radian of a quantum gate during the development of a quantum computing cloud platform. When editing the radian of a quantum gate, the radian of the quantum gate can be controlled by directly inputting a regular expression, which allows users to save the time and error of calculating the expression by themselves, and at the same time, the value can be taken according to the optimal value taking rule of a quantum computer, making it easier to use and more accurate. This method is aimed at the implementation requirements of the editing of the radian of a quantum gate of a quantum cloud platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of web front-end and quantum computing, and in particular to a method for realizing expression editing of quantum gate radians. 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 that will have a disruptive impact on the future.

[0003] A quantum computer is a computing system composed of a quantum chip and an external measurement and control system. The quantum cloud platform can intuitively provide users with some functions that require the use of quantum computers for calculations. The ability to edit the expression of the arc of quantum gates such as U1 is an important part of improving functions and enhancing user experience. It also greatly increases the effective working time of quantum computers and reduces the time of user experiments and the probability of erroneous operations. Therefore, the writing of this method is particularly important. Summary of the invention

[0004] In order to solve the above technical problems, the present invention provides a method for implementing expression editing of quantum gate radians.

[0005] The technical solution of the present invention is:

[0006] A method for implementing the expression editing of the radian of a quantum gate is based on the VUE front-end development framework and is completed using the JavaScript programming language. This method is designed to meet the development needs of using expressions to express the radian editing of quantum gates during the development of a quantum computing cloud platform. When editing the radian of a quantum gate, the radian of the quantum gate can be controlled by directly inputting a regular expression, which allows users to save the time and error of calculating the expression themselves, and at the same time, the value can be taken according to the optimal value-taking rules of the quantum computer, making it easier to use and more accurate. This method is designed to meet the implementation needs of the expression editing of the radian of a quantum gate on a quantum cloud platform.

[0007] Furthermore,

[0008] Here are the steps:

[0009] 1) First, write a regular expression to verify whether the expression entered by the user complies with the rules. If it does not comply with the rules, the user is not allowed to confirm the edit. When the expression entered by the user complies with the rules of the regular expression, the expression is calculated;

[0010] 2) After passing the regular expression verification, the expression in string format is obtained and then replaced with a number of specified digits;

[0011] 3) After the replacement is completed, the operation value of the expression in string form is calculated, and after the calculated value is obtained, the decimal place is controlled by the toFixed method, and then updated to the attribute of the quantum gate;

[0012] The updated value triggers the change event of the language programming, so as to obtain the attribute value to update the code value in the language programming and achieve the effect of data synchronization.

[0013] Going further,

[0014] In step 1), write a JavaScript regular expression method call to verify whether the expression input complies with the rules. If the verification passes, perform the operation.

[0015] If the following steps are not executed, return false is used to interrupt the program execution and a prompt will pop up to ask the user to enter the correct regular expression.

[0016] Going further,

[0017] In step 2), after obtaining the expression in string format, use the replace method to replace the symbols representing π, including pi and PI.

[0018] After obtaining the expression that passes the verification, write a filter to filter and convert the PI in the expression, and convert PI into a π value with a specified number of digits.

[0019] Going further,

[0020] After replacing the expression, use JavaScript's eval method to perform operations on the expression string and control the number of decimal places. The obtained radian value is set to the properties of the quantum gate so that the radian value of the quantum gate can be accurately obtained the next time it is edited. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 This is a diagram showing the expression input function of gate U1;

[0022] Figure 2 This is a schematic diagram of the arc update after the expression is verified. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0024] The present invention is an implementation method for editing the curvature of quantum gates such as U1 in a quantum computing cloud platform through expressions. The method is based on the VUE front-end development framework and is completed using the JavaScript programming language. This method is aimed at the development needs of using expressions to represent the curvature of quantum gates such as U1 during the development of the quantum computing cloud platform. When editing the curvature of quantum gates such as U1, the curvature of the quantum gate can be controlled by directly inputting a regular expression. This allows users to save the time and error of calculating the expression themselves, and at the same time, the value can be taken according to the optimal value-taking rules of the quantum computer, making it easier to use and the results more accurate. This method is aimed at the implementation needs of editing the curvature of quantum gates such as U1 in the quantum cloud platform through expressions.

[0025] Specifically include the following:

[0026] (1) First, write a regular expression to verify whether the expression entered by the user complies with the rules. If it does not comply with the rules, the user is not allowed to confirm the editing arc. When the expression entered by the user complies with the rules of the regular expression, the expression is operated.

[0027] (2) After obtaining an expression that passes verification, write a filter to filter and convert the PI in the expression, converting PI into a π value with a specified number of digits. The implementation method of this filter can use JavaScript's replace method to completely replace the expression string.

[0028] (3) After replacing PI in the expression, use the eval method to perform operations on the expression string and control the number of decimal places. The obtained radian value is set to the properties of the quantum gate so that the radian value of the quantum gate can be accurately obtained the next time it is edited.

[0029] The above description is only a preferred embodiment of the present invention, which is only used to illustrate the technical solution of the present invention, and is not used to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A method for implementing expression editing of quantum gate radians, characterized in that: When editing the radian of a quantum gate, the radian of the quantum gate is controlled by directly inputting a regular expression, and the value is determined according to the optimal value-taking rule of the quantum computer; The specific steps include: 1) First, write a JavaScript regular expression to verify whether the expression entered by the user complies with the rules. If it does not comply with the rules, the user is not allowed to confirm the editing arc. When the expression entered by the user complies with the rules of the regular expression, the expression is calculated; 2) After passing the regular expression verification, the expression in string format is obtained and then replaced with a number of specified digits; 3) After replacing the expression, use JavaScript's eval method to operate on the expression string. After obtaining the calculated value, use the toFixed method to control the decimal places and then update it to the properties of the quantum gate.

2. The method according to claim 1, characterized in that If the following steps are not executed, return false is used to interrupt the program execution and a prompt will pop up to ask the user to enter the correct regular expression.

3. The method according to claim 2, characterized in that In step 2), after obtaining the expression in string format, use the replace method to replace the symbols representing π, including pi and PI.

4. The method according to claim 3, characterized in that After obtaining the expression that passes the verification, write a filter to filter and convert the PI in the expression, and convert PI into a π value with a specified number of digits.

5. The method according to claim 1, characterized in that The updated value triggers the change event of the language programming, so as to obtain the attribute value to update the code value in the language programming and achieve the effect of data synchronization.

Citation Information

Patent Citations

  • Modularization thinking-based template framework design method and system

    CN106371829A

  • Regular expression detection method and device and computer readable storage medium

    CN110928793A