Introduction

The quantum fault-tolerant threshold theorem states that when the error rate of the physical components is below a certain threshold value for a given quantum error correction code, we can reduce the error rate of the logical qubits indefinitely by scaling up our code.1,2,3 Thus for a given code, its threshold value is the target hardware error rate the experimentalists will aim for. The threshold error rate is defined using the worst-case error rate like the diamond distance since it is related to the rate of error accumulation. However, experimentally we can only measure the average error rate like the fidelity efficiently. For Pauli channels, the worst-case error rate is similar to the average case error rate. However, for coherent (unitary) errors, their worst-case error rate can scale as the square root of the average error rate, making them potentially more damaging to quantum error correction codes due to a faster rate of error accumulation.4,5,6,7,8,9,10

At the physical qubit level, coherent noise can be mitigated using dynamical decoupling,11,12 however there are limitations due to imperfect control pulses and finite pulse durations and intervals. In the context of quantum error correction, local physical coherent noise will be decohered at the logical level as the code scale up.13 Their damage to the encoded state can be mitigated by using better decoders.14 Gate-level coherent errors in quantum error correction circuit can be mitigated by splitting the stabiliser check into two oppositely rotating halves15 with some requirements on the gates available to the given architecture. A more general solution would involve using Pauli twirling to turn the coherent noise into a Pauli channel,16,17,18,19 which as mentioned before can be much less damaging to the fault-tolerant threshold. Twirling generally involves using all possible Pauli gates to sandwich the noise channel and averaging over the results. The average weight of the extra twirling gates we need to apply scales with the total number of qubits, thus the gate errors introduced by the twirling gates are not negligible.

In this Article, instead of using twirling to combat coherent errors, we propose to deterministically sandwich the noise channel using a chosen pair of Pauli gates, which we call Pauli conjugation. We find ways to reduce the search space for the optimal Pauli conjugation scheme, which is then used to compare the logical fidelity and concatenated threshold of Pauli conjugation to those of twirling for several quantum error correction codes under global \(Z\) rotation noise. We then discuss the extension of our technique to multiple rounds of error corrections and conjugations.

Results

Quantum error correction

In the Pauli transfer matrix formalism,20 the density operators are written in vector form by decomposing into Pauli basis \(G\in {\mathbb{G}}\):

$$\begin{array}{l}\rho=\frac{1}{2^{n}}{\sum \limits_{G \in {\mathbb{G}}}}{\rm{Tr}}(G \rho)G\\ \Rightarrow\vert \rho \rangle\rangle={\sum \limits_{G \in {\mathbb{G}}}}\vert G \rangle\rangle\langle\langle G \vert \rho \rangle\rangle\end{array}$$

where we have defined the inner product as:

$$\left\langle \left\langle G| \rho \right\rangle \right\rangle =\frac{1}{\sqrt{{2}^{n}}}{\rm{Tr}}(G\rho )$$

We have added a scaling factor \(\frac{1}{\sqrt{{2}^{n}}}\) when we use the Pauli operators as basis, where \(n\) is the number of qubits. This is to ensure the normalisation of the basis set \(\{\left|G\right\rangle \rangle \}\).

In such a way, a general quantum channel \({\mathcal{E}}\) can be written in matrix form:

$${\mathcal{E}}={\sum \limits_{G,G^{\prime} \in {\mathbb{G}}}}\left|G^{\prime} \right\rangle \rangle \left\langle \left\langle G^{\prime} | {\mathcal{E}}| G\right\rangle \right\rangle \langle \langle G|$$

with the matrix elements given by

$${{\mathcal{E}}}_{G^{\prime} G}=\left\langle \left\langle G^{\prime} | {\mathcal{E}}| G\right\rangle \right\rangle =\left\langle \left\langle G^{\prime} | {\mathcal{E}}(G)\right\rangle \right\rangle =\frac{1}{{2}^{n}}{\rm{Tr}}(G^{\prime} {\mathcal{E}}(G)).$$

For a code defined by the set of stabilisers \({\mathbb{S}}\), we will denote the stabiliser generators as \(\widetilde{{\mathbb{S}}}\). In this Article, the generator of a set is denoted using \(\widetilde{\quad }\). When we talk about the generators for a Pauli set, the composition operation we used in the generation will ignore all the phase factors in front.

We will do stabiliser measurements for all \({\widetilde{S}}_{i}\in \widetilde{{\mathbb{S}}}\) to extract the error syndrome \(\overrightarrow{m}\) whose element \({m}_{i}\in \{0,1\}\) is the measurement outcome of the stabiliser generator \({\widetilde{S}}_{i}\). This will project the noisy state into the corresponding \(\overrightarrow{m}\)-syndrome subspace using the syndrome projection operators

