The quantum operations formalism is a general tool for describing the evolution of quantum systems in a wide variety of circumstances, including stochastic changes to quantum states, much as Markov processes describe stochastic changes to classical states.

# Quantum noise and quantum operations

# Quantum operations

Quantum states transformation is described as:

$\rho'=\mathcal{E}(\rho)$

The map $\mathcal{E}$ in this equation is a quantum operation. Two examples of quantum operations are unitary transformation and measurements:

$\mathcal{E}(\rho)=U\rho U^\dagger\\ \mathcal{E}_m(\rho)=M_m\rho M_m^\dagger$

# Environments and quantum operations

A natural way to describe the dynamics of an open quantum system is to regard it as arising from an interaction between the system of interest, which we shall call the principal system, and an environment, which together form a closed quantum system, as illustrated below:

We assume (for now) that:

$\mathcal{E}(\rho)=tr_{env}[U(\rho\otimes \rho_{env})U^\dagger]$

• An important assumption is made in this definition – we assume that the system and the environment start in a product state. In general, of course, this is not true. Quantum systems interact constantly with their environments, building up correlations.

# Operator-sum representation

Quantum operations can be represented in an elegant form known as the operator-sum representation. Let $|e_k\rangle$ be an orthonormal basis for the (finite dimensional) state space of the environment, and let $\rho_{env}=|e_0\rangle\langle e_0|$ be the initial state of the environment. Then the operator can be rewritten as:

\begin{aligned} \mathcal{E}(\rho)&=\sum_k\langle e_k|U[\rho\otimes |e_0\rangle\langle e_0|]U^\dagger|e_k\rangle\\ &=\sum_k E_k\rho E_k^\dagger \end{aligned}

where $E_k\equiv \langle e_k|U|e_0\rangle$ is an operator on the state space of the principal system.

Remark: For $\langle a|U|b\rangle$, if the dimension of $|a\rangle,|b\rangle,U$ is not matched, then we just let notation: $\langle a|U|b\rangle\equiv(I\otimes \langle a|)U(I\otimes |b\rangle)$.

So strictly we have the proof:

\begin{aligned} \mathcal{E}(\rho)&=tr_{env}(U(\rho\otimes |e_0\rangle\langle e_0|)U^\dagger)\\ &=tr_{env}(U(\rho\otimes I)(I\otimes |e_0\rangle)(I\otimes \langle e_0|)U^\dagger) \end{aligned}

where:

\begin{aligned} (\rho\otimes I)(I\otimes |e_0\rangle) &=(\rho I)\otimes (I|e_0\rangle)\\ &=(I\rho)\otimes (|e_0\rangle\cdot 1)\\ &=(I\otimes |e_0\rangle)(\rho\otimes 1)\\ &=(I\otimes |e_0\rangle)\rho \end{aligned}

And:

$tr_{env}(A)=\sum_k(I\otimes \langle e_k|)A(I\otimes |e_k\rangle)$

So we have:

\begin{aligned} \mathcal{E}(\rho)&=tr_{env}(U(I\otimes |e_0\rangle)\rho(I\otimes \langle e_0|)U^\dagger)\\ &=\sum_k(I\otimes \langle e_k|)U(I\otimes |e_0\rangle)\cdot\rho\cdot(I\otimes\langle e_0|)U^\dagger(I\otimes |e_k\rangle)\\ &\equiv\sum_k\langle e_k|U|e_0\rangle \rho\langle e_0|U^\dagger|e_k\rangle\\ &\equiv\sum_kE_k\rho E_k^\dagger \end{aligned}

• There is no loss of generality in assuming that the environment starts in a pure state, since if it starts in a mixed state we are free to introduce an extra system purifying the environment (later).

• Completeness relation:

$1=tr(\mathcal{E}(\rho))=tr(\sum_kE_k^\dagger E_k\rho)$

So $\sum_k E_k^\dagger E_k=I$. There are also quantum operations $\sum_k E_k^\dagger E_k\leq I$，they describe processes in which extra information about what occurred in the process is obtained by measurement.

