Constructing Smaller Pauli Twirling Sets for Arbitrary Error Channels

Twirling is a technique widely used for converting arbitrary noise channels into Pauli channels in error threshold estimations of quantum error correction codes. It is vitally useful both in real experiments and in classical quantum simulations. Minimising the size of the twirling gate set increases the efficiency of simulations and in experiments it might reduce both the number of runs required and the circuit depth (and hence the error burden). Conventional twirling uses the full set of Pauli gates as the set of twirling gates. This article provides a theoretical background for Pauli twirling and a way to construct a twirling gate set with a number of members comparable to the size of the Pauli basis of the given error channel, which is usually much smaller than the full set of Pauli gates. We also show that twirling is equivalent to stabiliser measurements with discarded measurement results, which enables us to further reduce the size of the twirling gate set.

the conditions that we laid out. This is followed by two examples. In Section 5, we discuss how to use stabiliser measurements to further reduce the size of our twirling set. Lastly, Section 6 provides a summary of our results and some possible future directions. The mathematical justification for our method of construction of the twirling set is described in the appendices, which forms an essential part of the paper.

Definitions of Functions and Operations
the pauli operator set and the * operation. G is defined to be the set of n-qubit Pauli operators: n For the Pauli operator set G, we can define a composition rule *, which is the same as the usual Pauli matrix multiplication but ignoring all the ±1 and ±i factors. For one qubit we have: * = * = * = * = * = * = * = and any composition with the identity I will just return the same operator.
The n-qubit case is just the tensor product of the one-qubit case. Note that * is commutative.
commutator function ζ. For g i , g j ∈ G, their commutator function ζ(g i , g j ) is defined to be: i j k ij k i k j k k i j k i j k i k j twirling Super-operators and error channels. We use to denote a super-operator: A general error channel E is of the form: In the following sections we are going to focus on only one of the noise operators M. exact twirling and random twirling. One can think of twirling as a super-super-operator that turns one super-operator into another. Applying exact twirling T W using the twirling set W on the noise operator M is defined as: In other words, each time we run the circuit, we conjugate the noise operator M with a different twirling gate w from the twirling set W. After we iterate over the whole twirling set W and take the average of the results, we effectively have process above.
The goal of twirling is to turn the noise operator M into a Pauli channel: where p g is the probability of the Pauli error g happening, which can be 0.
On the other hand, in random twirling, instead of systematically iterating over the whole twirling set W, each run we choose a random element w n from the twirling set W: At finite N, there will be shot noise associated with the output of random twirling due to imperfect sampling over the twirling set. The shot noise can be reduced by increasing the number of runs N, allowing the effect of random twirling to approach the effect of exact twirling: In this paper, we will focus on exact twirling, but most of the results are also applicable to random twirling. one-gate twirling. Let us consider the special case where W = {I, w}, for which W only contains one extra gate other than the identity.
We will call this a one-gate twirling operation and denote it as T I w { , } . Doing nested one-gate twirling with T I w , etc, is equivalent to twirling with W = w 1 , w 2 , …, where w 1 , w 2 , … denotes the full set of gates that can be generated from {w 1 , w 2 , …} using operation *.
Requirements and results of twirling. Now we will focus on Pauli twirling, which means our twirling set consists of only Pauli operators: W⊆G. Note that all Pauli operators are Hermitian: = † w w . We can break any n-qubit noise operator M into its Pauli basis: where V is the Pauli basis of M: Substituting this into (3) and applying it onto a state ρ, we have: Now let us look at sum over W. Using (2), we have www.nature.com/scientificreports www.nature.com/scientificreports/ Our arguments can be easily extended to the full noise channel (Section 3.1) by adding ∑ M before all the equations. In such case, V will be re-defined as the Pauli basis needed to construct all the noise elements in the noise channel. All the other results follow.
The details of how to apply twirling on erroneous quantum components and the result of such twirling is outlined in Appendix A.

