Abstract

Solving for quantum error correction remains one of the key challenges of quantum computing. Traditional decoding methods are limited by computing power and data scale, which restrict the decoding efficiency of color codes. There are many decoding methods that have been suggested to solve this problem. Machine learning is considered one of the most suitable solutions for decoding task of color code. We project the color code onto the surface code, use the deep Q network to iteratively train the decoding process of the color code and obtain the relationship between the inversion error rate and the logical error rate of the trained model and the performance of error correction. Our results show that through unsupervised learning, when iterative training is at least 300 times, a self-trained model can improve the error correction accuracy to 96.5%, and the error correction speed is about 13.8% higher than that of the traditional algorithm. We numerically show that our decoding method can achieve a fast prediction speed after training and a better error correction threshold.

1. Introduction

Color code is a kind of quantum error correction topological coding. As an important part of quantum computing, error correction provides the guarantee of quantum information transmission for the new theory in the field of quantum information [13] and quantum computing [47]. To ensure that the information of the quantum state will not change after transmission or can still be corrected after error, we must find a fast and accurate method of error correction qubits to protect the quantum information from irresistible external interference and ensure that the information transmission can be completed within the decoherence time. Studying the efficiency and algorithm of quantum error correction coding is an important topic in the field of quantum error correction, and it is a difficult problem that must be solved in the construction of quantum computer.

Based on the achievements and experience in the field of traditional communication, Shor [8] proposed a quantum error correction scheme in 1994 to reduce the decoherence of qubits during storage. Nine qubits were successfully used to encode one logic bit. However, Shor’s structure is not convenient to expand, and it is difficult to find a structure to protect a specified number of qubits. Most of the current quantum error correction schemes focus on a coding scheme called stabilizer code proposed by Gottesman [9]. The stabilizer composed of Pauli matrix can encode and detect errors more quickly. The topological stabilizer code [10, 11] is an error correction code based on the stabilizer code, which can be mapped to the geometric model. In terms of decoding, the topological stabilizer code can combine its topological structure with the mapped geometry to construct a variety of decoding methods. The surface code proposed by Mariantoni [12] belongs to topological coding. Another widely concerned topological code is the color code [1316], which allows the horizontal implementation of the whole Clifford gate group, and it can expand from 2D to higher dimensions [17]. At present, one of the research focuses of quantum error correction is how to decode quickly and stably.

For color codes, Sarvepalli proposed an alternating iterative error correction method [18], with an error threshold of 7.8%. Because the algorithm is recursive, the decoding speed is not optimal. Recently, machine learning has been paid attention to by various disciplines [1922], in which deep learning has been applied to various experiments. Machine learning is also widely used in quantum error correction. Machine learning can be used to build decoder frameworks, and deep learning can decode surface codes. In addition, machine learning can also be used to calculate error correction thresholds in quantum error correction [2325]. The decoding step of topological code makes it very suitable for machine learning training. Then, the trained model can be decoded quickly, which is more efficient and accurate than the traditional method.

At present, part of the research on the decoding of quantum topological error correction codes focuses on the decoding of surface codes, and there are few decoding methods for color codes, especially combined with machine learning. This paper first introduces the basic knowledge of quantum error correction code and then analyzes the principle of quantum topological code and error correction mechanism. Then, we propose a decoding method combining projection color code algorithm and deep learning. Our method uses neural network decoder to decode the color code on the surface code. Compared with other color code decoding methods, the decoder proposed in this paper not only completes the corresponding decoding tasks but also significantly improves the decoding performance.

2. Background

Stabilizer code is the core of many quantum fault-tolerant computing schemes. It depends on Pauli group, which is one-dimensional.

It consists of four Pauli operators, and the n-order Pauli group is defined as the tensor product of N one-dimensional Pauli operators.

Commutative operators are usually used as stabilizers because they have common eigenstates.

Topological stabilizer code is a kind of stabilizer code with geometric local generators and undetectable errors with topological properties. The number of qubits supported by the stabilizer of topological stabilizer coding and the number of stabilizer itself are bounded. The topological stabilizer code in geometry is shown in Figure 1.