The operator-sum representation is important because it gives us an intrinsic means of characterizing the dynamics of the principal system. The operator-sum representation describes the dynamics of the principal system without having to explicitly consider properties of the environment; all that we need to know is bundled up into the operators $E_k$, which act on the principal system alone.

# Physical interpretation of the operator-sum representation

Consider the equation:

\begin{aligned} \mathcal{E}(\rho)&=\sum_kE_k\rho E_k^\dagger\\ &=\sum_ktr(E_k\rho E_k^\dagger)\cdot\frac{E_k\rho E_k^\dagger}{tr(E_k\rho E_k^\dagger)}\\ &=\sum_kp(k)\rho_k \end{aligned}

This gives us a beautiful physical interpretation of what is going on in a quantum operation with operation elements $\{E_k\}$.

The action of the quantum operation is equivalent to taking the state $\rho$ and randomly replacing it by $\rho_k=\frac{E_k\rho E_k^\dagger}{tr(E_k\rho E_k^\dagger)}$, with probability $tr(E_k\rho E_k^\dagger)$.

In this sense, it is very similar to the concept of noisy communication channels used in classical information theory; in this vein, we shall sometimes refer to certain quantum operations which describe quantum noise processes as being noisy quantum channels.

# Axiomatic approach to quantum operations

We define a quantum operator $\mathcal{E}$ as a map from the set of density operators of the input space $Q_1$ to the set of density operators for the output space $Q_2$, with the following three axiomatic properties:

1. $tr(\mathcal{E}(\rho))$ is the probability that the process represented by $\mathcal{E}$ occurs, when $\rho$ is the initial state. Thus, $tr(\mathcal{E}(\rho))\in[0,1]$.

2. $\mathcal{E}$ is a convex-linear map on the set of density matrices, that is:

$\mathcal{E}(\sum_ip_i\rho_i)=\sum_ip_i\mathcal{E}(\rho_i)$

3. $\mathcal{E}$ is a completely positive map. That is, $\mathcal{E}(A)$ must be positive for any positive density operator $A$.

Furthermore, if we introduce an extra system $R$ of arbitrary dimensionality, it must be true that $(\mathcal{I}\otimes \mathcal{E})(A)$ is positive for any positive operator $A$ on the combined system $RQ_1$, where $\mathcal{I}$ is the identity map on $R$.

• If there is a $\rho$ such that $tr(\mathcal{E}(\rho))<1$, then the quantum operation is non-trace-preserving, so on its own $\mathcal{E}$ does not provide a complete description of the process that may occur in the system.

Remark: We need to talk about $\mathcal{I}\otimes\mathcal{E}$ in details. For example, if $\mathcal{I}:\mathbb{C}^{k\times k}\rightarrow\mathbb{C}^{k\times k}$, $\mathcal{E}:\mathbb{C}^{2\times 2}\rightarrow \mathbb{C}^{2\times 2}$, then we have $(\mathcal{I}\otimes\mathcal{E}):\mathbb{C}^{2k}\rightarrow\mathbb{C}^{2k}$:

$\forall A = \begin{pmatrix} a_{11}&...&a_{1k}\\ \vdots&\ddots&\vdots\\ a_{k1}&...& a_{kk} \end{pmatrix}, a_{ij}\in\mathbb{C}^{2\times 2}\\ (\mathcal{I}\otimes\mathcal{E})(A)=\begin{pmatrix} \mathcal{E}(a_{11})&...&\mathcal{E}(a_{1k})\\ \vdots &\ddots &\vdots\\ \mathcal{E}(a_{k1})&...&\mathcal{E}(a_{kk}) \end{pmatrix}\in\mathbb{C}^{2k\times 2k}$

Notice, the induced map $\mathcal{I}\otimes\mathcal{E}$ can only be left-induce where $\mathcal{E}\otimes\mathcal{I}$ is invalid.

• Example: positive map is not complete positive.

