Bias-preserving computation with the bit-flip code

We explore the feasibility of fault-tolerant quantum computation using the bit-flip repetition code in a biased noise channel where only the bit-flip error can occur. While several logic gates can potentially produce phase-flip errors even in such a channel, we propose bias-preserving implementation of $S$, $H$, $\mathrm{CZ}$, and $R_z$ gates. We demonstrate that our scheme improves the computational precision in several tasks such as the time evolution of quantum systems and variational quantum eigensolver.


I. INTRODUCTION
Quantum error correction plays a pivotal role in successfully executing quantum algorithms on noisy quantum computers.Specifically, the surface code [1][2][3] and its variants exhibit promising attributes concerning scalability.The family of quantum low-density parity check codes [4] that outperform those codes are also actively being investigated.While these error-correcting codes hold the potential to be deployed in fault-tolerant quantum computers in the future, their current utilization in practical calculations is constrained by existing technical limitations.
This paper examines the viability of fault-tolerant quantum computation in biased noise channels, particularly focusing on Noisy Intermediate-Scale Quantum (NISQ) or early Fault-Tolerant Quantum Computational (FTQC) devices, which are equipped with many qubits but have limited depth.Specifically, we focus on the repetition code, the simplest errorcorrecting code that would be useful in a highly biased environment and is feasible with modern technology [26][27][28][29][30][31].To clarify the setup, we will consider a noise model characterized exclusively by uncorrelated bit-flip errors; we will ignore coherent, readout, and other error types.The following argument holds true for a noise model in which only phase-flip errors occur.The question here is whether a universal quantum computation is possible in such a setup.This is highly nontrivial: despite the error channel being restricted to bit-flip errors, it remains possible for phase-flip errors to arise during the course of the computation, which cannot be detected nor corrected by the bit-flip repetition code.For example, a naively implemented Hadamard gate converts the bit-flip error to the phase-flip error.Consequently, achieving fault-tolerant quantum computation demands the implementation of logical gates that preserve the bias of the error channel.Such gates, known as bias-preserving gates [13,14,16], must be designed to avoid converting bit-flip errors into other types of errors.
To address this issue, we propose a set of novel bias-preserving gates: S, H, CZ, and R z gates.Our central concept is that phase-flip errors occurring in the middle of the circuits can be intentionally correlated with bit-flip errors.Consequently, this correlation enables the detection of the phase-flip errors emerging within these Clifford gates through usual syndrome measurements.While errors in the R z gate can no longer be Pauli errors, the biaspreserving R z gate can be implemented based on the same idea.While our implementation approach entails the drawback of requiring postselection, it offers the advantage of bypassing the need for the Toffoli gate in Hadamard gate implementation [13].Another previous study proposed a bias-preserving implementation for a class of operators called X-type unitaries [10].In contrast, a notable feature of this study is incorporating analog rotation gates that allow arbitrary unitary operations.This paper is organized as follows.In Sec.II, we define our noise model and show the details of implementing fault-tolerant and bias-preserving gates.In Sec.III, we show several numerical demonstrations of our scheme.In Sec.IV, we discuss the effects of phase-flip error.Section V is devoted to the discussion and concluding remarks.

II. FAULT-TOLERANT AND BIAS-PRESERVING LOGICAL GATES
Throughout this paper, X, Y and Z denote Pauli matrices.The Pauli matrix P that acts on i-th qubit is denoted by

A. The noise model and fault-tolerant operations
We discuss quantum circuits in a noisy environment where only bit-flip error occurs.We assume that elemental gate sets consist of single and two-qubit gates.Let ρ 0 and ρ be the ideal initial and final density matrices of the system, and U be a unitary gate.The state after a noisy single-qubit unitary operation is given by E p (U ρ 0 U † ) = E p (ρ), where E p denotes the quantum operation that describes the bit-flip error after a single qubit with probability p: The noisy two-qubit gate is given in a similar manner, but the noise channel is replaced by Unless otherwise noted, we do not consider other types of errors: phase-flip error, coherent error, readout error and so on.We also assume that we can always prepare clean |0⟩1 .
Encoding qubits in the bit-flip code is the simplest way to protect qubits from the bit-flip error.In the bit-flip code with distance d = 3, we make each qubit redundant with three qubits as Note that the encoded state, or the logical qubit, is denoted as |•⟩ L from now on.Each qubit that constitutes a logical qubit is called a physical qubit.This code can correct a single-qubit bit-flip error but cannot correct further errors, which we call logic errors.
Let N be the number of logical qubits, and X a,j be an X-gate acts on j-th physical qubit of the a-th logical qubit.An operation is called a fault-tolerant and bias-preserving operation if, after performing the operation, the density matrix is given by where ρ is the density matrix for the noiseless case, and c 0 and c aj are O(1) constants.The definition of the fault-tolerant operation requires logic errors do not occur with probability O(p).In other words, terms like pX 1,1 X 1,2 ρX 1,2 X 1,1 are not allowed.At the same time, Eq. ( 8) also requires that the phase-flip error does not appear with probability O(p).As we will see below, the phase-flip error inevitably appears during several logical gates, even for our noise model, if we implement these logical gates naively.Constructing bias-preserving logical gates, which only cause a bit-flip error, is a central issue of the following sections.