Surface code is a kind of topological code defined in two-dimensional physical qubits and is shown in Figure 2. Each physical qubit relates to four measured qubits, and each logical qubit is connected with four physical qubits.

On the boundary, the measurement qubits are only connected with three physical qubits, while the data qubits contact two or three measurement qubits. Lines a and b in the graph are called string operators, and string operators have specific generation rules [12].

Color code is also a kind of topological code. Compared with surface code, it uses three colors of faces. Each face has X and Z stabilizers and vertex is trivalent. This structure provides a lot of convenience for the detection and correction of color codes. The three colors used are just to distinguish different faces. Useto represent a d-dimensional color code defined on the lattice and its colorable surfaces are d + 1. The color code is shown in Figure 3. The generation rules of the string operator of color code and surface code are the same.

3. Constructing Color Code Decoding Scheme with Machine Learning

3.1. Decoding Method of Stabilizer Codes

Use 3-qubit encoding one-logic bit as an example to explain the decoding process.

Decoding process.(1)Suppose the stabilizer s is in .(2)The subspace of the stabilizer is , , .(3)Select the stabilizer and eigenstate as , and then we get the following equations: .(4)Calculate the stabilizer and analyze the results. If , qubit 1 or 2 has bit-flip error; if , qubit 2 or 3 has bit-flip error. Use the stabilizer and eigenstate to detect phase reversal error.(5)According to the error detection results, the corresponding quantum bits are corrected to restore the information of logical bit.

3.2. Neural Network Decoding Method of Color Code

Q-learning [26] is an optimization algorithm based on value expectation in reinforcement learning algorithm. is transfer function , which represents the value expectation obtained by taking action in state at a certain time. State s corresponds to the state of the stabilizer in topological coding, and action is the correction operator corresponding to .

Find out the next action according to the transfer rules.where represent the current state and action and represent the next state and action. We build a matrix to store the values of all states and actions.

Since the vertices of the [6]-color code are trivalent and each face has and stabilizers, the eigenvalue of the three adjacent stabilizers of the wrong qubit will be −1. This information can then be used for error correction. It is shown in Figure 4. There are many ways to add correctors, and we can use QNN to solve the best decoding method.

Color code can be projected onto the plane code for error correction [27], and this projection supports all decoding algorithms of the surface code. So, the error correction method of the plane code can be extended to the color code. Projection will map the stabilizer and error of color code to the surface code. This projection has a similar projection method for 3D color code [28].

The projection rule is denoted by the chain complexes in topology. Let be a d-dimensional lattice.where and is the projection of chain complex of K-type color code on and K-type surface code on . is boundary application of complex. Let prove transformation of (5).where is qubit. For arbitrary , all -simplices contained in C are -simplices.

So, we get

The geometric representation of projection is shown in Figure 5.

Decoding requires each of the three colors to be cast once, so that there are three kinds of subfaces generated by the color code. If the errors of the three faces are extracted in the color code, respectively, the projection of the final error on the surface code can be obtained.

3.2.1. Constructing Neural Network Training Model

After projecting the color code onto the surface code, we will build a neural network decoder to find the optimal string operator through reinforcement learning. The input layer is a matrix. According to the translational symmetry of topological coding, any qubit can be placed in the center of the matrix. The output layer is the Q value that performs different actions. The hidden layer consists of a convolution layer and some fully connected layers. After continuously traversing all defects using the network, update the matrix.

It is difficult to store complete values in a large state space, so we choose to use deep network [29] to approximate learning. Figure 6 shows the structure of the deep Q network .

Errors in coding are a collection of errors accumulated by random phase reversal and bit reversal over a period of time.

3.2.2. Decoding Process after Projection

Based on the periodic boundary condition (PBC) of topological coding, we use any faulty stabilizer as the center to represent the whole state. Choose one error as the center and other errors in its relative position. As shown in Figure 7, a set of stabilizer states can be represented in many ways, and the two observations in Figure 7 contain the same information.