Transpose is a positive map, let $Trans:\mathbb{C}^{2\times 2}\rightarrow\mathbb{C}^{2\times 2}$ be the transpose map. Then we consider the induced map $\mathcal{I}\otimes Trans$, and apply it on the density operator of $\frac{|00\rangle+|11\rangle}{\sqrt{2}}$:

$(\mathcal{I}\otimes Trans)\frac{1}{\sqrt{2}}\begin{pmatrix}1&0&0&1\\0&0&0&0\\0&0&0&0\\1&0&0&1\end{pmatrix}=\frac{1}{\sqrt{2}}\begin{pmatrix} Trans\begin{pmatrix}1&0\\0&0\end{pmatrix}&Trans\begin{pmatrix}0&1\\0&0\end{pmatrix}\\ Trans\begin{pmatrix}0&0\\1&0\end{pmatrix}&Trans\begin{pmatrix}0&0\\0&1\end{pmatrix}\\ \end{pmatrix}\\ =\frac{1}{\sqrt{2}}\begin{pmatrix} 1&0&0&0\\ 0&0&1&0\\ 0&1&0&0\\ 0&0&0&1 \end{pmatrix}$

The result is not positive and has an eigenvalue $-1/2$, so it’s not a valid density operator.

Theorem: The map $\mathcal{E}$ satisfies the axioms above if and only if

$\mathcal{E}(\rho)=\sum_kE_k\rho E_k^\dagger$

for some set of operators $\{E_k\}$ and $\sum_k E_kE_k^\dagger\leq I$. And the set of operators is not unique.

# Unitary freedom in the operator-sum representation

Consider the two different quantum operators $\mathcal{E},\mathcal{F}$:

\begin{aligned} &\mathcal{E}(\rho)=E_1\rho E_1^\dagger+E_2\rho E_2^\dagger\\ &\mathcal{F}(\rho)=F_1\rho F_1^\dagger+F_2\rho F_2^\dagger\\ & E_1=\frac{1}{\sqrt{2}}I,E_2=\frac{1}{\sqrt{2}}Z\\ & F_1=|0\rangle\langle 0|,F_2=|1\rangle\langle 1| \end{aligned}

And think, what physical process does $\mathcal{E},\mathcal{F}$ represents separately?

• For $\mathcal{E}$, it’s “we flipped a fair coin, and, depending on the outcome of the coin toss, applied either the unitary operator $I$ or $Z$ to the quantum system”.

• For $\mathcal{F}$, it’s performing a projective measurement in the $|0\rangle,|1\rangle$ basis, with the outcome of the measurement unknown.

However, notice the fact that:

\begin{aligned} \mathcal{F}(\rho) &=\frac{(E_1+E_2)\rho(E_1^\dagger+E_2^\dagger)+(E_1-E_2)\rho(E_1-E_2)^\dagger}{2}\\ &=E_1\rho E_1^\dagger+E_2\rho E_2^\dagger\\ &=\mathcal{E}(\rho) \end{aligned}

These two apparently very different physical processes give rise to exactly the same dynamics for the principal system.

When do two sets of operation elements give rise to the same quantum operation? Suppose we supplement the interaction $U$ with an additional unitary gate $U'$ on the environment alone:

Then what are the corresponding operators?

\begin{aligned} F_k&=(I\otimes\langle e_k|)\cdot(I\otimes U')U\cdot(I\otimes|e_0\rangle)\\ &=\sum_j(I\otimes\langle e_k|)\cdot(I\otimes U')\cdot(I\otimes|e_j\rangle)\cdot(I\otimes\langle e_j|)\cdot U\cdot(I\otimes|e_0\rangle)\\ &=\sum_j(I\otimes \langle e_k|U'|e_j\rangle)\cdot(I\otimes\langle e_j|)U(I\otimes |e_0\rangle)\\ &=\sum_j(I\otimes \langle e_k|U'|e_j\rangle)\cdot E_j \end{aligned}

So the new operator $F_k$ is composed by the element of $U'$ and original operators $E_j$.

