We conducted experiments using five benchmark datasets related to drug discovery sourced from MoleculeNet17 and breast cancer cell lines18, namely BACE, Blood-Brain Barrier Penetration (BBBP), Side Effect Resource (SIDER), BCAP37 and T-47D. BACE is a database providing binding results for a set of inhibitors of human \(\:\beta\:\)-secretase 1 with 1522 compounds. BBBP includes 2053 molecules with prediction of the barrier permeability. SIDER contains marketed drugs and adverse drug reactions, categorized into system organ classes for 1427 approved drugs. BCAP37 and T-47D breast-associated cell lines contain 275 triple-negative breast cancer (TNBC) subtype molecules and 3135 Luminal A subtype molecules, respectively. For each molecule, we converted SMILES representations to ECFP molecular fingerprints19 using the RDKit chemoinformatics toolkit20, with a radius set to 6 and bits to 1024.
LSTM is a classic ML model which has been widely applied across various domains and industries due to its ability to effectively handle sequential data. The QLSTM model, the quantum counterpart of the LSTM model, replaces the classical neural networks in the LSTM cells with a Variable Quantum Circuit (VQC) (Fig. 1). The VQC consists of three main components: data encoding, variational layer and quantum measurement. The data encoding circuit transforms classical vectors into quantum states. The variational layer with circuit parameters is the actual learnable components, updated by gradient descent algorithms. Finally, quantum measurements are utilized to retrieve values for subsequent processing. The mathematical equation of the QLSTM model is defined as:
$$\:{f}_{t}=Sigmoid\left({VQC}_{1}\left({v}_{t}\right)\right)$$
1
$$\:{i}_{t}=Sigmoid\left({VQC}_{2}\left({v}_{t}\right)\right)$$
2
$$\:{\stackrel{\sim}{C}}_{t}=Tanh\left({VQC}_{3}\left({v}_{t}\right)\right)$$
3
$$\:{c}_{t}={f}_{t}*{c}_{t-1}+{i}_{t}*{\stackrel{\sim}{C}}_{t}$$
4
$$\:{o}_{t}=Sigmoid\left({VQC}_{4}\left({v}_{t}\right)\right)$$
5
$$\:{h}_{t}={VQC}_{4}({o}_{t}*tanh({c}_{t}\left)\right)$$
6
where \(\:Sigmoid\) and \(\:Tanh\) are the activation functions, \(\:{f}_{t}\) is the forget gate, \(\:{i}_{t}\) is the input gate, \(\:{o}_{t}\) is the output gate, \(\:{v}_{t}\) is a concatenation of the input at step t and the hidden state at step t-1 and \(\:{h}_{t}\) is the hidden state of QLSTM model.
To demonstrate the robustness of QLSTM model, all models including classical ones were trained using three different split seeds. The average validation accuracy across these splits was used to evaluate model performance. We selected Adam algorithm21 as the optimizer, and the learning rate ranged from 0.1 to 0.001. The batch size was set as 256, and the training epochs was 100.
We also conducted performance comparison on the QLSTM model with different level of added noise. In order to evaluate whether the QLSTM model with added noise was adapted to real NISQ devices, we used the following score function \(\:s\) to estimate the overall error rate of the QLSTM model22, 23 on real quantum computers. The score function \(\:s\) is defined as:
$$\:s=1-\prod\:_{j=1}^{d}{\left(1-{\left(\frac{\sum\:_{i}{E}_{{r}_{i}}{N}_{i}}{\sum\:_{i}{N}_{i}}\right)}_{j}\right)}^{{m}_{j}}$$
7
where \(\:{N}_{i}\) is the number of a quantum logic gate, \(\:{E}_{{r}_{i}}\) is the corresponding error rate of this type of gate, \(\:d\) is the depth of the quantum circuit, the last term, \(\:{\left(\frac{\sum\:_{i}{E}_{{r}_{i}}{N}_{i}}{\sum\:_{i}{N}_{i}}\right)}_{j}\) is the average error rate in the \(\:j\)th layer, and \(\:{m}_{j}\) is the number of gate at circuit layer \(\:j\).
All experiments were performed on an NVIDIA A100 GPU on a 64-bit CentOS v8.5 server with 512 GB of RAM. The source code was written by Pytorch, using Torch Quantum as a quantum simulator. Our models have not yet been implemented on quantum hardware, but our proposed models and circuits are designed to be easily adaptable to NISQ devices. Due to equipment limitations, the number of qubits used for the QLSTM model comparisons are 2, 4, 8, and 12.
Table 1
The performance of the QLSTM and LSTM models was evaluated on the BACE, BBBP, SIDER, BCAP37, and T-47D datasets with 2, 4, 8, and 12 qubits.
| BACE | BBBP | SIDER | BCAP37 | T-47D |
| quantum | classical | quantum | classical | quantum | classical | quantum | classical | quantum | classical |
2 | 0.819 | 0.828 | 0.790 | 0.829 | 0.618 | 0.654 | 0.760 | 0.751 | 0.735 | 0.714 |
4 | 0.831 | 0.827 | 0.828 | 0.832 | 0.645 | 0.656 | 0.774 | 0.723 | 0.775 | 0.780 |
8 | 0.827 | 0.817 | 0.829 | 0.838 | 0.684 | 0.659 | 0.774 | 0.712 | 0.787 | 0.783 |
12 | 0.842 | 0.838 | 0.843 | 0.848 | 0.693 | 0.680 | 0.806 | 0.727 | 0.789 | 0.786 |