# Convolutional-Neural-Network-Based Hexagonal Quantum Error Correction Decoder
## 4 Simulation and Analysis  
We used a CNN network to generate a prediction model for the heavy hexagonal code error correction. To ensure the boundary and periodicity of the grid after each convolution step, regular padding was performed in our CNN model [47]. The random error rate was represented by the physical qubit error rate and calculated from the syndrome via sampling. We provided the obtained heavy hexagonal code threshold along with a performance analysis for different code distances during training of our convolutional neural network. Furthermore, we analyzed the impact of different network layers' efficiency and accuracy on decoding threshold. Our results showed that the functional properties of different layers within the CNN model can significantly affect the decoding threshold. For example, models with more convolutional layers and filters exhibited better decoding accuracy than those with fewer layers and filters. However, increasing network depth also led to longer training times and greater computational requirements. In the beginning, we decoded the heavy hexagonal code with distances of three, five, and seven using the MWPM algorithm and convolutional neural networks. Figure 5 shows a schematic of the logical error rate under the MWPM algorithm decoder. From the graph, it can be seen that the logical error rate increases rapidly with the increasing physical error rate and reaches the decoding threshold at 0.0040, where noise interference on quantum bits can be suppressed. After surpassing the threshold, the increase in logical error rate slows down. The threshold for the CNN-based decoding is shown in Figure 6. It can be observed from the graph that under the same code distance, the decoding threshold based on the CNN can reach 0.0057. Under the CNN model, the logical error rate generally shows a slow upward trend. Compared with the MWPM algorithm, the decoding threshold has been improved to some extent, but the threshold strength still needs to be further increased. Increasing the code distance to nine is an effective way to improve the error correction capability of the heavy hexagonal code. In this study, we increased the code distance from three, five, and seven to nine and further compared the threshold results of the two different decoders. As shown in Figure 7, as the code distance increases, the logical error rate rises significantly, and the decoding threshold of the MWPM algorithm increases to 0.0045. Above this threshold, the rising trend of the logical error rate is almost the same for different code distances. However, the training time and dataset size grow exponentially due to the increase in code distance. Therefore, we used the RestNet14 network to predict the correction model [48; 49; 50]. As shown in Figure 8, using a CNN-based  
Figure 4: Comparison of the accuracy simulation results of RestNet7 (marked by orange diamonds) and RestNet14 (marked by blue triangles) network training iterations. decoding solution can reduce the logical error rate by 0.005. Specifically, when the code distance of the weighted hexagonal code is nine, the decoding threshold based on the CNN network reaches 0.0065, which is very close to the optimal threshold. This indicates that the heavy hexagonal code decoder based on machine learning technology can improve its error correction capability to some extent and performs better than the traditional MWPM decoding algorithm. Although limited by the training time and dataset size, the use of machine learning technology is still an effective method worth exploring. Figure 5: The figure shows the variation in the logic error rate of the MWPM decoder for the heavy hexagonal code at code distances of 3 (marked with green squares), 5 (marked with orange triangles), and 7 (marked with blue circles). The threshold is indicated as 0.0040. Figure 6: The figure displays the variation in the logic error rate of the CNN decoder for the heavy hexagonal code at different code distances. The threshold is indicated as 0.0057.