A method, device, storage medium and electronic device for predicting molecular properties
Calculating the correlation coefficient in molecular graph data through variational quantum circuits, combined with graph attention and fully connected networks, solves the limitations of convolutional neural networks in complex molecular graph data processing, and significantly improves the accuracy of molecular property prediction and speed.
Patent Information
- Application Number
- CN202310250808.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-16
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-03-16
AI Technical Summary
Existing graph convolutional neural networks based on the convolution mechanism have limitations when processing complex molecular graph data, resulting in low accuracy of molecular property prediction results.
Variational quantum circuits are used to map high-dimensional feature vectors in molecular graph data, and the correlation coefficients between feature vectors of adjacent nodes are calculated through the coding layer, parameter-containing variation layer and measurement layer, and combined with graph attention calculation and full Connect to the network to improve the accuracy of prediction results.
Through the parallel computing and entanglement characteristics of variational quantum circuits, the correlation coefficients of adjacent nodes in complex graph data can be accurately calculated, significantly improving the accuracy and speed of molecular property prediction.
Smart Images

Figure CN116306952B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of quantum computing technology, and in particular, relates to a molecular property prediction method, device, storage medium and electronic device. Background Art
[0002] Quantum computers are physical devices that follow 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. Quantum computers have become a key technology under research because they have the ability to process mathematical problems more efficiently than ordinary computers. For example, they can speed up the time to crack RSA keys from hundreds of years to a few hours.
[0003] The prediction of molecular properties plays an important role in many fields, such as drug discovery, chemical reactions, catalyst generation, etc. Especially in the field of drug discovery, accurate prediction of molecular properties can accelerate the overall process of discovering candidate drugs.
[0004] At present, molecules are usually represented as graph data (Graph), and molecular graph data are processed based on Graph Neural Networks (GNNs). However, graph convolutional neural networks (GCN) based on convolution mechanism have limitations in processing graph data. It is difficult to process complex molecular graph data, resulting in low accuracy of molecular property prediction results. Summary of the invention
[0005] The purpose of this application is to provide a molecular property prediction method, device, storage medium and electronic device, aiming to improve the accuracy of molecular property prediction results.
[0006] In order to achieve the above-mentioned object, a first aspect of an embodiment of the present application provides a method for predicting molecular properties, the method comprising:
[0007] Acquire graph data of the molecule to be predicted, wherein a feature vector of each node of the graph data represents an atom of the molecule to be predicted;
[0008] For each node in the graph data, feature enhancement and concatenation are performed on the feature vector of the node and the feature vectors of its adjacent nodes to obtain a high-dimensional feature vector;
[0009] Mapping each high-dimensional feature vector through a variational quantum circuit to obtain a correlation coefficient between feature vectors of adjacent nodes in the graph data;
[0010] The molecular property prediction result of the molecule to be predicted is determined based on the correlation coefficient.
[0011] Optionally, the variational component circuit includes a coding layer, a parameter-containing variational layer and a measurement layer, and mapping each high-dimensional feature vector through the variational component circuit to obtain a correlation coefficient between adjacent nodes in the graph data includes:
[0012] Encoding each high-dimensional feature vector into a preset number of quantum bits using the encoding layer;
[0013] Using the parameter-variable layer to perform quantum state evolution on the encoded quantum bits;
[0014] The measurement layer is used to measure the quantum state of any quantum bit after evolution, and the expected value of the measurement result is calculated to obtain the correlation coefficient.
[0015] Optionally, the encoding layer includes an H gate and a first RY gate, and using the encoding layer to encode each high-dimensional feature vector into a preset number of quantum bits includes:
[0016] An H gate is applied to a preset number of quantum bits so that each quantum bit evolves from an initial state to a superposition state. According to quantum gate parameters determined by the high-dimensional feature vector, a first RY gate is applied to each quantum bit so that the high-dimensional feature vector is encoded onto a preset number of quantum bits in a superposition state.
[0017] Optionally, the parameter-variant layer includes an RX gate, a CNOT gate and a second RY gate.
[0018] Optionally, determining the prediction result of the molecular property of the molecule to be predicted based on the correlation coefficient includes:
[0019] Performing graph attention calculation according to the correlation coefficient, and performing a graph pooling operation on the calculation result to obtain a graph data representation of the molecule to be predicted;
[0020] The graph data representation of the molecule to be predicted is input into a fully connected network to obtain a prediction result of the molecular property of the predicted molecule.
[0021] Optionally, performing graph attention calculation according to the correlation coefficient and performing a graph pooling operation on the calculation result to obtain a graph data representation of the molecule to be predicted includes:
[0022] Normalizing the correlation coefficient to obtain an attention coefficient;
[0023] The feature vector of each node of the graph data is updated by calculating the attention coefficient to obtain updated graph data;
[0024] A graph pooling operation is performed on the updated graph data to obtain a graph data representation of the molecule to be predicted.
[0025] Optionally, the correlation coefficient is normalized by the following formula:
[0026]
[0027] in, represents the attention coefficient, represents the correlation coefficient of the feature vectors between two adjacent nodes in the graph data, k represents the summation coefficient, N represents the number of adjacent nodes of the i-th node, Represents the activation function.
[0028] Optionally, the feature vector of each node of the graph data is updated using the following formula:
[0029]
[0030] Among them, double vertical lines represent splicing. represents the updated feature vector of the i-th node, W represents the weight matrix of the linear transformation, represents the feature vector of the jth node before updating, represents the activation function, and k represents the number of independent attention coefficient matrices.
[0031] A second aspect of an embodiment of the present application provides a molecular property prediction device, the device comprising:
[0032] An acquisition module, used to acquire graph data of the molecule to be predicted, wherein a feature vector of each node of the graph data represents an atom of the molecule to be predicted;
[0033] A concatenation module, for each node in the graph data, performs feature enhancement and concatenation on the feature vector of the node and the feature vectors of its adjacent nodes to obtain a high-dimensional feature vector;
[0034] A mapping module, used to map each high-dimensional feature vector through a variational quantum circuit to obtain a correlation coefficient between feature vectors of adjacent nodes in the graph data;
[0035] A determination module is used to determine the molecular property prediction result of the molecule to be predicted based on the correlation coefficient.
[0036] Optionally, the variational quantum circuit includes a coding layer, a parameter-containing variational layer and a measurement layer, and the mapping module is specifically used to:
[0037] Encoding each high-dimensional feature vector into a preset number of quantum bits using the encoding layer;
[0038] Using the parameter-variable layer to perform quantum state evolution on the encoded quantum bits;
[0039] The measurement layer is used to measure the quantum state of any quantum bit after evolution, and the expected value of the measurement result is calculated to obtain the correlation coefficient.
[0040] Optionally, the coding layer includes an H gate and a first RY gate, and the mapping module is specifically used to:
[0041] An H gate is applied to a preset number of quantum bits so that each quantum bit evolves from an initial state to a superposition state. According to quantum gate parameters determined by the high-dimensional feature vector, a first RY gate is applied to each quantum bit so that the high-dimensional feature vector is encoded onto a preset number of quantum bits in a superposition state.
[0042] Optionally, the parameter-variant layer includes an RX gate, a CNOT gate and a second RY gate.
[0043] Optionally, the determining module is specifically used to:
[0044] Performing graph attention calculation according to the correlation coefficient, and performing a graph pooling operation on the calculation result to obtain a graph data representation of the molecule to be predicted;
[0045] The graph data representation of the molecule to be predicted is input into a fully connected network to obtain a prediction result of the molecular property of the predicted molecule.
[0046] Optionally, the determining module is specifically used to:
[0047] Normalizing the correlation coefficient to obtain an attention coefficient;
[0048] The feature vector of each node of the graph data is updated by calculating the attention coefficient to obtain updated graph data;
[0049] A graph pooling operation is performed on the updated graph data to obtain a graph data representation of the molecule to be predicted.
[0050] Optionally, the correlation coefficient is normalized by the following formula:
[0051]
[0052] in, represents the attention coefficient, represents the correlation coefficient of the feature vectors between two adjacent nodes in the graph data, k represents the summation coefficient, N represents the number of adjacent nodes of the i-th node, Represents the activation function.
[0053] Optionally, the feature vector of each node of the graph data is updated using the following formula:
[0054]
[0055] Among them, double vertical lines represent splicing. represents the updated feature vector of the i-th node, W represents the weight matrix of the linear transformation, represents the feature vector of the jth node before updating, represents the activation function, and K represents the number of independent attention coefficient matrices.
[0056] According to a third aspect of an embodiment of the present application, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the methods described in the first aspect when run.
[0057] According to a fourth aspect of an embodiment of the present application, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps of any one of the methods described in the first aspect.
[0058] By adopting the above technical scheme, by obtaining the graph data of the molecule to be predicted, for each node in the graph data, the feature vector of the node and the feature vectors of its adjacent nodes are feature enhanced and spliced to obtain a high-dimensional feature vector; each high-dimensional feature vector is mapped through a variational molecular circuit to obtain the correlation coefficient between the feature vectors of adjacent nodes in the graph data; the molecular property prediction result of the molecule to be predicted is determined according to the correlation coefficient, and the high-dimensional feature vectors between adjacent nodes are mapped through the variational molecular circuit to obtain the correlation coefficient between adjacent nodes. By utilizing the parallel computing characteristics and entanglement characteristics of the variational molecular circuit, the feature calculation of complex graph data can be accurately performed to obtain the correlation coefficient between adjacent nodes, and then the molecular properties of the molecule to be predicted can be predicted according to the correlation coefficient, thereby improving the accuracy of the prediction result. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 is a hardware structure block diagram of a computer terminal for a molecular property prediction method according to an exemplary embodiment;
[0060] Figure 2 is a flow chart of a method for predicting molecular properties according to an exemplary embodiment;
[0061] Figure 3 is a flow chart of another molecular property prediction method according to an exemplary embodiment;
[0062] Figure 4 is a schematic diagram of a variational quantum circuit according to an exemplary embodiment;
[0063] Figure 5is a block diagram of a molecular property prediction device according to an exemplary embodiment. DETAILED DESCRIPTION
[0064] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and should not be construed as limiting the present application.
[0065] The embodiments of the present application first provide a method for predicting molecular properties, which can be applied to electronic devices, such as computer terminals, specifically ordinary computers, quantum computers, etc.
[0066] The following describes it in detail by taking running on a computer terminal as an example. Figure 1 FIG. 1 is a hardware structure block diagram of a computer terminal for a molecular property prediction method according to an exemplary embodiment. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing the molecular property prediction method based on quantum circuits. Optionally, the computer terminal may also include a transmission device 106 for communication functions and an input and output device 108. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0067] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the molecular property prediction method in the embodiment of the present application, and the processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to a computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0068] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.
[0069] It should be noted that a true quantum computer is a hybrid structure, which consists of two parts: one part is a classical computer, which is responsible for performing classical calculations and control; the other part is a quantum device, which is responsible for running quantum programs and thus realizing quantum computing. A quantum program is a sequence of instructions written in a quantum language such as QRunes that can be run on a quantum computer, which supports quantum logic gate operations and ultimately realizes quantum computing. Specifically, a quantum program is a sequence of instructions that operate quantum logic gates in a certain sequence.
[0070] In practical applications, due to the limitations of the development of quantum device hardware, quantum computing simulation is usually required to verify quantum algorithms, quantum applications, etc. Quantum computing simulation is the process of simulating the operation of quantum programs corresponding to specific problems using a virtual architecture (i.e., quantum virtual machine) built with the resources of ordinary computers. Usually, it is necessary to build a quantum program corresponding to a specific problem. The quantum program referred to in the embodiments of the present application is a program written in a classical language to characterize quantum bits and their evolution, in which quantum bits, quantum logic gates, etc. related to quantum computing are represented by corresponding classical codes.
[0071] Quantum circuits, as a manifestation of quantum programs, are also called quantum logic circuits. They are the most commonly used general quantum computing model. They represent circuits that operate on quantum bits in an abstract concept. They are composed of quantum bits, circuits (timelines), and various quantum logic gates. Finally, the results often need to be read out through quantum measurement operations.
[0072] Unlike traditional circuits that are connected by metal wires to transmit voltage or current signals, in quantum circuits, the circuits can be seen as connected by time, that is, the state of the quantum bit evolves naturally over time, following the instructions of the Hamiltonian operator until it encounters a logic gate and is operated.
[0073] A quantum program as a whole corresponds to a total quantum circuit. The quantum program described in this application refers to this total quantum circuit, wherein the total number of quantum bits in the total quantum circuit is the same as the total number of quantum bits in the quantum program. It can be understood that a quantum program can be composed of a quantum circuit, measurement operations on quantum bits in the quantum circuit, registers for storing measurement results, and control flow nodes (jump instructions). A quantum circuit can contain dozens, hundreds, or even thousands of quantum logic gate operations. The execution process of a quantum program is the process of executing all quantum logic gates in a certain sequence. It should be noted that the sequence is the time order in which a single quantum logic gate is executed.
[0074] It should be noted that in classical computing, the most basic unit is the bit, and the most basic control mode is the logic gate, which can achieve the purpose of controlling the circuit through the combination of logic gates. Similarly, the way to process quantum bits is quantum logic gates. The use of quantum logic gates can make the quantum state evolve. Quantum logic gates are the basis of quantum circuits. Quantum logic gates include single-bit quantum logic gates, such as Hadamard gates (H gates, Hadamard gates), Pauli-X gates (X gates, Pauli X gates), Pauli-Y gates (Y gates, Pauli Y gates), Pauli-Z gates (Z gates, Pauli Z gates), RX gates (RX rotation gates), RY gates (RY rotation gates), RZ gates (RZ rotation gates), etc.; multi-bit quantum logic gates, such as CNOT gates, CR gates, iSWAP gates, Toffoli gates, etc. Quantum logic gates are generally represented by unitary matrices, and unitary matrices are not only in matrix form, but also a kind of operation and transformation. The general function of quantum logic gates on quantum states is to calculate by multiplying the unitary matrix on the left by the vector corresponding to the quantum state right vector. For example, the vector corresponding to the quantum state right vector |0> can be , the vector corresponding to the quantum state right vector |1> can be .
[0075] See also Figure 2 , Figure 2 is a flow chart of a method for predicting molecular properties according to an exemplary embodiment. The embodiment of the present application provides a method for predicting molecular properties, the method comprising:
[0076] S201, obtaining graph data of the molecule to be predicted.
[0077] Among them, the feature vector of each node in the graph data represents an atom of the molecule to be predicted, two nodes with a connection relationship (edge) in the graph data are adjacent nodes, and the edge between adjacent nodes represents the chemical bond between the two atoms.
[0078] S202: For each node in the graph data, the feature vector of the node and the feature vectors of its adjacent nodes are enhanced and concatenated to obtain a high-dimensional feature vector.
[0079] For example, the feature vector of node i is h i , the feature vector of node j is h j , nodes i and j are adjacent nodes, then the feature vector h can be increased by parameter w i and the eigenvector h j The feature dimension is enhanced to obtain the enhanced feature vector wh i and wh j , concatenation can obtain a high-dimensional feature vector [ wh j ], where double vertical lines indicate concatenation.
[0080] It can be understood that a high-dimensional feature vector between every two adjacent nodes in the graph data can be obtained through the above method.
[0081] S203. Map each high-dimensional feature vector through a variational quantum circuit to obtain a correlation coefficient between feature vectors of adjacent nodes in the graph data.
[0082] S204. Determine the prediction result of the molecular property of the molecule to be predicted based on the correlation coefficient.
[0083] By adopting the embodiment of the present application, by obtaining the graph data of the molecule to be predicted, for each node in the graph data, the feature vector of the node and the feature vectors of its adjacent nodes are feature enhanced and spliced to obtain a high-dimensional feature vector; each high-dimensional feature vector is mapped through a variational quantum circuit to obtain a correlation coefficient between the feature vectors of adjacent nodes in the graph data; the molecular property prediction result of the molecule to be predicted is determined according to the correlation coefficient, and the high-dimensional feature vectors between adjacent nodes are mapped through the variational quantum circuit to obtain the correlation coefficient between adjacent nodes. By utilizing the parallel computing characteristics and entanglement characteristics of the variational quantum circuit, the feature calculation of complex graph data can be accurately performed to obtain the correlation coefficient between adjacent nodes, and then the molecular properties of the molecule to be predicted can be predicted according to the correlation coefficient, thereby improving the accuracy of the prediction result.
[0084] In another embodiment of the present application, the above-mentioned variational quantum circuit includes a coding layer, a parameter variation layer and a measurement layer, such as Figure 3 As shown, S203, each high-dimensional feature vector is mapped through a variational quantum circuit to obtain the correlation coefficient between adjacent nodes in the graph data, which can be specifically implemented as follows:
[0085] S2031. Encode each high-dimensional feature vector into a preset number of quantum bits using a coding layer.
[0086] In the embodiment of the present application, the coding layer includes an H gate and a first RY gate, and S2031 can be specifically implemented as follows:
[0087] The H gate is applied to a preset number of quantum bits so that each quantum bit evolves from an initial state to a superposition state. According to the quantum gate parameters determined by the high-dimensional feature vector, the first RY gate is applied to each quantum bit so that the high-dimensional feature vector is encoded onto a preset number of quantum bits in a superposition state.
[0088] Among them, the preset number can be set according to the number of features included in the high-dimensional feature vector. For example, if the number of features included in the high-dimensional feature vector obtained by S202 is 4, then the preset number can be set to 4, and each high-dimensional feature vector is encoded into 4 quantum bits.
[0089] like Figure 4 As shown, Figure 4 A schematic diagram of a variational quantum circuit provided in an embodiment of the present application, Figure 4 The variational quantum circuit shown includes four quantum bits q0 to q3, and also includes a coding layer, a parameter variation layer and a measurement layer, wherein the coding layer includes an H gate and a first RY gate, and the H gate acts on the initial state of the four quantum bits q0 to q3 , transforming it into a superposition state , then the high-dimensional feature vector As the parameter of the first RY gate, the form is RY(a j ), j = 0, 1, 2, 3, the first RY gate acts on the quantum bit in the superposition state, mapping the features included in the high-dimensional feature vector to the corresponding quantum bit one by one.
[0090] S2032. Use parameter-variable layers to perform quantum state evolution on the encoded quantum bits.
[0091] Among them, the parameter-variant layer includes an RX gate, a CNOT gate and a second RY gate.
[0092] In the embodiment of the present application, the main function of the CNOT gate is to realize quantum entanglement, which can enable the exchange and transmission of information between quantum bits, such as Figure 4 As shown, the CNOT gate is used to entangle the first quantum bit and the last quantum bit as well as the two adjacent quantum bits. In addition, the variational quantum circuit also introduces an RX gate and a second RY gate. The RX gate and the second RY gate include training parameters Ψ and Φ, respectively. By continuously iteratively optimizing the training parameters Ψ and Φ, the variational quantum circuit can be optimized, so that the variational quantum circuit can accurately learn the correlation between adjacent nodes.
[0093] It should be noted that the variational quantum circuit provided in the embodiment of the present application can be stacked with multiple sub-layers to increase the depth and seek a better variational quantum circuit according to the specific quantum coding task.
[0094] S2033. Use the measurement layer to measure the quantum state of any quantum bit after evolution, calculate the expected value of the measurement result, and obtain the correlation coefficient.
[0095] The measurement layer is the last layer of the variational quantum circuit. Its function is to decoherent the quantum bits and realize the conversion of quantum data into classical data. In the embodiment of the present application, the variational quantum circuit includes a preset number of quantum bits. The measurement layer can output the expected value of the Pauli Z of any quantum bit to obtain the correlation coefficient.
[0096] For example, Figure 4 As shown, the measurement layer can measure the quantum state of the first quantum bit q0, calculate the expected value, and obtain the correlation coefficient.
[0097] By using the embodiment of the present application, the high-dimensional feature vectors between adjacent nodes are encoded into a preset number of quantum bits through the coding layer included in the quantum circuit, the quantum state of the encoded quantum bits is evolved through the parameter-containing variational layer, the quantum state of any evolved quantum bit is measured by the measurement layer, the expected value is calculated, and the correlation coefficient between adjacent nodes is obtained. With the help of the parallel computing characteristics of the variational quantum circuit and the quantum state entanglement characteristics, the processing of complex molecular graph data is realized, which can improve the accuracy and speed of predicting molecular properties.
[0098] In another embodiment of the present application, the above S204, determining the prediction result of the molecular property of the molecule to be predicted based on the correlation coefficient, can be specifically implemented as follows:
[0099] Step 1: Perform graph attention calculation based on the correlation coefficient, perform graph pooling on the calculation results, and obtain the graph data representation of the molecule to be predicted.
[0100] Specifically, the correlation coefficient can be normalized to obtain the attention coefficient, and the feature vector of each node of the graph data can be updated through the attention coefficient calculation to obtain the updated graph data, and the updated graph data can be subjected to graph pooling operation to obtain the graph data representation of the molecule to be predicted.
[0101] Furthermore, the correlation coefficient can be normalized by the following formula:
[0102]
[0103] in, represents the attention coefficient, represents the correlation coefficient of the feature vectors between two adjacent nodes in the graph data, k represents the summation coefficient, N represents the number of adjacent nodes of the i-th node, Represents the activation function.
[0104] Furthermore, the feature vector of each node of the graph data can be updated by the following formula:
[0105]
[0106] Among them, double vertical lines represent splicing. represents the updated feature vector of the i-th node, W represents the weight matrix of the linear transformation, represents the feature vector of the jth node before updating, represents the activation function, and K represents the number of independent attention coefficient matrices.
[0107] Step 2: Input the graph data representation of the molecule to be predicted into the fully connected network to obtain the molecular property prediction results with the predicted molecule.
[0108] The molecular property prediction method provided in the embodiment of the present application can perform classification tasks, such as molecular toxicity prediction, and can also perform regression tasks, such as molecular energy gap prediction. Different loss functions can be selected according to different tasks.
[0109] When performing classification tasks, the loss function is the cross entropy loss function:
[0110]
[0111] Among them, the probability distribution is the expected output, probability distribution is the actual output. The smaller the cross entropy loss function value is, the higher the probability distribution of the actual output is. The closer the probability distribution is to the expected output.
[0112] When performing regression tasks, the loss function is the mean square error loss function:
[0113]
[0114] in, is the data label value, Output value of the model. Optimize the model parameters according to the calculated loss function value until the loss function value reaches the preset threshold, confirming that the model training is complete, and select the Adam gradient update algorithm with a learning rate of 0.001.
[0115] Based on the same inventive concept, the present application embodiment also provides a molecular property prediction device, such as Figure 5 As shown, the device comprises:
[0116] An acquisition module 501 is used to acquire graph data of the molecule to be predicted, wherein a feature vector of each node of the graph data represents an atom of the molecule to be predicted;
[0117] A concatenation module 502 performs feature enhancement and concatenation on a feature vector of each node in the graph data and a feature vector of its adjacent nodes to obtain a high-dimensional feature vector;
[0118] A mapping module 503 is used to map each high-dimensional feature vector through a variational quantum circuit to obtain a correlation coefficient between feature vectors of adjacent nodes in the graph data;
[0119] The determination module 504 is used to determine the prediction result of the molecular property of the molecule to be predicted based on the correlation coefficient.
[0120] Optionally, the variational quantum circuit includes a coding layer, a parameter-containing variational layer and a measurement layer, and the mapping module 503 is specifically used to:
[0121] Encoding each high-dimensional feature vector into a preset number of quantum bits using a coding layer;
[0122] The quantum state evolution of the encoded quantum bits is performed using parameter-variable layers;
[0123] The measurement layer is used to measure the quantum state of any quantum bit after evolution, and the expected value of the measurement result is calculated to obtain the correlation coefficient.
[0124] Optionally, the coding layer includes an H gate and a first RY gate, and the mapping module 503 is specifically used for:
[0125] The H gate is applied to a preset number of quantum bits so that each quantum bit evolves from an initial state to a superposition state. According to the quantum gate parameters determined by the high-dimensional feature vector, the first RY gate is applied to each quantum bit so that the high-dimensional feature vector is encoded onto a preset number of quantum bits in a superposition state.
[0126] Optionally, the parameter-variant layer includes an RX gate, a CNOT gate and a second RY gate.
[0127] Optionally, the determination module 504 is specifically configured to:
[0128] Calculate the graph attention based on the correlation coefficient, perform graph pooling on the calculation results, and obtain the graph data representation of the molecule to be predicted;
[0129] The graph data representation of the molecule to be predicted is input into the fully connected network to obtain the molecular property prediction results with the predicted molecule.
[0130] Optionally, the determination module 504 is specifically configured to:
[0131] Normalize the correlation coefficient to get the attention coefficient;
[0132] The feature vector of each node of the graph data is updated by calculating the attention coefficient to obtain the updated graph data;
[0133] The updated graph data is subjected to graph pooling operation to obtain the graph data representation of the molecule to be predicted.
[0134] Optionally, the correlation coefficient is normalized by the following formula:
[0135]
[0136] in, represents the attention coefficient, represents the correlation coefficient of the feature vectors between two adjacent nodes in the graph data, k represents the summation coefficient, N represents the number of adjacent nodes of the i-th node, Represents the activation function.
[0137] Optionally, the feature vector of each node of the graph data is updated using the following formula:
[0138]
[0139] Among them, double vertical lines represent splicing. represents the updated feature vector of the i-th node, W represents the weight matrix of the linear transformation, represents the feature vector of the jth node before updating, represents the activation function, and K represents the number of independent attention coefficient matrices.
[0140] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0141] Yet another embodiment of the present application provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps in the above-mentioned molecular property prediction method embodiment when running.
[0142] Specifically, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0143] Yet another embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in the above-mentioned molecular property prediction method embodiment.
[0144] Specifically, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0145] Specifically, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0146] Step 1: Obtain graph data of the molecule to be predicted.
[0147] Step 2: For each node in the graph data, enhance and concatenate the feature vector of the node and the feature vectors of its adjacent nodes to obtain a high-dimensional feature vector.
[0148] Step 3: Map each high-dimensional feature vector through the variational quantum circuit to obtain the correlation coefficient between the feature vectors of adjacent nodes in the graph data.
[0149] Step 4: Determine the prediction result of the molecular property of the molecule to be predicted based on the correlation coefficient.
[0150] The above describes in detail the structure, features and effects of the present application based on the embodiments shown in the drawings. The above is only a preferred embodiment of the present application, but the present application does not limit the scope of implementation to what is shown in the drawings. Any changes made in accordance with the concept of the present application, or modifications to equivalent embodiments with equivalent changes, which still do not exceed the spirit covered by the description and drawings, should be within the protection scope of the present application.
Claims
1. A method for predicting molecular properties, characterized in that: The method comprises: Acquire graph data of the molecule to be predicted, wherein a feature vector of each node of the graph data represents an atom of the molecule to be predicted; For each node in the graph data, feature enhancement and concatenation are performed on the feature vector of the node and the feature vectors of its adjacent nodes to obtain a high-dimensional feature vector; Using the encoding layer of the variational quantum circuit to encode each high-dimensional feature vector into a preset number of quantum bits, using the parameter-containing variational layer of the variational quantum circuit to perform quantum state evolution on the encoded quantum bits, and using the measurement layer of the variational quantum circuit to measure the quantum state of any quantum bit after evolution, calculating the expected value of the measurement result, and obtaining the correlation coefficient between adjacent nodes in the graph data; The molecular property prediction result of the molecule to be predicted is determined based on the correlation coefficient.
2. The method according to claim 1, characterized in that The encoding layer includes an H gate and a first RY gate, and using the encoding layer to encode each high-dimensional feature vector into a preset number of quantum bits includes: An H gate is applied to a preset number of quantum bits so that each quantum bit evolves from an initial state to a superposition state. According to quantum gate parameters determined by the high-dimensional feature vector, a first RY gate is applied to each quantum bit so that the high-dimensional feature vector is encoded onto a preset number of quantum bits in a superposition state.
3. The method according to claim 1 or 2, characterized in that: The parameter-variant layer includes an RX gate, a CNOT gate and a second RY gate.
4. The method according to claim 1, characterized in that: The step of determining the molecular property prediction result of the molecule to be predicted based on the correlation coefficient comprises: Performing graph attention calculation according to the correlation coefficient, and performing a graph pooling operation on the calculation result to obtain a graph data representation of the molecule to be predicted; The graph data representation of the molecule to be predicted is input into a fully connected network to obtain a prediction result of the molecular property of the molecule to be predicted.
5. The method according to claim 4, characterized in that The performing graph attention calculation according to the correlation coefficient and performing a graph pooling operation on the calculation result to obtain the graph data representation of the molecule to be predicted includes: Normalizing the correlation coefficient to obtain an attention coefficient; The feature vector of each node of the graph data is updated by calculating the attention coefficient to obtain updated graph data; A graph pooling operation is performed on the updated graph data to obtain a graph data representation of the molecule to be predicted.
6. The method according to claim 5, characterized in that The correlation coefficient is normalized by the following formula: in, represents the attention coefficient, represents the correlation coefficient of the feature vectors between two adjacent nodes in the graph data, k represents the summation coefficient, N represents the number of adjacent nodes of the i-th node, Represents the activation function.
7. The method according to claim 6, characterized in that The feature vector of each node in the graph data is updated using the following formula: Among them, double vertical lines represent splicing. represents the updated feature vector of the i-th node, W represents the weight matrix of the linear transformation, represents the feature vector of the jth node before updating, represents the activation function, and K represents the number of independent attention coefficient matrices.
8. A molecular property prediction device, characterized in that: The device comprises: An acquisition module, used to acquire graph data of the molecule to be predicted, wherein a feature vector of each node of the graph data represents an atom of the molecule to be predicted; A concatenation module, for each node in the graph data, performs feature enhancement and concatenation on the feature vector of the node and the feature vectors of its adjacent nodes to obtain a high-dimensional feature vector; A mapping module, used to encode each high-dimensional feature vector into a preset number of quantum bits using the encoding layer of the variational quantum circuit, perform quantum state evolution on the encoded quantum bits using the parameter-containing variational layer of the variational quantum circuit, and measure the evolved quantum state of any quantum bit using the measurement layer of the variational quantum circuit, calculate the expected value of the measurement result, and obtain the correlation coefficient between adjacent nodes in the graph data; A determination module is used to determine the molecular property prediction result of the molecule to be predicted based on the correlation coefficient.
9. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.