When the corresponding value is obtained, the next action is determined by the algorithm, and the new corrected result is used as input again until there is no error.

3.3. Color Code Optimized Decoding Algorithm

The training starts with a random action and sends the stabilizer state to the program. The program uses the network with parameters to generate new and and uses greedy strategy to select action. controls the degree of randomness. When the random number is greater than , it selects the previous optimal action; otherwise, it selects a new action. The value of will decrease as the number of iterations increases, which can traverse all pairs to improve the accuracy of selection. The objective function iswhere is the next observation before acts on and is value before execution . The objective network is

’s updating formula iswhere is updated network parameter. is the last network parameter and is the last time network parameters.

Because the states are not independent, we extract some tuples as a unit and put them into the buffer for training to ensure that different units are independent and identically distributed. The pseudo-code description of the program is given in Algorithm 1.

(1) color code projection to surface code
(2) While defects exist do
(3)  from to get the observation of
(4)  greedy strategy selects the action corresponding to the error
(5)  perform action on
(6)  calculate the value of performing action on
(7)  obtain the observation results after the action is executed
(8)  save the tuple
(9)  update deep neural network
(10) end while
(11) each random draw tuple
(12)  calculate the objective function
(13) end for
(14) update network parameters

4. Simulation and Analysis

First, randomly build a dataset with a turnover error rate of 16% to 23%. The dataset is divided into fixed size and sent to the program for training. The results of each processing of coding errors are sent to the program as feedback for operation until all errors are corrected, and then a round of training is completed.

In the error correction process, we do not need to consider external factors, so the depolarized noise model can be selected as an ideal equi-probability model. In addition, other non-noise factors will also affect the success rate of code error correction, but it can be ignored here. If you want to further optimize the training results, you can use normalization or normalization to limit the cost decision of Q network.

4.1. Error Correction Success Rate under Bit-Flip Error

The program uses a 7-layer residual network (ResNet). In order to avoid the problem of too slow training speed caused by too fast gradient decline, ReLU function is used to assist in the training process. For systems with Hamming distance , the results of error correction success rate after program training under bit reversal error are shown in Figure 8.

When the flip error rate is lower than 17.4%, the error correction success rate of different code distances is very close. At a lower error rate, the error correction success rate of the three Hamming distances is very high. When the error rate increases by 1%, the error correction success rate decreases by about 20%. When the turnover error rate is between 17.4% and 19.6%, the error correction success rate is the highest when , and then when the error rate is between 19.6% and 20.3%, the error correction success rate when is higher than that when . After the error rate reaches 20.3%, the error correction success rate under the three Hamming distances tends to be stable. Because with the increase of flip error rate, the error correction success rate of hamming distance will also raise. When the Hamming distance increases, the error correction threshold will also decrease, and the error correction success rate will decrease. Therefore, the error correction code with lower Hamming distance will obtain higher error correction success rate. It is observed that when the error rate reaches 22.1%, the error correction success rate of the error correction code with decreases significantly compared with the error correction code with other Hamming distances, which indicates that there will be wrong judgment in the actual error correction application of the trained network, which may lead to the greedy strategy choosing the wrong action.

4.2. Logical Error Rate under Bit-Flip Error

Different Hamming distance codes have different logic error rates under certain flipping error rates. This is because when the Hamming distance is large, the error caused by bit flipping may become another correct code in the coding table or become an error that cannot be corrected, thus changing its own logic information. Figure 9 shows the change of the logic error rate at a high flip-error rate.

When d = 5, the logic error rate is the lowest among the three Hamming distances. When the turnover error rate is 16.0%, the logic error rate of the minimum Hamming distance in the simulation is about 6.2% lower than the maximum. Among them, the size of logical error rate also corresponds to the size of Hamming distance. The logical error rate of D = 9 is higher than that of other smaller Hamming distances within the error rate range shown in the figure. The logical error rate curves of the three Hamming distances are arranged according to the size of Hamming distance as a whole. When the turnover error rate reaches 21.5%, the logical error rate of the three is close to the same, reaching about 62.6%. After the error rate reaches 21.5%, the logic error rate changes around 60.0% and gradually tends to be stable within the range shown in the figure.