B. Error correction
A bit-flip error in the code Eq. ( 7) can be detected by the measurement of the stabilizers Z 1 Z 2 and Z 2 Z 3 , and it can be corrected by the subsequent feedback operation of X i .For completeness, we show the relation between the error syndrome and the feedback operation required in Table I.The eigenvalues of the stabilizers can be obtained by measuring ancilla qubits connected by CNOT gates with the logical qubit as shown in Fig. 1.
If the error syndrome is measured only once, bit-flip errors can accumulate in two physical qubits with probability p.This event is caused by a bit-flip error after the second CNOT gate.To evade this problem, it is well known that we need to take a majority vote on multiple syndrome measurements to obtain the correct error syndrome, known as Shor's fault-tolerant scheme [32].Here, we revisit the three-round scheme [33][Sec.10.6].If all three syndrome measurements differ from each other and the majority vote cannot be taken, no feedback is manipulated.In this implementation, there are 24 different failure patterns such that the probability of occurrence is p within our noise model.These errors can be recovered or give at most one bit-flip error in the final state.The density matrix after the fault-tolerant error correction is This parametrization can be slightly improved by reducing the number of syndrome measurements to two.Two syndrome measurements are sufficient to distinguish bit-flip errors occurring after the second CNOT gate, making the circuit non-fault-tolerant from other events.Proof of this and a lookup table for the feedback operations are shown in Appendix A. We find that the state after this shorthand error correction circuit is given by Below, we use this shorthand circuit to correct bit-flip errors.

TABLE I:
In the first and second columns, we show the eigenvalue of Z 1 Z 2 and Z 2 Z 3 .The feedback operation to correct the error is shown in the third column.

C. Clifford gates
Logical Pauli and CNOT gates are straightforwardly implemented as fault-tolerant gates.
They are shown in Figs. 2 and 3. On the other hand, the implementation of logical S and H gates are involved.While the logical S gate could naively be thought to be implemented as S L = S 1 , it is no longer bias-preserving.When it comes to the H gate, it is not possible to implement it transversely.To evade these difficulties, we examine gate teleportation, which is an essential building block of fault-tolerant quantum computation [5,34].One way to achieve S and H gates via teleportation is shown in Fig. 4. We note that the gate teleportation of S † gate is obtained by replacing |+i⟩ by |−i⟩ in Fig. 4 (a).In both circuits, the Pauli gate connected to the meter by the double line is meant to operate when the result −1 is obtained.
Our goal is to prove each component in these circuits, state preparation, CZ gate, and measurement in the X basis, can be implemented as a fault-tolerant and bias-preserving operation.

Preparation of |+⟩ L
Within our noise model, the eigenstate of logical X can be prepared directly by the circuit in Fig. 5. Noting that CNOT gates do not amplify the bit-flip error since the error after the H gate does not change the state (X |+⟩ = |+⟩), the final state reads FIG. 2: Logical X, Y , and Z gates.
FIG. 6: A quantum circuit to prepare |+i⟩ L .The SM 12 gate denotes the indirect measurement of Z 1 Z 2 .

Preparation of |+i⟩ L
The eigenstate of logical Y is prepared by the circuit shown in Fig. 6.This circuit consists of |+⟩ L -preparation followed by the S gate.Note that |−i⟩ L can be obtained by replacing the S gate by S † gate in this circuit.A bit-flip error on the first physical qubit before the S gate is converted to a Y error, and thus, it breaks the bias-preservation.However, the possible Y error can be detected by the measurement of the stabilizer Z 1 Z 2 depicted by SM 12 in Fig. 6, and eliminated by postselection.The output of this circuit after such postselection is given by