$${\Pi }_{\overrightarrow{m}}=\prod _{i=1}^{\left|\widetilde{{\mathbb{S}}}\right|}\frac{\left(1+{(-1)}^{{m}_{i}}{\widetilde{S}}_{i}\right)}{2}.$$

For each measured syndrome \(\overrightarrow{m}\), we will apply the corresponding recovery operator \({R}_{\overrightarrow{m}}\), which is usually chosen to be the most likely Pauli error that leads to the given syndrome. Using to denote a super-operator

the overall quantum error correction process can be written as:

where we have used \({\Pi }_{\overrightarrow{m}}={R}_{\overrightarrow{m}}{\Pi }_{0}{R}_{\overrightarrow{m}}\).

If we start within the logical subspace, the error correction process \({\mathcal{C}}\) will always project the state back to the logical subspace even after going through a noisy channel \({\mathcal{N}}\). Thus, the effective channel \({{\mathcal{N}}}_{0}={\mathcal{C}}{\mathcal{N}}\) will be a error channel that takes one logical state to another, i.e., it is a logical noise channel. The effective logical noise channel \({\overline{{\mathcal{N}}}}_{0}\) is defined to be the average over all logically equivalent starting and final states:

(1)

where Note that here we have abused the notation of \({\mathcal{R}}{\mathcal{N}}\) assuming it will only act on the logical Pauli basis \(\{|\overline{G}{\Pi }_{0}\rangle\rangle\}\) instead on all of the physical Pauli basis.

Pauli conjugation

Twirling is a technique for converting an arbitrary error channel into a Pauli channel,16,17,21 which is carried out by taking the average of the error channel conjugated with different gates chosen from a set of Pauli gates \({\mathbb{W}}\subseteq {\mathbb{G}}\) that we call the twirling set. Conventionally, twirling is carried out using the full set of Pauli gates as the twirling set: \({\mathbb{W}}={\mathbb{G}}\). However, it is possible to find a smaller \({\mathbb{W}}\) that is equivalent to the full Pauli set as we will see later (also shown in ref. 22).

Twirling a noise channel \({\mathcal{N}}\) is just

(2)

Twirling can decohere the Pauli components in the noise channel and turn it into a Pauli channel. This will correspond to removing the off-diagonal elements of the Pauli transfer matrix of the channel.

Using Eqs (1) and (2), the effective logical channel after twirling is:

Instead of averaging over all twirling gates, if we deterministically conjugate the noise process with a given twirling gate \(W\), the effective logical channel can be written as

which we will call Pauli conjugation.

Then we have:

$$\begin{array}{lll}{\overline{{\mathcal{N}}}}_{0}&=&\overline{{\mathcal{N}}}(I)\\ {\overline{{\mathcal{N}}}}_{T}&=&\frac{1}{\left|{\mathbb{W}}\right|}\mathop{\sum}\limits_{W\in {\mathbb{W}}}\overline{{\mathcal{N}}}(W).\end{array}$$

The logical fidelity of \(\overline{{\mathcal{N}}}(W)\) is

$$F(W)=\int \left\langle \left\langle \overline{\rho }| \overline{{\mathcal{N}}}(W)| \overline{\rho }\right\rangle \right\rangle {\rm{d}}\overline{\rho }$$

where \(\overline{\rho }\) is a logical state and the integral is over the pure state surface using the Haar measure.

Since the fidelity \(F\) is a linear function of the noise process \(\overline{{\mathcal{N}}}\), we can similarly obtain the original logical fidelity \({F}_{0}\) and the twirled logical fidelity \({F}_{T}\):

$$\begin{array}{l}{F}_{0}=F(I)\\ {F}_{T}=\frac{1}{\left|{\mathbb{W}}\right|}\mathop{\sum}\limits_{W\in {\mathbb{W}}}F(W).\end{array}$$

There exists a \({W}_{\mathrm{max}}\in {\mathbb{W}}\) such that \(F({W}_{\mathrm{max}})\) is the maximum \(F(W)\) that we can achieve. By definition we have

$$\begin{array}{l}F({W}_{\mathrm{max}})\ge F(I)\\ F({W}_{\mathrm{max}})\ge{F}_{T}.\end{array}$$

Thus if we can find such \({W}_{\mathrm{max}}\) and deterministically apply it to the noise instead of doing nothing or randomly applying all \(W\in {\mathbb{W}}\), we can obtain a higher fidelity \(F({W}_{\mathrm{max}})\) than the original fidelity \(F(I)\) and the twirled fidelity \({F}_{T}\).

