# Using a Deep Quantum Neural Network to Enhance the Fidelity of Quantum Convolutional Codes
## 4 Simulation and Analysis  
Assuming that all quantum gates are noisy quantum gates, we provide the simulation of the whole circuit in Figure 5.  
It can be seen through simulation that when the noise of the quantum gate is taken into account, the qubit error rate is greatly increased. As the SNR increases, in the case of a noisy quantum gate, the qubit error rate interval is \([23.44\%,0.45\%]\), and compared with the noiseless quantum gate, the qubit error rate interval is \([14.96\%,0.057\%]\).  
The results of training the first part of the quantum state are shown in Figure 6. Without the QNN, its fidelity is relatively discrete. After applying the QNN on the quantum state, the fidelity of the quantum state is very close to 1, indicating that it is very close to the desired target quantum state.  
Figure 4: The block method of the [6; 2; 2] quantum convolutional code.  
However, the training effect of the second part is relatively poor. It can be seen from Figure 7 that the fidelity is closer to 1 than before training, but it is still relatively discrete. By observing the quantum states of the two parts, it is not difficult to see that the quantum states of the second part have a higher degree of entanglement and are more complicated to train, so the fitting may be poor.  
We simulate the cost function of the two parts to observe the fit of the QNN in Figure 8.  
As shown in the figure, with the increase of training samples, the cost functions of both parts rise rapidly, but the trends are different. The cost function of the first part converges quickly, the rise is linear, and the final convergence value is very close to 1, so the training effect is better, and the fidelity close to 1 can be obtained when applied to the encoding quantum state. The second part of the cost function is more tortuous in ascending, probably because the data is more complex, it is difficult to select a suitable  
Figure 5: Simulation of the [6,2,2] quantum convolutional code with noisy quantum gates.  
Figure 6: The fidelity of quantum states before and after training the QNN on the quantum state of the first part.  
direction, and the convergence is slower. After fitting, it finally converges to 0.92, which is still some distance from 1. The fitting effect is not ideal, but still useful for improving the fidelity of the quantum state.  
After applying the QNN for all encoded quantum states, the trained encoded quantum states are used to enter the quantum noise channel. We simulate the final BER, and the result is shown in Figure 9.  
As shown in the figure, the final BER after QNN is intermediate between the case of noiseless quantum gates and the case of noisy quantum gates. Since the convergence of the second part of the QNN is not sufficient, the encoded quantum state cannot reach the noise-free criterion. In addition, the quantum gate at the receiver used to decode the encoded quantum state is also noisy. Since the received quantum information cannot be obtained at the receiver side without measurement, the QNN cannot be applied to optimize the decoding circuit at the receiver.  
Figure 8: The cost function for the QNNs of two parts.  
Figure 7: The fidelity of quantum states before and after training the QNN on the quantum state of the second part.  
In a word, the quantum neural network has a good correction effect on the encoding state of the quantum convolutional code. It can defend the noise of quantum gates by improving the fidelity of the encoded quantum state, which has a certain effect on reducing the BER.