Theorem: Suppose $\{E_1,...,E_m\}$ and $\{F_1,...,F_n\}$ are operation elements giving rise to quantum operations $\mathcal{E}$ and $\mathcal{F}$, respectively. By appending zero operators to the shorter list of operation elements we may ensure that $m=n$. Then $\mathcal{E}=\mathcal{F}$ if and only if there exist complex numbers $u_{ij}$ such that $E_{i}=\sum_j u_{ij}F_j$, and $u_{ij}$ is an $m\times m$ unitary matrix.

This theorem can be used to answer another interesting question: what is the maximum size of an environment that would be needed to mock up a given quantum operation?

Theorem: All quantum operations $\mathcal{E}$ on a system of Hilbert space dimension $d$ can be generated by an operator-sum representation containing at most $d^2$ elements,

$\mathcal{E}(\rho)=\sum_{k=1}^ME_k\rho E_k^\dagger$

where $1\leq M\leq d^2$.

# Examples of quantum noise and quantum operations

In this section we examine some concrete examples of quantum noise and quantum operations. These models illustrate the power of the quantum operations formalism we have been developing.

# Trace and partial trace

The simplest operation related to measurement is the trace map:

$\rho\rightarrow tr(\rho)$

which we can show is indeed a quantum operation, in the following way. Let $H_Q$ be any input Hilbert space, spanned by an orthonormal basis $|1\rangle,...,|d\rangle$, and let $H_Q'$ be a one-dimensional output space, spanned by the state $|0\rangle$. Define:

\begin{aligned} \mathcal{E}(\rho)&=\sum_{i=1}^d|0\rangle\langle i|\rho|i\rangle\langle 0|\\ &=\sum_{i=1}^d|0\rangle\langle 0|tr(\langle i|\rho|i\rangle)\\ &=|0\rangle\langle 0|tr(\sum_{i=1}^d|i\rangle\langle i|\rho)\\ &=|0\rangle\langle 0|tr(\rho) \end{aligned}

so that $\mathcal{E}$ is a quantum operation. The operation is identical to the trace function, means that the “measurement” will be 100% collapse into $H_Q'$, which is $|0\rangle\langle 0|$.

An even more useful result is the observation that the partial trace is a quantum operation.

Suppose we have a joint system $QR$, and wish to trace out system $R$. Let $|j\rangle$ be a basis for system $R$. Define a linear operator $E_i:H_{QR}\rightarrow H_Q$ by:

$E_i(\sum_j\lambda_j|q_j\rangle|j\rangle)\equiv\lambda_i|q_i\rangle$

where $|q_j\rangle$ are arbitrary states of system $Q$. Define:

$\mathcal{E}(\rho)=\sum_i E_i\rho E_i^\dagger$

Then we have ($|j_1\rangle,|j_2\rangle$ are two basis states):

\begin{aligned} \mathcal{E}(\rho\otimes |j_1\rangle\langle j_2|)&=\sum_iE_i(\rho\otimes |j_1\rangle\langle j_2|) E_i^\dagger\\ &=\sum_iE_i(\sum_t\lambda_t|q_tj_1\rangle\langle q_tj_2|)E_i^\dagger\\ &=\sum_{i,t}\lambda_t E_i|q_tj_1\rangle\langle q_tj_2|E_i^\dagger\\ &=\sum_{i,t}\lambda_t|q_t\rangle\langle q_t|\delta_{i,j_1}\delta_{i,j_2}\\ &=\sum_t\lambda_t|q_t\rangle\langle q_t|\delta_{j_1,j_2}\\ &=\rho\delta_{j_1,j_2}\\ &=\rho tr(|j_1\rangle\langle j_2|) \end{aligned}

which is just the same as partial trace.

# Bit flip channels

The bit flip channel flips the state of a qubit with probability $1-p$:

$E_0=\sqrt{p}I,E_1=\sqrt{1-p}X$

The effect of such channel is illustrated as:

Intuitively, $\frac{1+|\overrightarrow{r}|^2}{2}=tr(\rho^2)$ where $\overrightarrow{r}$ is the Bloch vector. The channel will make the mixed state so $tr(\rho^2)$ can only decrease.

# Depolarizing channel