Now let us dig deeper into the mechanism of conjugation. Let us first consider the case when we perform quantum error correction on a unitary (completely coherent) noise channel and obtain the 0-syndrome (\({m}_{i}=0\quad \forall i\)). The resultant effective noise channel will contain an error-free component representing by the coherent superposition of the stabiliser operators \({\sum }_{i}{\alpha }_{i}{S}_{i}\). When acting on a logical state, the effective amplitude corresponding to the logical identity will then be \({\sum }_{i}{\alpha }_{i}\).

Now if we apply Pauli conjugation using the operator \(W\) to the error channel, the error-free components will become \({\sum }_{i}{\alpha }_{i}W{S}_{i}W\), which corresponds to an amplitude of \({\sum }_{i}\eta (W,{S}_{i}){\alpha }_{i}\) for the logical identity. Here \(\eta (A,B)\) is the commutator between operators \(A\) and \(B\):

$$AB=\eta (A,B)BA.$$

Thus Pauli conjugation will change the sign of the Pauli components of the error channel, changing the way the Pauli components interfere. For the 0-syndrome case, if we can choose a conjugation operator \(W\) such that \({\sum }_{i}\eta (W,{S}_{i}){\alpha }_{i}\ge {\sum }_{i}{\alpha }_{i}\), i.e., the error-free components (the stabilisers) interfere more constructively with conjugation than without, it will lead to an increase in the logical fidelity of the channel using conjugation. The normalisation of the channel also means that the logical error components of the channel will interfere more destructively when using conjugation. Similar arguments can be made for the non-zero-syndrome cases.

Hence for a given noise channel, as long as there is some coherent superposition of its Pauli components corresponding to the same logical operators for a given syndrome, Pauli conjugation should be able to improve its logical fidelity by changing the relative signs between the components and alter the way they interfere. One case for which Pauli conjugation will not be able to help is when the identity is the optimal conjugation gate \({W}_{\mathrm{max}}=I\), i.e., the noise Pauli components are interfering in the optimal ways for the given code, which should be unlikely unless we have hand-picked our code to exactly fit the noise process.

Finding the optimal conjugation gate

The usual Pauli twirling will have \({\mathbb{W}}={\mathbb{G}}\). For \(n\) qubits, this means that there are \({4}^{n}\) elements in \({\mathbb{W}}\) that we need to search over to find \({W}_{\mathrm{max}}\), which is exponentially difficult for large \(n\). Hence, we first need to reduce the size of \({\mathbb{W}}\) in order to find \({W}_{max}\) effectively.

Rather than dealing with the twirling set \({\mathbb{W}}\), we will first be working with its generator \(\widetilde{{\mathbb{W}}}\). The reason we can work with the generators for our later purposes is outlined in Supplementary Section III.

The generators of the conventional twirling set is just \(\widetilde{{\mathbb{W}}}=\widetilde{{\mathbb{G}}}\). For a given quantum error correction code, the generators of the Pauli basis \(\widetilde{{\mathbb{G}}}\) can be divided into the following partitions:

  • Stabiliser generators \(\widetilde{{\mathbb{S}}}\): the set of Pauli operators that define the stabiliser checks of the code.

  • Logical generators \(\widetilde{\overline{{\mathbb{G}}}}\): together with the stabiliser generators, they generate the set of logical operators \(\overline{{\mathbb{G}}}\), which is just the normaliser of the set of stabilisers \({\mathbb{S}}\).

  • Error generators \(\widetilde{{\mathbb{E}}}\): All the remaining generators needed to generate the whole Pauli set. Each error generator \(\widetilde{E}\) anti-commutes with a different subset of stabiliser generators and thus will produce a different syndrome.

Hence, we have

$$\widetilde{{\mathbb{W}}}=\widetilde{{\mathbb{G}}}=\widetilde{{\mathbb{S}}}+\widetilde{{\mathbb{E}}}+\widetilde{\overline{{\mathbb{G}}}}$$

Note that we have used the label ‘error generators’ since each such element creates a code violation, but physical error process can give rise to elements of any of these sets, and in particular those in \(\widetilde{\overline{{\mathbb{G}}}}\) which create undetectable logical errors.