CZ gate
The CZ gate is not bias-preserving due to the relation CZ ij X i = X i Z j CZ ij .On the other hand, the phase-flip error does not appear alone but together with a bit-flip error.This FIG. 8: A quantum circuit to measure a logical state in the X basis.

Measurement in the X basis
Measurement of the logical state in the X basis can be performed by the circuit shown in Fig. 8, where the set of gates enclosed by the dotted line should be repeated three times.
The probability of obtaining an incorrect measurement is O(p 2 ) by taking a majority vote on the results of three measurements.
The probability that an uncorrectable error accumulates on the output state is also O(p 2 ).
This can be seen from the fact that any error in the ancilla is not spread over more than two physical qubits by noting that the bit-flip error does not change |+⟩.

S gate
Encoding each component in Fig. 4 (a), we obtain a quantum circuit of logical S gate teleportation.We show the entire circuit in Fig. 9.Note that the preparation of |+i⟩ L needs appropriate postselection to eliminate phase-flip errors as we saw before.However, if we allow a repeat-until-success approach to prepare the state, the postselection is no longer mandatory.The logical S gate teleportation requires seven qubits in total: one logical data qubit, one logical resource qubit, and one ancilla if the ancilla can be recycled.The parametrization of the output state depends on the result of the measurement of the logical data qubit.If ancilla is |0⟩ (in the sense of the majority vote), the output state reads FIG. 9: A quantum circuit of logical S gate teleportation.
If |1⟩ is measured and the logical Y gate is operated, we obtain

H gate
Encoding each component in Fig. 4 (b), we obtain a quantum circuit of logical H gate teleportation.We show the entire circuit in Fig. 10.This circuit needs postselection to eliminate phase-flip errors that can appear after the CZ gate.The logical H gate teleportation requires at least seven qubits, assuming that ancilla can be recycled.The parameterization of the output state depends on the result of the measurement of the logical data qubit.If |0⟩ L is observed, the output state reads otherwise

D. Rotation gates
We discuss the implementation of rotation gates, namely the R z gate.Once the R z gate is made, the rotation gate in other bases can be constructed using fault-tolerant Clifford gates.We start by pointing out that the R z gate can be operated indirectly, as shown in Fig. 11.The conditional Z gate acts on the target state only when the result −1 is obtained.
To obtain the fault-tolerant version of this circuit, we employ the same strategy as the fault-tolerant S and H gates construction, detecting unacceptable events by the syndrome measurement.In this case, the event we should detect is that a bit-flip error arises before the R z gate.Such an error changes the sign of the rotation angle since R z (θ)X = XR z (−θ).
If this happens, the encoded ancilla will be |100⟩, which the syndrome measurement can detect.Thus, we reach the circuit shown in Fig. 12.This circuit needs at least seven qubits if the ancilla can be recycled.The output state is FIG. 11: A quantum circuit to operate R z gate.
FIG. 12: A quantum circuit of the fault-tolerant logical R z gate.
if 0 is measured in the ancilla side, otherwise

III. NUMERICAL DEMONSTRATIONS
We apply our scheme to several problems to demonstrate the effectiveness of fault-tolerant computation in a noisy environment.

A. Benchmark
Let us consider a benchmark circuit as shown in Fig. 13, which consists of X and CNOT gates.We repeat the part of the circuit enclosed by the dotted line d times.One can easily verify that the final state will be |00⟩ regardless of d in a noiseless environment.To quantify the effect of bit-flip noise, we define the average squared fidelity F by where N denotes the number of shots and |ψ i ⟩ denotes i-th sampled state vector.For comparison, we also consider the following circuits.
1.An encoded circuit: Logically same as that shown in Fig. 13, but each qubit is encoded by the bit-flip code.
2. An encoded circuit with error correction: Insert d error-correction circuits to the end of each layer of the above-mentioned circuit.
We perform numerical simulations of these circuits using Qiskit.We set the gate error to p = 10 −3 .We consider d = 2 0 , 2 1 , . . ., 2 9 for each circuit and take 10 5 shots for each simulation.In Fig. 14

