Virtual screening with quantum computing! #Quantum_computing #chemoinformatics #memorandum

Quantum computing is one of the hot area in these days. Now google reported exciting article to nature.

Quantum computing reach is also very useful for drug discovery. Some days ago I found interesting article published by researcher in 1QBit, Univ. Drive, Accenture Labs and Biogen. URL is below.
A Quantum-Inspired Method for Three-Dimensional Ligand-Based Virtual Screening

The authors used quantum computer for Ligand Based Virtual Screening(LBVS). Their strategy is below.

Made molecular graph which like pharmacophore representation of molecule. And the search maximum common sub graph(MCS) with quantum computing.

Find MCS problem is NP hard. So it requires huge computational cost. But they solved the issue with quantum annealar.

To find the MCS, they used conflict graph. I’m not familiar the concept but regarding the publication, the graph made from two molecular graphs.

From the fig3 in the article. (Pls check original article because I can’t share figure)

Construction of the conflict graph G c from two given graphs G 1 and G 2 . A vertex (v 1 , v a ) is added to G c because at least one of the labels in the set of labels associated with v 1 from G 1 (3 v 1 ), and v a from G 2 (3 v a ) match. In this case, the set of labels match exactly so we designate the new vertex (v 1 , v a ) as an exact match. The rest of the vertices in the conflict graph are added in the same way. Edges are added according to two
conditions: bijective mapping and distance violations. Bijective mapping is violated if one of the nodes has been matched twice (represented by a red edge). Distance violation aims to incorporate 3D molecular information (represented by a green edge). An edge between two vertices (e.g.,
between (v 1 , v b ) and (v 2 , v c )) is added if the Euclidean distance between v 1 and v 2 is not comparable to the Euclidean distance between v b and v c .
Formally, an edge is added if |d(v 1 , v 2 ) − d(v b , v c )| > ε (ε = 0.4 in this example).

Regarding the concept described above, less edge graph is preferred for maximum common substructure.

And by using the method, graph based approach outperformed Morgan finger print based LBVS against several targets.

It indicates that quantum computer is useful for drug discovery.

Unfortunately the calculation performance of quantum computation is not described in this article.
I would like to know comparison between current traditional computation and quantum computation.

Make quantum accumulator #quantum computing #qiskit

It’s not related to today’s topic but I’m sick with back pain. I hope I will get well soon..

Somedays ago I wrote post about qiskit. I think qiskit is very interesting package for quantum computing. And I stared to learn qiskit and quantum computer.

One of the interesting point of quantum computer is that it uses qubit instead of bit and the qubit can have an entangle state which means 0 or 1.

Today I made very simple quantum accumulator with qiskit.

Following code uses 4 qubit and 4 classical register.
Classical register used for results measurement.
And 4 kinds of gates.
Pauli X gate: x, this gate change |0> to |1>
hadamard gate: h, this gate generates entangle state |0> => 1/sq(2) [|0> + |1>]
control not gate: cx, this gate is same as NOT gate of classical computer
And gate: ccx, this gate is same ans AND gate.

Image of quantum circuit for 1 + 0 is below. First two qubits are used for input and third and forth qubits are used for output.

The code is below.

 
%matplotlib inline
import numpy as np
from qiskit import QuantumCircuit
from qiskit import QuantumRegister
from qiskit import execute
from qiskit import BasicAer
from qiskit import ClassicalRegister
from qiskit.visualization import plot_histogram
# I used simulator instead of real quantum computer
backend_sim = BasicAer.get_backend('qasm_simulator')

# 1 + 0 = 1
# Made 4 qubits and 4 classical bits
q = QuantumRegister(4)
c = ClassicalRegister(4)

# make quantum circuit object and add gates.
qc = QuantumCircuit(q,c)
qc.x(q[0])
qc.ccx(q[0],q[1],q[2])
qc.cx(q[0],q[3])
qc.cx(q[1],q[3])
qc.barrier(q)
qc.measure(q[3],c[0])
qc.measure(q[2],c[1])
qc.measure(q[1],c[2])
qc.measure(q[0],c[3])
qc.draw(output='mpl') # draw the circuit above.