The process of finding the optimal conjugation gate follows three steps:

  1. 1.

    Removing stabilisers and logical operators

    \({\mathcal{R}}\) and commute because they are both Pauli channels which are diagonal in the form of Pauli transfer matrix. Hence, for any channel \({\mathcal{N}}\), and logical states \(\left|\overline{\rho }\right\rangle \rangle\) and \(\left|\overline{\rho }^{\prime} \right\rangle \rangle\), we have:

    which means that conjugation using stabilisers on any noise channel has a trivial effect on the effective logical channels. Hence, we can remove all stabilisers from the twirling generator set and reduce it to:

    $$\widetilde{{\mathbb{W}}}=\widetilde{{\mathbb{E}}}+\widetilde{\overline{{\mathbb{G}}}}$$

    Now if we are calculating the logical fidelity, we are integrating over all the logical pure state using the unitary Haar measure, which is by definition invariant under any unitary transformation. Thus we have:

    \({\mathcal{R}}\) and again commute since they are both Pauli channel. Hence we have:

    Hence, when calculating the logical fidelity, conjugation with logical Pauli operators also acts trivially and can be removed from the twirling generating group. The remaining non-trivial twirling generators are:

    $$\widetilde{{\mathbb{W}}}=\widetilde{{\mathbb{E}}}$$
    (3)

    The way to construct a \(\widetilde{{\mathbb{E}}}\) consists of only single-qubit \(X\) and \(Z\) gates is outlined in Supplementary Section I.

  2. 2.

    Using the structure of the noise

    Two super-operators and will commute if their commutator \(\eta (A,B)={e}^{i\phi }\), i.e., their commutator is some phase factor.

    We will write our noise channel \({\mathcal{N}}\) in terms of its noise elements :

    Now if a twirling generator \(W\) satisfies \(\eta (W,N)={e}^{i\phi }\ \forall N\), then

    i.e. it act trivially on noise \({\mathcal{N}}\) and hence can be removed.

    After such reduction, the twirling generating set now becomes:

    $$\widetilde{{\mathbb{W}}}=\{W\in \widetilde{{\mathbb{E}}}| \;\exists N \, \eta (W,N)\;\ne \;{e}^{i\phi },\phi \in {\mathbb{R}}\}$$
  3. 3.

    Symmetry in code and noise

    The twirling set \({\mathbb{W}}\) can be generated from \(\widetilde{{\mathbb{W}}}\) following Supplementary Section II. Based on the symmetry existing in both the code and the noise, we can prove the equivalence between different elements in \({\mathbb{W}}\).

    Suppose we manage to find a Clifford operation \(U\) such that the code state basis \({\Pi }_{\overrightarrow{0}}\overline{G}\) and the physical noise channel \({\mathcal{N}}\) are invariant under its transformation:

    we can prove that (see Supplementary Section IV)

    $$\overline{{\mathcal{N}}}(W)=\overline{{\mathcal{N}}}({U}^{\dagger }WU)$$

    i.e. the effective logical channel conjugated with \(W\) is the same as that with \({U}^{\dagger }WU\). All of such \(U\) will form a group \({\mathbb{U}}\).

    Hence, we can define an equivalence relation:

    $$W^{\prime} \sim W\ \iff \ \exists U\in {\mathbb{U}}\quad W^{\prime} ={U}^{\dagger }WU$$

    In such a way, conjugacy with elements in \({\mathbb{U}}\) will split \({\mathbb{W}}\) into several equivalence classes. The elements in the same equivalence class will produce the same logical fidelity when used to conjugate the noise.

    The simplest type of Clifford transformation to consider is qubit permutation, for which \(U\) consists of swap gates. Permutation symmetry of quantum error correction codes has been studied in refs 10,14. Note that qubit permutation will preserve the weights of the operators, thus it is crucial to construct \({\mathbb{W}}\) to have the elements with the lowest weight possible (see Supplementary Section II), so that more of them can be proven to be in the same equivalence class.

    If a code has one logical qubit and its logical Pauli gates (one of the possible representations out of the logically equivalent operators) consist of applying physical Pauli gates to all the qubits, then such transversal logical Pauli gates are invariant under any qubit permutation \(U\), i.e., \(\left[U,\overline{G}\right]=0\quad \forall G\in {\mathbb{G}}\). For such codes, we only need to further make sure that the set of stabilisers are invariant under the given qubit permutation \(U\):

    $$\left[U,{\Pi }_{0}\right]=0$$

    to ensure the code symmetry requirement in Eq. (7) is satisfied. Furthermore, if some of the stabilisers commute with the noise, then these stabilisers will have trivial effect in the error correction process and thus can be safely ignored. In such a case, we will only need to consider the symmetry of the stabilisers that do not commute with the noise. For example, for a pure \(Z\) noise, we can safely ignore the \(Z\) stabilisers when we are considering code symmetry.

Mitigating coherent \(Z\) noise using Pauli conjugation

In this Section we will try to find the optimal Pauli conjugation gate for different quantum error correction codes under the global \(Z\) rotation noise:

$$N(\theta )=\prod _{j=1}^{J}{e}^{-i\theta {Z}_{j}}$$
(7)

where \(J\) is the number of qubit. This noise is a coherent superposition of all possible \(Z\) operators (tensor products of \(I\) and \(Z\)). The weight-\(n\) \(Z\) operators in the superposition will have the amplitude \({\left(-i\sin \theta \right)}^{n}{\left(\cos \theta \right)}^{J-n}\).

Of course if we are allowed to flip all the qubits right in the middle of the channel, we can flip the direction of the rotation and cancel the coherent error, which is just a simple example of dynamical decoupling. However, if we look at for example high frequency global \(Z\) noise, in which the direction of the global \(Z\) rotation may flip after a very short time interval in a random walk fashion, dynamical decoupling cannot be applied. In such a case, we have discussed how Pauli conjugation can be used to mitigate such noise in Supplementary Section XI. It builds from our discussion in this section, in which we will be looking at the coherent global \(Z\) rotation noise described in Eq. (7) without allowing gates to be performed in the middle of the channel.

Since the noise only consists of \(Z\) components, all pure \(Z\) twirling generators will act trivially on the noise, thus can be removed. This noise is symmetric under any qubit permutation. Hence, any permutation symmetry of the quantum error correction code will also exist for the noise.

For all the codes that we will discuss in this section, their logical Pauli gates consist of applying physical Pauli gates to all the qubits. Thus the code symmetry condition can be reduced into Eq. (8). Along with the fact that we have pure Z noise, we only need to focus on the symmetry of the \(X\) stabilisers in this section when we talk about the symmetry of a code, except for the five-qubit code. Global logical Pauli gates also mean that \(N(\frac{\pi }{2})\) will be the \(Z\) logical operator. Thus the logical fidelity curve against different \(\theta\) will have rotational symmetry about \(\theta =\frac{\pi }{4}\) (see Supplementary Section V), which means that we only need to look at \(0\le \theta \le \frac{\pi }{4}\) to see the effect of the noise on logical fidelity.

Now let’s first look at the example of the Steane Code (shown in Fig. 1), for which we have

  • Stabiliser generators \(\widetilde{{\mathbb{S}}}\): \(X\) or \(Z\) checks on plaquettes \((1,4,6,7)\), \((2,4,5,7)\) and \((3,5,6,7)\).

  • Logical generators \(\widetilde{\overline{{\mathbb{G}}}}\): \(X\) or \(Z\) on all qubits.

Following Eq. (3), we can construct our twirling generators to be

$$\widetilde{{\mathbb{W}}}=\widetilde{{\mathbb{E}}}=\{{X}_{1},{X}_{2},{X}_{3},{Z}_{1},{Z}_{2},{Z}_{3}\}.$$

Since the noise only consists of \(Z\) components, all pure \(Z\) twirling generators will act trivially on the noise, thus can be removed, we then have:

$$\widetilde{{\mathbb{W}}}=\{{X}_{1},{X}_{2},{X}_{3}\}$$

which generates the twirling set:

$${\mathbb{W}}=\{I,{X}_{1},{X}_{2},{X}_{3},{X}_{4},{X}_{5},{X}_{6},{X}_{7}\}.$$

Note that here we have transformed the error operators to their lowest weight equivalence that produce the same error syndromes.

The Steane code has the same symmetry as the Fano plane,10 whose permutation symmetry group will be denoted as \({\mathbb{U}}\). Since our noise model is symmetric under any qubit permutation, all \(U\in {\mathbb{U}}\) satisfied Eq. (7).

Now for every pair of single-qubit \(X\) operators \({X}_{i},{X}_{j}\in {\mathbb{W}}\), we can find at least one \(U\in {\mathbb{U}}\) such that

$${U}^{\dagger }{X}_{i}U={X}_{j}.$$

Hence, using Eq. (8) we know that all the remaining single-qubit \(X\) twirling operators are equivalent.

There are two equivalence class of twirling gates here, one is equivalent to \(I\), while the other is equivalent to \({X}_{1}\) (or any single-qubit \(X\) gate).

The effect of different strategies on the logical fidelity of Steane code is shown in Fig. 2. We can see that twirling is consistently better than doing nothing, while \({X}_{1}\) conjugation will yield even higher fidelity than twirling.

Fig. 1
figure 1

The Steane code.

Fig. 2
figure 2

Logical fidelity of the Steane code under different noise strength and noise tailoring schemes.