construction of the twirling Set
As we can see from the last section, the key to twirling is to find a twirling set W that satisfy (7) for the Pauli basis V of the given noise.
The common choice is W = G, the full set of Pauli operators. In such a way, for any v ≠ v′ (i.e. vv′ ≠ I), the number of elements in G that commute with vv′ will always equal to the number of elements that anti-commute with vv′, thus (7) is always satisfied.
Hence, if we choose W = G, we can transform any error channel into a Pauli channel. However, as mentioned before, twirling with the full Pauli set is not always ideal. A systematic way to construct a smaller set of W is laid out in this section, whose validity is proven in Appendix D, E, ??. Note that for the steps below, compositions between elements refer to the * operation defined in Section 2.1.
Before proceeding to the steps of construction, we need to introduce the ideas of commutator table first which is crucial to our method of construction.
Generator tables are just commutator tables of the form:  www.nature.com/scientificreports www.nature.com/scientificreports/ The rows of a generator table cannot be obtained from composing other rows, thus the row labels  q i also cannot be obtained from composing other row labels. Hence, all the row labels  q i are independent from each other, forming a valid generating set. Similarly for the column labels  h j , hence the name generator tables. We can compose the columns of the generator table to obtain new columns as shown in Table 2.
Steps to construct W. 1

. Decompose the noise operator M to obtain its Pauli basis
For a general noise channel, V will be the union of the Pauli basis of all the noise elements in the noise channel. 2. Find the following set: We now define a generating set ∼ H of size N and denote the complete set that it generates as = ∼ H H 4. Map elements in V to elements in H using the following steps: to any subset of the remaining elements in H (which includes the identity). Using the steps above, we can obtain the subset of H that ∼ V maps to, which we will denoted as ∼ H V : An example. Here we will ignore the qubit labels on the operators. e.g. IX ≡ I 1 X 2 .

Suppose we have noise
Within V, the only composition relation is YY = IZ * YX. Hence, we have: www.nature.com/scientificreports www.nature.com/scientificreports/ In the brackets are the elements in ∼ V that the elements in ∼ H V map to. 6. Our goal is just to find   Application to a physical noise model. We will provide another example that has more physical significance. Suppose we want to implement the Steane code as shown in Fig. 1 using spin qubits, but there is a small global field causing a global rotation of a small angle θ in the Z direction, leading to the following coherent noise: We will ignore the higher order term O(θ 2 ) in the noise channel for the purpose of obtaining the reduced twirling set. The exact steps of obtaining the reduced twirling set are:

The Pauli basis of M is
there is no composition relations other than those involving the identity. Hence, we have:   www.nature.com/scientificreports www.nature.com/scientificreports/ In the brackets are the elements in ∼ V that the elements in ∼ H V map to. 6. Our goal is just to find

The smallest integer N that satisfies both
i j i v j , . A possible choice is to have = ∼ W X X X X X X X X X X X X { , , } 1 4 5 7 2 4 6 7 3 5 6 7 , which will produce the following commutator table: This is the same as the commutator table in the last step. The result of applying this reduced twirling generating set (X 1 X 4 X 5 X 7 , X 2 X 4 X 6 X 7 , X 3 X 5 X 6 X 7 ) as opposed to the full twirling set to the Steane code under global Z rotation is shown in Fig. 2. As we can see from the plot, the fidelity curve of the reduced twirling set has some deviation from the full twirling curve due to the approximation we made initially in which we discarded the O(θ 2 ) term. However, when looking at θ = 0.1, such deviation is ~3.5 × 10 −4 , which is an order of magnitude smaller than the ~2.5 × 10 −3 deviation of the untwirled curve from the twirled curve. If we assume that when we sample from the full twirling set, the fluctuation of the logical fidelity in each sample is represented by the gap between the twirled fidelity and the original fidelity (since the original curve is just twirling using identity), then to achieve the same level of approximation as our reduced twirling set, we need to reduce the error fluctuation by an order of magnitude, which requires 10 2 = 100 samples (i.e. 100 circuit runs). This is significantly more than the 2 3 = 8 circuit runs needed using the reduced twirling set. expected size of ∼ W. Using (S11), (S12), (S13) and Hence, unlike the full Pauli operator set whose size 4 n is dependent on the number of qubits n that we are considering, the size of our twirling set |W| is only dependent on the sizes of the Pauli basis and the generating set of the Pauli basis of the particular noise channel we have. Noise arising from real physical process usually have symmetries present. Such symmetry constraints will reduce the size of the Pauli basis that builds our noise, which enable us to find a much smaller twirling set than the full Pauli set.
One such example was shown in the last section (Section 4.4), in which the lower bound is reached: . For such noise due to the fluctuation of a global field, we have |V| = n + 1 where n is the number of qubits. Hence, we have Comparing to the twirling using the full set of Pauli operators: = ∼ W n 2 , there is an exponential reduction of the size of the twirling set.

