# Hybrid Quantum-Classical Deep Neural Networks Based Smart Contract Vulnerability Detection
## 3 Materials and Methods
### Quantum Artificial Neural Networks  
In classical neural networks, input data are usually processed in numerical form and with a given distribution. As these data pass through the neural network layers, each neuron is multiplied by weights and subjected to a non-linear activation function. However, in QNNs, this process follows a different structure. QNNs work with quantum gates and qubits [58].  
While in classical neural networks, data are processed with neurons and weights, in QNNs, these operations are performed through quantum gates. Qubits are processed within quantum gates, which serve as the fundamental building blocks of quantum circuits. These gates are mathematically represented by matrices and play a crucial role in quantum computing operations. In particular, superposition and entanglement allow for much more complex computations compared to the limitations of classical neural networks [59].  
The superposition property of qubits allows to process multiple possibilities simultaneously. This replaces the sequential computation processes in classical networks with parallel computation processes. This enables faster processing of more complex datasets and problems [60].  
\[\mid\psi\rangle=\alpha\mid 0\rangle+\beta\mid\rangle 1 \tag{1}\]  
Mathematically, a qubit state is expressed as in Formula (1). \(\alpha\) and \(\beta\) are complex number amplitudes and satisfy the condition \(\mid\alpha\mid^{2}+\mid\beta\mid^{2}=1\). Since the information that is represented as 0 or 1 in a classical system is represented by probability amplitudes at the quantum level, quantum computers can have the advantage of \"parallel computing\" for certain problems [61].  
The entanglement property of qubits provides a great advantage for QNNs. While in classical neural networks, data are processed between independent neurons, in QNNs, entanglement creates a strong dependency between qubits. A change made in one qubit can affect other qubits. This helps to more deeply understand and process the relationships between data [62].  
QNNs combine the basic principles of quantum mechanics with artificial neural network models to target high performance in specific problem classes [52]. The effectiveness of this approach relies on the premise that the high-dimensional and complex structures of classical data (e.g., images, text, or sensor data) can be represented more efficiently in quantum circuits [63]. Unfortunately, the data encoding process called \"feature mapping\" or \"data embedding\" becomes a significant cost factor as the data size increases, limiting the scalability of applications [64]. Moreover, repeating the readout process for each data sample in QNN models increases the training cost by requiring the system to be re-prepared due to the \"collapse\" of the quantum state after the readout [65].  
These problems are particularly pronounced in the so-called NISQ era, where current quantum computers are limited to noisy processors at the 50- to several-hundred-qubit level [66]. Due to their limited qubit capacity and high noise ratios, NISQ devices face serious limitations in both data encoding and error correction approaches [67]. Moreover, handling extensive datasets during QNN training increases the risk of encountering low-gradient regions, known as \"barren plateaus\", which further complicates the learning process [68]. On the other hand, the interface between classical computers and quantum processors (e.g., data preprocessing, output conversion to classical format) also increases the time and resource cost, limiting the large-scale use of QNN models.