Now we will explore the effect of Pauli conjugation using other small codes under the same noise model. The details of finding the equivalent class of conjugating gates for different codes are outlined in Supplementary Section VI. Here we will just look at the effect of using conjugating gates in different equivalence classes and compare their effects to doing nothing and twirling.

  • Five-qubit code

    The structure of five-qubit code is shown in Fig. 3. There is just one non-trivial conjugating strategy in five-qubit code, which is conjugation with any single-qubit X gate, the same we found in the Steane code. However, in our noise model, we found that this strategy makes no difference to the logical fidelity compared to doing nothing. Consequently, the twirled logical fidelity is also the same. Hence, rather interestingly under our noise model, none of the strategies works for the five-qubit code.

    Fig. 3
    figure 3

    The five-qubit code.

  • Nine-qubit Shor code

    The structure of the nine-qubit Shor code is shown in Fig. 4. There are three types of non-trivial Pauli conjugations in the nine-qubit Shor code for our noise model:

    • Single qubit flip: \({X}_{1}\)

    • Two-qubit flip (in different rows): \({X}_{1}{X}_{4}\)

    • Three-qubit flip (in different rows): \({X}_{1}{X}_{4}{X}_{7}.\)

    The effects of these strategies on the logical fidelity are shown in Fig. 5. We see that doing nothing will result in a dip at \(\theta =\frac{\pi }{6}\), where our noise turns into a logical operator. Twirling can definitely mitigate such a problem, leading to a great jump in fidelity. Superior improvements can be achieved by conjugating the noise with \({X}_{1}{X}_{4}{X}_{7}\).

    Fig. 4
    figure 4

    The nine-qubit Shor code.

    Fig. 5
    figure 5

    Logical fidelity of the nine-qubit Shor code under different noise strength and noise tailoring schemes.

    The result for the other nine-qubit Shor code with the X and Z checks exchanged is shown in Supplementary Section VIII.

  • Distance-3 surface code

    The structure of the distance-3 surface code is shown in Fig. 6. The non-trivial conjugating strategies and their effects on the logical fidelity are shown in Fig. 7. Again we see improvement of the twirled fidelity over doing nothing, and a marked improvement of conjugating the noise with \({X}_{1}{X}_{8}\) over twirling.

    Fig. 6
    figure 6

    The surface code of distance 3.

    Fig. 7
    figure 7

    Logical fidelity of the distance-3 surface code under different noise strength and noise tailoring schemes.

Gate error

In reality, applying extra Pauli gates does not come free due to the errors associated with the gates. We should expect the effect of such errors due to Pauli conjugation to be small since the quantum error correction circuits involve far more gates than Pauli conjugation and also contain two-qubit gates which usually have much lower fidelity than single-qubit Pauli gates. Here we have simulated the performance of different schemes using different codes with depolarising gate error rates of \(0.5 \%\) and \(1 \%\) for the encoding circuit, the quantum error correction circuit and the Pauli conjugation gates (with the details of the circuits shown in Supplementary Section IX). From the result in Fig. 8 we can see that as we increase the gate error rate, the fidelity curves shift downward without much change to their shapes. Hence, the optimal Pauli conjugation schemes maintain their advantages over doing nothing when we take into account gate errors. The fidelity curves using twirling are not shown. However in our examples, we should expect the advantage of Pauli conjugation over twirling increases with increasing gate error rates since the average weights of the twirling gates are higher than that of the conjugation gates.

Fig. 8: Logical fidelity with global Z rotation environmental noise of magnitude θ and depolarising gate noise of probability 0%, 0.5% and 1% with or without Pauli conjugation.
figure 8

The three plots show three different codes: (a) Steane code, (b) 9-qubit Shor code and (c) distance-3 surface code. The Pauli conjugations we used here are the optimal schemes that we found with zero gate error.

When trying to implement Pauli conjugation in practice, such gate errors can be mitigated by absorbing the conjugation gates into the existing gates in the circuit. Such a strategy has been proven to be effective in the case of twirling.23

Concatenated threshold

As discussed by Rahn et al.,24 after finding the map between the physical noise channel and the logical noise channel with one level of encoding, composing this map will give us the physical-logical noise map for the concatenated code. Here we have assumed that we are using a hard decoder which only takes into account of syndrome information of the current concatenation level. Finding such maps will allow us to compute the performance of a code with different levels of concatenation and hence find its concatenated threshold. Such analysis was carried out in ref. 10 for a variety of codes. Here we will use the local \(Z\) noise map obtained in ref. 10 to calculate the concatenated threshold for different codes when we apply different kinds of noise tailoring schemes at the physical level (not at any subsequent levels of concatenation). From the results in Fig. 9, we can see the logical fidelity of the threshold crossing points of different noise tailoring schemes are essentially the same. Hence when we try to achieve the threshold logical fidelity with one level of encoding, if one scheme has a higher tolerance of the physical error than another scheme, we should expect a similar improvement in the concatenated threshold. The improvement of the conjugated threshold over the original threshold is \(40 \%\), \(160 \%\) and \(110 \%\) for the Steane code, 9-qubit Shor code and distance-3 surface code respectively. All of them also show improvements of the conjugated thresholds over the twirled thresholds.