B. Dynamics of quantum system
We consider the time evolution of a spin-chain model as an example of a deep nontrivial circuit.Let us consider the transverse field Ising model with the periodic boundary condition Z N +1 = Z 1 .The time evolution of this model is approximated by the Suzuki-Trotter decomposition as Below, we set N = 2 for simplicity.The time evolution operator is implemented as shown in Fig. 15, where δ = t/M .Note that ten physical qubits are needed to make this circuit fault-tolerant.
As for the previous subsection, we measure the performance of this circuit in a noisy environment.For comparison, we also consider the encoded circuits with or without EC.
The fault-tolerant R x gate is implemented by decomposing the R x gate as R x = HR z H.
The EC is inserted every time after each fault-tolerant Hadamard gate.We do not use such decomposition for the bare circuit.We compute the expectation value of the total magnetization M (t) = N i=1 ⟨ψ(t)|Z i |ψ(t)⟩ where |ψ(t)⟩ = U |00⟩ taking 10 4 shots at each time under the transverse magnetic field h = 1.We set the Trotter time slice to δ = 0.1 and the gate error to p = 10 −3 .
In Fig. 16a, we show the total magnetization obtained from each quantum circuit at each Trotter step.The results of all circuits appear to deviate from noiseless one.To quantify the accumulation of errors, we define the integrated error by where M noisy is the magnetization obtained by noisy quantum simulations and N trot is the number of Trotter steps.We show the evolution of the integrated error in Fig. 16b.On a quantitative level, the encoded circuits have a clear advantage up to t ∼ 2. In contrast to the case of the benchmark circuit consisting only of X and CNOT gates, the EC circuit does not reduce the integrated error compared with the encoded circuit without EC.In the encoded circuit, Z errors that occur with probability O(p) are removed by post-selection, but those that occur with probability lower than O(p 2 ) remain unremoved.Figure 16b suggests that the contribution of such uncorrectable errors is dominant in this simulation.
Finally, we discuss the yield of postselection.In Fig. 16c, we show the time dependence of the discard rate of postselection needed for fault-tolerant H and R z gates.In both cases, the discard rate exponentially approaches one.According to the fitting by the function 1 − e −at with a single parameter a, it gives a ≃ 0.59 for the encoded circuit, and a ≃ 0.66 for the encoded circuit with EC.Post-selection exponentially worsens the efficiency of sampling, making it unsuitable for running deep circuits.However, if the time is limited to t ≲ 2, which benefits from encoding, the discard rate is less than about 70%.
FIG. 15: Repeating this circuit M times gives the Trotterized time evolution operator Eq. ( 22) for N = 2.

C. Variational quantum eigensolver
We discuss the effectiveness of fault-tolerant computation in a shallow circuit.To see this, we consider variational quantum eigensolver (VQE) using a hardware-efficient ansatz and apply it to quantum chemistry problems.In general, the Hamiltonian of some molecule has a form of Ĥ = h 0 + pq h pq â † p âq + pqrs h pqrs â † p â † q âr âs , where â( †) p is the annihilation (creation) operator of an electron in a molecular orbital p, h 0 is the nuclear repulsion energy, h pq is the one-electron integral and h pqrs is the two-electron integral.The electron integrals are obtained by the Hartree-Fock method, for instance.
In our demonstration, we aim to compute the ground state energy of caffeine (C 8 H 10 N 4 O 2 ) with restricted active space and the eigenspace of spin so that the Hamiltonian of a twoqubit system is obtained after the Jordan-Wigner transformation.The concrete form of the qubit Hamiltonian and its derivation is presented in Appendix B. Since all coefficient of the Hamiltonian is real, it is sufficient to consider the following ansatz for VQE: where {θ i } are the real parameters.The fault-tolerant R y gate is implemented by decomposing the R y gate to R y = SHR z HS † .
We optimize these parameters classically and compute the ground state energy using the quantum circuit with those parameters.The qubit Hamiltonian of the caffeine is divided into four groups of Pauli strings, and 10 7 shots are taken to measure the expectation value of each.The gate error is p = 10 −3 as before.The result is summarized in Table II, indicating that the encoded circuits reproduce the exact value well.On the other hand, the results are not so different from those of the bare circuit, so the benefit of encoding would be realized when better accuracy than chemical accuracy (1kcal/mol ≃ 1.6mHa) is required.