OK let’s run the calculation.

 
# shots means number of trials because results of quantum computing depends on probability.
 
job = execute(qc, backend_sim, shots=80)
result = job.result()
plot_histogram(result.get_counts(qc))

1001 meants qubit1(1) + qubit(0) = 01 with 100% probability! It seems work well.

Next, how about 1 + 1? I added additional Pauli X gate to q[1].

 
# 1 + 1 = 2
q = QuantumRegister(4)
c = ClassicalRegister(4)
c = ClassicalRegister(4)

qc = QuantumCircuit(q,c)
qc.x(q[0])
qc.x(q[1])
qc.ccx(q[0],q[1],q[2]) # and gate count up when q[0] and q[1] is 1
qc.cx(q[0],q[3])
qc.cx(q[1],q[3])
qc.barrier(q)
qc.measure(q[3],c[0])
qc.measure(q[2],c[1])
qc.measure(q[1],c[2])
qc.measure(q[0],c[3])
qc.draw(output='mpl')

The results 1110 with 100% probability. It means qubit(1) + qubit(1) = 10, Binary 10 means 2 in decimal.

At last, write code with entangle state.

 
# 0/1 + 0/1 = 0, 1, 2
q = QuantumRegister(4)
c = ClassicalRegister(4)
c = ClassicalRegister(4)

qc = QuantumCircuit(q,c)
#qc.x(q[0])
#qc.x(q[1])
qc.h(q[0])
qc.h(q[1])
qc.ccx(q[0],q[1],q[2])
qc.cx(q[0],q[3])
qc.cx(q[1],q[3])
qc.barrier(q)
qc.measure(q[3],c[0])
qc.measure(q[2],c[1])
qc.measure(q[1],c[2])
qc.measure(q[0],c[3])
qc.draw(output='mpl')
 
job = execute(qc, backend_sim, shots=80)
result = job.result()
plot_histogram(result.get_counts(qc))

Result showed four state with almost same probability (25%).

0 + 0 = 0, 0 + 1 = 1, 1+0=1, 1+1 = 10(2)

I got more unbalanced data when I run code with low shots.

It is difficult for me to make the quantum circuit for complicated problem.

But technology goes very fast. Quantum computer is used for drug discovery in the feature. So I need to keep my eyes open.

Today’s code is uploaded following URL.

https://nbviewer.jupyter.org/github/iwatobipen/quantum_computing/blob/master/basics_sum.ipynb

Quantum annealing for QSAR!

In the chemoinformatics area, it is important to describe molecular similarity. Merit of fingerprint bit vector based similarity calculation is speed I think. But sometime ECFP4 or any other related methods do not sense of chemst feeling. By the way graph based similarity like a MCS is useful but calculation cost is high. You know, gWT ( graph indexing wavelet tree ) works very first for similarity search.
https://code.google.com/archive/p/gwt/
And also new version of RDKit implemented Atom-Atom Path based similarity algorithm. I’ll introduce the FP soon…

Recently I found very attractive report.

A Novel Graph-based Approach for Determining Molecular Similarity
https://arxiv.org/pdf/1601.06693v1.pdf

First author is researcher of 1QBit. 1QBit developer tools and end-to-end expertise in quantum software are built to solve the world’s most demanding computational challenges( from HP ).
http://1qbit.com/
;-) The article solve the molecular similarity based prediction used “D-Wave systems“.
D-wave system is the quantum computer based on quantum annealing (QA). QA is a metaheuristic for finding global minimum of given objective function by a process using quantum fluctuations.

They represent molecule as graph. The graph has many information, i.e. kind of atoms, bonds, formal charge, position, geometrical center of ring. In the article, the author did not describe the details of the way to molecule to graph.

Finally, they performed case study “prediction of mutagenicity”. And they compared with graph similarity based method and MACCS fingerprint based method. And graph based method showed good performance.
The results was very exiting for me. Because the result indicated that QA is useful for chemoinformatics.
I want to learn about QA more and more.
Keep watching QA!