A construction method, device, medium and electronic device for variational quantum circuits
By constructing a new variable quantum circuit, using quantum logic gates to encode and regulate the qubits, the problem of high data processing complexity when VQE solves complex problems is solved, and more efficient and accurate data processing is achieved.
Patent Information
- Application Number
- CN202310474498.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-27
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2043-04-27
AI Technical Summary
When the prior art uses traditional methods to solve complex problems, the data extraction and data processing processes are highly complex, low efficiency and low calculation accuracy.
By constructing new variable quantum circuits, encode the feature vectors into a specified quantum state using the first type of quantum logic gate, and constructing an initial variable circuit module containing multiple prosthetic layers using the second type of quantum logic gate to regulate the quantum states of multiple quantum bits, and generating target variable quantum circuits for calculating the problem to be solved.
It improves the efficiency and calculation accuracy of data extraction and data processing processes, and reduces the complexity of data processing.
Smart Images

Figure CN118863078B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of quantum computing, and particularly relates to a method, device, medium and electronic device for constructing a variational quantum circuit. Background Art
[0002] A quantum computer is a physical device that follows the laws of quantum mechanics to perform high-speed mathematical and logical operations, store and process quantum information. When a device processes and calculates quantum information and runs quantum algorithms, it is a quantum computer. Due to its ability to process mathematical problems more efficiently than ordinary computers, for example, it can accelerate the time to crack RSA keys from hundreds of years to a few hours, quantum computers have become a key technology under research.
[0003] The existing Variational Quantum Eigensolver (VQE) can use a classical optimizer to solve matrix eigenvalues and eigenvectors, and can also be used to solve the ground state and low-lying excited states of a quantum system, and has broad application prospects in the fields of quantum many-body physics, quantum chemistry, etc.
[0004] Currently, the difficulty in using traditional methods to perform VQE to solve complex problems lies in the high complexity, low efficiency, and low calculation accuracy in the data extraction and data processing processes. Therefore, how to construct a variational quantum circuit to overcome the above difficulties has become an urgent problem to be solved. Summary of the Invention
[0005] The purpose of the present invention is to provide a method, device, medium and electronic device for constructing a variational quantum circuit to solve the deficiencies in the prior art. It constructs a new variational quantum circuit to improve the efficiency and calculation accuracy of the data extraction and data processing processes and reduce the complexity of data processing.
[0006] An embodiment of the present application provides a method for constructing a variational quantum circuit, the method comprising:
[0007] Obtain a problem to be solved and a set of qubits, wherein the number of the qubits is determined according to the dimension of the eigenvector of the problem to be solved;
[0008] Use a first type of quantum logic gate to construct an eigenvector evolution sub-module that performs encoding of the eigenvector into a specified quantum state on a single qubit;
[0009] Use a second type of quantum logic gate to construct an initial variational circuit module including multiple ansatz layers to control multiple qubits in the specified quantum state, wherein the second type of quantum logic gate includes variational parameters;
[0010] Using the feature vector evolution sub-module, the variational circuit module, and the measurement operation module, a target variational quantum circuit for calculating the problem to be solved is generated.
[0011] Optionally, the problem to be solved includes a molecular property prediction problem, and obtaining the problem to be solved includes:
[0012] Obtaining a molecule to be predicted and determining the graph data of the molecule to be predicted, where the graph data includes node feature vectors and edge feature vectors, and the node feature vectors and edge feature vectors are used to represent the features of the molecule to be predicted.
[0013] Optionally, the first type of quantum logic gates includes: Hadamard quantum logic gates and RY quantum logic gates, and the rotation angle of the RY quantum logic gate is determined based on the features of the molecule to be predicted.
[0014] Optionally, the feature vector evolution sub-module is composed of Hadamard quantum logic gates and RY quantum logic gates that act on all the qubits in sequence.
[0015] Optionally, the second type of quantum logic gates includes: RX quantum logic gates and controlled RX quantum logic gates, and the rotation angle of the RX quantum logic gate is determined based on the features of the molecule to be predicted.
[0016] Another embodiment of the present application provides a method for predicting molecular properties, and the method includes:
[0017] Using the target variational quantum circuit constructed according to any of the above, converting the node feature vectors and edge feature vectors of the molecule to be predicted into high-dimensional feature vectors, and performing feature fusion on the high-dimensional feature vectors to obtain the fused feature vector of the molecule to be predicted;
[0018] Inputting the fused feature vector into a trained molecular property prediction model to obtain a prediction result of the properties of the molecule to be predicted.
[0019] Another embodiment of the present application provides a device for constructing a variational quantum circuit, and the device includes:
[0020] An obtaining module, configured to obtain a problem to be solved and a set of qubits, where the number of qubits is determined according to the dimension of the feature vector of the problem to be solved;
[0021] A first construction module, configured to use the first type of quantum logic gates to construct a feature vector evolution sub-module that encodes the feature vector into a specified quantum state for a single qubit;
[0022] A second construction module, configured to use a second type of quantum logic gate to construct an initial variational circuit module including multiple hypothesized layers to control multiple qubits in the specified quantum state, where the second type of quantum logic gate includes variational parameters;
[0023] A generation module, configured to use the eigenvector evolution sub-module, the variational circuit module, and the measurement operation module to generate a target variational quantum circuit for calculating the problem to be solved.
[0024] Another embodiment of the present application provides a molecular property prediction device, where the device includes:
[0025] A conversion module, configured to use the constructed target variational quantum circuit to convert the node feature vector and edge feature vector of the molecule to be predicted into high-dimensional feature vectors, and perform feature fusion on the high-dimensional feature vectors to obtain the fusion feature vector of the molecule to be predicted;
[0026] An obtaining module, configured to input the fusion feature vector into a trained molecular property prediction model to obtain a prediction result of the molecular property to be predicted.
[0027] Another embodiment of the present application provides a storage medium, in which a computer program is stored, where the computer program is configured to implement the method described in any one of the above when running.
[0028] Another embodiment of the present application provides an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to implement the method described in any one of the above.
[0029] Compared with the prior art, the present invention first obtains the problem to be solved and a set of qubits, uses the first type of quantum logic gate to construct an eigenvector evolution sub-module that encodes the eigenvector to the specified quantum state for a single qubit, then uses the second type of quantum logic gate to construct an initial variational circuit module including multiple hypothesized layers to control multiple qubits in the specified quantum state, and finally uses the eigenvector evolution sub-module, the variational circuit module, and the measurement operation module to generate a target variational quantum circuit for calculating the problem to be solved. It constructs a new variational quantum circuit to improve the efficiency and calculation accuracy of the data extraction and data processing processes and reduce the complexity of data processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a system network block diagram of a method for constructing a variational quantum circuit provided by an embodiment of the present invention;
[0031] Figure 2It is a schematic flowchart of a method for constructing a variational quantum circuit provided by an embodiment of the present invention;
[0032] Figure 3 It is a schematic diagram of a set of qubits obtained provided by an embodiment of the present invention;
[0033] Figure 4 It is a schematic diagram of an eigenvector evolution sub-module provided by an embodiment of the present invention;
[0034] Figure 5 It is a schematic diagram of an initial variational quantum circuit provided by an embodiment of the present invention;
[0035] Figure 6 It is a schematic diagram of a target variational quantum circuit provided by an embodiment of the present invention;
[0036] Figure 7 It is a schematic flowchart of a method for predicting molecular properties provided by an embodiment of the present invention;
[0037] Figure 8 It is a schematic structural diagram of a device for constructing a variational quantum circuit provided by an embodiment of the present invention;
[0038] Figure 9 It is a schematic structural diagram of a device for predicting molecular properties provided by an embodiment of the present invention. Detailed implementation manners
[0039] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0040] An embodiment of the present invention first provides a method for constructing a variational quantum circuit. This method can be applied to electronic devices, such as computer terminals, specifically, ordinary computers, quantum computers, etc.
[0041] Below, taking running on a computer terminal as an example, it will be described in detail. Figure 1 It is a system network block diagram of a method for constructing a variational quantum circuit provided by an embodiment of the present invention. The system applied to the method for constructing a variational quantum circuit may include a network 110, a server 120, a wireless device 130, a client 140, a storage unit 150, a classical processing system 160, a quantum processing system 170, and may also include additional memories, classical processors, quantum processors, and other devices not shown.
[0042] The network 110 is a medium that provides a communication link between various devices and computers connected together within the system network of the method for constructing a variational quantum circuit, including but not limited to the Internet, enterprise intranets, local area networks, mobile communication networks, and combinations thereof. The connection method can adopt wired, wireless communication links, or fiber optic cables, etc.
[0043] The server 120 and the client 140 are conventional data processing systems, which may contain data and have application programs or software tools for performing conventional computing processes. The client 140 can be a personal computer or a network computer, so the data can also be provided by the server 120. The wireless device 130 can be a smart phone, a tablet, a laptop, a smart wearable device, etc. The storage unit 150 may include a database 151, which may be configured to store data such as qubit parameters, quantum logic gate parameters, quantum circuits, and quantum programs.
[0044] The classical processing system 160 (quantum processing system 170) may include a classical processor 161 (quantum processor 171) for processing classical data (quantum data) and a memory 163 (memory 172) for storing classical data (quantum data). The classical data (quantum data) may be a boot file, an operating system image, and an application program 162 (application program 173). The application program 162 (application program 173) may be used to implement a quantum algorithm compiled according to the method for constructing a variational quantum circuit provided in an embodiment of the present invention.
[0045] Any data or information stored or generated in the classical processing system 160 (quantum processing system 170) may also be configured to be stored or generated in another classical (quantum) processing system in a similar manner. Similarly, any application program executed by it may also be configured to be executed in another classical (quantum) processing system in a similar manner.
[0046] It should be noted that a real quantum computer has a hybrid structure, which at least includes Figure 1 two major parts: the classical processing system 160, which is responsible for performing classical computing and control; and the quantum processing system 170, which is responsible for running quantum programs to implement quantum computing.
[0047] The above-mentioned classical processing system 160 and quantum processing system 170 may be integrated in one device, or may be distributed in two different devices. For example, the first device including the classical processing system 160 runs a classical computer operating system, on which quantum application development tools and services are provided, and storage and network services required for quantum applications are also provided. The user develops quantum applications through the quantum application development tools and services thereon, and sends the quantum program to the second device including the quantum processing system 170 through the network services thereon. The second device runs a quantum computer operating system, parses the code of the quantum program through the quantum computer operating system, and compiles it into instructions that can be recognized and executed by the quantum computer measurement and control system. The quantum processor 170 implements the quantum algorithm corresponding to the quantum program according to the instructions.
[0048] In a classical processing system 160 based on a silicon chip, the units of the classical processor 161 are CMOS transistors. Such computing units are not restricted by time and coherence, that is, such computing units are not restricted by the usage duration and are available at any time. In addition, in a silicon chip, the number of such computing units is also sufficient. Currently, the number of computing units in a classical processor is in the thousands or tens of thousands. The sufficiency of the number of computing units and the fixed computing logic selectable by CMOS transistors, for example: AND logic. When operating with CMOS transistors, a large number of CMOS transistors are combined with limited logic functions to achieve the operation effect.
[0049] Different from such logic units in the classical processing system 160, the basic computing unit of the quantum processor 171 in the quantum processing system 170 is a qubit. The input of a qubit is restricted by coherence and also by the coherence time, that is, a qubit is restricted by the usage duration and is not available at any time. Making full use of qubits within their available usage duration is a key problem in quantum computing. In addition, the number of qubits in a quantum computer is one of the representative indicators of the performance of the quantum computer. Each qubit realizes the computing function through logic functions configured as needed. Given the limited number of qubits, while the logic functions in the field of quantum computing are diverse, for example: Hadamard gate (H gate), Pauli-X gate (X gate), Pauli-Y gate (Y gate), Pauli-Z gate (Z gate), X gate, RY gate, RZ gate, CNOT gate, CR gate, iSWAP gate, Toffoli gate, etc. When performing quantum computing, it is necessary to combine a limited number of qubits with diverse logic function combinations to achieve the operation effect.
[0050] Based on these differences, the design of the logic function acting on qubits (including the design of whether to use qubits and the design of the usage efficiency of each qubit) is the key to improving the operation performance of a quantum computer and requires special design. And the above-mentioned design for qubits is a technical problem that ordinary computing devices do not need to consider and do not need to face. In this application, in view of the current difficulties in using traditional methods to solve complex problems by VQE, such as the high complexity, low efficiency, and low computing accuracy in the data extraction and data processing processes, etc., therefore, how to construct a variational quantum circuit to overcome the above difficulties has become an urgent problem to be solved. This application provides a method, device, medium, and electronic device for constructing a variational quantum circuit to solve the deficiencies in the prior art. It constructs a new variational quantum circuit to improve the efficiency and computing accuracy of the data extraction and data processing processes and reduce the complexity of data processing.
[0051] See Figure 2 , Figure 2 is a schematic flowchart of a method for constructing a variational quantum circuit provided by an embodiment of the present invention and may include the following steps:
[0052] S201: Obtain the problem to be solved and a set of qubits, where the number of the qubits is determined according to the dimension of the eigenvector of the problem to be solved.
[0053] Specifically, the problem to be solved includes a molecular property prediction problem, and obtaining the problem to be solved may include:
[0054] Obtain the molecule to be predicted, and determine the graph data of the molecule to be predicted, where the graph data includes a node feature vector and an edge feature vector, and the node feature vector and the edge feature vector are used to represent the features of the molecule to be predicted.
[0055] Among them, the molecule to be predicted can be considered as the molecular structure modeling for which the user wants to obtain the molecular property result, for example, including the atomic type, chemical element bond, number of atoms, atomic coordinates, charge, and spin multiplicity of the chemical molecule.
[0056] According to the obtained molecule to be predicted, convert the atoms of the molecule to be predicted into nodes of the graph data, and convert the chemical bonds of the molecule to be predicted into edges of the graph data, so as to obtain the graph data of the molecule to be predicted. Among them, the node feature vector is a vector characterizing the attributes of the node (i.e., the entity object), and the attribute is a feature describing the node of the graph neural network. The graph neural network is a neural network that directly acts on the graph, and the graph data is a data structure composed of nodes and edges, where the node refers to the entity object and the edge refers to the relationship between nodes. In each node of the graph neural network, based on the information propagation mechanism, the state of the node is updated by exchanging information with each other. In some embodiments, the graph neural network model can obtain the prediction result of the node based on the state of each current node.
[0057] In quantum computing, the quantum bit is the unit of quantum information. The quantum bit is similar to the classical bit, except that it adds the quantum characteristics of physical atoms. Physically speaking, the quantum bit is the quantum state. Therefore, the quantum bit has the attributes of the quantum state. Due to the unique quantum attributes of the quantum state, the quantum bit has many characteristics different from the classical bit, which is one of the basic characteristics of quantum information science.
[0058] To intuitively display the quantum bits and facilitate the user's understanding, in the quantum computing cloud platform, obtaining a set of quantum bits can be represented by a set of parallel time lines for the obtained quantum bits.
[0059] Exemplarily, refer to Figure 3 , Figure 3It is a schematic diagram of a set of qubits obtained according to an embodiment of the present invention. Among them, there are a total of 9 qubits obtained, and the quantum state in front of each timeline represents the initial quantum state of the qubit, which can be, for example, |0> or any other arbitrary quantum state; q[0]-q[8] in front of the initial quantum state represent the numbers of the qubits, which are the 0th qubit, the 1st qubit, …, the 8th qubit in sequence. The following quantum logic gates on each timeline indicate that the quantum logic gate acts on the current qubit and performs corresponding operations, which will not be elaborated hereinafter.
[0060] S202: Use the first type of quantum logic gates to construct a feature vector evolution sub-module for encoding the feature vector into a specified quantum state on a single qubit.
[0061] Specifically, the first type of quantum logic gates includes: Hadamard quantum logic gates and RY quantum logic gates. The feature vector evolution sub-module consists of Hadamard quantum logic gates and RY quantum logic gates that act on all the qubits in sequence. See Figure 4 , Figure 4 It is a schematic diagram of a feature vector evolution sub-module provided by an embodiment of the present invention. Among them, the Hadamard quantum logic gate is a quantum logic gate that can change the ground state into a superposition state. It acts on a single qubit and changes the ground state |0> into and changes the ground state |1> into The matrix form of the Hadamard quantum logic gate is:
[0062]
[0063] The RY quantum logic gate is a rotation quantum logic gate. Similar to the RY quantum logic gate, there are also RX quantum logic gates and RZ quantum logic gates. The RX quantum logic gate, RY quantum logic gate, and RZ quantum logic gate mean rotating the quantum state by an angle θ around the X, Y, and Z axes on the Bloch sphere respectively. Therefore, the RX quantum logic gate and RY quantum logic gate can bring about changes in the probability amplitude, while the RZ quantum logic gate only has a phase change. Then, using these three operations together can make the quantum state move freely on the entire Bloch sphere. The matrix form of the RY quantum logic gate is:
[0064]
[0065] S203: Use the second type of quantum logic gates to construct an initial variational circuit module including multiple hypothesized layers to control multiple qubits in the specified quantum state, where the second type of quantum logic gates includes variational parameters.
[0066] Specifically, the second type of quantum logic gates includes: RX quantum logic gates and controlled RX quantum logic gates.
[0067] In an alternative embodiment, referring to Figure 5 , Figure 5 is a schematic diagram of an initial variational quantum circuit provided by an embodiment of the present invention. Among them, the qubit where the solid dot is located is called the control qubit, and the qubit where the graphic RX is located is called the target qubit. An entanglement operation can be performed on the quantum state of multiple qubits using a controlled RX quantum logic gate. It can start from the low-order qubit and sequentially construct the entangled state of adjacent qubits using the controlled RX quantum logic gate until all the above qubits are entangled with each other. It should be noted that the solid line box in the figure represents a layer of assumed sub-module, and the initial variational quantum circuit can include multiple layers of assumed sub-modules.
[0068] Among them, the variational parameters can be determined according to a preset function, and the preset function can be selected according to the actual situation. For example, it can be a probability density function or other functions that can obtain variational parameters. The variational parameters mentioned here can be more than one. When there are more than one variational parameters, they can be obtained separately or simultaneously. The initial value of the variational parameter can be a value randomly selected from the function values of the probability density function, or can be selected according to certain rules, and the selected initial value is assigned to the variational parameter.
[0069] It should be noted that there are many methods to optimize the variational parameters. For example, new variational parameters can be obtained to replace the values of the variational parameters in the current module; or new variational parameters can be used to construct a quantum circuit with the same structure as the assumed sub-module and inserted into the variational quantum circuit, which is not limited here.
[0070] S204: Use the eigenvector evolution sub-module, the variational circuit module, and the measurement operation module to generate a target variational quantum circuit for calculating the problem to be solved.
[0071] Exemplarily, referring to Figure 6 , Figure 6 is a schematic diagram of a target variational quantum circuit provided by an embodiment of the present invention. In the figure, a quantum circuit of a group of 9 qubits is obtained, and the initial states of all qubits are set to |0>. The qubit numbers are q[0]-q[8]. In the eigenvector evolution sub-module, Hadamard quantum logic gates and RY quantum logic gates are mainly used. First, the Hadamard quantum logic gate is applied to the initial state of the qubit to convert it into a superposition state Then, a set of classical data x i = a 0 , a 0 , …, a 7 , a 8 can be used as the quantum logic gate parameters, in the form of RX(aj ), where \(j = 0, 1, \ldots, 7, 8\), which are respectively quantum mapped to the qubits in the superposition state. In the ansatz sub-module, there are mainly two types of quantum gate operations: the controlled RX quantum logic gate and the RX quantum logic gate. The main role of the controlled RX quantum logic gate is to achieve quantum entanglement, thereby realizing the information exchange and transmission between qubits. For example, by iteratively optimizing the rotation angle parameter \(a\) in the parameterized gate controlled RX quantum logic gate 1 , the ansatz sub-module can be optimized to learn more effective node features. After achieving multiple entanglements between multiple qubits, a layer of \(RX(a 2 ) is introduced into the variational quantum circuit, where \(a 2 can be classical graph node data for further retaining the information of the molecular nodes to be predicted. It should be noted that the ansatz sub-module can be stacked multiple times according to the needs of the circuit structure and the problem to be solved to increase the depth in order to seek a better variational quantum circuit model. Finally, by adding a layer of measurement operation module, its role is to decohere the qubits and realize the conversion from quantum data to classical data.
[0072] It can be seen that the present invention first obtains the problem to be solved and a set of qubits, uses the first type of quantum logic gate to construct a feature vector evolution sub-module that encodes the feature vector into a specified quantum state for a single qubit, then uses the second type of quantum logic gate to construct an initial variational circuit module containing multiple ansatz layers to control multiple qubits in the specified quantum state, and finally uses the feature vector evolution sub-module, the variational circuit module, and the measurement operation module to generate a target variational quantum circuit for calculating the problem to be solved. It constructs a new variational quantum circuit to improve the efficiency and computational accuracy of the data extraction and data processing processes and reduce the complexity of data processing.
[0073] See Figure 7 , Figure 7 which is a schematic flowchart of a method for predicting molecular properties provided by an embodiment of the present invention and may include the following steps:
[0074] S701: Using the constructed target variational quantum circuit, convert the node feature vector and edge feature vector of the molecule to be predicted into high-dimensional feature vectors, and perform feature fusion on the high-dimensional feature vectors to obtain the fused feature vector of the molecule to be predicted.
[0075] Specifically, using the constructed target variational quantum circuit to convert the node feature vector and edge feature vector of the molecule to be predicted into high-dimensional feature vectors may include:
[0076] Run and measure the target variational quantum circuit, obtain the final quantum state of the target variational quantum circuit, and convert the final quantum state into a high-dimensional feature vector.
[0077] Exemplarily, using the target variational quantum circuit, first, each node of the graph data of the molecule to be predicted is input Subsequently, feature encoding is performed through the target variational quantum circuit to obtain the node feature encoding vector where n is the dimension of a single node feature vector. For example, n can be set to 9, and then the obtained feature vectors are fused to generate the node encoding feature matrix Taking the water molecule H 2 O as an example, this molecule contains 3 atomic nodes and 2 edges (chemical bonds). The molecule data can be converted into graph data containing edge feature vectors E and node feature vectors through a preset database (such as the smiles2graph library). The feature vectors of each atomic node in the graph data are respectively encoded through the feature encoding of the quasi-set sub-module, and new node feature encoding vectors are output Then they are concatenated into new node features
[0078] In an alternative embodiment, following the example as described above Figure 6 shown, during the encoding process, since the dimension n of the single node feature vector in this model is 9, the quantum circuit consists of 9 qubits, and the measurement expectation value of the Pauli Z of each qubit can be used as the output. Therefore, the feature encoding x′ of each node output i is a 9-dimensional vector
[0079] S702: Input the fused feature vector into the trained molecular property prediction model to obtain the prediction result of the property of the molecule to be predicted
[0080] Specifically, after obtaining the fused feature vector of the molecule to be predicted, the fused feature vector of the molecule to be predicted can be input into the pre-trained molecular property prediction model to obtain the prediction result of the property of the molecule to be predicted. Among them, the molecular property prediction model can be trained through machine learning models such as neural networks, and this embodiment does not make specific limitations here
[0081] Exemplarily, the prediction of molecular properties can include: extraction of features of the molecule to be predicted, construction of feature vectors and adjacency matrices, conversion of the molecular image into a digital vector with atomic information, chemical bond information, and molecular structure information, construction of an image convolution layer, input of the obtained feature vectors and the image adjacency matrix, and obtaining the convolved feature vectors; construction of a pooling layer, pooling the feature vectors of the molecule, and extracting the molecular feature vectors. For example, the feature vectors x′ after encoding each node i can be concatenated together to form the node feature matrix The adjacency matrix A represents the connection situation of each node with its surrounding nodes. Together with the node feature matrix X, it serves as the input to the graph convolutional layer. The graph convolutional layer aggregates and transmits the information of nodes and edges through the feature matrix X and the adjacency matrix A, and finally realizes the representation learning of nodes. The graph convolutional neural network of this model consists of L graph convolutional layers. Each layer generates the representation of the current layer of the central node by aggregating the representations of the previous layer of adjacent nodes:
[0082] Z l+1 = A'X l W l , X l+1 = σ(Z l+1 )
[0083] Among them, represents the representation of N nodes in the l-th layer, and there is X 0 = X, A' is the adjacency matrix after normalizing and standardizing A, is the weight matrix, that is, the parameter to be trained. For simplicity, it can be assumed that the representation dimensions of all layers are the same, that is, F 1 =... = F L = F. The activation function σ can usually be set according to the needs of the user.
[0084] Finally, after obtaining the node representations through multi-layer graph convolutional operations, it is necessary to perform graph pooling (Graph Pooling), or called graph readout, on the representations of each node on the graph to obtain a graph representation node Finally, based on the graph representation g, the predicted value is output through the fully connected neural network layer
[0085] For the calculation of the loss, different loss functions can be selected according to the type of problem to be solved. For the optimization of the model parameters, the Adam gradient update algorithm with a learning rate of 0.001 can be selected.
[0086] It can be seen that in this embodiment, by using the constructed target variational quantum circuit, the node feature vector and edge feature vector of the molecule to be predicted are converted into high-dimensional feature vectors, and the high-dimensional feature vectors are subjected to feature fusion to obtain the fusion feature vector of the molecule to be predicted. Subsequently, the fusion feature vector is input into the trained molecular property prediction model to obtain the prediction result of the property of the molecule to be predicted. It realizes the prediction of molecular properties through the target variational quantum circuit and uses the related characteristics of quantum to improve the calculation speed and calculation accuracy.
[0087] See Figure 8 , Figure 8 is the structural schematic diagram of a device for constructing a variational quantum circuit provided by an embodiment of the present invention. Compared with Figure 2corresponding to the process shown may include:
[0088] An acquisition module 801, configured to acquire a problem to be solved and a set of qubits, where the number of the qubits is determined according to the dimension of the eigenvector of the problem to be solved;
[0089] A first construction module 802, configured to use a first type of quantum logic gate to construct an eigenvector evolution sub-module that performs encoding of the eigenvector into a specified quantum state on a single qubit;
[0090] A second construction module 803, configured to use a second type of quantum logic gate to construct an initial variational circuit module including multiple ansatz layers to control multiple qubits in the specified quantum state, where the second type of quantum logic gate includes variational parameters;
[0091] A generation module 804, configured to use the eigenvector evolution sub-module, the variational circuit module, and a measurement operation module to generate a target variational quantum circuit for calculating the problem to be solved.
[0092] Compared with the prior art, the present invention first acquires a problem to be solved and a set of qubits, uses a first type of quantum logic gate to construct an eigenvector evolution sub-module that performs encoding of the eigenvector into a specified quantum state on a single qubit, then uses a second type of quantum logic gate to construct an initial variational circuit module including multiple ansatz layers to control multiple qubits in the specified quantum state, and finally uses the eigenvector evolution sub-module, the variational circuit module, and the measurement operation module to generate a target variational quantum circuit for calculating the problem to be solved. It constructs a new variational quantum circuit to improve the efficiency and calculation accuracy of the data extraction and data processing process and reduce the complexity of data processing.
[0093] See Figure 9 , Figure 9 is a schematic structural diagram of a molecular property prediction device provided by an embodiment of the present invention. Corresponding to the Figure 7 process shown may include:
[0094] A conversion module 901, configured to use the constructed target variational quantum circuit to convert the node eigenvector and edge eigenvector of the molecule to be predicted into high-dimensional eigenvectors, and perform eigenvector fusion on the high-dimensional eigenvectors to obtain a fused eigenvector of the molecule to be predicted;
[0095] An obtaining module 902, configured to input the fused eigenvector into a trained molecular property prediction model to obtain a prediction result of the property of the molecule to be predicted.
[0096] Compared with the prior art, in this embodiment, by using the constructed target variational quantum circuit, the node feature vector and edge feature vector of the molecule to be predicted are converted into high-dimensional feature vectors, and the high-dimensional feature vectors are subjected to feature fusion to obtain the fusion feature vector of the molecule to be predicted. Subsequently, the fusion feature vector is input into the trained molecular property prediction model to obtain the prediction result of the property of the molecule to be predicted. It realizes the prediction of molecular properties through the target variational quantum circuit and utilizes the relevant characteristics of quantum to improve the calculation speed and calculation accuracy.
[0097] An embodiment of the present invention further provides a storage medium, in which a computer program is stored. Wherein, the computer program is configured to implement the steps in the method embodiment in any one of the above when running.
[0098] Specifically, in this embodiment, the above storage medium may be configured to store a computer program for implementing the following steps:
[0099] S201: Obtain the problem to be solved and a set of qubits, where the number of the qubits is determined according to the dimension of the feature vector of the problem to be solved;
[0100] S202: Use the first type of quantum logic gates to construct a feature vector evolution sub-module that encodes the feature vector into a specified quantum state for a single qubit;
[0101] S203: Use the second type of quantum logic gates to construct an initial variational circuit module including multiple ansatz layers to control multiple qubits in the specified quantum state, where the second type of quantum logic gates includes variational parameters;
[0102] S204: Use the feature vector evolution sub-module, the variational circuit module, and the measurement operation module to generate a target variational quantum circuit for calculating the problem to be solved.
[0103] Specifically, in this embodiment, the above storage medium may include, but is not limited to: various media that can store computer programs such as USB flash drives, read-only memories (ROM for short), random access memories (RAM for short), mobile hard disks, magnetic disks, or optical discs.
[0104] An embodiment of the present invention further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to implement the steps in the method embodiment in any one of the above.
[0105] Specifically, the above electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the above processor, and the input / output device is connected to the above processor.
[0106] Specifically, in this embodiment, the above processor may be configured to implement the following steps through a computer program:
[0107] S201: Obtain the problem to be solved and a set of qubits, wherein the number of the qubits is determined according to the dimension of the eigenvector of the problem to be solved;
[0108] S202: Use the first type of quantum logic gates to construct an eigenvector evolution sub-module that encodes the eigenvector into a specified quantum state for a single qubit;
[0109] S203: Use the second type of quantum logic gates to construct an initial variational circuit module including multiple ansatz layers to control multiple qubits in the specified quantum state, wherein the second type of quantum logic gates includes variational parameters;
[0110] S204: Use the eigenvector evolution sub-module, the variational circuit module, and the measurement operation module to generate a target variational quantum circuit for calculating the problem to be solved.
[0111] The above has described in detail the structure, features, and effects of the present invention according to the illustrated embodiments. The above is only the preferred embodiment of the present invention, but the present invention is not limited to the scope defined by the drawings. Any changes made according to the concept of the present invention, or equivalent embodiments modified into equivalent changes, still within the spirit covered by the specification and the drawings, shall be within the protection scope of the present invention.
Claims
1. A construction method of variational quantum circuit, characterized in that, the method includes: obtaining a problem to be solved and a set of qubits, where the number of the qubits is determined according to the dimension of the eigenvector of the problem to be solved; where the problem to be solved includes: molecular property prediction problem; using the first type of quantum logic gates to construct an eigenvector evolution sub-module that performs encoding the eigenvector into a specified quantum state on a single qubit; using the second type of quantum logic gates to construct an initial variational circuit module including multiple ansatz layers to control multiple qubits in the specified quantum state, where the second type of quantum logic gates includes variational parameters; where the second type of quantum logic gates includes: RX quantum logic gates and controlled RX quantum logic gates, the controlled RX quantum logic gates act on adjacent qubits in sequence, the RX quantum logic gates act on a single qubit, and the action timing of the controlled RX quantum logic gates in one ansatz layer is before the RX quantum logic gates; using the eigenvector evolution sub-module, the variational circuit module and the measurement operation module to generate a target variational quantum circuit for calculating the problem to be solved.
2. The method according to claim 1, characterized in that, the problem to be solved includes a molecular property prediction problem, and obtaining the problem to be solved includes: obtaining a molecule to be predicted and determining the graph data of the molecule to be predicted, where the graph data includes node eigenvectors and edge eigenvectors, and the node eigenvectors and edge eigenvectors are used to represent the characteristics of the molecule to be predicted.
3. The method according to claim 2, characterized in that, the first type of quantum logic gates includes: Hadamard quantum logic gates and RY quantum logic gates, and the rotation angle of the RY quantum logic gate is determined based on the characteristics of the molecule to be predicted.
4. The method according to claim 3, characterized in that, the eigenvector evolution sub-module is composed of Hadamard quantum logic gates and RY quantum logic gates that act on all the qubits in sequence.
5. The method according to claim 4, characterized in that, the rotation angle of the RX quantum logic gate is determined based on the characteristics of the molecule to be predicted.
6. A molecular property prediction method, characterized in that, the method includes: using the target variational quantum circuit constructed according to any one of claims 2 to 5 to convert the node eigenvectors and edge eigenvectors of the molecule to be predicted into high-dimensional eigenvectors, and performing eigenvector fusion on the high-dimensional eigenvectors to obtain the fused eigenvector of the molecule to be predicted; inputting the fused eigenvector into a trained molecular property prediction model to obtain the prediction result of the property of the molecule to be predicted.
7. A construction device of variational quantum circuit, characterized in that, the device includes: an obtaining module, configured to obtain a problem to be solved and a set of qubits, where the number of the qubits is determined according to the dimension of the eigenvector of the problem to be solved; where the problem to be solved includes: molecular property prediction problem; A first construction module for constructing an eigenvector evolution sub-module that encodes the eigenvector into a specified quantum state for a single qubit by using a first type of quantum logic gate; A second construction module for constructing an initial variational circuit module including multiple ansatz layers by using a second type of quantum logic gate to control multiple qubits in the specified quantum state, where the second type of quantum logic gate includes variational parameters; wherein the second type of quantum logic gate includes: an RX quantum logic gate and a controlled RX quantum logic gate, the controlled RX quantum logic gate acts on adjacent qubits in sequence, the RX quantum logic gate acts on a single qubit, and the action timing of the controlled RX quantum logic gate in one ansatz layer is before that of the RX quantum logic gate; A generation module for generating a target variational quantum circuit for calculating the problem to be solved by using the eigenvector evolution sub-module, the variational circuit module, and a measurement operation module.
8. A molecular property prediction device, characterized in that, the device includes: A conversion module for converting the node eigenvector and edge eigenvector of the molecule to be predicted into high-dimensional eigenvectors by using the constructed target variational quantum circuit, and performing eigenvector fusion on the high-dimensional eigenvectors to obtain the fused eigenvector of the molecule to be predicted; An obtaining module for inputting the fused eigenvector into a trained molecular property prediction model to obtain a prediction result of the property of the molecule to be predicted.
9. A storage medium, characterized in that, a computer program is stored in the storage medium, wherein the computer program is set to implement the method described in any one of claims 1 to 6 when running.
10. An electronic device including a memory and a processor, characterized in that, a computer program is stored in the memory, and the processor is set to run the computer program to implement the method described in any one of claims 1 to 6.
Citation Information
Patent Citations
Meteorological prediction method based on variable component sub-line and related equipment
CN115144934A
Systems and Methods for Predicting the Olfactory Properties of Molecules Using Machine Learning
US20220139504A1