# Hybrid Quantum Neural Network Image Anti-Noise Classification Model Combined with Error Mitigation
## 3 Construction of Mixed Variational Quantum Neural Network and Error Mitigation Model
### Error Mitigation  
Our discussion utilizes the concepts outlined in [24]. In this work, the authors employ a generic detection-based error-mitigation strategy utilizing quantum autoencoders, presenting a novel protocol for quantum error correction. The method crucially relies on the identification of singular unitary operators capable of compressing quantum data from the entirety of the Hilbert space to a designated subspace, which is particularly effective when specific quantum datasets exhibit discernible underlying structures. The assumption is made that the Hilbert space and the supporting subspace \(\mathcal{S}\) share common underlying structures. For clarity, parameters \(X\equiv\dim\mathcal{H}\) and \(M\equiv\dim\mathcal{S}\) are defined. The subspace \(\mathcal{S}\) is presumed to have an orthogonal basis \(|S_{i}\rangle\), with the introduction of a latent subspace \(\mathcal{L}\) characterized by \(\dim\mathcal{L}=M\), defined by another orthogonal basis \(|L_{i}\rangle\). The encoding unitary operator \(U_{e}\) is introduced with flexibility, allowing it to be set as any unitary satisfying \(\langle L_{i}|U_{e}|S_{i}\rangle=1\). These elements collectively form a comprehensive framework for a quantum error-correction protocol utilizing autoencoders and singular unitary operators, offering insights into the challenges and strategies for effective error mitigation in quantum information processing systems. Using the unitary encoding \(U_{e}\) to manipulate the encoded and variational processed quantum state \(\widetilde{q}\), we denote the tilde as representing a noisy quantum state and the prime as indicating reduced errors. The compressed noisy quantum state \(\widetilde{q}_{c}\equiv U_{e}\widetilde{q}U_{e}^{\dagger}\) transforms into \((1-\epsilon)q_{c}+\epsilon L_{e}q^{error}U_{e}^{\dagger},\{M_{L}\}\) and \(\{M_{J}\}\) are projectors onto \(\mathcal{L}\) and orthogonal projectors, respectively. Considering the subspace of \(q_{c}\), we have  
\[M_{L}\widetilde{q}_{c}M_{L}^{\dagger}=(1-\epsilon)q_{c}+\epsilon L_{e}\Lambda_ {s}^{error}U_{e}^{\dagger} \tag{18}\]  
where \(\Lambda_{s}^{error}\equiv M_{S}q^{error}M_{S}^{\dagger}\), \(\Lambda_{s}^{error}\) to the supporting subspace \(\mathcal{S}\). When \(\epsilon\) is small, the states gather in the potential subspace \(\mathcal{L}\), and they become  
\[q^{\prime}_{c}=\frac{(1-\epsilon)q_{c}+\epsilon L_{e}\Lambda_{s}^{error}U_{e} ^{\dagger}}{1-\epsilon+\epsilon\text{tr}\left(\Lambda_{s}^{error}\right)}= \left[p_{s}+O\Big{(}\epsilon^{2}\Big{)}\right]+\left[\epsilon+O\Big{(} \epsilon^{2}\Big{)}\right]U_{e}\Lambda_{e}^{error}U_{e}^{\dagger} \tag{19}\]  
Here, \(\epsilon\) and \(tr(\Lambda_{s}^{error})\) determine higher-order terms. These states are projected into the garbage subspace with a low probability of \(1-p_{s}\). In such cases, errors are identified, and the corresponding quantum data are eliminated. Finally, the error-mitigated state is obtained by applying the decoding unitary \(U_{e}^{\dagger}\) to \(q^{\prime}_{c}\), where \(q^{\prime}\equiv U_{e}^{\dagger}q^{\prime}_{c}\). We use programmable circuits, as shown in the figure. Global entanglement unitary \(e^{-iH\tau}\) and a set of arbitrary single-qubit rotations exist in each layer (we set \(\tau=1\)), where  
\[H=\sum_{i=1}^{n}\sum_{\sigma=x,z}h_{i}^{\sigma}q_{ci}^{\sigma}+\sum_{i=1}^{n} \sum_{j\geq i}^{n}\sum_{\sigma=x,y,z}J_{ij}^{\sigma}q_{ci}^{\sigma}d_{cj}^{ \sigma} \tag{20}\]  
Here, \(h_{i}^{\sigma}\) and \(J_{ij}^{\sigma}\) are adjustable parameters necessitating iterative experimentation to identify the suitable dimension of the subspace \(\dim\mathcal{L}\) for compression. Notably, a shallow error-mitigation circuit with \(N_{ly}=1\) suffices, and increasing \(N_{ly}\) provides no additional benefit. Consequently, our approach involves training a single-layer shallow error-mitigation circuit to compress input states to the subspace. During compression, the last qubit is considered an \"auxiliary qubit,\" as it is not utilized for classification.