1 Introduction

Quantum computer has attracted much attention since its potential parallel computing power based on the principle of quantum coherent superposition and quantum entanglement. However, quantum states are vulnerable to various noise during the process of quantum information processing (QIP), i.e., the quantum states will be destroyed (quantum decoherence), thus any weak noise may lead to final calculation error. To overcome this shortcoming, quantum error prevention and correction becomes more and more important. One method is to build a decoherence-free subspace for quantum information storage, transmission and computing [16], another one is to generate Calderbank-Shor-Steane (CSS) code and quantum stabilizer codes, which can construct an important class of quantum error-correction codes. Due to its less resource-intensive, error correction and good results, quantum error correction is widely used in quantum secure communication, fault-tolerant quantum computing and other fields [7].

Since the original quantum error-correction code, [[9,1,3]] code, is proposed by Shor in 1995 [8], and the [[7,1,3]] code is proved and produced by Calderbank et al and Steane, independently, in 1996 [9, 10], significant progress has been made on the development of quantum code, especially for quantum stabilizer code. Then, a number of error-correction schemes and constructing schemes for the quantum stabilizer code are proposed [9, 1116]. Quantum circuit for encoding and decoding of the stabilizer code is also very important for applying the quantum error-correction code on fault-tolerant quantum computation. Recently, the quantum circuits for efficient encoding and decoding of the [[5,1,3]] stabilizer code has been presented, where the controlled phase flip gates are used [16]. The [[5,1,3]] code, encodes one qubit in five qubits and protects against one-qubit error [17, 18], is only a simple example of quantum error-correction code. Therefore, how to construct an efficient quantum circuit that encoding and decoding for any stabilizer code becomes imperative.

In this letter, we investigate an efficient quantum circuit for encoding and decoding of the [[8,3,5]] stabilizer code, which is a typical example for protecting multi-qubit state with up to one error. Meanwhile, it is optimal in the sense of quantum Hamming bound [12]. On the other hand, the [[8,3,5]] stabilizer code is the simplest one with generators including all the Pauli operators “I”, “X”, “Y”, “Z”. Thus, it can be generalized to all quantum stabilizer codes satisfying Hamming bound. The single-qubit operations, two-qubit controlled gates and three-qubit Toffoli gates are required in current protocol. Here, we first introduce the encoding rule of the [[8,3,5]] stabilizer code based on depolarizing channel and stabilizer codes, and then logically analyze the encoding code and give its detailed quantum circuit. To generate the [[8,3,5]] stabilizer code words, we choose five generators and three seed generators. This method is more predominant than Ref. [13], which used a systematic approach to generate code words by employing Gaussian elimination on bit flip matrix, because some unsolved difficulties exist in the latter. Then, we describe the decoding circuit of the [[8,3,5]] stabilizer code that can be used to correct one error from three qubits. Finally, discussions and conclusion are given.

2 Encoding of the [[8,3,5]] Stabilizer Code

Most quantum error-correction code deal with the depolarizing channel which has four basic error operators (Pauli operators) on a qubit: I, X, Y and Z, which denotes “no error”, “bit flip”, “bit and phase flip” and “phase flip” [19]. In the n-qubit depolarizing channel, error operators can be expressed as G n =±{I,X,Y,Z}n, where ⊗n denotes the n-fold tensor product. To correct one of the above errors, one can first find out a quantum stabilizer code. Arbitrary stabilizer code [[n,k,d]] is based on a stabilizer group [16]

$$ S=\Biggl\{\prod_{i=1}^{n-k}M_{i}^{b_{i}},b_{i} \in\{0,1\},i=1,2,\ldots, n-k\Biggr\} $$
(1)

where M 1,M 2,…,M nk G n are the generators of S. Then, one can select seed generators N 1,N 2,…,N k G n that make {M 1,M 2,…,M nk ,N 1,N 2,…,N k } an independent commuting set contained in the normalizer of S. The code words of a stabilizer code are eigenvectors associated with eigenvalue 1 of the stabilizer code, i.e.,

$$ C(S)=\bigl\{|\psi\rangle: M|\psi\rangle=|\psi\rangle, \forall M \in S \bigr\} $$
(2)

Thus the encoder of a stabilizer code can generate a code word

$$ |c_{1}\cdots c_{k}\rangle_{L}= \frac{1}{\sqrt{2^{n-k}}}\Biggl[\prod_{i=1}^{n-k}(I+M_{i}) \Biggr]N^{c_{1}}_{1} \cdots N^{c_{k}}_{k}|0 \cdots 0\rangle_{n} $$
(3)

Finally, one can efficiently construct quantum circuit of the stabilizer code by means of Eq. (3).

Next, we will discuss the case of n=8, k=3 and d=5 ([[8,3,5]] stabilizer code). This stabilizer is optimal in the sense of quantum Hamming. According to Eq. (1), one can select five generators M 1, M 2, M 3, M 4 and M 5, i.e.,

