cuit of CCNOT gates (Fig. 24.5), followed by the corresponding qubit measurements and bit-flip corrections. The correction of phase-flip, or Z-type errors, is achieved by first passing each qubit of the X-corrected state |x + C2)*) X through a Hadamard gate, i.e., to obtain the state H |(x + C2)*) X. In Chapter 19, when describing the Deutsch-Joszsa algorithm, we have established (as supported through Exercise 19.1) that the action of Hon on any n-qubit /x) yields the transformation (24.40) where Z is any possible n-bit combination. Applying this property to the state |(x + C2)*), in Eq. (24.39), namely, for each of the terms /x+y) in the sum, we 24.3 Calderbank-Shor-Steine (CSS) codes obtain: (24.41) By introducing z' = ey, we may rewrite the above in the form (24.42) To reduce the right-hand side in Eq. (24.42) to a single summation, we first isolate the term involving the dot-product y z' as follows ******************************* (24.43) It can be shown through a (not SO trivial but tractable) exercise that the sum in brackets [.] is equal to |C2| for the dual of the C2 code), and zero otherwise Hence, the simplification of the definition in Eq. (24.43): (24.44) Except for the normalization factor and the phase terms, the above expression is similar to that in Eq. (24.38) concerning the bit-flip errored state, but here with ey as the error pattern and as the code (as opposed to ex and C2, respectively). A similar error- correction procedure can, thus, be implemented. First, we append an n-qubit ancilla |0) to this state, transforming each term in the sum in Eq. (24.44) into |z' +ey)|0), then pass the result through a quantum circuit to achieve the transformation (24.45) = |z' + ey)| H - ey)), where is the parity-check matrix of the code C2, for which ' = 0. Measuring each qubit in the ancilla |H-ey) yields the syndrome vector ey and, hence, the full error diagnosis ey, which is common to each of the series terms in Eq. (24.44). The ancilla can then be discarded and each of the errored qubits can be corrected 