# Using a Deep Quantum Neural Network to Enhance the Fidelity of Quantum Convolutional Codes
## 3 Methods  
When we encode quantum states with quantum gates, the quantum gates themselves introduce noise. Quantum gates have been shown to be fault-tolerant in quantum coding. However, considering that the subsequent encoding will pass through a noisy channel, the impact of quantum gates cannot be ignored. After we encode the quantum states with the quantum convolutional code, the fidelity of the encoded quantum states needs to be improved before entering the quantum channel due to the presence of noise in the quantum gates themselves and the fact that the quantum states involved in the encoding do not necessarily have a high purity. The QNN can then play its role. We chose the \([6,2,2]\) quantum convolutional codes. The generator matrix is as follows:  
\[\mathbf{M}=\left( \begin{array}{cccc|cccccc}1&0&0&1&0&0&0&1&1&0&0&0\\ 0&1&1&0&0&0&1&1&1&1&0&0\\ D&0&0&1&0&0&0&0&0&1&1\\ 0&0&0&0&1&1&D&0&0&1&1\end{array} \right) \tag{13}\]  
The corresponding quantum circuit is shown in Figure 3.  
As shown in Figure 3, \(\ket{\delta_{i}}\) refers to the target quantum bit that needs to be encoded. The ratio of the number of input auxiliary qubits to the number of target qubits is 2:1. The output 6-bit quantum state is controlled by 4 qubits at the current moment and 2 qubits in the previous coding module, so that the goal of associating the input information from different moments before and after together is achieved, and the noise affected by the coding states at different moments is no longer independent and more conducive to decoding. Moreover, each 2 target qubits are in fact controlled by 6 qubits at the same time, but the ratio of the number of auxiliary qubits to the number of encoding qubits is 2:1, which also saves some resources and achieves higher bit rates. In order to reduce the effect caused by the noise of quantum gates, the encoded quantum state is trained with a quantum neural network (QNN). When encoding the target quantum state, the quantum state information is known, so the fidelity of the encoded quantum state information is also known before entering the quantum channel, and it can be improved by the quantum neural network. Firstly, according to the encoding circuit, we can derive the four encoded states corresponding to the four inputs, \(|00\rangle,|01\rangle,|10\rangle,|11\rangle\), respectively, and train them with a certain volume of sample set to get the QNN for different coding states. The trained QNN is then applied to the noisy coding quantum states to obtain the high-fidelity encoded quantum states. The complexity of the QNN increases exponentially with the increase in the number of qubits. To reduce the complexity and training difficulty of the QNN, we can perform block processing on the quantum convolutional code circuit, and only train 4 qubits once. The block method is as shown in Figure 4.  
For each 6-bit quantum state, it is divided into two parts for the QNN training. As shown in Figure 4, the input of the 4-bit quantum state in the first part is \(|0000\rangle\), and the first 4 qubits of the encoded state are obtained after passing through the encoding circuit, which is not affected by the input information, so 4 different input quantum states can all use the same QNN. The 4-bit quantum state in the second part is encoded by \(|00\rangle\) through the quantum gate operation, and then the input quantum state is controlled for encoding. Therefore, 4 different QNNs are required to be trained for 4 input quantum states. Figure 3: The encoding circuit of the [6; 2; 2] quantum convolutional code. Take the input quantum state \(|00\rangle\) as an example. We construct two QNNs with the expectation that the quantum states are trained to the standard quantum states after noiseless quantum gates.