IV. EFFECT OF PHASE-FLIP ERROR
From a practical standpoint, how circuits encoded with bit-flip codes behave in a general error channel is a question worth investigating.Here, we perform a numerical simulation of VQE with the following error channel Subsequently, we comment on the relationship of our error correction scheme to other methods that have been proposed in recent years.In the realm of fault-tolerant computation under resource constraints, error correction using flag qubits, where errors on a code of distance three can be corrected using just two ancillary qubits, is a promising approach [35].
This has the advantage of requiring fewer resources than fault-tolerant syndrome measurements using a Greenberger-Horne-Zeilinger state as employed in Shor's scheme.Although we do not employ flag qubits in our scheme, the minimum number of ancillary qubits re- Certain logical operations necessitate postselection, raising questions about the scalability in terms of the yield of such processes.We can show that the yield after postselection does not decrease with increasing code distance as follows.Consider, for example, the logical S gate.For any code distance, the logical S gate is basically the same as in Fig. 6.We only increase the number of physical qubits by d.A Pauli-Y error may arise solely after the action of the S gate on the first qubit.Detection of such an error is feasible by measuring a single syndrome, Z 1 Z 2 .The likelihood of detecting the Y error remains constant regardless of the distance, thus the yield from postselection shows a robust insensitivity to distance variations.This characteristic is also observed for H, CZ, and R z gates.This property shows the scalability of our proposed scheme for arbitrary logical operations.which is problematic in the single-round syndrome measurement, has a distinctly different syndrome than the others that trigger feedback control.Thanks to this property, fault tolerance is manifest in the error-correcting circuit with double-round syndrome measurement.
Note that the 16th and 17th patterns that are indistinguishable from the 4th pattern cause a bit-flip error on the first physical qubit, but it does not break fault tolerance.Error cor-rection based on the double-round measurements is not unique.For example, there is a way not to give feedback for the 4th, 16th, and 17th patterns.
TABLE IV: Location of bit-flip errors and error syndromes of double-round measurement.
where I is the identity matrix.The eigenstates of X and Y gates are denoted by |±⟩ and |±i⟩, respectively, i.e.X |±⟩ = ± |±⟩ and Y |±i⟩ = ± |±i⟩.First, we define our noise model and clarify the meaning of fault-tolerance and biaspreserving gates in Sec.II A. In the next section II B, we remind well-known fault-tolerant error-correcting circuit and a slightly modified version.In the remaining sections II C and II D, we propose fault-tolerant and bias-preserving logic gates.

FIG. 1 :
FIG.1:A quantum circuit for the fault-tolerant error correction.The part of the circuit enclosed by the dotted line forms the syndrome measurement.It should be repeated twice or more.The X-gates connected by double wires means the operating an X-gate to a physical qubit with a suspicious bit-flip error identified by the results of the syndrome measurement.

. 7 :
FIG. 7: A fault-tolerant and bias-preserving logical CZ gate.The first and second logical qubits are denoted by |ψ 1 ⟩ L and |ψ 2 ⟩ L , respectively.The SM gate denotes the syndrome measurement.
, we show the average squared fidelity as a function of the depth for the bare (non-encoded), encoded circuits, and the circuit equipped with the error correction (EC).While the encoded circuit without EC improves the scaling of the fidelity from 1−O(p) to 1 − O(p 2 ), it shows poor performance as the depth increases.In particular, at d = 512, it is almost entirely randomized, i.e., F = 1/4 indicated by the dotted line.In contrast, the encoded circuit with EC keeps fidelity high even at d = 512.This result clearly shows that the error-correction is mandatory in deep circuits.

FIG. 14 :
FIG. 14: Average squared fidelity of the benchmark circuits.The dotted line indicates F = 1/4, which means that the bit-flip noise totally randomizes the circuit.The star, triangle, and circle symbols correspond to the average fidelity of bare, encoded circuits, and encoded circuits with EC.

FIG. 16 :
FIG. 16: Time evolution of the transverse Ising model.The diamond symbols indicate the noise-free results.Other symbols are the same as Fig. 14.

FIG. 17 :
FIG.17:The absolute energy difference between exact and numerical results of caffeine.The symbols are the same as Fig.14.The probability of the bit-flip error is p = 10 −3 .
quired is one as long as clean |0⟩-states are supplied.If such clean states are not available, at least four ancillary qubits are needed.(See Appendix C.) It is interesting whether the flag qubit method can be used to reduce this amount of resources.Finally, we discuss the scalability of our proposed scheme.So far, we have employed a repetition code with a distance of three, but its extension to arbitrary distances remains straightforward.The repetition code with distance d can correct ⌊(d − 1)/2⌋ bit-flip errors.Using classical bounded distance decoding, the logical error rate after a single quantum operation is denoted by p L = 1 − ⌊(d−1)/2⌋ k=0 d k p k (1 − p) d−k .As d increases, p L diminishes for most values of p, thereby ensuring fault-tolerant computation with arbitrarily small logical errors.However, the code rate, expressed as 1/d, is suboptimal.