# Hybrid Quantum-Classical Deep Neural Networks Based Smart Contract Vulnerability Detection
## 3 Materials and Methods
### Hybrid Quantum-Classical Deep Neural Networks  
HQCDNN is a neural network architecture designed for binary classification problems, combining the advantages of both quantum and classical computing [67; 69]. In this architecture, the hidden layer consists of parameterized quantum circuits and Variational Quantum Circuits (VQCs), and these circuits act as \"quantum neurons\" [70]. Classical data are transformed into quantum states via amplitude coding, resulting in a unique quantum state for each input [71]. Compared to standalone VQC models, HQCDNNs offer higher accuracy and lower cost on simulated quantum hardware [67]. While qubit errors and noise from quantum gates in current quantum hardware pose significant constraints for purely quantum-based models, keeping the quantum circuits in the hidden layer relatively small in the HQCDNN architecture reduces the impact of this noise [20]. As a result, the quantum layer enables a more complex and compact representation of the data in the quantum domain [64]. On the other hand, the adoption of well-established learning methods such as extensive parameter optimization and backpropagation within the classical neural network (DNN) ensures a stable and efficient training process [70]. Thus, HQCDNNs combine the advantage of rich data representation obtained in the quantum layer with the scalability and computational power of the classical layer [69]. This hybrid approach allows for higher accuracy and lower computational cost, especially on low-dimensional datasets, compared to models that use only quantum circuits or purely classical methods [67]. However, as the data dimension increases, the growing number of qubits and quantum gates required for amplitude coding can make the model more susceptible to noise and optimization challenges [64]. Nonetheless, HQCDNNs mitigate some of these high-dimensional issues commonly faced by fully quantum-based models by leveraging classical layers [70]. The ability to use classical backpropagation algorithms for parameter updates also supports this process [69]. HQCDNNs make it possible to benefit from the unique advantages of quantum computing despite the limitations of current quantum hardware and to take advantage of the scalability and efficient learning approaches of deep neural networks DNNs [20]. By processing data interactively between quantum and classical layers, this architecture provides a high-performance learning process that is more resilient to hardware constraints [67]. Current research suggests that HQCDNNs could be adapted to more complex problems as quantum technology advances and that hybrid models may become a significant part of future quantum machine learning applications [71]. The HQCDNN model we propose in this study is shown in Figure 2. The transition between classical dense layers and quantum circuits is one of the most critical stages of hybrid classical-quantum models. This process involves the conversion of classical data into a form suitable for processing in quantum computing. The classical dense layer provides the preprocessing of classical data before it is input to the quantum circuit. In this layer, usually multidimensional classical data \(X_{i}=[X_{1},\,X_{2},\,\ldots,\,X_{n}]\) are reduced to dimensions that the quantum circuit can accept. For example, data consisting of n-dimensional features in a dataset are reduced to m dimensions in accordance with the number of qubits in the quantum circuit. Since 2 qubits are used in this study, the feature vectors are reduced to 2 dimensions. In order for a classical feature vector to be used in quantum computing, it must be represented in a Hilbert space, the Hilbert space in which quantum systems operate. Hilbert space is a high-dimensional space of complex vectors in which quantum states are mathematically described. Hilbert space is a vector space of complex numbers used to represent the states of quantum mechanical systems.