Fig. 9: The concatenated threshold plot under global \(Z\) rotation noise.
figure 9

The three plots show three different codes: (a) Steane code, (b) 9-qubit Shor code and (c) distance-3 surface code. Different colours show different levels of concatenation while different line styles show applying different strategies like twirling or Pauli conjugation to the noise. The Pauli conjugations we used here are the optimal schemes that we found with zero gate error.

Multiple rounds of quantum error correction

As mentioned in the introduction, coherent errors can be more damaging than incoherent errors because they can accumulate at a faster rate.4,8 Hence, we use Pauli twirling to remove the coherent nature of the error channel for each round of error correction so that errors in multiple rounds of error correction will accumulate at a more favourable scaling. As demonstrated in the previous sections, Pauli conjugation can improve the logical fidelity for coherent errors in one round of error correction. However, the error remains coherent after conjugation, which means that the advantages of conjugation can be lost when we go to multiple rounds of error correction.

Fortunately this can be overcome by injecting ‘just enough’ randomness—the solution might be called ‘logical twirling’ of the error channel (instead of twirling at the physical level). Logical twirling simply means twirling over the logical Pauli operators and decohere the Pauli components that corresponding to different logical operators. The resultant effective channel will be logically incoherent and thus the errors will accumulate at a more favourable rate in terms of logical fidelity. For one round of quantum error correction, applying logical twirling will not change the logical fidelity just like twirling a noise channel will not change its fidelity. Hence, applying logical fidelity on top of conjugation can maintain the fidelity improvement brought by conjugation in each round of error correction while preventing the logical errors from rapid accumulation as we go to multiple rounds.

The Pauli components of a given noise channel can be partitioned into sets that correspond to different logical operators with different measured syndromes after quantum error correction. As discussed before, the coherence between the components that correspond to the same logical operator and the same syndrome can be used by conjugation to improve the logical fidelity of the channel in one round of quantum error correction (via destructive interference between the logical error components), while in this section we see that the coherence between different logical operators can be removed by logical twirling to fight the accumulation of logical errors in multiple rounds of quantum error correction.

In Supplementary Section X, using global \(Z\) rotation as an example, we have demonstrated that using conjugation alone, the advantages of conjugation over physical twirling will diminish as we go to more rounds of quantum error correction and we have also shown how this is overcome by using logical twirling.

Multiple rounds of noise tailoring

Instead of applying both noise tailoring and error correction at each time step, we can apply just noise tailoring in each time step and only do one round of error correction at the very end.

The matrix elements for the effective noise channel with \(K\) rounds of twirling are:

(8)

Here we divide the noise process into \(K\) steps and apply a random Pauli gate \({W}_{k}\) at the beginning of each step. At the end, we undo all these random Pauli gate by applying the their inverse \({\prod }_{k=1}^{K}{W}_{k}\) and then perform quantum error correction. We denote the set of \(K\) Pauli gate chosen using a vector \(\overrightarrow{W}\). Similar to our arguments about one round of twirling, multiple rounds of twirling correspond to the average of all the Pauli conjugation schemes, thus one of the Pauli conjugations will be optimal and outperforms twirling.

As detailed in Supplementary Section XII, if we want to find the equivalent conjugations to reduce the search space for multi-round conjugation, we can use similar arguments about the structure of the noise and the symmetries in both the noise and the code, while the arguments about interaction with the code space to remove stabilisers and logical operators can only be applied to the outer-most round of conjugation.

The search space of possible conjugations grows exponentially with the number of rounds while the number of symmetries that we can utilise is less than the one-round case (since we cannot remove all the stabilisers and logical operators from the twirling generating set). Hence, iterating over the whole search space might not be practical for a large number of rounds. However, we can still sample different conjugation schemes in our reduced search space to find a better scheme than doing nothing or even twirling, though such a scheme might not be optimal.

Discussion

