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:


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

E(ρ)=UρUEm(ρ)=MmρMm\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:

E(ρ)=trenv[U(ρρenv)U]\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 ek|e_k\rangle be an orthonormal basis for the (finite dimensional) state space of the environment, and let ρenv=e0e0\rho_{env}=|e_0\rangle\langle e_0| be the initial state of the environment. Then the operator can be rewritten as:

E(ρ)=kekU[ρe0e0]Uek=kEkρEk\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 EkekUe0E_k\equiv \langle e_k|U|e_0\rangle is an operator on the state space of the principal system.

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

So strictly we have the proof:

E(ρ)=trenv(U(ρe0e0)U)=trenv(U(ρI)(Ie0)(Ie0)U)\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}


(ρI)(Ie0)=(ρI)(Ie0)=(Iρ)(e01)=(Ie0)(ρ1)=(Ie0)ρ\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}


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

So we have:

E(ρ)=trenv(U(Ie0)ρ(Ie0)U)=k(Iek)U(Ie0)ρ(Ie0)U(Iek)kekUe0ρe0UekkEkρEk\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(E(ρ))=tr(kEkEkρ)1=tr(\mathcal{E}(\rho))=tr(\sum_kE_k^\dagger E_k\rho)

    So kEkEk=I\sum_k E_k^\dagger E_k=I. There are also quantum operations kEkEkI\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 EkE_k, which act on the principal system alone.

# Physical interpretation of the operator-sum representation

Consider the equation:

E(ρ)=kEkρEk=ktr(EkρEk)EkρEktr(EkρEk)=kp(k)ρk\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 {Ek}\{E_k\}.

The action of the quantum operation is equivalent to taking the state ρ\rho and randomly replacing it by ρk=EkρEktr(EkρEk)\rho_k=\frac{E_k\rho E_k^\dagger}{tr(E_k\rho E_k^\dagger)}, with probability tr(EkρEk)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 E\mathcal{E} as a map from the set of density operators of the input space Q1Q_1 to the set of density operators for the output space Q2Q_2, with the following three axiomatic properties:

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

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


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

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

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

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

A=(a11...a1kak1...akk),aijC2×2(IE)(A)=(E(a11)...E(a1k)E(ak1)...E(akk))C2k×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 IE\mathcal{I}\otimes\mathcal{E} can only be left-induce where EI\mathcal{E}\otimes\mathcal{I} is invalid.

  • Example: positive map is not complete positive.

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

    (ITrans)12(1001000000001001)=12(Trans(1000)Trans(0100)Trans(0010)Trans(0001))=12(1000001001000001)(\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-1/2, so it’s not a valid density operator.

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

E(ρ)=kEkρEk\mathcal{E}(\rho)=\sum_kE_k\rho E_k^\dagger

for some set of operators {Ek}\{E_k\} and kEkEkI\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 E,F\mathcal{E},\mathcal{F}:

E(ρ)=E1ρE1+E2ρE2F(ρ)=F1ρF1+F2ρF2E1=12I,E2=12ZF1=00,F2=11\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 E,F\mathcal{E},\mathcal{F} represents separately?

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

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

However, notice the fact that:

F(ρ)=(E1+E2)ρ(E1+E2)+(E1E2)ρ(E1E2)2=E1ρE1+E2ρE2=E(ρ)\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 UU with an additional unitary gate UU' on the environment alone:

Then what are the corresponding operators?

Fk=(Iek)(IU)U(Ie0)=j(Iek)(IU)(Iej)(Iej)U(Ie0)=j(IekUej)(Iej)U(Ie0)=j(IekUej)Ej\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 FkF_k is composed by the element of UU' and original operators EjE_j.

Theorem: Suppose {E1,...,Em}\{E_1,...,E_m\} and {F1,...,Fn}\{F_1,...,F_n\} are operation elements giving rise to quantum operations E\mathcal{E} and F\mathcal{F}, respectively. By appending zero operators to the shorter list of operation elements we may ensure that m=nm=n. Then E=F\mathcal{E}=\mathcal{F} if and only if there exist complex numbers uiju_{ij} such that Ei=juijFjE_{i}=\sum_j u_{ij}F_j, and uiju_{ij} is an m×mm\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 E\mathcal{E} on a system of Hilbert space dimension dd can be generated by an operator-sum representation containing at most d2d^2 elements,

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

where 1Md21\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:

ρtr(ρ)\rho\rightarrow tr(\rho)

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

E(ρ)=i=1d0iρi0=i=1d00tr(iρi)=00tr(i=1diiρ)=00tr(ρ)\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 E\mathcal{E} is a quantum operation. The operation is identical to the trace function, means that the “measurement” will be 100% collapse into HQH_Q', which is 00|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 QRQR, and wish to trace out system RR. Let j|j\rangle be a basis for system RR. Define a linear operator Ei:HQRHQE_i:H_{QR}\rightarrow H_Q by:


where qj|q_j\rangle are arbitrary states of system QQ. Define:

E(ρ)=iEiρEi\mathcal{E}(\rho)=\sum_i E_i\rho E_i^\dagger

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

E(ρj1j2)=iEi(ρj1j2)Ei=iEi(tλtqtj1qtj2)Ei=i,tλtEiqtj1qtj2Ei=i,tλtqtqtδi,j1δi,j2=tλtqtqtδj1,j2=ρδj1,j2=ρtr(j1j2)\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 1p1-p:


The effect of such channel is illustrated as:


Intuitively, 1+r22=tr(ρ2)\frac{1+|\overrightarrow{r}|^2}{2}=tr(\rho^2) where r\overrightarrow{r} is the Bloch vector. The channel will make the mixed state so tr(ρ2)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.



And we rewrite it in operator-sum form:

I2=IρI+XρX+YρY+ZρZ4E(ρ)=(13p4)ρ+p4(XρX+YρY+ZρZ)E1=13p4I,E2=p2X,E3=p2Y,E4=p2Z\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:


  • amplitude damping:

    (1001γ),(0γ00)\begin{pmatrix} 1 & 0 \\0 & \sqrt{1-\gamma} \end{pmatrix}, \begin{pmatrix} 0&\sqrt{\gamma}\\ 0&0 \end{pmatrix}

  • phase damping:

    (1001γ),(000γ)\begin{pmatrix} 1 & 0 \\0 & \sqrt{1-\gamma} \end{pmatrix}, \begin{pmatrix} 0&0\\ 0&\sqrt{\gamma} \end{pmatrix}

  • phase flip:


  • bit flip:


  • bit-phase flip:


# 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 {px}\{p_x\} and {qx}\{q_x\} over the same index set, xx, are similar to one another?

Static measures:

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

D(px,qx)12xpxqx=12(pxqx(pxqx)+px<qx(qxpx)=12[pxqxpxpxqxqx+px<qxqxpx<qxpx]=12[(1px<qxpx)(1px<qxqx)+px<qxqxpx<qxpx]=px<qx(qxpx)=maxSXxSpxxSqx\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<q_x}p_x)-(1-\sum_{p_x<q_x}q_x)+\sum_{p_x<q_x}q_x-\sum_{p_x<q_x}p_x]\\ &=\sum_{p_x<q_x}(q_x-p_x)\\ &=\mathop{max}\limits_{S\subseteq X}|\sum_{x\in S}p_x-\sum_{x\in S}q_x| \end{aligned}

