#### Abstract

Quantum error correction (QEC) is a key technique for building scalable quantum computers that can be used to mitigate the effects of errors on physical quantum bits. Since quantum states are more or less affected by noise, errors are inevitable. Traditional QEC codes face huge challenges. Therefore, designing an error suppression algorithm based on neural networks (NN) and quantum topological error correction (QTEC) codes is particularly important for quantum teleportation. In this paper, QTEC codes: semion codes—a greater than 2 dimensional (2D) error correction code based on the double semion model—are used to suppress errors during quantum teleportation, using a NN to build a decoder based on semion codes and to simulate the quantum information error suppression process and the suppression effect. The proposed convolutional neural network (CNN) decoder is suitable for small distance topological semion codes. The aim is to optimize the NN for better decoder performance while deriving the relationship between decoder performance and slope and pseudothreshold during training and calculate the thresholds for different noise areas when the code distances are the same, for and for . This paper demonstrates the ability of CNNs to suppress errors in quantum transmission information and the great potential of NNs in the field of quantum computing.

#### 1. Introduction

Quantum information theory is an emerging interdisciplinary subject that combines the principles of quantum mechanics, classical communication technology, and classical information theory. Quantum communication [1, 2] is a communication technology [3, 4] that transmits and processes secret information through a quantum channel. It has provable security in principle and is an essential supplement to the traditional cryptographic security system [5, 6]. In addition to quantum communication, quantum computers are another essential application in information. Quantum computers cannot directly measure quantum states and the noncopy ability of quantum states, which determines that error correction methods in classical computers cannot be now transplanted to quantum computers. The study of quantum error-correcting (QEC) code technology [7] makes quantum logic gate circuits have a higher threshold for fault-tolerant calculations, which also has important guiding significance for the research in the field of quantum computers. QEC code technology [8, 9] is an essential means of antinoise in quantum information processing [10, 11], and it has important guiding significance for the research of quantum communication, quantum computer, quantum storage, and other fields. Extending topological codes [12–14] in modern error correction code theory in quantum information has become a hot research issue in the area of QEC codes.

Machine learning is a programming method that learns patterns from data through statistical analysis and makes corresponding predictions [15, 16]. In traditional computing, an algorithm executes specific program instructions to give the correct output value for the input data. Through the machine learning algorithm, the rules or patterns are learned, the model is trained, and the optimal algorithm is finally obtained. Training is mainly divided into two types, one is supervised learning, which requires a data set with input and the corresponding output. The machine learning algorithm will learn from the input and output information during training and try to make predictions based on the analysis of the actual situation and data, such as classification and regression problems [17]. The other is unsupervised learning, which has the same input data set as supervised learning, but the difference is that there is no corresponding actual situation information. Looking at machine learning algorithms from a mathematical perspective, the core of any machine learning algorithm is to estimate a function or function parameters that can solve a problem given a task.

Quantum information in a quantum system is highly fragile. In a noisy network, an information processing system may change. Using a larger-dimensional Hilbert space to prevent noise from a QEC is a robust approach [18–20]. The logical encoding of the error code can have a better error correction effect. A topological code is equivalent to a quantum memory with topological protection and can be given additional computing power in some cases. One of the remarkable characteristics of topological codes is that their generators are located in the physical qubits of the quantum system, which means that each generator only involves neighboring qubits. This locality has been proved to be very useful for performing quantum error correction tasks with auxiliary qubits, and it is an advantage for nonlocal standard codes. Therefore, based on previous research results, to suppress the errors of logical qubits, we study quantum topological error correction (QTEC) code. Topological properties are robust to noise and errors and are widely used in the ordered phase studies to protect super qubits in conductive circuits.

The rest of this article is organized as follows. Section 2 is the background of this paper on semion codes. Section 3 is a quantum information error suppression algorithm based on quantum topological semion codes and CNNs. Section 4 is an experimental simulation of the CNN decoder training process, performance analysis, and quantum information error suppression capabilities. Section 5 is the conclusion.

#### 2. Background

Topological quantum computing uses arbitrary ones of strange quasiparticles to store and manipulate information [21, 22]. In basic physics [23], anyons that cover the statistical information of bosons and fermions seem to be a way of performing quantum computing too much. Complex methods play a critical role in QEC and should not be underestimated. The lattice has the characteristics of a nontrivial topological structure. When the system is on the lattice, it will show the degeneracy of the ground state [24]. Quantum topological error correction applies the topological properties of quantum states to protect the safety of quantum states in quantum teleportation. The realization of topological quantum adds activity and tension to quantum computing.

Code space can be identified using Hamiltonian ground space popularity [25]. The Hamiltonian [26] is the Hermitian function , which is entirely solvable in a specific subspace. The topological characteristics of a quantum system are a unique resource that is robust to external interference, which is better than the standard QEC code. The development of topological characteristics provides us with new ideas for research in the quantum field. QTEC codes [27] are more robust error correction codes than ordinary QEC codes. Error correction can be achieved by measuring the topological charge of lattice position each time.

A semion code is a QEC code with double-semion characteristics. Small plaquette represents stabilizer operators. Edges represent qubits and vertices. Qubits have a deep connection with the edges of the lattice. We can regularly detect errors in them by measuring vertices and small block operators. Semion code are constructed by topological order based on double Semion model [28]. Semion is defined in the hexagonal lattice . As shown in Figure 1(a), vertex operator is appended to the three edges of a , which is similar to that in the Kitaev toric code. Vertex operator is the same, and vertex operator satisfies

**(a)**

**(b)**

Pauli operation of each edge of vertex corresponds to the three quantum bits in the diagram, label them as . As shown in Figure 1(b), plaquette operator is a Hermitian operator applying Pauli operation to the edge of the hexagon, and there iswhere is the representation of hexagon sides, and the aggregate of in all plaquette operators is . The eigenvalues of vertex operator and plaquette operator are both . The properties of vertex operators and plaquette operators provide help for the following calculations. All normal values on are all , and when appears, the measured value of will become , in the same way, when we measure the two adjacent . The value of this place changed from to , indicating that error occurred on .

#### 3. Arithmetic

##### 3.1. Study the Quantum State

The preparation of an arbitrary quantum primitive state is the very first step to be implemented in all algorithms, and for the study of logical quantum bit error suppression algorithms, the study in [29] is drawn upon to address the preparation of the quantum state. Assume that the quantum register has orthogonal quantum basis vectors, denoted by quantum bits as . The amplitude of each basis vector is expressed as the square root of the probability of measuring the value obtained from the above equation, and the sum of the measurement probabilities of the individual basis vectors is 1, denoted as , where is the probability. However, the measurement probe of each basis vector is random, and it is desired to prepare the basis state with as few elementary quantum gate operations as possible, using a dichotomy that divides the basis vector into two parts, so and . Then, continue to use dichotomy to divide the above two-part basis vectors into two parts, respectively, and the probability of the four-part basis vectors is as follows:where operation can be expressed using a quantum gate, the gate, which has the matrix formand any quantum state is

##### 3.2. Exploring Quantum Teleportation

Quantum teleportation [30, 31] is a technique that uses scattered quantum entanglement and the conversion of some physical information to transmit a quantum state to a position at any distance [32]. As we all know, the working principle of quantum teleportation is that both the sender and the receiver hold a qubit in the pair, and the sender needs to send a qubit to the receiver, but the sender does not know the state of the qubit, and the laws of mechanics make it impossible for the sender to copy with only one qubit. Assuming that the quantum state that the sender needs to transmit is , where and are unknown amplitudes, and then, the input in Figure 2 is can be expressed as follows:

After the qubit is transformed by the gate in Figure 2,

After the sender Hadamard gates a qubit, after the transformation of the integer, we can get

Therefore, the sender only needs to tell the receiver of its measurement results, and then, the receiver can obtain qubits through some unitary transformations. The measurement results and actions to be performed by the receiver are shown in Table 1. To sum up, it can be concluded that if the receiver wants to get the most primitive qubit, it needs to perform the operation.

##### 3.3. Select Semion Code

Hamiltonian is the sum of local exchange terms, and both are projectors [33]. Hamiltonian defined by vertex operator and plaquette operator:where is not the same as in our previous (2). And is the project or on the state or [14] of qubit . is a phase operator, which can be obtained by the twelve sides of the plaquette , and the form of depends on the specific position of the plaquette. meets the following conditions:for all hold.

Therefore, this is the desired property required for a stabilizer form of QTEC to satisfy the entire Hilbert space. It can also be said that a qubit on has an error, and we can correct the error according to the commutation property of to ensure the correctness of the qubit.

All vertex operators with eigenvalues and all plaquette operators with eigenvalues constitute the code space of a system. When an error occurs, the symbol of the stabilizer will flip. These flipped positions can be regarded as a vertex excitation, similar to the Kitaev toric code. The recovery process uses string operators to form a small loop, which is a way to eliminate incentives. The string that generates lattice excitation is a string of *Z* operators, which we denote as , and the string that generates vertex excitation is a string of *X* operators. can be exchanged with any stabilizer, except for the grid at the end of the string. A character string on the path as shown in Figure 1(a) is denoted as :

The value of some phases is or , and the operator only works on , as shown in Figure 1, , and any whose qubits in are zero. Fore-chiral chord is , and negative-chiral chord is . . , generate semions at endpoints. If chirality is the same, it is reversed exchange, and if chirality is different, it is exchanged.

The Hamiltonian is used as the coding space, and stable codes are vertex and plaquette operators. Semion code is similar to Kitaev toric code. The logical operator consists of and , is any homogeneous nontrivial path in the horizontal(vertical) direction, and the other pair logical operator is and . Embedding the semion code in Kitaev toric code results in two quantum memories with logical qubits, the embedded torus 16 lattices of the code, and two logical qubits of the code require two pairs of logical operators, which are defined as and :

The set of these operators satisfies the inverse relationship. The hexagonal lattice makes the distance of the operator twice that of the operator, which can better avoid errors. The semion code has a topological protection effect on quantum information and will not affect the global error due to local errors. It can correct the quantum information [34] during the invisible transmission process. For the wrong qubit, after the syndrome is successfully corrected, the measurement result of the eigenvalue will be restored to the eigenvalue, and the quantum information will be restored. The stabilizer must be measured regularly, and the stabilizer must be combined with the string operator to eliminate excitation and ensure the security of quantum information.

##### 3.4. Coded Logic Quantum State

Suppose that the quantum information transmitted by quantum teleportation is , in teleportation is regarded as a physical quantum state. According to the relevant knowledge of quantum error correction codes, physical quantum states can be encoded as logical quantum states, and each logical qubit is described by a set of connected physical qubits that meet the requirements of any nonzero coupling in the target, what may happen when a physical quantum state interacts with the environment: no error (represented by ), bit reversal error (represented by ), bit phase reversal error(represented by ), bit phase reversal error, and bit phase reversal error (represented by ), and the most preferred choice is depolarization noise, which assigns only , , errors with equal probability on the data qubits with probability an error occurs in a given qubit.

The general error of a qubit can be expressed as a linear combination of these error operators. Assuming that the state of logical qubits is saved in a quantum computer, the first step is to introduce redundancy and encode the state in a larger space of physical qubits. For this reason, it is necessary to introduce physical qubits and prepare these newly introduced physical qubits in the state, and this extended system is , that is, introduce them into the logical space of semion codes, and then perform a coding operation : is the coding state of the original state in the Hilbert space of qubits.

##### 3.5. Detect and Correct Errors

For the noise model composed of the Pauli operator, it is very important to determine the influence of the Pauli operator on the path of the semion code. We take Pauli- operator as an example. Suppose that the Pauli- on a path acting on the code is

Use diagonal part to express Pauli- as follows:where is expressed as the qubit set of the Pauli- operator acting on bywhich can get [35]. For logical quantum state , suppose is represented as a logical subspace, is represented as an eigenvalue, and the eigenvalue is divided into and , represents a vertex operator, and represents a plaquette operator, when acts on the logical quantum state :where flips the vertices at the endpoint, and flips the plaquette at the endpoint. Satisfy for each plaquette involved, where is the syndrome of plaquette : . So the influence of Pauli- operator on the path of the semion code iswhere N is the normalization factor, and .

For error recovery operations, we assume that the recovery operation is , can be made, and can form a trivial cycle of the Pauli- operator, so can be used to correct the error and restore the quantum state to the .

Before designing the CNN decoder, we must map the quantum topological semion code into the toric code. Figure 3 shows the semion code map converted to an embedded toric code suitable for CNN, as shown in the figure, with 16 slabs, 32 vertices, and 48 physical quantum bits, the vertices, and plaquettes being labelled right-to-left and top-to-bottom as images, corresponding to the matrix form in Table 2. Numbers represent vertex operators, plaquette operators are represented by letters, and 0 does not represent any number or letter. It has no meaning, just for space validity. The mapping method can refer to the way in Refs. [35]. This article directly gives the result after the mapping and does not go into the process.

#### 4. Decoder

##### 4.1. Build a Network Model

Neurons [36] are elements that accept input data and perform operations, and the highest abstraction of NNs can be thought of as black-box functions:where parameter here needs to be adjusted several times. Choose the loss function and do the operation to minimize , the input and output relationships of the dataset are as follows:

Therefore, it is necessary to use gradient descent to train the network, and the gradient descent algorithm will calculate local minima or regions with small gradients, which has a huge advantage. A common classification problem is to use cross-entropy. For dataset , where , and the output of the NN tries to approach , and the cross-entropy loss function iswhere the dataset is calculated by the probability distribution. Different basic neurons will be combined into different architectures. The current well-known structures are CNNs [37], recurrent NNs, fully CNNs, etc. All architectures are composed of layers, which are combinations of neurons.

An alternative to traditional decoders is used to identify errors, they exhibit constant execution time and physical error rate, and their execution time scales linearly with the number of qubits. And it has been proven that NNs provide better decoding performance than many classical decoding algorithms [38, 39]. To build a NN decoder, one can simply train a CNN with input-output pairs, namely syndrome and logic correction, but it does not achieve good enough performance in practice. Therefore, special attention needs to be paid to the design of CNNs. The CNN in this paper allows the construction of very deep networks. Since CNN can naturally take into account the spatial structure of the code, it has scalability and significant performance advantages. For semion codes, the CNN can be the largest to achieve it to the limit. Since the vertices and squares of semion codes have a robust correlation, for a variety of noises, the CNN can take the correlation into account and obtain better results.

The CNN decoder in this paper consists of three different parts, namely the input layer, the hidden layer, and the output layer, where the hidden layer is the convolutional layer, as shown in Figure 4(a), and we start with the syndrome slice, arbitrarily choose the depth of the syndrome volume, and then input the syndrome into the CNN in Figure 4(b), and these layers are composed of neurons or nodes with trainable parameters, and each node is fully connected to all nodes in adjacent layers. All hidden layers have the same number of nodes. The cost function uses categorical cross-entropy, and the optimizer uses the gradient-based optimization algorithm Adam [40]. NNs have been widely used for image recognition, although the information of each position in the lattice is binary, and it is still necessary to treat this as an image, and false syndrome patterns can be seen as CNNs can identify an image. Compared to other NNs, CNNs are more suitable for semion codes because the structure of the lattice stabilizer of semion codes can lead to complex correlations between externally generated and errors.

##### 4.2. Training Model

The data to be used as a training dataset should be collected first, and we may all think that all possible error syndromes have an impact on the performance of the decoder but as the code distance increases, all error syndromes slowly become infeasible, because the space of all potential errors increases exponentially with increasing code distance and therefore needs to contain as few and diverse error syndromes as possible that will provide the greatest generalization ability.

During sampling, multiple error correction cycles are run to store each decoder’s corresponding input and output. At first, smaller and shorter code distances [41] are selected, and when the performance is stable enough, we expand the code distance and gradually train the stability of the decoder. Due to the diverse nature of semion codes, different datasets may generate the same error syndrome, so it is necessary to track the frequency of occurrence of each set of errors that provide the same error syndrome. One set of errors is more likely to occur when the physical error rate is small, and another set of errors is more likely to occur when the physical error rate is large. When training a NN decoder [42], regardless of the physical error rate being tested for a given error syndrome, only one of these error sets will be selected. To get better decoding performance, it is necessary to create multiple datasets, obtain different datasets for different physical error rates, and train different NNs. By sampling, training, and testing performance at the same physical error rate, the decoder has the most relevant information to perform the decoding task.

Create an error probability distribution for each logic state based on the observed error syndrome. Train a NN to map all stored inputs to corresponding outputs. When the NN can correctly predict a higher value, the training ends, and a relatively stable decoder performance is obtained. The decoder’s corrections do not need to exactly match the errors that occur, just correct the observed error syndromes, and predict whether the corrections proposed by the decoder will result in logical errors. In addition, the decoder is designed in the simplest way to conform to semion codes, ensuring fast and convenient data acquisition. The decoder is tested against an error model, the depolarization noise model [43], which assigns only , , errors with equal probability on the data qubits. There are no insertion errors on the auxiliary quantum bits, and perfect measurements are used. Therefore, only a single error correction cycle is required to find all errors.

