Visual configuration system and quantum circuit generation method
By introducing a visual configuration system on the low-code platform of quantum computing programming, and using component configuration modules and rendering modules to generate quantum circuits, the problem of insufficient flexibility in quantum circuit design in the prior art is solved, and a more efficient and friendly quantum programming experience is achieved.
Patent Information
- Application Number
- CN202411559701.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-03-07
AI Technical Summary
The prior art lacks flexibility in quantum circuit design, cannot meet the diverse design needs of users, and has poor user experience.
Provides a visual configuration system for low-code platform for quantum computing programming, including component configuration modules and rendering modules. The component configuration module generates component configuration information through predefined configuration information and user-input configuration resource files, and the rendering module generates quantum circuits based on this information.
It improves the flexibility and customizability of quantum circuit design, simplifies the quantum programming process, and allows non-professional users to design and build quantum algorithms and circuits.
Smart Images

Figure CN119578570A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of quantum computing, and more specifically, to a visual configuration system and quantum circuit generation method for a low-code platform for quantum computing programming. Background Art
[0002] Quantum circuits that operate on quantum bits can perform computational tasks that are difficult or impossible for classical computers to complete. In related technologies, in order to simplify quantum circuit design, quantum circuits can be displayed graphically and a fixed number of general logic gates can be provided for users to select and drag logic gates to design quantum circuits. However, this does not provide enough flexibility in quantum circuit design. Summary of the invention
[0003] The present application provides a visual configuration system and quantum circuit generation method for a low-code platform for quantum computing programming.
[0004] The embodiment of the present application provides a visual configuration system for a low-code platform for quantum computing programming, the visual configuration system comprising a component configuration module and a rendering module;
[0005] The component configuration module includes predefined configuration information, and the component configuration module is configured to obtain component configuration information according to the predefined configuration information and the configuration resource file in response to the generated configuration resource file;
[0006] The rendering module is configured to generate a first target component according to the component configuration information, and the low-code platform can generate a quantum circuit according to the first target component.
[0007] In this way, the visualization configuration system of the low-code platform for quantum computing programming provided by the present application includes a component configuration module and a rendering module. The component configuration module includes predefined configuration information. In response to the generated configuration resource file, the component configuration module obtains the component configuration information according to the predefined configuration information and the configuration resource file. Then, the rendering module can generate a first target component according to the component configuration information. Based on the first target component, the low-code platform can generate a quantum circuit. In this way, the visualization configuration system can flexibly design the quantum gate components required by the user through the generated configuration resource file and predefined configuration information, flexibly meet the user's design requirements, and effectively improve the user experience.
[0008] In some implementations, the component configuration module is configured to:
[0009] In response to a first form input by a user for a first configuration form, generating an input configuration file;
[0010] Performing identification processing on the input configuration file to obtain an input style file, an input attribute file and an input rule file;
[0011] The input style file, the input attribute file and the input rule file are packaged to generate the configuration resource file, which includes a style configuration resource file, an attribute configuration resource file and a rule configuration resource file.
[0012] In this way, the component configuration module can generate an input configuration file in response to the user's first form input for the first configuration form. Then, the component configuration module can also obtain an input style file, an input attribute file, and an input rule file in response to the identification processing of the input configuration file. Finally, the component configuration module can also be used to package the input style file, the input attribute file, and the input rule file to generate a configuration resource file, and the configuration resource file includes a style configuration resource file, an attribute configuration resource file, and a rule configuration resource file. In this way, the component configuration module not only simplifies the user's configuration operation, but also provides structured management and processing of component configuration information, thereby making the design and programming of quantum circuits more efficient and friendly.
[0013] In some embodiments, the component configuration module is configured to:
[0014] Parsing the style configuration resource file to obtain style configuration information;
[0015] Parsing the attribute configuration resource file to obtain attribute configuration information;
[0016] Parsing the rule configuration resource file to obtain rule configuration information;
[0017] Merging the predefined style configuration information in the predefined configuration information and the style configuration information to generate component style configuration information;
[0018] Merging the predefined attribute configuration information in the predefined configuration information and the attribute configuration information to generate component attribute configuration information;
[0019] The predefined rule configuration information in the predefined configuration information and the rule configuration information are combined to generate component rule configuration information.
[0020] In this way, the component configuration module can parse the style configuration resource file to obtain the style configuration information. The component configuration module can also parse the attribute configuration resource file to obtain the attribute configuration information. The component configuration module can also parse the rule configuration resource file to obtain the rule configuration information. The component configuration module can also merge the predefined style configuration information and the style configuration information in the predefined configuration information to generate the component style configuration information. The component configuration module can also merge the predefined attribute configuration information and the attribute configuration information in the predefined configuration information to generate the component attribute configuration information. The component configuration module can also merge the predefined rule configuration information and the rule configuration information in the predefined configuration information to generate the component rule configuration information. In this way, the component configuration module can generate the component configuration information according to the configuration resource file and the predefined configuration information, and the component configuration information can be used by the rendering module to generate a visual representation of the quantum circuit, thereby improving the flexibility and customizability of the quantum circuit design and ensuring the correctness and consistency of the quantum circuit design.
[0021] In some embodiments, the component style configuration information includes color, shape, whether to align, and / or whether to display an angle;
[0022] The component attribute configuration information includes the component name, the number of quantum bits manipulated, the name of the quantum bits manipulated, whether to perform batch operation and / or enable and edit the composite quantum gate component;
[0023] The component rule configuration information includes manipulation restriction information of the manipulated quantum bits.
[0024] In this way, the component style configuration information includes color, shape, whether to align and / or whether to display angles. The component attribute configuration information includes the component name, the number of manipulated quantum bits, the name of the manipulated quantum bits, whether to perform batch operations and / or enable and edit composite quantum gate components. The component rule configuration information includes the manipulation restriction information of the manipulated quantum bits. In this way, the component configuration information jointly defines the behavior and appearance of the quantum gate or component in the low-code platform. Users can edit these configuration information through a graphical interface to quickly build and adjust quantum circuits, thereby simplifying the complexity of quantum programming and enabling non-professional users to design quantum algorithms and circuits. In addition, by setting up and editing composite quantum gate components, multiple quantum gate fusions, or composite quantum gate components that fuse classical and quantum, can be performed, thereby realizing component-based reuse of quantum gate component combinations and flexibly meeting user needs.
[0025] In some embodiments, the rendering module is configured to:
[0026] The first target component is generated according to the component style configuration information, the component attribute configuration information and the component rule configuration information.
[0027] In this way, the rendering module can generate a first target component according to the component style configuration information, the component attribute configuration information and the component rule configuration information. In this way, the rendering module converts the component style configuration information, the component attribute configuration information and the component rule configuration information into the first target component on the visual interface. Users can intuitively design and understand quantum circuits based on the quantum gate components in the first target component without having to deeply understand the complexity of the underlying code and quantum computing, thereby lowering the threshold for quantum programming and improving the programming efficiency of users.
[0028] In some embodiments, the visualization configuration system further includes a quantum circuit design module, wherein the quantum circuit design module is configured to:
[0029] In response to a first input operation, a target quantum gate is determined from the first target component, and a target quantum circuit is generated according to the target quantum gate.
[0030] In this way, the quantum circuit design module can determine the target quantum gate from the first target component in response to the first input operation, and generate the target quantum circuit according to the target quantum gate. In this way, the quantum circuit design module enables users to design and modify quantum circuits through simple input operations without directly writing complex quantum computing codes, thereby simplifying the design process of quantum circuits and enabling non-professional users to easily build and experiment with quantum algorithms.
[0031] In some embodiments, the visualization configuration system further includes a state management module, and the state management module is configured to:
[0032] According to the first input operation, the node position of the target quantum gate is determined to determine the operation record of the target quantum gate.
[0033] In this way, the state management module can determine the node position of the target quantum gate according to the first input operation to determine the operation record of the target quantum gate. In this way, the state management module ensures that the design process of the quantum circuit is traceable and auditable. Users can understand the changes of the quantum circuit at any time according to the operation record, and trace back and check the design process of the quantum circuit according to the operation record.
[0034] In some embodiments, the visualization configuration system further includes a file storage module, and the file storage module is configured to:
[0035] The predefined configuration information is updated according to the component configuration information and stored.
[0036] In this way, the visual configuration system also includes a file storage module, which can update and store the predefined configuration information according to the component configuration information. In this way, the file storage module ensures that the user's configuration information in the quantum circuit design process can be effectively managed and persisted, so that the user's work progress and personalized settings are retained when the user uses the low-code platform next time, thereby realizing the customizability and scalability of the low-code platform.
[0037] In some embodiments, the first target component includes a plurality of quantum gate units, and the component configuration module is configured to:
[0038] In response to the user's second form input for the second configuration form, the composite quantum gate component is generated according to at least two of the quantum gate units in the first target component, and the low-code platform is capable of generating the quantum circuit according to the composite quantum gate component. The second configuration form is generated by the component configuration module according to the component configuration information.
[0039] In this way, the first target component includes multiple quantum gate units, the component configuration module can respond to the user's second form input for the second configuration form, and generate a composite quantum gate component based on at least two quantum gate units in the first target component. The low-code platform can generate a quantum circuit based on the composite quantum gate component, and the second configuration form is generated by the component configuration module based on the component configuration information. In this way, the component configuration module and the low-code platform provide users with an efficient and intuitive way to design and build complex quantum circuits. Users can quickly generate composite quantum gate components through simple form input and configuration, thereby speeding up the development and testing process of quantum algorithms.
[0040] The embodiment of the present application provides a quantum circuit generation method, the quantum circuit generation method is based on the above-mentioned visualization configuration system, and the method includes:
[0041] In response to the generated configuration resource file, obtaining component configuration information according to the predefined configuration information and the configuration resource file;
[0042] A first target component is generated according to the component configuration information, so as to generate a quantum circuit according to the first target component.
[0043] Thus, in response to the generated configuration resource file, the visual configuration system obtains the component configuration information according to the predefined configuration information and the configuration resource file. Then, the visual configuration system generates the first target component according to the component configuration information to generate a quantum circuit according to the first target component. In this way, the visual configuration system allows users to design and build complex quantum circuits through customized quantum gate components, flexibly meeting the design requirements of users, and greatly simplifying the complexity of quantum programming, so that non-professional users can also easily build and experiment with quantum algorithms.
[0044] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0046] Figure 1 It is a structural diagram of a visual configuration system according to an embodiment of the present application;
[0047] Figure 2 is a schematic diagram of a default quantum gate assembly according to an embodiment of the present application;
[0048] Figure 3 It is a schematic diagram of the architecture of the visual configuration engine of the implementation mode of the present application;
[0049] Figure 4 It is a schematic diagram of the component configuration module interface of the implementation mode of the present application;
[0050] Figure 5 It is a schematic diagram of basic information of a quantum gate component according to an embodiment of the present application;
[0051] Figure 6 This is a schematic diagram of a first configuration form of an implementation method of the present application;
[0052] Figure 7 is a schematic diagram of a second configuration form in an implementation manner of the present application;
[0053] Figure 8 It is a flowchart of a quantum circuit generation method according to an embodiment of the present application. DETAILED DESCRIPTION
[0054] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and cannot be understood as limiting the embodiments of the present application.
[0055] Quantum circuits are the core component of quantum computing, which implements complex computing tasks by operating quantum bits. Unlike the binary circuits used by classical computers, quantum circuits use the superposition and entanglement characteristics of quantum bits to perform calculations, which enables quantum computers to solve some computing problems that are difficult or impossible for classical computers to complete, such as prime factorization of large integers and search problems.
[0056] In the process of writing quantum algorithms, the design of quantum circuits is a crucial step. In order to lower the threshold of programming, existing technologies usually use graphical methods to display quantum circuits. This method allows users to design quantum circuits by defining the number of quantum bits, dragging logic gates, and other operations. However, existing technologies have some problems.
[0057] For example, when quantum algorithms become complex, they often require a large number of quantum logic gates to be combined and constructed. In the existing display area, the icons of the logic gates may become densely displayed, resulting in a poor user experience.
[0058] Secondly, in algorithm design, it is often necessary to combine classical code with quantum instructions to implement specific functions. However, existing technologies only provide a fixed number of general logic gates, which limits the design flexibility of quantum circuits and cannot meet the diverse design needs of users.
[0059] In addition, due to the topological structure limitations of quantum computing physical machines, the writing of quantum algorithms needs to consider characteristics such as the connectivity of quantum bits. In the quantum circuits of the prior art, the numbering of quantum bits is fixed, and it is impossible to ensure that the order of adjacent bits is consistent with the actual topological structure, which may cause program compilation failure.
[0060] Based on the above questions, please refer to Figure 1 An embodiment of the present application provides a visual configuration system for a low-code platform for quantum computing programming, and the visual configuration system includes a component configuration module and a rendering module.
[0061] The component configuration module includes predefined configuration information, and the component configuration module can respond to the generated configuration resource file and obtain the component configuration information according to the predefined configuration information and the configuration resource file.
[0062] The rendering module can generate a first target component according to the component configuration information, and based on the first target component, the low-code platform can generate a quantum circuit.
[0063] Specifically, quantum computing programming refers to a field involving quantum mechanics and computer science that uses quantum bits (qubits) to perform calculations. Unlike traditional binary computing, quantum computing uses the properties of quantum bits that can represent 0 and 1 at the same time to achieve powerful computing capabilities through quantum superposition and quantum entanglement. Quantum computing programming usually requires the use of specific quantum programming languages and development environments.
[0064] Low-code is a software development approach that allows developers to create applications using graphical interfaces and pre-made templates instead of manually writing large amounts of code. This approach can speed up the application development process while reducing development difficulty and cost. Low-code platforms typically provide visual design tools that enable developers to build user interfaces by dragging and dropping components and elements.
[0065] Quantum state is used to describe all possible states of a quantum system and their probabilities.
[0066] Quantum Circuit is used to describe the sequential application of quantum gates, which can be used to implement quantum algorithms and process quantum states.
[0067] Quantum gates are used to change the state of quantum bits and are the basis for building and executing quantum algorithms.
[0068] The visual configuration system refers to a quantum computing programming low-code platform that can generate personalized quantum gate components based on custom configuration files and predefined configuration information uploaded by users, and generate quantum circuits based on these personalized quantum gate components.
[0069] Predefined configuration information refers to a set of configuration parameters and rules pre-set in the visual configuration system, which define the default style, default properties and default rules of quantum gate components. These predefined configuration information provide users with a basic template and starting point for designing and building quantum circuits. Users can adjust and customize these default settings according to their needs. Figure 2 , Figure 2 The default quantum gate components generated directly from the predefined configuration information are shown in the figure.
[0070] The configuration resource file refers to the custom configuration file uploaded by the user, which is obtained after being processed by the visual configuration system.
[0071] Component configuration information refers to the configuration information obtained by the visual configuration system based on predefined configuration information and configuration resource files, which is ultimately used to generate the quantum gate component.
[0072] The first target component refers to a quantum gate component that is customized by the user and can be used to generate a quantum circuit.
[0073] In the schematic diagram of the implementation mode of the present application, such as quantum bit Q0, quantum bit Q1, ..., quantum bit Qx is used to indicate the quantum bit in action.
[0074] See also Figure 3 , Figure 3 The following is a diagram of the architecture of the visualization configuration engine. The visualization configuration engine architecture includes the data layer, the function layer, and the application layer. The data layer mainly includes component configuration data, which consists of predefined configuration files and custom configuration files. The predefined configuration files include the system default quantum gate component style, quantum gate component properties, and quantum gate component rules. The custom configuration files are the personalized configurations of the components by the user according to personal needs, such as changing the component style, properties, and rules.
[0075] The functional layer includes component configuration module, rendering module, visual component management module and interactive logic library. The component configuration module is used to load component configuration data and parse the configuration data into component attributes, component rules and component styles. The rendering module can render the visual interface according to the component configuration information parsed by the component configuration module, that is, generate quantum gate components on the graphical interface according to the component configuration information. Visual component management is used to store and manage information related to visual components, that is, manage the generated quantum gate components. The interactive logic library contains interactive engines such as drag, click, and place, which are used to drag quantum gates to realize the generation of quantum circuits or composite quantum gate components.
[0076] The application layer is mainly a user-oriented graphical interface, which mainly includes quantum circuits, quantum gate components, the first configuration form and the second configuration form. The quantum circuit shows the layout and structure of the entire circuit. The quantum gate component represents each quantum gate in the circuit, and users can build circuits by dragging and connecting these components. The first configuration form allows users to edit the properties, rules and styles of the components. The second configuration form can generate a composite quantum gate component based on user input.
[0077] See also Figure 4 , Figure 4 This is a schematic diagram of the component configuration module interface. The component configuration module includes the default quantum gate component area, Figure 4The area marked with a dotted box in the figure is the default quantum gate component area, which includes multiple quantum gate component schematics generated according to predefined configuration information. By clicking, dragging, and other operations on these quantum gate component schematics, the information of the quantum gate component can be modified or the quantum gate component can be moved. Figure 5 , Figure 5 This is a schematic diagram of the basic information of the quantum gate component that will be obtained after double-clicking the quantum gate component.
[0078] The Quantum Gate Components in the Default Quantum Gate Component area include schematic graphics of Pauli-X, Pauli-Y, and Pauli-Z gates, which are used to rotate the quantum bit on the X, Y, and Z axes. The Default Quantum Gate Component area also includes schematic graphics of a rotation gate around the X axis, a rotation gate around the Y axis, and a rotation gate around the Z axis, with θ on the schematic graphics, which represents the angle of rotation, and can accurately control the state of the quantum bit. The Default Quantum Gate Component area also includes a schematic graphic of a dual-axis rotation gate, which rotates around both the X and Y axes, with Φ and θ on the schematic graphics, where Φ and θ represent the rotation angles on the two axes, respectively. The Default Quantum Gate Component area also includes a specific schematic graphic of a dual-axis rotation gate, which is used to rotate on the XY plane.
[0079] The default quantum gate component area also includes schematic diagrams of Phase Gate and Phase Gate's inverse, which correspond to the S gate and S+ gate in quantum computing, respectively. S is used to rotate the phase of the quantum bit by π / 2, and S + Used to rotate the phase of the qubit by -π / 2. The default quantum gate component area also includes schematic graphics of T-gate and T-gate, which are also phase gates. T-gate is used to rotate the phase of the qubit by π / 4, and the inverse of T-gate is used to rotate the phase of the qubit by -π / 4. The default quantum gate component area also includes schematic graphics of both X2P quantum gate and X2M quantum gate, which are used to rotate 180 degrees on the X axis. X2P is a positive rotation of 180 degrees, and X2M is a negative rotation of 180 degrees. The default quantum gate component area also includes schematic graphics of both Y2P quantum gate and Y2M quantum gate, which are used to rotate 180 degrees on the Y axis. Y2P is a positive rotation of 180 degrees, and Y2M is a negative rotation of 180 degrees.
[0080] The default quantum gate component area also includes an identity gate, which indicates that no operation is performed on the quantum bit. The default quantum gate component area also includes a schematic diagram of the Hadamard gate, which is used to create a superposition state of the quantum bit. By using the Hadamard gate in multiple stages of the quantum algorithm, the conversion from classical probabilistic algorithms to quantum probabilistic algorithms can be achieved, making full use of the superposition and entanglement characteristics of quantum states to enhance the performance and efficiency of the algorithm. The default quantum gate component area also includes a schematic diagram of the control Z gate, which is a two-qubit gate used to produce a phase relationship between two qubits.
[0081] The default quantum gate component area also includes a schematic graphic of a barrier gate, which acts as a placeholder. You can use the barrier gate to customize the circuit layout and keep the circuit regular. The default quantum gate component area also includes a schematic graphic of a measurement gate, which is used to measure the state of the quantum bit Qx and record the result. Measurement causes the wave function of the quantum bit to collapse, which means that the state of the quantum bit after the measurement will be determined by the specific result obtained by the measurement. For example, if you measure a quantum bit in a superposition state, the result of the measurement may be |0> or |1>. After the measurement, the quantum bit will collapse to the corresponding state.
[0082] See also Figure 5 , Figure 5 The following is a schematic diagram of the basic information of the quantum gate component. By double-clicking the quantum gate component, the basic information of the quantum gate component can be viewed.
[0083] Please refer to Figure 4 , the side of the default quantum gate component area also includes a custom quantum gate adding area and a custom configuration file adding area. Among them, the custom configuration file adding area includes an add button, by clicking the add button, you can import or edit a custom configuration file related to quantum computing.
[0084] After the user starts the visual configuration system, the component configuration module loads the predefined interface style and default properties of each component, and loads the predefined universal quantum logic gate component. Subsequently, the rendering module renders these components to the programming interface. After the user inputs the configuration file in the custom configuration file adding area, the component configuration module will perform certain processing on the input configuration file and generate a configuration resource file. Then, the component configuration module obtains the component configuration information based on the predefined configuration information and the configuration resource file. Subsequently, the rendering module can generate the first target component based on the component configuration information. In this way, based on the generated first target component, the user can flexibly design quantum circuits.
[0085] In summary, the visualization configuration system of the low-code platform for quantum computing programming provided by the present application includes a component configuration module and a rendering module. The component configuration module includes predefined configuration information. In response to the generated configuration resource file, the component configuration module obtains the component configuration information according to the predefined configuration information and the configuration resource file. Then, the rendering module can generate a first target component according to the component configuration information. Based on the first target component, the low-code platform can generate a quantum circuit. In this way, the visualization configuration system can flexibly design the quantum gate components required by the user through the generated configuration resource file and predefined configuration information, flexibly meet the user's design requirements, and effectively improve the user experience.
[0086] In some embodiments, the component configuration module can generate an input configuration file in response to a user's first form input for a first configuration form. Next, the component configuration module performs identification processing on the input configuration file to obtain an input style file, an input attribute file, and an input rule file. Finally, the component configuration module packages the input style file, the input attribute file, and the input rule file to generate a configuration resource file, which includes a style configuration resource file, an attribute configuration resource file, and a rule configuration resource file.
[0087] Specifically, the first configuration form refers to a graphical interface that allows users to upload a custom configuration file and determine what content the uploaded custom configuration file is used to define for the component. The content that can be defined includes component style, component attributes, and component rules. Figure 6 , Figure 6 This is a schematic diagram of the first configuration form. A custom configuration file can be added by clicking "Add custom configuration file". A custom configuration file can be uploaded by clicking the "Upload" button. After the custom configuration file is uploaded, the user can select the configuration file type of the custom configuration file uploaded this time. The user can also download the template for adding the custom configuration file by clicking "Download template".
[0088] The input configuration file refers to the configuration file generated after the custom configuration file uploaded by the user is processed by the component configuration module. The processing performed by the component configuration module includes checking whether the file size meets the requirements, performing security checks, and handling exceptions that occur when uploading files. In some implementations, other checks and processing may also be included, which are not limited here.
[0089] Input style files are files that define the appearance and layout of component elements.
[0090] Input property files are files that define the properties of component elements.
[0091] An input rule file is a file that defines the rules or restrictions that component elements must follow.
[0092] Packaging refers to packaging the uploaded custom configuration file according to the configuration file type entered in the first configuration form. If the configuration file type entered by the user is "style", the component configuration module will package the uploaded custom configuration file into a css file, which is the style configuration resource file. If the configuration file type entered by the user is "property", the component configuration module will package the uploaded custom configuration file into a js file, which is the property configuration resource file. If the configuration file type entered by the user is "rule", the component configuration module will package the uploaded custom configuration file into a json file, which is the rule configuration resource file.
[0093] In this way, the component configuration module not only simplifies the user's configuration operations, but also provides structured management and processing of component configuration information, making the design and programming of quantum circuits more efficient and user-friendly.
[0094] In certain embodiments, the component configuration module can:
[0095] Parse the style configuration resource file to obtain style configuration information;
[0096] Parse the attribute configuration resource file to obtain attribute configuration information;
[0097] Parse the rule configuration resource file to obtain rule configuration information;
[0098] Merging the predefined style configuration information and the style configuration information in the predefined configuration information to generate component style configuration information;
[0099] Merging the predefined attribute configuration information and the attribute configuration information in the predefined configuration information to generate component attribute configuration information;
[0100] The predefined rule configuration information and the rule configuration information in the predefined configuration information are merged to generate component rule configuration information.
[0101] Specifically, the component configuration module can parse the style configuration resource file to extract the style configuration information. The component configuration module can also parse the attribute configuration resource file to extract the attribute configuration information. The component configuration module can also parse the rule configuration resource file to extract the rule configuration information.
[0102] The component configuration module can also merge the predefined style configuration information and the style configuration information in the predefined configuration information to generate component style configuration information to cover or supplement the default style configuration. The component configuration module can also merge the predefined attribute configuration information and the attribute configuration information in the predefined configuration information to generate component attribute configuration information to cover or supplement the default attribute configuration. The component configuration module can also merge the predefined rule configuration information and the rule configuration information in the predefined configuration information to generate component rule configuration information to cover or supplement the default rule configuration.
[0103] In this way, the component configuration module can generate component configuration information based on the configuration resource file and the predefined configuration information, and the component configuration information can be used by the rendering module to generate a visual representation of the quantum circuit, thereby improving the flexibility and customizability of the quantum circuit design and ensuring the correctness and consistency of the quantum circuit design.
[0104] In some embodiments, the component style configuration information includes color, shape, whether to align, and / or whether to display an angle;
[0105] The component attribute configuration information includes the component name, the number of quantum bits manipulated, the name of the quantum bits manipulated, whether to perform batch operation and / or enable and edit the composite quantum gate component;
[0106] The component rule configuration information includes manipulation restriction information of the manipulated quantum bits.
[0107] Specifically, color refers to the display color of the quantum gate component in the visualization interface.
[0108] The shape refers to the graphical shape of the quantum gate component, such as circle, rectangle, etc.
[0109] Alignment refers to whether the quantum gate components are aligned with other components in the quantum circuit.
[0110] Whether to display the angle refers to whether to display the angle information of the quantum gate component. Some quantum gate components require setting the angle information, such as RX and RZ quantum gates.
[0111] The component name refers to the name of the quantum gate component set by the user.
[0112] The number of manipulated qubits refers to the number of qubits that can be manipulated by the quantum gate set by the user.
[0113] The name of the manipulated qubit refers to the name or identifier of the specific qubit manipulated by the quantum gate set by the user.
[0114] Whether to perform batch application refers to whether the user can set whether quantum gates can be applied to multiple quantum bits in batches.
[0115] Enabling and editing composite quantum gate components means allowing users to create and edit composite quantum gates composed of multiple quantum gates.
[0116] The manipulation restriction information of the manipulated qubits refers to the rules and restrictions set by the user for the quantum gate to manipulate the qubits, such as the connectivity restrictions and operation order restrictions between qubits. In some embodiments, due to the topological structure restrictions of the quantum computing physical machine, some qubits cannot be connected or the operation order cannot be changed, so the corresponding manipulation restrictions must be set in advance. In this way, the user can ensure the correctness and effectiveness of the quantum circuit by customizing the manipulation restriction information of the qubits manipulated by the quantum gate component, allowing the user to customize and expand the functions of the system without modifying the underlying code.
[0117] In this way, the component configuration information jointly defines the behavior and appearance of the quantum gate or component in the low-code platform. Users can edit these configuration information through a graphical interface to quickly build and adjust quantum circuits, thereby simplifying the complexity of quantum programming and enabling non-professional users to design quantum algorithms and circuits. In addition, by setting up and editing composite quantum gate components, multiple quantum gate fusions or composite quantum gate components that fuse classical and quantum can be performed, thereby realizing component-based reuse of quantum gate component combinations and flexibly meeting user needs.
[0118] In some embodiments, the rendering module can generate a first target component according to component style configuration information, component attribute configuration information, and component rule configuration information.
[0119] Specifically, the network communication protocol SSE (Server-Sent Events) refers to a network communication protocol that allows the server to push real-time data updates to the client. By establishing a one-way connection from the server to the client, the server can send data to the client at any time without the client needing to regularly poll the server to obtain the latest data.
[0120] The rendering module uses style configuration information, such as color, shape, alignment, and angle display, to determine the visual appearance of a quantum gate or component on the user interface. For example, if a quantum gate is configured to be blue, rectangular, and needs to be aligned with other gates, the rendering module will ensure that the gate is displayed in this way on the interface.
[0121] The rendering module uses the property configuration information, such as the component name, the number and name of the qubits it manipulates, batching options, etc., to define the function and behavior of the quantum gate or component. For example, if a quantum gate is configured to manipulate two specific qubits, the rendering module will ensure that the gate is correctly associated with these qubits in the quantum circuit.
[0122] The rendering module uses the rule configuration information, such as qubit manipulation restrictions, to apply the necessary rules and restrictions in quantum circuit design. For example, if some qubits cannot interact directly with each other, the rendering module will ensure that direct connections between these qubits are not shown in the circuit diagram.
[0123] After the rendering module has finished rendering the component configuration information, real-time data exchange between the front-end and the back-end can be achieved through the system integrated network communication protocol SSE. When any data changes occur in the back-end, such as the update of the quantum gate component or the status update of the quantum circuit, the server can immediately send these changes to the front-end through SSE to ensure that any modifications on the interface can be quickly reflected. In addition, by combining SSE with state management libraries such as pinia, timely updates of the front-end UI can be achieved. When the back-end pushes new data through SSE, the state management library can detect these changes and automatically update the corresponding status, thereby triggering the re-rendering of the UI so that users can see the latest data status.
[0124] In this way, the rendering module converts the component style configuration information, component attribute configuration information, and component rule configuration information into the first target component on the visual interface. Users can intuitively design and understand quantum circuits based on the quantum gate components in the first target component without having to deeply understand the complexity of the underlying code and quantum computing, thereby lowering the threshold for quantum programming and improving user programming efficiency.
[0125] Please refer to Figure 1 In some embodiments, the visualization configuration system further includes a quantum circuit design module, and the quantum circuit design module is configured to:
[0126] In response to a first input operation, a target quantum gate is determined from a first target component, and a target quantum circuit is generated according to the target quantum gate.
[0127] Specifically, the first input operation refers to the operation performed by the user on the graphical interface, such as clicking, dragging or selecting a quantum gate, etc., and also such as connecting quantum bits, setting parameters of quantum gates, etc.
[0128] First, the browser's native JavaScript event mechanism is used to handle user clicks, drags, and other interactive logic events. When the user's click event is captured on the deepest element, that is, the quantum gate component itself, the event will bubble up layer by layer, and bubble up to higher management components in turn until it bubbles to the global listener. The state of the quantum gate component is then updated, and once the state is updated, the interface will immediately reflect these changes. After the click event is processed, the user can see real-time feedback on the interface and can continue with other operations, such as dragging the quantum gate component to a new position in the quantum circuit. In the above process, based on the Composition API and Teleport functions of Vue 3.0, the Composition API allows users to better manage the state and responsive data of components, thereby realizing complex interactive logic. The Teleport function facilitates the arbitrary movement of quantum gate components, allowing users to drag quantum gate components to any position in the quantum circuit.
[0129] In this way, the quantum circuit design module can determine the target quantum gate from the first target component in response to the first input operation, and generate the target quantum circuit according to the target quantum gate. In this way, the quantum circuit design module enables users to design and modify quantum circuits through simple input operations without directly writing complex quantum computing codes, thereby simplifying the design process of quantum circuits and enabling non-professional users to easily build and experiment with quantum algorithms.
[0130] Please refer to Figure 1 In some embodiments, the visualization configuration system further includes a state management module, and the state management module is configured to:
[0131] According to the first input operation, the node position of the target quantum gate is determined to determine the operation record of the target quantum gate.
[0132] Specifically, when the user performs an input operation in the quantum circuit design module, such as adding or modifying a quantum gate, the state management module will receive a signal of this operation. Next, the state management module will analyze this operation and determine the specific location of the target quantum gate operated by the user in the quantum circuit, that is, the node location. Then, once the target quantum gate and its node location are determined, the state management module will record the relevant information of this operation, including the type of operation, the timestamp of the operation, the parameters of the operation, etc. The types of operations include addition, deletion, modification, etc. When the user needs it, the state management module can provide a complete history of the quantum circuit state, allowing the user to trace back and check the design process of the quantum circuit.
[0133] In this way, the state management module ensures that the design process of the quantum circuit is traceable and auditable. Users can understand the changes of the quantum circuit at any time based on the operation records, and trace back and check the design process of the quantum circuit based on the operation records.
[0134] Please refer to Figure 1 In some embodiments, the visualization configuration system further includes a file storage module, and the file storage module is configured to:
[0135] The predefined configuration information is updated according to the component configuration information and stored.
[0136] Specifically, the file storage module receives component configuration information from the component configuration module, which includes style configuration information, attribute configuration information, and rule configuration information. Then, the file storage module updates the predefined configuration information based on this information. The update process includes adding new configuration options, modifying the default values of existing configurations, or deleting configuration options that are no longer used.
[0137] In addition, the file storage module also stores updated predefined configuration information so that it can be loaded the next time the user uses the platform, ensuring that the user's work progress and personalized settings are retained.
[0138] In this way, the file storage module ensures that the user's configuration information during the quantum circuit design process can be effectively managed and persisted, so that the user's work progress and personalized settings can be retained when they use the low-code platform next time, thereby realizing the customizability and scalability of the low-code platform.
[0139] In some embodiments, the first target component includes a plurality of quantum gate units, and the component configuration module is configured to:
[0140] In response to the user's second form input for the second configuration form, a composite quantum gate component is generated based on at least two quantum gate units in the first target component. The low-code platform is able to generate a quantum circuit based on the composite quantum gate component. The second configuration form is generated by the component configuration module based on the component configuration information.
[0141] Specifically, the component configuration module can generate a composite quantum gate component based on at least two quantum gate units in the first target component in response to the user's second form input for the second configuration form, and the low-code platform can generate a quantum circuit based on the composite quantum gate component. The second configuration form is generated by the component configuration module based on the component configuration information.
[0142] In the implementation mode of the present application, in addition to editing the composite quantum gate component by adding a custom configuration file, it can also be achieved by clicking "Add custom quantum gate component". Figure 4 and Figure 7 , Figure 7 This is a diagram of the second configuration form. By clicking Figure 4 In "Add custom quantum gate component", you will enter the following Figure 7 The interface shown. In the rectangular box after the component name, you can set the name of the composite quantum gate component, such as "First Composite Gate". You can also enter the number of quantum bits that the composite quantum gate component can connect to after the number of quantum bits. Click "Enable Composite Gate" or "Edit Composite Gate" to process the composite quantum gate component. Below is the specific connection situation that meets the requirements of the quantum gate component. By dragging the existing quantum gate component, a new composite quantum gate component is generated.
[0143] In this way, the component configuration module and low-code platform provide users with an efficient and intuitive way to design and build complex quantum circuits. Users can quickly generate composite quantum gate components through simple form input and configuration, thereby speeding up the development and testing process of quantum algorithms.
[0144] See also Figure 8 The embodiment of the present application provides a quantum circuit generation method, which is based on the above-mentioned visualization configuration system, and the method includes:
[0145] 01: In response to the generated configuration resource file, component configuration information is obtained according to the predefined configuration information and the configuration resource file;
[0146] 02: Generate a first target component according to the component configuration information, so as to generate a quantum circuit according to the first target component.
[0147] The embodiment of the present application also provides a computer device, including a memory and a processor. The task processing method of the embodiment of the present application can be implemented by the computer device of the embodiment of the present application. Specifically, a computer program is stored in the memory, and the processor is used to respond to the generated configuration resource file, obtain component configuration information according to the predefined configuration information and the configuration resource file. And generate a first target component according to the component configuration information, so as to generate a quantum circuit according to the first target component.
[0148] The quantum circuit generation method of the embodiment of the present application can be implemented by the visualization configuration system of the embodiment of the present application. Specifically, the visualization configuration system includes a component configuration module and a rendering module. The component configuration module is used to obtain component configuration information according to predefined configuration information and the configuration resource file in response to the generated configuration resource file. The rendering module is used to generate a first target component according to the component configuration information to generate a quantum circuit according to the first target component.
[0149] Specifically, in response to the generated configuration resource file, the visualization configuration system obtains component configuration information according to the predefined configuration information and the configuration resource file. Next, the visualization configuration system generates a first target component according to the component configuration information to generate a quantum circuit according to the first target component.
[0150] In summary, the visual configuration system allows users to design and build complex quantum circuits through customized quantum gate components, flexibly meeting users' design needs and greatly simplifying the complexity of quantum programming, allowing non-professional users to easily build and experiment with quantum algorithms.
[0151] In the description of this specification, the descriptions with reference to the terms "specifically", "further", "particularly", "understandably", etc. are intended to mean that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms are not intended to refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0152] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0153] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A visual configuration system for a low-code platform for quantum computing programming, characterized in that: The visualization configuration system includes a component configuration module and a rendering module; The component configuration module includes predefined configuration information, and the component configuration module is configured to obtain component configuration information according to the predefined configuration information and the configuration resource file in response to the generated configuration resource file; The rendering module is configured to generate a first target component according to the component configuration information, and the low-code platform can generate a quantum circuit according to the first target component.
2. The visualization configuration system according to claim 1, characterized in that: The component configuration module is configured to: In response to a first form input by a user for a first configuration form, generating an input configuration file; Performing identification processing on the input configuration file to obtain an input style file, an input attribute file and an input rule file; The input style file, the input attribute file and the input rule file are packaged to generate the configuration resource file, which includes a style configuration resource file, an attribute configuration resource file and a rule configuration resource file.
3. The visualization configuration system according to claim 2, characterized in that: The component configuration module is configured to: Parsing the style configuration resource file to obtain style configuration information; Parsing the attribute configuration resource file to obtain attribute configuration information; Parsing the rule configuration resource file to obtain rule configuration information; Merging the predefined style configuration information in the predefined configuration information and the style configuration information to generate component style configuration information; Merging the predefined attribute configuration information in the predefined configuration information and the attribute configuration information to generate component attribute configuration information; The predefined rule configuration information in the predefined configuration information and the rule configuration information are combined to generate component rule configuration information.
4. The visualization configuration system according to claim 3, characterized in that: The component style configuration information includes color, shape, whether to align and / or whether to display an angle; The component attribute configuration information includes the component name, the number of quantum bits manipulated, the name of the quantum bits manipulated, whether to perform batch operation and / or enable and edit the composite quantum gate component; The component rule configuration information includes manipulation restriction information of the manipulated quantum bits.
5. The visualization configuration system according to claim 3, characterized in that: The rendering module is configured as follows: The first target component is generated according to the component style configuration information, the component attribute configuration information and the component rule configuration information.
6. The visualization configuration system according to claim 1, characterized in that: The visualization configuration system further includes a quantum circuit design module, wherein the quantum circuit design module is configured to: In response to a first input operation, a target quantum gate is determined from the first target component, and a target quantum circuit is generated according to the target quantum gate.
7. The visualization configuration system according to claim 6, characterized in that: The visualization configuration system further includes a state management module, which is configured to: According to the first input operation, the node position of the target quantum gate is determined to determine the operation record of the target quantum gate.
8. The visualization configuration system according to claim 1, characterized in that: The visualization configuration system further includes a file storage module, which is configured to: The predefined configuration information is updated according to the component configuration information and stored.
9. The visualization configuration system according to claim 4, characterized in that: The first target component includes a plurality of quantum gate units, and the file processing module is configured to: In response to the user's second form input for the second configuration form, the composite quantum gate component is generated according to at least two of the quantum gate units in the first target component, and the low-code platform is capable of generating the quantum circuit according to the composite quantum gate component. The second configuration form is generated by the component configuration module according to the component configuration information.
10. A quantum circuit generation method, characterized in that: The quantum circuit generation method is based on the visualization configuration system according to claims 1-9, and the method comprises: In response to the generated configuration resource file, obtaining component configuration information according to the predefined configuration information and the configuration resource file; A first target component is generated according to the component configuration information, so as to generate a quantum circuit according to the first target component.
Citation Information
Patent Citations
Quantum gate component rendering method and device, equipment, storage medium and program product
CN115660092A
Quantum circuit diagram processing method and device, electronic equipment and storage medium
CN116451795A
Quantum circuit editing method and device, equipment and medium
CN116702912A
Quantum circuit editing method and device, electronic equipment and storage medium
CN116757288A