In this section, I describe the Shor code, a QECC that concatenates the features of the bit-flip and phase-flip repetition codes, as implemented with 9-qubit codewords. The nice feature of the Shor code is that it can correct any single bit-flip or phase-flip error, and as a matter of fact, any error, as will be established. The encoding principle proceeds as follows. First, consider the 3-qubit phase-flip repetition code. The quantum circuit is the same as shown in Fig. 24.3, with the last wire removed. As we have seen earlier, this code performs the following transformation: (24.21) Quantum error correction Figure 24.4 Quantum circuit for encoding a qubit lq) into a 9-qubit repetition codeword 19) before transmission to a bit-phase-flip channel. In a second stage, we consider the 3-qubit bit-flip repetition code. The quantum circuit is the same as shown in Fig. 24.1, with the last wire removed. Clearly, such a circuit encodes the qubits |+> = (|0) + and = (|0) - |1))/2 according to (24.22) We notice from the above definition that the two qubits 14), 1-> are entangled. They represent the 3-qubit extension of the EPR or Bell states 1Boo) = (|00) + |11)) / 2 and (B10) = (|00) - |11)) IV2, which were described in Chapter 18. Such a property will be used later, when considering error correction. The end result of applying successively, or concatenating the two encoding phases, as defined in Eqs. (24.19) and (24.20), is the following: |111) |000) (24.23) |000) |111) |000) |111) The corresponding encoding circuit is shown in Fig. 24.4. The first stage of the circuit, which includes two CNOT and three H gates, performs the phase-flip repetition coding as defined in Eq. (24.19). The second stage, which includes six CNOT gates, performs the bit-flip repetition coding as defined in Eq. (24.20). For clarity, the ancillary qubits used for the second stage are shown with dashed lines. 24.2 Shor code Table 24.2 Corrective actions in Shor code from phase-flip syn- drome diagnostic based on measurements of (X123456,X456789) and