twirling and Measurements in Stabiliser code
Stabiliser code. In quantum error correction codes, we try to encode logical qubits into a larger number of physical qubits. All the states of the logical qubits ψ L will live in a subspace V S of the full quantum space of the physical qubits. We will call V S the code subspace. Quantum states that live outside the code subspace can be detected as erroneous states and might be corrected by projecting (or transforming) back to the code subspace.
If we have a given code subspace V S . Then the stabiliser set S ⊆ G is defined to be: Hence, for any ∈ s S we have www.nature.com/scientificreports www.nature.com/scientificreports/ (11) i.e. an one-gate twirl W = {I, w} will decohere between the components in M that commute with w and the components that anti-commute with w. If we discard the information about result of the s stabiliser check, then our error channel after the s stabiliser check becomes: (12) where ρ ψ ψ = L L . We can follow similar analysis even if there is a Pauli error g on the logical state ψ ψ → g L L . The extra Pauli error may swap the ±1 stabiliser check outcome, but will not change our error channel in (12).
Comparing (12) to (11) where the pair of X will be applied with 50% probability, similarly and independently for the pair of Z.
However, if we discard the information specifying the result of the Z stabiliser check, then as argued before, the Z stabiliser check will have the same effect as the Z-twirling. Hence, we can turn M into Pauli errors with just the X-twirling: This example shows how stabiliser measurements with thrown-away results can lead to a smaller set of twirling gates.

conclusion and future Works
In this paper, we found the necessary and sufficient conditions for a set of twirling gate to turn a given noise operator into a Pauli channel form. We then demonstrated a way to construct the smallest twirling set that satisfies the conditions. The size of the twirling set we obtained is lower-bounded by the size of the Pauli basis of the noise operator, and upper bounded by is the generating set of the Pauli-basis of the noise operator. We showed that there can be an exponential reduction in the number of twirling gates in some cases. Our arguments can be easily extended to a general noise channel. In addition, we showed that in the case of stabiliser codes, we can replace elements in the generating set of the twirling set with existing stabiliser measurements to further reduce the size of the twirling set.
For twirling of a given noise operator, we have not proven the twirling set we obtained is the smallest possible. Hence, any further investigations can look into such a proof or even constructing a smaller twirling set than ours.
For a general noise channel, the simple generalisation mentioned in Section 4.2 can indeed produce a twirling set smaller than the full set of Pauli operators. However, it is not the smallest possible set since we have not made use of the fact that different noise elements are inherently separated. To obtain the optimal twirling set, we need to study the following property of twirling: if we know a twirling set that can twirl the noise operator M, and we know another twirling set that can twirl the noise operator N, then what is the twirling set that can twirl the noise channel Similarly, we can also ask what is the twirling set that can twirl the noise operator MN, which is essential in finding a single twirling operation that can twirl several consecutive erroneous components. We hope that this article will provide a framework for further explorations of properties of twirling like the two mentioned above.
In this paper, we have only focused on using Pauli twirling to convert error channels into Pauli channels for error threshold estimation. There is also Clifford twirling, which converts error channels into depolarising channels instead. Clifford twirling can be viewed as symplectic twirling on top of Pauli twirling 23 , so we can easily apply our arguments to the Pauli twirling step. Clifford twirling is integral to Clifford randomised benchmarking 3,4 and is also used in quantum process tomography to reduce the number of experiments that we need to run exponentially 5,6 . We cannot apply our techniques directly to both of these areas since we do not know the form of the quantum process that we want to twirl. However, our analysis might provide a basis for finding a reduced twirling set for the case in which some characteristics of the quantum process are known, but not the full model.