Through the first two experiments, it is concluded that under the low error rate, this method has good performance with other color code error correction methods, and the error correction success rate is almost equivalent. For the larger Hamming distance , if the error rate is too large, the error correction performance is lower than that of some error correction methods. In the case of large Hamming distance, the state space increases exponentially, and the resulting error correction success rate decreases within a predictable range. However, by upgrading the hardware level, expanding the hardware scale of data processing, and adjusting the size of neural network, the error correction tasks under larger Hamming distance or higher error rate can be handled under the current conditions.

For systems with different Hamming distances, the point where the logical error rate is equal to the physical error rate is called level-1 pseudo-threshold, which is obtained by fitting the pseudo-threshold to the following formula [30]:where is the pseudo-threshold when the Hamming distance is and is the threshold under the limit. is the scaling exponent and is the coefficient. The least square fitting is used to fit the curve of flip error rate and logic error rate, find the level-1 pseudo-threshold with different Hamming distance, and then bring them into the formula to solve the non-linear equation. After calculation, we obtain .

4.3. Influence of Training Iteration Times on Accuracy

The number of iterations and layers of neural network have a great influence on the accuracy of the model. We tested the effect of iteration number on decoding accuracy and used different network layers for comparison. Figure 10 shows the number of iterations and training accuracy.

By increasing the number of convolution layers of the network and adjusting the number of training iterations, we can obviously observe that the accuracy of training has improved, but after the number of iterations reaches more than 300, it is easy to have overfitting phenomenon, and the improvement of performance is small, which is basically maintained at about 9.0%. Normally, more precise training data can be obtained by increasing the number of layers of the network. By comparing the network training of and , it can be found that before the number of iterations reaches 300, the network of obtains better accuracy, which is about 0.3% higher than the network of L = 7 in each training interval. Comparing the accuracy curves of and networks, it can be seen that before the number of iterations reaches 120, the accuracy of network is slightly higher than that of network. After 300 iterations, the accuracy of the three networks began to swing. The network with had the highest accuracy about 320 times, the network with L = 14 had the highest accuracy about 360 times, and the network with L = 21 had the highest accuracy about 400 times.

After fully trained program depth, the Q-value matrix of q-network will be supplemented completely, the performance will be close to the optimal decoder, and the decoding efficiency and accuracy will be improved a lot. Q-depth neural network has few adjustable parameters, which is also convenient for decoding training.

5. Conclusions

As a quantum error correction code, the color code studied in this paper obtains good results in quantum error correction under ideal conditions. For the color code and surface code which belong to the same topological stabilizer code, we use the projection method to map the color code to the surface code and then use the depth neural network to correct the projected surface code. The training accuracy can reach about 96.5%. By using the 21-layer residual network, the training time can be further reduced by about 29%. Applying the error correction method of surface code to color code increases the application scope of the traditional error correction method of surface code and expands the error correction idea of color code. However, it can be seen from the simulation results that there are many unstable disturbances outside the ideal situation. For these noises that affect quantum physical transmission, we should combine the current quantum transmission protocols to ensure the effectiveness of color code in coding and transmission. While vigorously developing the error correction theory, we should also pay attention to the combination with some quantum device, bring the actual experimental environment into the consideration of simulation, and reduce the interference of external factors while developing and optimizing the optimal decoding scheme, so as to optimize and improve the accuracy of quantum algorithm and quantum calculation.

Data Availability

Data are available on request.

Conflicts of Interest

The authors declare that they have no potential conflicts of interest.

Acknowledgments

This study was supported by the National Natural Science Foundation of China (grant no. 61772295), Natural Science Foundation of Shandong Province, China (grant nos. ZR2021MF049 and ZR2019YQ01), and Project of Shandong Provincial Natural Science Foundation Joint Fund Application (ZR202108020011).