​ 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 SS occurs.

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


    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 XX is sent through a noisy channel, giving as output another random variable YY , to form a Markov process XYX\rightarrow Y. For convenience we assume both XX and YY have the same range of values, denoted by xx. Then the probability that YY is not equal to XX, p(XY)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 XX, denoted as X~=X\tilde{X}=X, and use trace distance to measure the distance between the initial pair (X~,X)(\tilde{X},X) and the final states pair (X~,Y)(\tilde{X},Y):

D((X~,X),(X~,Y))=12x1,x2δx1,x2p(X=x2)p(X~=x1,Y=x2)=12x1x2p(X~=x1,Y=x2)+12xp(X=x)p(X~=x,Y=x)=12x1x2p(X~=x1,Y=x2)+12x(p(X=x)p(X~=x,Y=x))=p(X~Y)+1p(X~=Y)2=p(X~Y)+p(X~Y)2=p(XY)\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:


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


So for the same unitary gates, then:

D(UρU,UσU)=D(ρ,σ)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 XX (0 or 1), and the bit may be flipped due to the noise. So instead of transmitting it directly, we copy it three times: XXXXXX then transmit. So if one receives 001001, 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 ψ=a0+b1|\psi\rangle=a|0\rangle+b|1\rangle, then we first encode it to a000+b111a|000\rangle+b|111\rangle, which is quite easy. Then:

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

    P0000000+111111P1100100+011011P2101101+010010P3110110+001001P0+P1+P2+P3=IP_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 ψ=a100+b011|\psi\rangle=a|100\rangle+b|011\rangle, then ψP1ψ=1\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,ba,b now.

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

If the channel is phase flip channel, then we just encode a0+b1a|0\rangle+b|1\rangle into state ψ=a++++b|\psi\rangle=a|+++\rangle+b|---\rangle. Then the phase flip would flip 1|1\rangle to 1-|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+++000+11123=(000+111)(000+111)(000+111)22100011123=(000111)(000111)(000111)22|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 Z1Z2=0000+111101101010Z_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 ψZ1Z2ψ=1\langle\psi|Z_1Z_2|\psi\rangle=1. Otherwise, it would be 1-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, 000+11120001112\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,


We measure the observable:

(H3Z1Z2Z3H3)(H3Z4Z5Z6H3)=X1X2X3X4X5X6(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 ψ=000+1112|\psi\rangle=\frac{|000\rangle+|111\rangle}{\sqrt{2}}, we have ψX3ψ=ψψ=1\langle \psi|X^{\otimes 3}|\psi\rangle=\langle\psi|\psi\rangle=1,while for ψ=0001112|\psi\rangle=\frac{|000\rangle-|111\rangle}{\sqrt{2}}, we have ψX3ψ=1\langle\psi|X^{\otimes 3}|\psi\rangle=-1. So measuring the observable X1X2X3X4X5X6X_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 11, otherwise is 1-1.

So given a state (001+110)(000111)(010+101)22\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 (000+111)(000111)(000+111)22\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 (000+111)(000+111)(000+111)22\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|0\rangle.

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

ψ=α0L+β1L0L(000+111)(000+111)(000+111)221L(000111)(000111)(000111)22|\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:


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


So the unnormalized quantum state Eiψ=ei0ψ+ei1X1ψ+ei2Z1ψ+ei3X1Z1ψ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 Z1Z2Z_1Z_2, then the state would be collapsed into one of the four state ψ,X1ψ,Z1ψ,X1Z1ψ|\psi\rangle,X_1|\psi\rangle,Z_1|\psi\rangle,X_1Z_1|\psi\rangle and we just diagnose the error and recover it.