In this Article, we have shown that when doing one round of quantum error correction on a coherent noise channel, part of its coherence can actually be used to improve its logical fidelity using Pauli conjugation, which outperforms twirling. To search for the optimal Pauli conjugation under a given noise model using a given quantum error correction code, we use the properties and the symmetries of the noise and the code to identify the equivalent conjugations to reduce our search space. We applied our techniques to the Steane code, the Shor code and the surface code under a global \(Z\) rotation noise, reducing the \({4}^{n}\) possibilities of Pauli conjugation to 2, 4 and 6 equivalent classes respectively for those three codes. Iterated over these different classes of conjugations, we managed to find the optimal conjugations for each code, which resulted in higher logical fidelities than the twirled and original noise channel. We have shown via simulation that the advantages of the optimal Pauli conjugation schemes remain with gate errors present. Conjugation can also lead to higher concatenated thresholds than the twirled threshold. The conjugated threshold showed improvements over the original thresholds by \(40 \%\), \(160 \%\) and \(110 \%\) for the three codes we considered under the coherent \(Z\) noise. We showed that by using logical twirling to remove the ‘harmful’ coherence within the error channel, we can extend the advantages of Pauli conjugation to multiple rounds of error correction. We also briefly discussed how to extend our arguments into multiple rounds of Pauli conjugation.

Compared to twirling, Pauli conjugations does not require the implementation of a random circuit, and the weights of the gates that we need to implement can be on average much smaller than twirling as shown by our examples. Being a deterministic scheme, it can be implemented in hardware systems in which modifying the circuit at each run is hard. It can also be used in quantum communication to combat coherent noise in the communication channel without needing to transmit the extra random bit needed by twirling. Single-qubit Pauli gates are usually the gates with the highest fidelity, combining with the fact that the Pauli conjugation gates we need to implement can be low-weight, it should be resilient to gate errors, as shown by our simulation. Hence, Pauli conjugation can be a practical way forward to mitigate errors in real experiments.

The way we reduce the Pauli conjugation search space is highly dependent on the code we use and the noise model we have. Though our techniques work for the simple examples that we have considered, searching over all possible Pauli conjugations may not be feasible when the size of our system increase, when there are very few symmetries in the noise or when we are considering multiple rounds of Pauli conjugation. Hence, we might want to find a way to construct the optimal conjugation based on the mechanism of conjugation described, or at least find a better searching strategy than random sampling. Furthermore, we may not know the full noise model in practice. As mentioned, conjugation will only act on the coherent components in the channel, thus to find the optimal (or close-to-optimal) conjugation gate we only need the information about the dominant coherent component in the channel without needing any information about the incoherent parts or the other small coherent components. In the worst-case scenario, we can still sample over the different Pauli conjugations based on any limited information we have to find a scheme with better performance than the original noise channel instead of finding the optimal one.

The above ideas can be tested by applying Pauli conjugation to more general error channels beyond the global \(Z\) rotation. An example will be the general local \(Z\) noise channel considered in10 or some non-biased noise models like those considered in.25 To see if the conjugation technique is valuable in fault-tolerant computation, it will also be interesting to see how Pauli conjugation will perform against gate-level coherent noise and whether it can improve the surface code threshold (instead of the concatenated threshold) given a realistic noise model.

There are several degrees of freedom we can add to further optimise our noise tailoring schemes. Firstly, throughout this Article we have been focusing on conjugation using Pauli gates, it will be interesting to extend our technique to Clifford gates or even general unitaries. We can also look into the case where we allow Clifford correction.14 We definitely did not exhaust all the ways to reduce the Pauli conjugation search space. For example, we have only been focusing on the permutation symmetry of code and noise, which at best can only prove the operators with the same weight are equivalent. A next step could be including other Clifford symmetries like CZ gates, etc.

Our conjugation scheme, especially the multi-round variant, in a way can be viewed as bang-bang dynamical decoupling tailored to a given quantum error correction code. Attempts have been made before to study the effect of dynamical decoupling within the context of quantum error correction,26,27,28 but more work can be done by making use of the code and noise structures like we did in this Article. It will be a fruitful area to adapt more schemes in the established literature of dynamical decoupling12 into the context of quantum error correction taking into account the code structure. We may get a fuller understanding about how to search for better multi-round conjugation scheme from the way we optimise dynamical decoupling using average Hamiltonian arguments29 and group-theoretic arguments.30 Ideas like non-equidistant pulses,31 robust decoupling sequences and higher-order decoupling12 can also be extended into multi-round conjugation.

Besides applications in quantum error correction for memory, the conjugation technique can also be extended into other fields like quantum metrology and quantum simulation. For quantum metrology with error correction,32,33,34 we hope to find conjugation schemes that can tailor the noise into a form that is less damaging to the code and/or tailor the signal into a form that the code is more sensitive towards. When applied to symmetry verification in quantum simulation,35,36,37conjugation may enable more noise to be detected via transformation of the previously undetected noise components. In the above applications, it is likely that we need to develop more complex conjugation schemes beyond one-round Pauli conjugation.