The depolarizing channel is an important type of quantum noise. Imagine we take a single qubit, and with probability p that qubit is depolarized.

$\mathcal{E}(\rho)=\frac{pI}{2}+(1-p)\rho$

And we rewrite it in operator-sum form:

\begin{aligned} &\because \frac{I}{2}=\frac{I\rho I+X\rho X+Y\rho Y+Z\rho Z}{4}\\ &\therefore \mathcal{E}(\rho)=(1-\frac{3p}{4})\rho+\frac{p}{4}(X\rho X+Y\rho Y+Z\rho Z)\\ &\therefore E_1=\sqrt{1-\frac{3p}{4}}I,E_2=\frac{\sqrt{p}}{2}X,E_3=\frac{\sqrt{p}}{2}Y,E_4=\frac{\sqrt{p}}{2}Z \end{aligned}

# Summary

• depolarizing channel:

$\sqrt{1-\frac{3p}{4}}I,\sqrt{\frac{p}{4}}X,\sqrt{\frac{p}{4}}Y,\sqrt{\frac{p}{4}}Z$

• amplitude damping:

$\begin{pmatrix} 1 & 0 \\0 & \sqrt{1-\gamma} \end{pmatrix}, \begin{pmatrix} 0&\sqrt{\gamma}\\ 0&0 \end{pmatrix}$

• phase damping:

$\begin{pmatrix} 1 & 0 \\0 & \sqrt{1-\gamma} \end{pmatrix}, \begin{pmatrix} 0&0\\ 0&\sqrt{\gamma} \end{pmatrix}$

• phase flip:

$\sqrt{p}I,\sqrt{1-p}Z$

• bit flip:

$\sqrt{p}I,\sqrt{1-p}X$

• bit-phase flip:

$\sqrt{p}I,\sqrt{1-p}Y$

# Distance measures for quantum information

Static measures quantify how close two quantum states are, while dynamic measures quantify how well information has been preserved during a dynamic process.

# Distance measures for classical information

What does it mean to say that two probability distributions $\{p_x\}$ and $\{q_x\}$ over the same index set, $x$, are similar to one another?

Static measures:

• The first measure is the trace distance, defined by the equation:

\begin{aligned} D(p_x,q_x)&\equiv\frac{1}{2}\sum_x|p_x-q_x|\\ &=\frac{1}{2}(\sum_{p_x\geq q_x}(p_x-q_x)+\sum_{p_x< q_x}(q_x-p_x)\\ &=\frac{1}{2}[\sum_{p_x\geq q_x}p_x-\sum_{p_x\geq q_x}q_x+\sum_{p_x< q_x}q_x-\sum_{p_x< q_x}p_x]\\ &=\frac{1}{2}[(1-\sum_{p_x

​ This quantity is sometimes known as the L1 distance or Kolmogorov distance.

​ Interpretation: the quantity being maximized is the difference between the probability that the event $S$ occurs.

• A second measure of distance between probability distributions, the fidelity of the probability distributions:

$F(p_x,q_x)=\sum_x\sqrt{p_xq_x}$

Unfortunately, a similarly clear interpretation for the fidelity is not known. However, in the next section we show that the fidelity is a sufficiently useful quantity for mathematical purposes to justify its study, even without a clear physical interpretation.

Suppose a random variable $X$ is sent through a noisy channel, giving as output another random variable $Y$ , to form a Markov process $X\rightarrow Y$. For convenience we assume both $X$ and $Y$ have the same range of values, denoted by $x$. Then the probability that $Y$ is not equal to $X$, $p(X\neq Y )$, is an obvious and important measure of the degree to which information has been preserved by the process.

Surprisingly, this dynamic measure of distance can be understood as a special case of the static trace distance!

Let’s make a copy of $X$, denoted as $\tilde{X}=X$, and use trace distance to measure the distance between the initial pair $(\tilde{X},X)$ and the final states pair $(\tilde{X},Y)$:

\begin{aligned} D((\tilde{X},X),(\tilde{X},Y)) &=\frac{1}{2}\sum_{x_1,x_2}|\delta_{x_1,x_2}p(X=x_2)-p(\tilde{X}=x_1,Y=x_2)|\\ &=\frac{1}{2}\sum_{x_1\neq x_2}p(\tilde{X}=x_1,Y=x_2)+\frac{1}{2}\sum_x|p(X=x)-p(\tilde{X}=x,Y=x)|\\ &=\frac{1}{2}\sum_{x_1\neq x_2}p(\tilde{X}=x_1,Y=x_2)+\frac{1}{2}\sum_x(p(X=x)-p(\tilde{X}=x,Y=x))\\ &=\frac{p(\tilde{X}\neq Y)+1-p(\tilde{X}=Y)}{2}\\ &=\frac{p(\tilde{X}\neq Y)+p(\tilde{X}\neq Y)}{2}\\ &=p(X\neq Y) \end{aligned}

The process is illustrated following:

# How close are two quantum states?

We begin by defining the trace distance between quantum states $\rho$ and $\sigma$:

$D(\rho,\sigma)\equiv\frac{1}{2}tr|\rho-\sigma|$

Consider the Bloch sphere, if $\rho=\frac{I+\overrightarrow{r}\cdot\overrightarrow{\sigma}}{2},\sigma=\frac{I+\overrightarrow{s}\cdot\overrightarrow{\sigma}}{2}$, then we have:

$D(\rho,\sigma)=\frac{|\overrightarrow{r}-\overrightarrow{s}|}{2}$

So for the same unitary gates, then:

$D(U\rho U^\dagger,U\sigma U^\dagger)=D(\rho,\sigma)$

# Quantum error-correction

# Introduction

# The three qubit bit flip/phase flip code

If we want to transmit one-bit information $X$ (0 or 1), and the bit may be flipped due to the noise. So instead of transmitting it directly, we copy it three times: $XXX$ then transmit. So if one receives $001$, he may think that the third bit is flipped due to the noise and the information is 0 itself.

Compared with classical information, the quantum information raises three difficulties we need to deal with:

• No cloning.
• Errors are continuous.
• Measurement destroys quantum information.

If we want to transmit one-qubit information $|\psi\rangle=a|0\rangle+b|1\rangle$, then we first encode it to $a|000\rangle+b|111\rangle$, which is quite easy. Then:

1. Error detection or Syndrome diagnosis: Consider the four projectors:

$P_0\equiv|000\rangle\langle000|+|111\rangle\langle111|\\ P_1\equiv|100\rangle\langle100|+|011\rangle\langle011|\\ P_2\equiv|101\rangle\langle 101|+|010\rangle\langle010|\\ P_3\equiv|110\rangle\langle110|+|001\rangle\langle001|\\ P_0+P_1+P_2+P_3=I$

For example, if the first bit is flipped, then $|\psi\rangle=a|100\rangle+b|011\rangle$, then $\langle\psi|P_1|\psi\rangle=1$. Then we know that the first bit is flipped.

Notice that we don’t know anything about $a,b$ now.

2. Recovery: Just apply the $X$ gate on the qubit just detected.

If the channel is phase flip channel, then we just encode $a|0\rangle+b|1\rangle$ into state $|\psi\rangle=a|+++\rangle+b|---\rangle$. Then the phase flip would flip $|1\rangle$ to $-|1\rangle$, that is $|+\rangle$ to $|-\rangle$.

# The Shor Code

Suppose an arbitrary error could happens to any qubit, then we need the Shor Code:

$|0\rangle\rightarrow|+++\rangle\rightarrow\frac{|000\rangle+|111\rangle}{\sqrt{2}}^{\otimes 3} =\frac{(|000\rangle+|111\rangle)(|000\rangle+|111\rangle)(|000\rangle+|111\rangle)}{2\sqrt{2}}\\ |1\rangle\rightarrow|---\rangle\rightarrow\frac{|000\rangle-|111\rangle}{\sqrt{2}}^{\otimes 3} =\frac{(|000\rangle-|111\rangle)(|000\rangle-|111\rangle)(|000\rangle-|111\rangle)}{2\sqrt{2}}$

So we need all 9 qubits. If a bit flip error happens to any of them, we just measure the observable $Z_1Z_2=|00\rangle\langle 00|+|11\rangle\langle 11|-|01\rangle\langle 10|-|10\rangle\langle 10|$ which is used to “compare the two qubits”, if they are the same, then the expectation of measurements is $\langle\psi|Z_1Z_2|\psi\rangle=1$. Otherwise, it would be $-1$.

So we just compare the adjacent three qubits. If only one of then is different from the other two, then it is flipped with high probability.

For phase flip, if any of the three qubits in the first block is phase flipped, that is, $\frac{|000\rangle+|111\rangle}{\sqrt{2}}\rightarrow\frac{|000\rangle-|111\rangle}{\sqrt{2}}$, then what we do is to compare the sign of the first and the second block. For example,

$\frac{(|000\rangle+|111\rangle)(|000\rangle-|111\rangle)(|000\rangle+|111\rangle)}{2\sqrt{2}}$

We measure the observable:

$(H^{\otimes 3}Z_1Z_2Z_3H^{\otimes 3})\otimes (H^{\otimes 3}Z_4Z_5Z_6H^{\otimes 3})=X_1X_2X_3X_4X_5X_6$

Obviously, for $|\psi\rangle=\frac{|000\rangle+|111\rangle}{\sqrt{2}}$, we have $\langle \psi|X^{\otimes 3}|\psi\rangle=\langle\psi|\psi\rangle=1$，while for $|\psi\rangle=\frac{|000\rangle-|111\rangle}{\sqrt{2}}$, we have $\langle\psi|X^{\otimes 3}|\psi\rangle=-1$. So measuring the observable $X_1X_2X_3X_4X_5X_6$ is just to make out whether the first three-qubits block and the second three-qubits block has the same phase. If same, the expectation of measurement is $1$, otherwise is $-1$.

So given a state $\frac{(|001\rangle+|110\rangle)(|000\rangle-|111\rangle)(|010\rangle+|101\rangle)}{2\sqrt{2}}$, we first analyze that the third and the eighth qubits are flipped, and recover them to $\frac{(|000\rangle+|111\rangle)(|000\rangle-|111\rangle)(|000\rangle+|111\rangle)}{2\sqrt{2}}$, then analyze that the second block is phase flipped, and recover to $\frac{(|000\rangle+|111\rangle)(|000\rangle+|111\rangle)(|000\rangle+|111\rangle)}{2\sqrt{2}}$, so we know that the bit we want to transmit is $|0\rangle$.

Now suppose an arbitrary noise occurs, we use a quantum operation to describe it. Let the encoded state:

$|\psi\rangle=\alpha|0_L\rangle+\beta|1_L\rangle\\ |0_L\rangle\equiv\frac{(|000\rangle+|111\rangle)(|000\rangle+|111\rangle)(|000\rangle+|111\rangle)}{2\sqrt{2}}\\ |1_L\rangle\equiv\frac{(|000\rangle-|111\rangle)(|000\rangle-|111\rangle)(|000\rangle-|111\rangle)}{2\sqrt{2}}\\$

And the noise act as:

$\mathcal{E}(|\psi\rangle\langle\psi|)=\sum_iE_i|\psi\rangle\langle\psi|E_i^\dagger$

And the operator $E_i$ can be expanded as (We now assume that the noise is only affecting the first qubit):

$E_i=e_{i0}I_1+e_{i1}X_1+e_{i2}Z_1+e_{i3}X_1Z_1$

So the unnormalized quantum state $E_i|\psi\rangle=e_{i0}|\psi\rangle+e_{i1}X_1|\psi\rangle+e_{i2}Z_1|\psi\rangle+e_{i3}X_1Z_1|\psi\rangle$. If we know measure the observable $Z_1Z_2$, then the state would be collapsed into one of the four state $|\psi\rangle,X_1|\psi\rangle,Z_1|\psi\rangle,X_1Z_1|\psi\rangle$ and we just diagnose the error and recover it.