CN117877611A - Method and device for predicting molecular properties - Google Patents

Method and device for predicting molecular properties Download PDF

Info

Publication number
CN117877611A
CN117877611A CN202211220100.6A CN202211220100A CN117877611A CN 117877611 A CN117877611 A CN 117877611A CN 202211220100 A CN202211220100 A CN 202211220100A CN 117877611 A CN117877611 A CN 117877611A
Authority
CN
China
Prior art keywords
predicted
quantum
molecules
sub
molecule
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211220100.6A
Other languages
Chinese (zh)
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Benyuan Quantum Computing Technology Hefei Co ltd
Original Assignee
Benyuan Quantum Computing Technology Hefei Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Benyuan Quantum Computing Technology Hefei Co ltd filed Critical Benyuan Quantum Computing Technology Hefei Co ltd
Priority to CN202211220100.6A priority Critical patent/CN117877611A/en
Publication of CN117877611A publication Critical patent/CN117877611A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16CCOMPUTATIONAL CHEMISTRY; CHEMOINFORMATICS; COMPUTATIONAL MATERIALS SCIENCE
    • G16C20/00Chemoinformatics, i.e. ICT specially adapted for the handling of physicochemical or structural data of chemical particles, elements, compounds or mixtures
    • G16C20/30Prediction of properties of chemical compounds, compositions or mixtures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • G06N10/20Models of quantum computing, e.g. quantum circuits or universal quantum computers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • General Health & Medical Sciences (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Mathematics (AREA)
  • Molecular Biology (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Chemical & Material Sciences (AREA)
  • Crystallography & Structural Chemistry (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a method and a device for predicting molecular properties, wherein the method comprises the following steps: firstly, obtaining a molecule to be predicted, determining graph data of the molecule to be predicted, constructing a target quantum circuit for optimizing a feature vector, converting a node feature vector and a side feature vector of the molecule to be predicted into a high-dimensional feature vector by utilizing the target quantum circuit, carrying out feature fusion on the high-dimensional feature vector to obtain a fusion feature vector of the molecule to be predicted, inputting the fusion feature vector of the molecule to be predicted into a trained molecular property prediction model to obtain a prediction result of the molecular property to be predicted, and realizing the prediction of the molecular property by utilizing the quantum circuit, and improving the calculation speed and the calculation accuracy by utilizing the correlation characteristic of quanta.

Description

Method and device for predicting molecular properties
Technical Field
The invention belongs to the technical field of quantum computing, and particularly relates to a method and a device for predicting molecular properties.
Background
Traditional medicine molecular property prediction methods mainly rely on extracting molecular fingerprints or artificially designed features, and then use the molecular fingerprints in combination with a machine learning algorithm. Such molecular characterization itself carries a bias of the expert in the field in order to capture the characteristics required for the current task. To overcome this prejudice, with more general approaches, different types of machine learning algorithms are introduced in the field of molecular property prediction. Due to the acceleration of computing power, the availability of large data sets is increasing, and the great success in related fields such as natural language processing and pattern recognition, deep learning algorithms are being expected. These different types of network models can learn task-specific characterizations in an automated manner, and thus can eliminate complex feature extraction processes. In order to avoid feature engineering in a specific field by using a deep learning algorithm, a proper representation method needs to be found for molecules, and a graph neural network method is generated.
The difficulty in solving the problem of predicting the molecular properties of the drug by using the classical graph neural network model is that the complexity of the characteristic extraction and data processing process is high, the parameters are numerous in the training process, the prediction accuracy is low, and the like, while the quantum computing has great potential in terms of computing capacity, compared with a classical computer, the more the information processing amount is, the more the implementation of the operation is beneficial, and the operation accuracy can be ensured. At present, how to predict molecular properties by quantum technology is a urgent problem to be solved.
Disclosure of Invention
The invention aims to provide a method and a device for predicting molecular properties, which solve the defects in the prior art, realize the prediction of molecular properties through a quantum circuit, and improve the calculation speed and the calculation accuracy by utilizing the relevant characteristics of quanta.
One embodiment of the present application provides a method of predicting molecular properties, the method comprising:
obtaining molecules to be predicted, and determining graph data of the molecules to be predicted, wherein the graph data comprises node feature vectors and edge feature vectors of the molecules to be predicted;
constructing a target quantum circuit for feature vector optimization;
converting the node characteristic vector and the edge characteristic vector of the molecule to be predicted into a high-dimensional characteristic vector by utilizing the target quantum circuit, and carrying out characteristic fusion on the high-dimensional characteristic vector to obtain a fusion characteristic vector of the molecule to be predicted;
and inputting the fusion feature vector of the molecule to be predicted into a trained molecular property prediction model to obtain a prediction result of the molecular property to be predicted.
Optionally, the obtaining the molecule to be predicted and determining the map data of the molecule to be predicted include:
obtaining a molecule to be predicted, converting atoms of the molecule to be predicted into nodes of graph data, and converting 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.
Optionally, the constructing the target quantum circuit for feature vector optimization includes:
acquiring a group of quantum bits and setting the initial state of the quantum bits to be |0>;
constructing a first sub-quantum circuit for mapping the graph data of the molecules to be predicted to the quantum bit superposition state by using a first type quantum logic gate;
constructing a second sub-quantum circuit for optimizing the graph data of the molecules to be predicted by using a second type quantum logic gate;
constructing a measurement sub-line for extracting the characteristic vector of the optimized graph data of the molecules to be predicted;
and obtaining a target quantum circuit for feature vector optimization by using the first sub-quantum circuit, the second sub-quantum circuit and the measuring sub-circuit.
Optionally, the obtaining, by using the first sub-quantum wire, the second sub-quantum wire, and the measurement sub-wire, a target quantum wire for feature vector optimization includes:
combining the first sub-quantum circuit, the second sub-quantum circuit and the measuring sub-circuit in sequence to obtain a target quantum circuit, or
And combining the first sub-quantum circuits, a preset number of second sub-quantum circuits and the measuring sub-circuits in sequence to obtain a target quantum circuit, wherein the preset number is an integer greater than or equal to 2.
Optionally, the first type of quantum logic gate includes: hadamard quantum logic gates and quantum rotation logic gates;
the second type quantum logic gate includes: CNOT quantum logic gates and quantum rotating logic gates.
Optionally, the converting, by using the target quantum circuit, the node feature vector and the edge feature vector of the molecule to be predicted into high-dimensional feature vectors includes:
operating and measuring the target quantum circuit to obtain a final quantum state of the target quantum circuit;
the final quantum state is converted into a high-dimensional feature vector.
Yet another embodiment of the present application provides an apparatus for predicting molecular properties, the apparatus comprising:
the device comprises an obtaining module, a prediction module and a prediction module, wherein the obtaining module is used for obtaining molecules to be predicted and determining graph data of the molecules to be predicted, and the graph data comprises node characteristic vectors and edge characteristic vectors of the molecules to be predicted;
the construction module is used for constructing a target quantum circuit for feature vector optimization;
the conversion module is used for converting the node characteristic vector and the edge characteristic vector of the molecules to be predicted into high-dimensional characteristic vectors by utilizing the target quantum circuit, and carrying out characteristic fusion on the high-dimensional characteristic vectors to obtain fusion characteristic vectors of the molecules to be predicted;
the obtaining module is used for inputting the fusion feature vector of the molecule to be predicted into a trained molecular property prediction model to obtain a prediction result of the molecular property to be predicted.
Optionally, the obtaining module includes:
the obtaining unit is used for obtaining molecules to be predicted, converting atoms of the molecules to be predicted into nodes of graph data, and converting chemical bonds of the molecules to be predicted into edges of the graph data so as to obtain the graph data of the molecules to be predicted.
Optionally, the building module includes:
an acquisition unit for acquiring a set of qubits and setting an initial state of the qubits to |0>;
the first construction unit is used for constructing a first sub-quantum circuit for mapping the graph data of the molecules to be predicted to the quantum bit superposition state by utilizing a first type of quantum logic gate;
the second construction unit is used for constructing a second sub-quantum circuit for optimizing the graph data of the molecules to be predicted by using a second type quantum logic gate;
a third construction unit for constructing a measurement sub-line for extracting a feature vector of the optimized map data of the molecule to be predicted;
and the combining unit is used for obtaining a target quantum circuit for feature vector optimization by using the first sub-quantum circuit, the second sub-quantum circuit and the measuring sub-circuit.
Optionally, the combination unit includes:
a first combining subunit, configured to combine the first sub-quantum circuit, the second sub-quantum circuit, and the measurement sub-circuit in order to obtain a target quantum circuit, or
And the second combination subunit is used for sequentially combining the first sub-quantum circuits, the preset number of the second sub-quantum circuits and the measurement sub-circuits to obtain a target quantum circuit, wherein the preset number is an integer greater than or equal to 2.
Optionally, the conversion module includes:
the operation unit is used for operating and measuring the target quantum circuit to obtain a final quantum state of the target quantum circuit;
and the conversion unit is used for converting the final quantum state into a high-dimensional characteristic vector.
A further embodiment of the present application provides a storage medium having a computer program stored therein, wherein the computer program is arranged to implement the method of any of the above when run.
Yet another embodiment of the present application provides an electronic device comprising a memory having a computer program stored therein and a processor configured to run the computer program to implement the method described in any of the above.
Compared with the prior art, the method has the advantages that firstly, the molecules to be predicted are obtained, the graph data of the molecules to be predicted are determined, the target quantum circuit for optimizing the feature vector is constructed, the node feature vector and the edge feature vector of the molecules to be predicted are converted into the high-dimensional feature vector by utilizing the target quantum circuit, the high-dimensional feature vector is subjected to feature fusion to obtain the fusion feature vector of the molecules to be predicted, the fusion feature vector of the molecules to be predicted is input into a trained molecular property prediction model, the prediction result of the molecular property to be predicted is obtained, the prediction of the molecular property is realized through the quantum circuit, and the calculation speed and the calculation accuracy are improved by utilizing the relevant characteristics of quanta.
Drawings
FIG. 1 is a block diagram of a hardware architecture of a computer terminal for a method of predicting molecular properties according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for predicting molecular properties according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a target quantum circuit according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus for predicting molecular properties according to an embodiment of the present invention.
Detailed Description
The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention.
The embodiment of the invention firstly provides a method for predicting molecular properties, which can be applied to electronic equipment such as computer terminals, in particular to common computers, quantum computers and the like.
The following describes the operation of the computer terminal in detail by taking it as an example. Fig. 1 is a hardware block diagram of a computer terminal according to a method for predicting molecular properties according to an embodiment of the present invention. As shown in fig. 1, the computer terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, and optionally, a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the computer terminal described above. For example, the computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store software programs and modules of application software, such as program instructions/modules corresponding to the methods of predicting molecular properties in the embodiments of the present application, and the processor 102 executes the software programs and modules stored in the memory 104 to perform various functional applications and data processing, i.e., implement the methods described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the computer terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 106 is arranged to receive or transmit data via a network. Specific examples of the network described above 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) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module for communicating with the internet wirelessly.
It should be noted that a real quantum computer is a hybrid structure, which includes two major parts: part of the computers are classical computers and are responsible for performing classical computation and control; the other part is quantum equipment, which is responsible for running quantum programs so as to realize quantum computation. The quantum program is a series of instruction sequences written by a quantum language such as the qlunes language and capable of running on a quantum computer, so that the support of quantum logic gate operation is realized, and finally, quantum computing is realized. Specifically, the quantum program is a series of instruction sequences for operating the quantum logic gate according to a certain time sequence.
In practical applications, quantum computing simulations are often required to verify quantum algorithms, quantum applications, etc., due to the development of quantum device hardware. Quantum computing simulation is a process of realizing simulated operation of a quantum program corresponding to a specific problem by means of a virtual architecture (namely a quantum virtual machine) built by resources of a common computer. In general, it is necessary to construct a quantum program corresponding to a specific problem. The quantum program, namely the program for representing the quantum bit and the evolution thereof written in the classical language, wherein the quantum bit, the quantum logic gate and the like related to quantum computation are all represented by corresponding classical codes.
Quantum circuits, which are one embodiment of quantum programs, also weigh sub-logic circuits, are the most commonly used general quantum computing models, representing circuits that operate on qubits under an abstract concept, the composition of which includes qubits, circuits (timelines), and various quantum logic gates, and finally the results often need to be read out by quantum measurement operations.
Unlike conventional circuits, which are connected by metal lines to carry voltage or current signals, in a quantum circuit, the circuit can be seen as being connected by time, i.e., the state of the qubit naturally evolves over time, as indicated by the hamiltonian operator, during which it is operated until a logic gate is encountered.
One quantum program is corresponding to one total quantum circuit, and the quantum program refers to the 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 of the quantum program. It can be understood that: one quantum program may consist of a quantum circuit, a measurement operation for the quantum bits in the quantum circuit, a register to hold the measurement results, and a control flow node (jump instruction), and one quantum circuit may contain several tens to hundreds or even thousands of quantum logic gate operations. The execution process of the quantum program is a process of executing all quantum logic gates according to a certain time sequence. Note that the timing is the time sequence in which a single quantum logic gate is executed.
It should be noted that in classical computation, the most basic unit is a bit, and the most basic control mode is a logic gate, and the purpose of the control circuit can be achieved by a combination of logic gates. Similarly, the way in which the qubits are handled is a quantum logic gate. Quantum logic gates are used, which are the basis for forming quantum circuits, and include single-bit quantum logic gates, such as Hadamard gates (H gates, hadamard gates), brix gates (X gates), brix-Y gates (Y gates), brix-Z gates (Z gates), RX gates, RY gates, RZ gates, and the like; multi-bit quantum logic gates such as CNOT gates, CR gates, iSWAP gates, toffoli gates, and the like. Quantum logic gates are typically represented using unitary matrices, which are not only in matrix form, but also an operation and transformation. The effect of a general quantum logic gate on a quantum state is calculated by multiplying the unitary matrix by the matrix corresponding to the right vector of the quantum state.
It will be appreciated by those skilled in the art that in classical computers, the basic unit of information is a bit, one bit having two states, 0 and 1, the most common physical implementation being to represent both states by the level of high and low. In quantum computing, the basic unit of information is a qubit, and one qubit also has two states of 0 and 1, which is marked as |0>And |1>But it can be in an overlapped state of two states of 0 and 1, and can be expressed asWherein a and b are represented by |0>State, |1>Complex numbers of state amplitudes (probability magnitudes), which are not possessed by classical bits. After measurement, the state of the qubit collapses to a definite state (eigenstate, here |0>State, |1>State), where collapse to |0>The probability of (a) is |a| 2 Collapse to |1>The probability of (2) is |b| 2 ,|a| 2 +|b| 2 =1,|>Is a dirac symbol.
Quantum states, i.e., states of qubits, generally require the use of a set of orthographically complete basis vector descriptions, the computational basis typically used for which is represented in binary in a quantum algorithm (or weighing subroutine). For example, a group of qubits q0, q1, q2, representing the 0 th, 1 st, and 2 nd qubits, ordered from high order to low order as q2q1q0, the quantum state of the group of qubits being 2 3 The superposition state of the computing groups, 8 computing groups refer to: i000>、|001>、|010>、|011>、|100>、|101>、|110>、|111>Each computation basis corresponds to a qubit, e.g., |000>In states, 000 corresponds to q2q1q0 from high to low. In short, a quantum state is an overlapped state composed of basis vectors, when the probability amplitude of other basis is 0, that is, at one of the determined basis vectors.
In quantum mechanics, all measurable mechanical quantities can be described by a hermite matrix, which is defined as the transposed conjugate of the matrix, i.e. the matrix itself, i.e. there is:such a matrix is commonly referred to as a measurement operator, and non-zero operators each have at least one eigenvalue λ other than 0 and its corresponding eigenvalue |ψ>Satisfy H|psi>=λ|ψ>If the eigenvalues of the operator H correspond to the energy levels of a certain system, such an operator may also be referred to as Hamiltonian.
From one state |ψ (t=0) according to the schrodinger equation>Start to evolve to another state |ψ (t=t)>Is done with unitary operators, i.e., U (0, t) |ψ (t=0)>=|ψ(t=T)>Wherein, the relationship between the hamiltonian and the unitary operator is that if a quantum state naturally evolves under a certain system, and describes the energy of the system, namely, the hamiltonian, the unitary operator can be written by the hamiltonian:
when the system starts from time 0, and HamiltonianWhen the amount does not change over time, the unitary operator, i.e., u=exp (-iHt). In quantum computing in a closed system, all quantum operations, except for measurements, can be described by a unitary matrix, which is defined as the transposed conjugate of the matrix, i.e., the inverse of the matrix, i.e., there is:in general, unitary operators are also known as quantum logic gates in quantum computing.
In a quantum-classical mixed graph neural model (QGNN), a graph node embedding layer in a classical graph neural network is replaced by a quantum circuit, so that node characteristics in molecular graph data are mapped into Gao Weixi Erbert space, and the characteristics of data parallel computation and quantum entanglement in the quantum circuit are utilized to improve the efficiency of characteristic extraction and data processing. The quantum-classical mixed algorithm is adopted, so that the number of training parameters can be reduced, and the complexity of a model is reduced.
For example, the characteristics of each node of the molecular map data can be firstly encoded into a quantum circuit, then the quantum circuit is utilized to extract the node characteristics, the obtained map data with new node characteristics is input into a convolution layer and a pooling layer of a classical map neural network to perform map characterization extraction, and a prediction result is output based on the characterization; then calculating a loss value of an output result by using a regression loss function, and optimizing model parameters according to the value, wherein the model parameters also comprise iterative optimization of parameters in a quantum circuit; the accuracy and stability of molecular prediction are improved by continuous iterative optimization of quantum-hybrid classical neural network models.
Referring to fig. 2, fig. 2 is a flow chart of a method for predicting molecular properties according to an embodiment of the present invention, which may include the following steps:
s201: obtaining molecules to be predicted, and determining graph data of the molecules to be predicted, wherein the graph data comprises node characteristic vectors and edge characteristic vectors of the molecules to be predicted.
Specifically, the molecule to be predicted may be regarded as modeling of a molecular structure that the user wants to obtain a result of a molecular property, including, for example, an atomic type, a chemical element bond, an atomic number, an atomic coordinate, a charge, and a spin severity, etc., constituting the chemical molecule.
According to the obtained molecules to be predicted, atoms of the molecules to be predicted are converted into nodes of graph data, and chemical bonds of the molecules to be predicted are converted into edges of the graph data, so that the graph data of the molecules to be predicted are obtained. Wherein, the node characteristic vector is a vector for characterizing the node (namely entity object) attribute, and the attribute is the characteristic for describing the nodes of the graph neural network. The graph neural network is a neural network directly acting on a graph, and graph data is a data structure composed of nodes and edges, wherein the nodes refer to physical objects, and the edges refer to relations among the nodes. Each node in the graph neural network updates the state of the node by exchanging information with each other based on the information propagation mechanism. In some embodiments, the graph neural network model may obtain a prediction result of a node based on a current state of each node.
S202: and constructing a target quantum circuit for feature vector optimization.
Specifically, constructing a target quantum circuit for feature vector optimization may include:
1. acquiring a group of quantum bits and setting the initial state of the quantum bits to be |0>;
2. constructing a first sub-quantum circuit for mapping the graph data of the molecules to be predicted to the quantum bit superposition state by using a first type quantum logic gate;
3. constructing a second sub-quantum circuit for optimizing the graph data of the molecules to be predicted by using a second type quantum logic gate;
4. constructing a measurement sub-line for extracting the characteristic vector of the optimized graph data of the molecules to be predicted;
5. and obtaining a target quantum circuit for feature vector optimization by using the first sub-quantum circuit, the second sub-quantum circuit and the measuring sub-circuit.
It should be noted that the first type quantum logic gate includes: hadamard quantum logic gates (H gates) and quantum rotating logic gates; the second type quantum logic gate includes: CNOT quantum logic gates and quantum rotating logic gates.
Wherein, utilizing the first sub-quantum circuit, the second sub-quantum circuit and the measurement sub-circuit, obtaining the target quantum circuit for feature vector optimization may include:
and combining the first sub-quantum circuit, the second sub-quantum circuit and the measuring sub-circuit in sequence to obtain a target quantum circuit, or combining the first sub-quantum circuit, a preset number of the second sub-quantum circuits and the measuring sub-circuit in sequence to obtain the target quantum circuit, wherein the preset number is an integer greater than or equal to 2.
Exemplary, referring to FIG. 3, FIG. 3 is a schematic diagram of a target quantum circuit according to an embodiment of the present invention, wherein 9 qubits are obtained and the initial states of all the qubits are set to |0>Respectively, qubits q0]-q[8]In the first sub-quantum circuit (solid line frame part of fig. 3), mainly the H gate and RY gate are used, and first the H gate is used to act on the initial state of the qubitOn, it is converted into the superimposed state +.>Classical graph node data x i =[a 0 、a 0 、…、a 7 、a 8 ]As a quantum gate parameter, the form RY (a j ) Where j=0, 1, …,7,8, respectively, are quantized mapped onto the qubits in the superimposed state. Two quantum gate operations are used in a layer of the second sub-quantum wire (dashed box portion of fig. 3): CNOT gate and RY gate. The CNOT gate has the main function of realizing quantum entanglement, and can exchange and transfer information among quantum bits. After the entanglement of multiple crossing qubits is realized, a parameterized RY (theta) gate is introduced into the line, optimization of the target quantum line can be realized by continuously iterating and optimizing the rotation angle parameter theta so as to learn more effective node feature coding, and the layer can be overlapped for multiple times according to the line structure and task requirements, so that the depth is increased to seek a better line model. The measuring output layer is the target quantumThe last layer of the line is used for decoherence of the quantum bit and conversion from quantum data to classical data.
S203: and converting the node characteristic vector and the edge characteristic vector of the molecule to be predicted into a high-dimensional characteristic vector by utilizing the target quantum circuit, and carrying out characteristic fusion on the high-dimensional characteristic vector to obtain a fusion characteristic vector of the molecule to be predicted.
Specifically, the converting the node feature vector and the edge feature vector of the molecule to be predicted into high-dimensional feature vectors by using the target quantum circuit may include:
operating and measuring the target quantum circuit to obtain a final quantum state of the target quantum circuit; the final quantum state is converted into a high-dimensional feature vector.
Illustratively, with a target quantum wire, first, each node of the map data of the molecule to be predicted is inputFeature encoding is carried out through a target quantum circuit (quantum variation circuit VQC) to obtain a node feature encoding vector +.>Where n is a single node feature number, for example, n=9 may be set, and then the obtained feature vectors are fused to generate a node coding feature matrix +.>With water molecules H 2 O is exemplified as that the molecule contains 3 atomic nodes and 2 edges (chemical bonds), and the molecular data can be converted into a molecule containing an edge characteristic vector E and a node characteristic vector +.>Is a graph of the graph data. Individual atomic node feature vectors in graph dataRespectively through VQCSign encoding, outputting new node feature encoding vector +.>Which are then spliced into new node features. In the encoding process, since the single-node feature number n=9 in the model, the quantum circuit is composed of 9 qubits, and the measured expected value of brix Z of each qubit is used as output, so that the feature code x 'of each node of the output is obtained' i Is a 9-dimensional vector.
S204: and inputting the fusion feature vector of the molecule to be predicted into a trained molecular property prediction model to obtain a prediction result of the molecular property to be predicted.
Specifically, after the fusion feature vector of the molecule to be predicted is obtained, the fusion feature vector of the molecule to be predicted can be input into a pre-trained molecular property prediction model to obtain a prediction result of the molecular property to be predicted. The molecular property prediction model may be obtained by training a machine learning model such as a neural network, and the embodiment is not specifically limited herein.
By way of example, the prediction of molecular properties may include: extracting the predicted molecular characteristics, constructing a characteristic vector and an adjacent matrix, converting a molecular image into a digital vector with atomic information, chemical bond information and molecular structure information, constructing an image convolution layer, inputting the obtained characteristic vector and the image adjacent matrix, and obtaining the characteristic vector after convolution; and constructing a pooling layer, pooling the feature vectors of the molecules, and extracting the feature vectors of the molecules. For example, the feature vector x 'after encoding each node may be' i Spliced together to form a node feature matrixThe adjacency matrix A shows the connection of each node with its surrounding nodes, and it is used as the input of the graph convolution layer together with the node characteristic matrix X. The graph convolution layer gathers and transmits node and side information through the feature matrix X and the adjacent matrix A, and finally, the characteristic learning of the node is realized. The dieThe model of a roll-up neural network consists of L layers of roll-ups, each layer generating a representation of the current layer of the central node by aggregating representations of the previous layers of neighboring nodes:
Z l+1 =A′X l W l ,X l+1 =σ(Z l+1 )
wherein,representing a representation of N nodes of a layer, and having X 0 =x, a' is a normalized and normalized adjacency matrix, ++>Is a weight matrix, i.e. the parameter to be trained. For simplicity, it can be assumed that the characterization dimensions of all layers are the same, i.e. F 1 =…=F L =f. The activation function sigma may be generally set according to the needs of the user.
Finally, after node characterization is obtained through multi-layer Graph rolling operation, graph Pooling (Graph Pooling), or Graph Readout, is required to be performed on the characterization of each node on the Graph to obtain a Graph characterization nodeFinally, based on the representation g of the graph, outputting a predicted value +.>
For the calculation of the loss, different loss functions can be selected according to the task types, and if the task is classified, the cross entropy loss function H (p, q) can be selected, and the calculation formula is as follows:
the probability distribution p (x) is a desired output, namely, a label of the data set, and the probability distribution is an actual output, namely, a probability value generated by the model according to input data. The smaller the cross entropy loss, the closer the probability distribution q (x) of the actual output is to the probability distribution p (x) of the desired output.
The regression task may be selected as a mean square error Loss function Loss, the calculation formula of which is as follows:
wherein y is i For data tag value, f θ (x i ) And outputting a value for the model. The closer the two values are to the loss value, the smaller the model performance is. For optimization of model parameters, adam gradient update algorithm with a learning rate of 0.001 may be selected.
Therefore, the method comprises the steps of firstly obtaining molecules to be predicted, determining graph data of the molecules to be predicted, constructing a target quantum circuit for optimizing feature vectors, converting node feature vectors and edge feature vectors of the molecules to be predicted into high-dimensional feature vectors by using the target quantum circuit, carrying out feature fusion on the high-dimensional feature vectors to obtain fusion feature vectors of the molecules to be predicted, inputting the fusion feature vectors of the molecules to be predicted into a trained molecular property prediction model to obtain a prediction result of molecular properties to be predicted, realizing prediction of the molecular properties by using quantum circuits, and improving calculation speed and calculation accuracy by using relevant characteristics of quanta.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an apparatus for predicting molecular properties according to an embodiment of the present invention, which corresponds to the flow shown in fig. 2, and may include:
the obtaining module 401 is configured to obtain a molecule to be predicted, and determine graph data of the molecule to be predicted, where the graph data includes a node feature vector and an edge feature vector of the molecule to be predicted;
a construction module 402, configured to construct a target quantum circuit for feature vector optimization;
the conversion module 403 is configured to convert the node feature vector and the edge feature vector of the molecule to be predicted into high-dimensional feature vectors by using the target quantum circuit, and perform feature fusion on the high-dimensional feature vectors to obtain fused feature vectors of the molecule to be predicted;
and an obtaining module 404, configured to input the fusion feature vector of the molecule to be predicted into a trained molecular property prediction model, and obtain a prediction result of the molecular property to be predicted.
Specifically, the obtaining module includes:
the obtaining unit is used for obtaining molecules to be predicted, converting atoms of the molecules to be predicted into nodes of graph data, and converting chemical bonds of the molecules to be predicted into edges of the graph data so as to obtain the graph data of the molecules to be predicted.
Specifically, the construction module includes:
an acquisition unit for acquiring a set of qubits and setting an initial state of the qubits to |0>;
the first construction unit is used for constructing a first sub-quantum circuit for mapping the graph data of the molecules to be predicted to the quantum bit superposition state by utilizing a first type of quantum logic gate;
the second construction unit is used for constructing a second sub-quantum circuit for optimizing the graph data of the molecules to be predicted by using a second type quantum logic gate;
a third construction unit for constructing a measurement sub-line for extracting a feature vector of the optimized map data of the molecule to be predicted;
and the combining unit is used for obtaining a target quantum circuit for feature vector optimization by using the first sub-quantum circuit, the second sub-quantum circuit and the measuring sub-circuit.
Specifically, the combination unit includes:
a first combining subunit, configured to combine the first sub-quantum circuit, the second sub-quantum circuit, and the measurement sub-circuit in order to obtain a target quantum circuit, or
And the second combination subunit is used for sequentially combining the first sub-quantum circuits, the preset number of the second sub-quantum circuits and the measurement sub-circuits to obtain a target quantum circuit, wherein the preset number is an integer greater than or equal to 2.
Specifically, the conversion module includes:
the operation unit is used for operating and measuring the target quantum circuit to obtain a final quantum state of the target quantum circuit;
and the conversion unit is used for converting the final quantum state into a high-dimensional characteristic vector.
Compared with the prior art, the method has the advantages that firstly, the molecules to be predicted are obtained, the graph data of the molecules to be predicted are determined, the target quantum circuit for optimizing the feature vector is constructed, the node feature vector and the edge feature vector of the molecules to be predicted are converted into the high-dimensional feature vector by utilizing the target quantum circuit, the high-dimensional feature vector is subjected to feature fusion to obtain the fusion feature vector of the molecules to be predicted, the fusion feature vector of the molecules to be predicted is input into a trained molecular property prediction model, the prediction result of the molecular property to be predicted is obtained, the prediction of the molecular property is realized through the quantum circuit, and the calculation speed and the calculation accuracy are improved by utilizing the relevant characteristics of quanta.
The embodiment of the invention also provides a storage medium in which a computer program is stored, wherein the computer program is configured to implement the steps of the method embodiment of any one of the above when run.
Specifically, in the present embodiment, the above-described storage medium may be configured to store a computer program for realizing the steps of:
s201: obtaining molecules to be predicted, and determining graph data of the molecules to be predicted, wherein the graph data comprises node feature vectors and edge feature vectors of the molecules to be predicted;
s202: constructing a target quantum circuit for feature vector optimization;
s203: converting the node characteristic vector and the edge characteristic vector of the molecule to be predicted into a high-dimensional characteristic vector by utilizing the target quantum circuit, and carrying out characteristic fusion on the high-dimensional characteristic vector to obtain a fusion characteristic vector of the molecule to be predicted;
s204: and inputting the fusion feature vector of the molecule to be predicted into a trained molecular property prediction model to obtain a prediction result of the molecular property to be predicted.
Specifically, in the present embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
An embodiment of the invention also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to implement the steps of the method embodiment of any of the above.
Specifically, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Specifically, in this embodiment, the above-mentioned processor may be configured to implement the following steps by a computer program:
s201: obtaining molecules to be predicted, and determining graph data of the molecules to be predicted, wherein the graph data comprises node feature vectors and edge feature vectors of the molecules to be predicted;
s202: constructing a target quantum circuit for feature vector optimization;
s203: converting the node characteristic vector and the edge characteristic vector of the molecule to be predicted into a high-dimensional characteristic vector by utilizing the target quantum circuit, and carrying out characteristic fusion on the high-dimensional characteristic vector to obtain a fusion characteristic vector of the molecule to be predicted;
s204: and inputting the fusion feature vector of the molecule to be predicted into a trained molecular property prediction model to obtain a prediction result of the molecular property to be predicted.
While the foregoing is directed to embodiments of the present invention, other and further embodiments of the invention may be devised without departing from the basic scope thereof, and the scope thereof is determined by the claims that follow.

Claims (10)

1. A method of predicting molecular properties, the method comprising:
obtaining molecules to be predicted, and determining graph data of the molecules to be predicted, wherein the graph data comprises node feature vectors and edge feature vectors of the molecules to be predicted;
constructing a target quantum circuit for feature vector optimization;
converting the node characteristic vector and the edge characteristic vector of the molecule to be predicted into a high-dimensional characteristic vector by utilizing the target quantum circuit, and carrying out characteristic fusion on the high-dimensional characteristic vector to obtain a fusion characteristic vector of the molecule to be predicted;
and inputting the fusion feature vector of the molecule to be predicted into a trained molecular property prediction model to obtain a prediction result of the molecular property to be predicted.
2. The method of claim 1, wherein the obtaining the molecule to be predicted and determining map data for the molecule to be predicted comprises:
obtaining a molecule to be predicted, converting atoms of the molecule to be predicted into nodes of graph data, and converting 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.
3. The method of claim 1, wherein said constructing a target quantum wire for eigenvector optimization comprises:
acquiring a group of quantum bits and setting the initial state of the quantum bits to be |0>;
constructing a first sub-quantum circuit for mapping the graph data of the molecules to be predicted to the quantum bit superposition state by using a first type quantum logic gate;
constructing a second sub-quantum circuit for optimizing the graph data of the molecules to be predicted by using a second type quantum logic gate;
constructing a measurement sub-line for extracting the characteristic vector of the optimized graph data of the molecules to be predicted;
and obtaining a target quantum circuit for feature vector optimization by using the first sub-quantum circuit, the second sub-quantum circuit and the measuring sub-circuit.
4. A method according to claim 3, wherein said obtaining a target quantum wire for feature vector optimization using said first sub-quantum wire, said second sub-quantum wire and said measurement sub-wire comprises:
combining the first sub-quantum circuit, the second sub-quantum circuit and the measuring sub-circuit in sequence to obtain a target quantum circuit, or
And combining the first sub-quantum circuits, a preset number of second sub-quantum circuits and the measuring sub-circuits in sequence to obtain a target quantum circuit, wherein the preset number is an integer greater than or equal to 2.
5. The method according to claim 3 or 4, wherein the first type of quantum logic gate comprises: hadamard quantum logic gates and quantum rotation logic gates;
the second type quantum logic gate includes: CNOT quantum logic gates and quantum rotating logic gates.
6. The method according to any one of claims 3 to 5, wherein the converting the node feature vector and the edge feature vector of the molecule to be predicted into high-dimensional feature vectors using the target quantum wire comprises:
operating and measuring the target quantum circuit to obtain a final quantum state of the target quantum circuit;
the final quantum state is converted into a high-dimensional feature vector.
7. An apparatus for predicting molecular properties, the apparatus comprising:
the device comprises an obtaining module, a prediction module and a prediction module, wherein the obtaining module is used for obtaining molecules to be predicted and determining graph data of the molecules to be predicted, and the graph data comprises node characteristic vectors and edge characteristic vectors of the molecules to be predicted;
the construction module is used for constructing a target quantum circuit for feature vector optimization;
the conversion module is used for converting the node characteristic vector and the edge characteristic vector of the molecules to be predicted into high-dimensional characteristic vectors by utilizing the target quantum circuit, and carrying out characteristic fusion on the high-dimensional characteristic vectors to obtain fusion characteristic vectors of the molecules to be predicted;
the obtaining module is used for inputting the fusion feature vector of the molecule to be predicted into a trained molecular property prediction model to obtain a prediction result of the molecular property to be predicted.
8. The apparatus of claim 7, wherein the obtaining module comprises:
the obtaining unit is used for obtaining molecules to be predicted, converting atoms of the molecules to be predicted into nodes of graph data, and converting chemical bonds of the molecules to be predicted into edges of the graph data so as to obtain the graph data of the molecules to be predicted.
9. A storage medium having a computer program stored therein, wherein the computer program is arranged to implement the method of any of claims 1 to 6 when run.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to implement the method of any of the claims 1 to 6.
CN202211220100.6A 2022-09-30 2022-09-30 Method and device for predicting molecular properties Pending CN117877611A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211220100.6A CN117877611A (en) 2022-09-30 2022-09-30 Method and device for predicting molecular properties

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211220100.6A CN117877611A (en) 2022-09-30 2022-09-30 Method and device for predicting molecular properties

Publications (1)

Publication Number Publication Date
CN117877611A true CN117877611A (en) 2024-04-12

Family

ID=90575963

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211220100.6A Pending CN117877611A (en) 2022-09-30 2022-09-30 Method and device for predicting molecular properties

Country Status (1)

Country Link
CN (1) CN117877611A (en)

Similar Documents

Publication Publication Date Title
CN113159239B (en) Method for processing graph data by quantum graph convolutional neural network
CN113850389B (en) Quantum circuit construction method and device
CN114821217B (en) Image recognition method and device based on quantum classical hybrid neural network
CN113222150B (en) Quantum state transformation method and device
CN114792378A (en) Quantum image identification method and device
CN116011682B (en) Meteorological data prediction method and device, storage medium and electronic device
CN115759413B (en) Meteorological prediction method and device, storage medium and electronic equipment
CN114358319B (en) Machine learning framework-based classification method and related device
CN115293254B (en) Classification method based on quantum multilayer perceptron and related equipment
CN117709415A (en) Quantum neural network model optimization method and device
CN116187548A (en) Photovoltaic power generation power prediction method and device, storage medium and electronic device
CN114358216B (en) Quantum clustering method based on machine learning framework and related device
CN113222153A (en) Quantum state simulation method and device, storage medium and electronic device
CN113222151B (en) Quantum state transformation method and device
CN116431807B (en) Text classification method and device, storage medium and electronic device
CN113222160B (en) Quantum state conversion method and device
CN116011681A (en) Meteorological data prediction method and device, storage medium and electronic device
CN116403657A (en) Drug response prediction method and device, storage medium and electronic device
CN114372539B (en) Machine learning framework-based classification method and related equipment
CN117877611A (en) Method and device for predicting molecular properties
CN117875370A (en) Task processing method and device utilizing molecular data
CN116306952B (en) Molecular property prediction method and device, storage medium and electronic device
CN116499466B (en) Intelligent navigation method and device, storage medium and electronic device
CN114764618B (en) Quantum preprocessing method and device for linear system
CN116167407B (en) Quantum circulation neural network-based data prediction method and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination