STEANE CODE ANALYSIS BY RANDOMIZED BENCHMARKING

. Quantum error correction codes (QECC) play a fundamental role in protecting the information processed in today’s noisy quantum computers. To build good error correction schemes, it is essential to understand how noise affects the behavior of these codes. In this research paper, we analyze Steane code, a 7-qubit QECC, using a randomized benchmarking (RB) protocol. With RB protocols, we can partially characterize the quality of implementation of a set of quantum gates. We show a scenario where Steane code with one logical qubit is advantageous compared to the situation with no quantum code. We obtained our results using a quantum simulator with custom noise models considering different numbers of noisy qubits.

regard, Combes et al. [4] proposed a logical randomized benchmarking protocol that, as the name implies, is capable of evaluating an error correction implementation at the logical level. In this work, we use this protocol to evaluate the performance of Steane code, an important quantum error correction code with characteristics that facilitate the implementation.
In addition to the logical RB, several other variations of the original protocol were proposed. Morvan et al. [5] extended the RB to make it able to analyze qutrits. Brown and Eastin [6] examined RB protocols based on subgroups of the Clifford group that are not unitary 2-designs. Magesan et al. [7] proposed a new protocol called interleaved randomized benchmarking to analyze individual quantum gates. Proctor et al. [8] proposed a direct RB protocol that avoids compiling -qubit Clifford gates, for large , into large circuits composed of the native gates of the device to be characterized. This work was inspired by the experiments performed by Harper and Flammia [9] with a quantum error detection code. They analyzed a 4-qubit code with distance 2 that encodes two qubits with a variation of the RB protocol called Real Randomized Benchmarking [10], which can be used with any gate set that is an orthogonal 2-design. They observed an improvement in the fidelity of the gates from 94.2%, when no code is used, to 99.4%, with the use of the 4-qubit code.
Our results show that, under certain circumstances, it is worthwhile to use Steane's code, as we obtain a higher fidelity than in the case with no code. Although the conditions under which the experiments were performed are not those found in the normal use of quantum devices, the results indicate that in these cases we would be able to obtain similar behaviors.
The rest of this paper is organized as follows. In Section 2, we present the background of this work. In Section 3, we explain our experiments. In Section 4, we present our final results. Finally, in Section 5, we summarize our conclusions.

Background
In this section we give some details about the code we used, Steane code, explain how to perform the randomized benchmarking protocol, and show how the quantum channels we considered act on a quantum state.

Steane code
Steane code is a quantum error correction code introduced by Steane [11] that encodes one logical qubit into seven physical ones and has distance 3, which means it can correct arbitrary errors up to 1 qubit. Because of these characteristics, we say it is a [ [7,1,3]] code. Furthermore, Steane code is a stabilizer code, that is, its code space can be generated by a subgroup of the Pauli group, which we call a stabilizer. Table 1 shows all six generators of Steane code, which consist of tensor products of the Pauli and gates and the Identity gate ( ). Table 2 shows the main encoded Clifford gates in Steane code. We can see that all qubits can be implemented in a bitwise fashion and, as all Clifford gates can be implemented as a product of the gates shown in Table 2, all of them can be implemented in this fashion. We call this a transversal implementation. That is a feature of a class of quantum codes called CSS (Calderbank-Shor-Steane), to which the Steane code belongs. This class was discovered by Calderbank and Shor [12] and Steane [13] and is particularly useful due to its easy implementation.

Randomized benchmarking
Randomized benchmarking is a protocol for partially characterizing the quality of the implementation of a set of quantum gates. That is done by estimating the fidelity between the identity channel and the average noise ℰ acting on the set, which is given by where d is the Haar measure on the space of quantum states | ⟩. The fidelity is a distance measure, that is, it is a way of quantifying how similar two quantum states are, that is why it is important in the context of error correction. The fidelity between a pure state | ⟩ and a mixed state is given by The RB protocol was proposed by Magesan et al. [2,3] and is scalable in the number of qubits of the system. It consists of the following steps: (1) Choose a sequence length and prepare a state . (2) Choose uniformly at random a sequence of m Clifford gates, apply them to the circuit and apply the inversion gate, which, in an ideal situation, inverts all the sequence and makes the circuit equivalent to the identity. (3) Perform the measurement to verify if the register returned to the initial state .
After the development of this RB protocol, several modifications were proposed to adapt it to different situations and needs. One of these modifications was the logical randomized benchmarking proposed by Combes et al. [4], which is suitable for benchmarking quantum gates encoded in QECCs. The logical RB protocol can be performed through the following steps: (1) Choose an initial state and a sequence length m.  Positive Operator-Valued Measure (POVM) is a formalism for the analysis of quantum measurements that is suitable for applications where we are mainly interested in measurement probabilities associated with each operator. In the logical RB protocol, the POVM element represents the situation in which the qubit returns to the initial state, whose probability we want to estimate. The value obtained with the protocol above corresponds to the probability that the initial state be recovered at the end of the circuit for a given sequence length . To estimate the average of this probability for all possible sequences, it is necessary to perform the steps above for different sequences of gates. In addition, the whole procedure must also be done for different values of so that we obtain several points that associate a sequence length with a probability, known as survival probability. The curve obtained from these points is known as the fidelity decay curve, which can be fitted to the model where and are constants that absorb state preparation and measurement errors and is given by where Λ is the average noise acting on the code gate set and = 2 , where is the number of logical qubits. That means that by finding the value of through the fit, we can determine the average fidelity (Λ ).

Quantum channels
Below we present the three quantum channels that we used to build the noise models: the depolarizing channel, the amplitude damping, and the phase damping, which are some of the most important. Let be a mixed quantum state.
-Depolarizing channel: the action of the -qubit depolarizing channel is given by where is the parameter of the channel and is the × identity matrix. -Amplitude damping: the action of the 1-qubit amplitude damping channel is given by where the Kraus operators are given by and where is the parameter of the channel. The Kraus operators of the 2-qubit amplitude damping are given by Guo et al. [14] = ⊗ , , = 0, 1.
-Phase damping: the action of the 1-qubit phase damping is given by where the Kraus operators are given by where is the parameter of the channel. The Kraus operators of the 2-qubit phase damping are given by = ⊗ , , = 0, 1.

Methodology
The experiments from this work were performed in the simulators ibmq qasm simulator , available on IBM Quantum, and qasm simulator , which can be run locally through Qiskit [15]. We decided to use simulators instead of real quantum devices because some non-unitary instructions necessary to implement Steane code, such as mid-circuit measurements, returning a qubit to the state |0⟩ (reset) and applying gates conditioned to the value of the classical register (if ), were not available on IBM Quantum computers. The first two instructions became available later, but the if remains unavailable.
To simulate noise, we created noise models based on three of the most important quantum channels, the depolarizing channel, the amplitude damping, and the phase damping. The first one is characterized by a parameter and the others by a parameter . Our goal was to compare the performance of experiments using one physical qubit and using one logical qubit encoded in Steane code, which corresponds to 13 physical qubits, seven from the code block and six ancilla ones. For that, we created noise models for each quantum channel acting on different numbers of qubits from the code block, from 2 to 7, and we sought to find a parameter value (threshold), for each model, in which the fidelity decay curves were approximately equal for encoded and non-encoded experiments. To each model were added 1-qubit and 2-qubit errors from the respective quantum channel. The 1-qubit errors were associated with the gates 1, 2, 3 and , and the 2-qubit errors with the CNOT gate. It is important to mention that the circuits to be run were initially built with the gates , , , , , † and CNOT, but later were converted into equivalent circuits with the gates 1, 2, 3 and CNOT, that were the standard gates on IBM Quantum devices. We did not add noise on ancilla qubits because the threshold would be so low that it would require a number of gates in the thousands to generate a useful curve and, as a result, an amount of memory much higher than the 8 GB available on IBM Quantum.
We performed experiments with initial states |0⟩ and |1⟩ and with 30 different values for starting at 2 and with equal intervals. The lower the threshold found, the greater the interval necessary to generate a good curve. For each value of , we considered the average of the values obtained for |0⟩ and |1⟩. Each circuit was run 1024 times to estimate the probability of returning to the initial state, which means = 1024 in the logical RB protocol.
The use of Steane code consists of three procedures: encoding, correction, and decoding. The encoding is done at the beginning of the circuit, starting from the original state with which we want to work. Figure 1 shows the circuit that we used to encode the initial state in Steane code, which includes only the seven qubits from the code block and performs no action on the ancilla. The correction procedure is performed after each encoded gate is applied and consists of two steps: syndrome measurement and recovery. The syndrome measurement is performed by measuring each generator of the Steane code. To measure each generator, one ancilla qubit is needed, and that is why we need six. The combination of the results of all the measurements is the error syndrome. Let be the result of the measurement of the generator and { } be a set of correctable errors for the Steane code. We perform the recovery by applying such that † = for all . Finally, the

Results
We created a different noise model for each quantum channel and each number of noisy qubits from 2 to 7, that is, we performed experiments for 18 different models. We found the threshold for each of these models. Figure 2 shows the thresholds obtained for each case. The graph is in logarithmic scale for better visualization. The channel that has the highest thresholds was the phase damping channel, which shows it is the one that causes less damage to the information for the same parameter value. The other channels have similar thresholds, but those from the depolarizing channel were slightly lower.
We can notice that, in this scale, the points form curves that are close to lines, which indicates that a function of the form ( ) = can be fitted to them. The fitted function for the phase damping was ( ) = 1.99 −2.32 ,  Figure 2 represent the fitted functions. Although our experiments were limited to simulating noise on the code block, the curves we obtained in Figure 2 show that we can also expect to find thresholds when simulating noise on the ancilla, which would represent a more realistic scenario where the use of Steane code is advantageous. Table 3 shows the main average fidelities found. They refer to the encoded and non-encoded experiments in which the models, for each channel, were generated using the threshold for seven noisy qubits. In the case of encoded experiments, column Configuration indicates the number of noisy qubits from the code block, and only the cases from 5 to 7 qubits are shown. We can see that the average fidelities from the encoded experiments with seven noisy qubits and the non-encoded ones are almost the same, with a maximum difference of 3 × 10 −4 . That indicates that, with lower parameter values, we would obtain better results when using Steane code than when no quantum code is used. Furthermore, the fidelities show a scenario, albeit restricted, that clearly favors Steane code, which is the one in which there are five noisy qubits with noise that can be modeled using the thresholds corresponding to seven noisy qubits, for each channel.

Conclusion
Our objective in this work was to find a scenario in which using a quantum error correction code was beneficial. We chose Steane code for our experiments because it is an influential code that is also easy to implement. To evaluate the code and compare it to the situation without error correction, we used the fidelity metric, which can be estimated using a randomized benchmarking protocol. Furthermore, we chose to run our experiments in quantum simulators with custom noise models due to the limitations of the quantum devices available in IBM Quantum.
We found the threshold for all 18 noise models created. In a scenario with the same number of noisy qubits with noise modeled by one of the three quantum channels considered, if the parameter value is less than the corresponding threshold, it would be advantageous to use the Steane code. The quantum channel that generated the lowest thresholds was the depolarizing channel, which means that it is the one that damages the information the most. On the other hand, phase damping was the channel that generated the highest thresholds. In addition, we found that on a logarithmic scale the curve of the threshold as a function of the number of noisy qubits is approximately a line, indicating the possibility of finding thresholds in cases where ancilla qubits are also noisy.
However, it is noteworthy that this curve probably has a different behavior when considering ancilla qubits, because in this block the structure of the circuit is different.