(4)

where M 1, M 2, M 3, M 4 are linearly independent primary generators and M 5 is called secondary generators [12]. The symplectic matrix corresponding to M 1, M 2, M 3, M 4 and M 5 can be expressed as

$$ H= \left ( \begin{array}{c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\qquad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c} 1&1 & 1& 1 &1&1&1& 1 & 0& 0& 0&0 &0&0&0&0\\ 1&0 & 0& 1 &0&1&1& 0 & 0& 1& 0&1 &0&1&0&1\\ 1&0 & 1& 0 &0&1&0& 1 & 0& 0& 0&0 &1&1&1&1\\ 1&0 & 1& 0 &1&0&1& 0 & 0& 0& 1&1 &0&0&1&1\\ 0&0 & 0& 0 &0&0&0& 0 & 1& 1& 1&1 &1&1&1&1\\ \end{array} \right ) $$
(5)

To choose the code words, we augment these generators with a set of three seed generators, which are chosen so that the seed and primary generators are linearly independent. The three seed generators can be chosen as

(6)

According to Eq. (3), we can obtain a standard formula of the quantum code word of the [[8,3,5]] stabilizer code (see the Appendix).

According to Eq. (8), we can design the effective circuit for encoding [[8,3,5]] code, as shown in Fig. 1. It is noted that the states c 1, c 2 and c 3 are all used to control phase flip of the code words. The main operators are single-qubit rotations, controlled phase gates and Toffoli gates. Here, c 1, c 2 and c 3 are encoded into eight qubits successfully.

Fig. 1
figure 1

Circuit for encoding the [[8,3,5]] code. “H” denotes Hadamard gate, “•” denotes Controlled operator and “⊕” denotes Not operator

3 Decoding of the [[8,3,5]] Stabilizer Code

As a stabilizer code, the important application for the [[8,3,5]] stabilizer code is to correct one error from three qubits, thus the design for decoding circuit of the [[8,3,5]] stabilizer code is necessary. Assume that the syndromes of a received state |ψ1 is defined as S=|s 1s 5〉 where s i ∈{0,1} (i=1,2,…,5) and \(M_{i}|\psi\rangle_{1}=(-1)^{s_{i}}|\psi\rangle_{1}\). One can know any error from above encoded eight qubits as shown in Sect. 2 by means of the syndrome s i . According to the symplectic Matrix H, it can be observed that the Matrix is composed of the left part and the right part, by which one can obtain syndromes S for different error operations. The syndromes S and error operators E are listed in Table 1, where E denotes X j , Y j or Z j (j=1,2,…,8).

Table 1 Syndromes (S) and error (E) operators

Then, one can operate controlled X gates and controlled Z gates on |ψ1 and |s i 〉 with |s i 〉 being controlled qubits. These operations will lead state |ψ1 to a right state |ψ2. The decoding quantum circuit of the [[8,3,5]] stabilizer code is illustrated in Fig. 2. It can be observed that this decoder is composed of (left) syndrome generation and (right) error correction parts. The main operations are Hadamard operations, controlled gates and multi-controlled gates.

Fig. 2
figure 2

The effective circuit diagram for decoding the [[8, 3, 5]] stabilizer code

4 Discussions and Conclusions

The [[8,3,5]] stabilizer code is another typical example for stabilizer code besides the [[5,1,3]] code proposed in previous works [1618]. We proposed another protocol for the construction and verification of quantum circuit for the [[8,3,5]] stabilizer code comparing with Ref. [13]. The complete encoding and decoding circuit has been designed where the main operators include any single-qubit operations, controlled-phase gates, Toffoli gates, controlled-controlled-X gates and controlled-controlled-Z gates. The quantum circuit can successfully correct one error, which is very important for QIP. The current method can be generalized to implement quantum circuit of any [[n,k,d]] stabilizer code.

The application of quantum error-correction code in several quantum systems is also worth considering for building quantum computer. Recently, some schemes for quantum computing have been investigated including single qubit operations, two-qubit controlled gates [2031], Toffoli gates [3238], multi-qubit controlled gates et al [39]. If we can implement any-qubit controlled gates in these systems, the quantum encoding and decoding circuit of the [[8,3,5]] stabilizer code would be implemented. It is noted that quantum error-correction code has been used to solve realistic noise in cavity-QED setup [40], where the three-qubit quantum error-correction code can preserve the prepared atomic state against the noise due to fluctuating electric fields, which randomly shift the atomic energy levels via the quadratic stark effect. Besides, the quantum error-correction code can be applied to some of special dephasing noise due to background charge fluctuations (such as random telegraph noise) in quantum dot systems. Thus the stabilizer code satisfying quantum Hamming bound would be applied to some quantum systems as a useful error correction tool.