The physical error rate corresponding to the logical quantum bit exceeding the physical quantum a bit is referred to as the pseudothreshold, which is defined as , can be expressed as follows:where and denote the fitting parameters for the pseudothreshold, respectively. denotes the physical error rate, and indicates the logical error rate. This formula is adapted from the study of [44]. The slope of the decoder is also an important parameter, which is defined as . Figure 5 shows a correlation plot between and and code distance during training, from which it can be seen that the increases from 2 to about 4.5 as the increases from 0 to 0.12 and increases as the code distance increases from 7 to 9 and then to 11. It can therefore be concluded that both the slope and the pseudothreshold increase when increasing to a sufficiently large code distance, but due to the exponential relationship, the slope usually dominates the decoding performance at lower physical error rates. Regarding the CNN framework simulated in this paper, thanks to the provider of the open-source code [44].

##### 4.3. Analysis of Performance

The primary function of the NN decoder is to obtain the output of the correction data through the training of the NN and to generate the basic correction of the error by measuring the given syndrome. Specifically, the decoder process can be regarded as a classification problem of a NN, and we use cross-entropy for the classification problem. A CNN decoder takes as input the error syndrome and produces that the corresponding thresholds are obtained based on the relationship between the , and the code spacing. The threshold value is defined as the at the intersection of the different code pitch curves. By displaying different code distances , different thresholds can be obtained. For code distance , has the following formula: as output the error probability of the logical state of the logical qubit. Based on this error correction scheme, the NN does not need to predict the correction of all data qubits but only needs to predict the state of the logical qubits, which will make prediction easier. This is because there are four types of logic errors: no error, the output result is I; logic error, logic error, and logic error. It is worth noting that a very high level of granularity is required to correctly predict each physical error, which is unnecessary for semion codes.where is the threshold of decoders, and is the logical error rate, and is the scaling exponent corresponding to the universality class of the three-dimensional random-plaquette gauge model. When using the same dataset size, there is a constant execution time and physical error rate for a given code spacing, and the sum of samples from multiple datasets with different increases linearly relative to the code spacing. Training improves decoding performance because the samples are more correlated. Figure 6 plots the relationship between , , noise area , and , as shown in the Figure 6(a), when the code distance , the of the intersection is 0.082 for the noise area , which is the threshold . Figure 6(b) shows that when the code distance , the of the intersection is 0.096 for the noise area , which is the threshold . For different noise area, we have different thresholds. Compared with other decoders [45–47], the CNN decoder is easier to train, can decode higher code distances, and achieves better decoding performance.

**(a)**

**(b)**

Through our experiments for the semion code decoder, we can see that we can successfully suppress information errors during the transmission of states by quantum invisibility through quantum topological semion codes, which not only solves the problem if possible errors in quantum information but also verify the contribution of NNs to quantum computing, the great potential of NNs.

#### 5. Conclusions

This paper protects quantum information during quantum teleportation based on quantum topological semion codes, suppresses errors in quantum information due to the influence of noise during transmission, ensures the safety of quantum information, uses NNs to simulate the error suppression process, and evaluates the performance of the NN decoder. Error correction using quantum topology semion codes is a new error correction method. Through regular measurements and checks, it is ensured that interference from local errors does not destroy the global degrees of freedom. Error-correcting codes protect the security and correctness of quantum information. Semion codes are more novel and flexible than ordinary QEC codes. Embedding the hexagonal lattice into the surface code by mathematical thinking will make experimental simulations easier to implement, and the resulting input into a NN algorithm and numerical results will be obtained. We demonstrate the possibility of QTEC codes for the protection of quantum information in invisible transmission states, and the possibility of NN implementations of QTEC codes, and discover the great potential of NNs.

#### Data Availability

The data used to support the findings of this study are available from the corresponding author upon request.

#### Conflicts of Interest

The authors declare 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, ZR2019YQ01), and project of the Shandong Provincial Natural Science Foundation Joint Fund Application (ZR202108020011).