# Stabilizer code

Short description: Quantum error correction code

In quantum computing and quantum communication, a stabilizer code is a class of quantum codes for performing quantum error correction. The toric code, and surface codes more generally,[1] are types of stabilizer codes considered very important for the practical realization of quantum information processing.

## Conceptual background

Quantum error-correcting codes restore a noisy, decohered quantum state to a pure quantum state. A stabilizer quantum error-correcting code appends ancilla qubits to qubits that we want to protect. A unitary encoding circuit rotates the global state into a subspace of a larger Hilbert space. This highly entangled, encoded state corrects for local noisy errors. A quantum error-correcting code makes quantum computation and quantum communication practical by providing a way for a sender and receiver to simulate a noiseless qubit channel given a noisy qubit channel whose noise conforms to a particular error model. The first quantum error-correcting codes are strikingly similar to classical block codes in their operation and performance.

The stabilizer theory of quantum error correction allows one to import some classical binary or quaternary codes for use as a quantum code. However, when importing the classical code, it must satisfy the dual-containing (or self-orthogonality) constraint. Researchers have found many examples of classical codes satisfying this constraint, but most classical codes do not. Nevertheless, it is still useful to import classical codes in this way (though, see how the entanglement-assisted stabilizer formalism overcomes this difficulty).

## Mathematical background

The stabilizer formalism exploits elements of the Pauli group $\displaystyle{ \Pi }$ in formulating quantum error-correcting codes. The set $\displaystyle{ \Pi=\left\{ I,X,Y,Z\right\} }$ consists of the Pauli operators:

$\displaystyle{ I\equiv \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} ,\ X\equiv \begin{bmatrix} 0 & 1\\ 1 & 0 \end{bmatrix} ,\ Y\equiv \begin{bmatrix} 0 & -i\\ i & 0 \end{bmatrix} ,\ Z\equiv \begin{bmatrix} 1 & 0\\ 0 & -1 \end{bmatrix} . }$

The above operators act on a single qubit – a state represented by a vector in a two-dimensional Hilbert space. Operators in $\displaystyle{ \Pi }$ have eigenvalues $\displaystyle{ \pm1 }$ and either commute or anti-commute. The set $\displaystyle{ \Pi^{n} }$ consists of $\displaystyle{ n }$-fold tensor products of Pauli operators:

$\displaystyle{ \Pi^{n}=\left\{ \begin{array} [c]{c} e^{i\phi}A_{1}\otimes\cdots\otimes A_{n}:\forall j\in\left\{ 1,\ldots ,n\right\} A_{j}\in\Pi,\ \ \phi\in\left\{ 0,\pi/2,\pi,3\pi/2\right\} \end{array} \right\} . }$

Elements of $\displaystyle{ \Pi^{n} }$ act on a quantum register of $\displaystyle{ n }$ qubits. We occasionally omit tensor product symbols in what follows so that

$\displaystyle{ A_{1}\cdots A_{n}\equiv A_{1}\otimes\cdots\otimes A_{n}. }$

The $\displaystyle{ n }$-fold Pauli group $\displaystyle{ \Pi^{n} }$ plays an important role for both the encoding circuit and the error-correction procedure of a quantum stabilizer code over $\displaystyle{ n }$ qubits.

## Definition

Let us define an $\displaystyle{ \left[ n,k\right] }$ stabilizer quantum error-correcting code to encode $\displaystyle{ k }$ logical qubits into $\displaystyle{ n }$ physical qubits. The rate of such a code is $\displaystyle{ k/n }$. Its stabilizer $\displaystyle{ \mathcal{S} }$ is an abelian subgroup of the $\displaystyle{ n }$-fold Pauli group $\displaystyle{ \Pi^{n} }$. $\displaystyle{ \mathcal{S} }$ does not contain the operator $\displaystyle{ -I^{\otimes n} }$. The simultaneous $\displaystyle{ +1 }$-eigenspace of the operators constitutes the codespace. The codespace has dimension $\displaystyle{ 2^{k} }$ so that we can encode $\displaystyle{ k }$ qubits into it. The stabilizer $\displaystyle{ \mathcal{S} }$ has a minimal representation in terms of $\displaystyle{ n-k }$ independent generators

$\displaystyle{ \left\{ g_{1},\ldots,g_{n-k}\ |\ \forall i\in\left\{ 1,\ldots,n-k\right\} ,\ g_{i}\in\mathcal{S}\right\} . }$

The generators are independent in the sense that none of them is a product of any other two (up to a global phase). The operators $\displaystyle{ g_{1},\ldots,g_{n-k} }$ function in the same way as a parity check matrix does for a classical linear block code.

## Stabilizer error-correction conditions

One of the fundamental notions in quantum error correction theory is that it suffices to correct a discrete error set with support in the Pauli group $\displaystyle{ \Pi^{n} }$. Suppose that the errors affecting an encoded quantum state are a subset $\displaystyle{ \mathcal{E} }$ of the Pauli group $\displaystyle{ \Pi^{n} }$:

$\displaystyle{ \mathcal{E}\subset\Pi^{n}. }$

Because $\displaystyle{ \mathcal{E} }$ and $\displaystyle{ \mathcal{S} }$ are both subsets of $\displaystyle{ \Pi^{n} }$, an error $\displaystyle{ E\in\mathcal{E} }$ that affects an encoded quantum state either commutes or anticommutes with any particular element $\displaystyle{ g }$ in $\displaystyle{ \mathcal{S} }$. The error $\displaystyle{ E }$ is correctable if it anticommutes with an element $\displaystyle{ g }$ in $\displaystyle{ \mathcal{S} }$. An anticommuting error $\displaystyle{ E }$ is detectable by measuring each element $\displaystyle{ g }$ in $\displaystyle{ \mathcal{S} }$ and computing a syndrome $\displaystyle{ \mathbf{r} }$ identifying $\displaystyle{ E }$. The syndrome is a binary vector $\displaystyle{ \mathbf{r} }$ with length $\displaystyle{ n-k }$ whose elements identify whether the error $\displaystyle{ E }$ commutes or anticommutes with each $\displaystyle{ g\in\mathcal{S} }$. An error $\displaystyle{ E }$ that commutes with every element $\displaystyle{ g }$ in $\displaystyle{ \mathcal{S} }$ is correctable if and only if it is in $\displaystyle{ \mathcal{S} }$. It corrupts the encoded state if it commutes with every element of $\displaystyle{ \mathcal{S} }$ but does not lie in $\displaystyle{ \mathcal{S} }$. So we compactly summarize the stabilizer error-correcting conditions: a stabilizer code can correct any errors $\displaystyle{ E_{1},E_{2} }$ in $\displaystyle{ \mathcal{E} }$ if

$\displaystyle{ E_{1}^{\dagger}E_{2}\notin\mathcal{Z}\left( \mathcal{S}\right) }$

or

$\displaystyle{ E_{1}^{\dagger}E_{2}\in\mathcal{S} }$

where $\displaystyle{ \mathcal{Z}\left( \mathcal{S} \right) }$ is the centralizer of $\displaystyle{ \mathcal{S} }$ (i.e., the subgroup of elements that commute with all members of $\displaystyle{ \mathcal{S} }$, also known as the commutant).

## Simple example of a stabilizer code

A simple example of a stabilizer code is a three qubit $\displaystyle{ \left3,1,3\right }$ stabilizer code. It encodes $\displaystyle{ k=1 }$ logical qubit into $\displaystyle{ n=3 }$ physical qubits and protects against a single-bit flip error in the set $\displaystyle{ \left\{ X_{i}\right\} }$. This does not protect against other Pauli errors such as phase flip errors in the set $\displaystyle{ \left\{ Y_{i}\right\} }$.or $\displaystyle{ \left\{ Z_{i}\right\} }$. This has code distance $\displaystyle{ d=3 }$. Its stabilizer consists of $\displaystyle{ n-k=2 }$ Pauli operators:

$\displaystyle{ \begin{array} [c]{ccc} g_{1} & = & Z & Z & I\\ g_{2} & = & I & Z & Z\\ \end{array} }$

If there are no bit-flip errors, both operators $\displaystyle{ g_{1} }$ and $\displaystyle{ g_{2} }$ commute, the syndrome is +1,+1, and no errors are detected.

If there is a bit-flip error on the first encoded qubit, operator $\displaystyle{ g_{1} }$ will anti-commute and $\displaystyle{ g_{2} }$ commute, the syndrome is -1,+1, and the error is detected. If there is a bit-flip error on the second encoded qubit, operator $\displaystyle{ g_{1} }$ will anti-commute and $\displaystyle{ g_{2} }$ anti-commute, the syndrome is -1,-1, and the error is detected. If there is a bit-flip error on the third encoded qubit, operator $\displaystyle{ g_{1} }$ will commute and $\displaystyle{ g_{2} }$ anti-commute, the syndrome is +1,-1, and the error is detected.

## Example of a stabilizer code

Main page: Five-qubit error correcting code

An example of a stabilizer code is the five qubit $\displaystyle{ \left5,1,3\right }$ stabilizer code. It encodes $\displaystyle{ k=1 }$ logical qubit into $\displaystyle{ n=5 }$ physical qubits and protects against an arbitrary single-qubit error. It has code distance $\displaystyle{ d=3 }$. Its stabilizer consists of $\displaystyle{ n-k=4 }$ Pauli operators:

$\displaystyle{ \begin{array} [c]{ccccccc} g_{1} & = & X & Z & Z & X & I\\ g_{2} & = & I & X & Z & Z & X\\ g_{3} & = & X & I & X & Z & Z\\ g_{4} & = & Z & X & I & X & Z \end{array} }$

The above operators commute. Therefore, the codespace is the simultaneous +1-eigenspace of the above operators. Suppose a single-qubit error occurs on the encoded quantum register. A single-qubit error is in the set $\displaystyle{ \left\{ X_{i},Y_{i},Z_{i}\right\} }$ where $\displaystyle{ A_{i} }$ denotes a Pauli error on qubit $\displaystyle{ i }$. It is straightforward to verify that any arbitrary single-qubit error has a unique syndrome. The receiver corrects any single-qubit error by identifying the syndrome via a parity measurement and applying a corrective operation.

## Relation between Pauli group and binary vectors

A simple but useful mapping exists between elements of $\displaystyle{ \Pi }$ and the binary vector space $\displaystyle{ \left( \mathbb{Z}_{2}\right) ^{2} }$. This mapping gives a simplification of quantum error correction theory. It represents quantum codes with binary vectors and binary operations rather than with Pauli operators and matrix operations respectively.

We first give the mapping for the one-qubit case. Suppose $\displaystyle{ \left[ A\right] }$ is a set of equivalence classes of an operator $\displaystyle{ A }$ that have the same phase:

$\displaystyle{ \left[ A\right] =\left\{ \beta A\ |\ \beta\in\mathbb{C},\ \left\vert \beta\right\vert =1\right\} . }$

Let $\displaystyle{ \left[ \Pi\right] }$ be the set of phase-free Pauli operators where $\displaystyle{ \left[ \Pi\right] =\left\{ \left[ A\right] \ |\ A\in\Pi\right\} }$. Define the map $\displaystyle{ N:\left( \mathbb{Z}_{2}\right) ^{2}\rightarrow\Pi }$ as

$\displaystyle{ 00 \to I, \,\, 01 \to X, \,\, 11 \to Y, \,\, 10 \to Z }$

Suppose $\displaystyle{ u,v\in\left( \mathbb{Z}_{2}\right) ^{2} }$. Let us employ the shorthand $\displaystyle{ u=\left( z|x\right) }$ and $\displaystyle{ v=\left( z^{\prime}|x^{\prime }\right) }$ where $\displaystyle{ z }$, $\displaystyle{ x }$, $\displaystyle{ z^{\prime} }$, $\displaystyle{ x^{\prime}\in\mathbb{Z}_{2} }$. For example, suppose $\displaystyle{ u=\left( 0|1\right) }$. Then $\displaystyle{ N\left( u\right) =X }$. The map $\displaystyle{ N }$ induces an isomorphism $\displaystyle{ \left[ N\right] :\left( \mathbb{Z} _{2}\right) ^{2}\rightarrow\left[ \Pi\right] }$ because addition of vectors in $\displaystyle{ \left( \mathbb{Z}_{2}\right) ^{2} }$ is equivalent to multiplication of Pauli operators up to a global phase:

$\displaystyle{ \left[ N\left( u+v\right) \right] =\left[ N\left( u\right) \right] \left[ N\left( v\right) \right] . }$

Let $\displaystyle{ \odot }$ denote the symplectic product between two elements $\displaystyle{ u,v\in\left( \mathbb{Z}_{2}\right) ^{2} }$:

$\displaystyle{ u\odot v\equiv zx^{\prime}-xz^{\prime}. }$

The symplectic product $\displaystyle{ \odot }$ gives the commutation relations of elements of $\displaystyle{ \Pi }$:

$\displaystyle{ N\left( u\right) N\left( v\right) =\left( -1\right) ^{\left( u\odot v\right) }N\left( v\right) N\left( u\right) . }$

The symplectic product and the mapping $\displaystyle{ N }$ thus give a useful way to phrase Pauli relations in terms of binary algebra. The extension of the above definitions and mapping $\displaystyle{ N }$ to multiple qubits is straightforward. Let $\displaystyle{ \mathbf{A}=A_{1}\otimes\cdots\otimes A_{n} }$ denote an arbitrary element of $\displaystyle{ \Pi^{n} }$. We can similarly define the phase-free $\displaystyle{ n }$-qubit Pauli group $\displaystyle{ \left[ \Pi^{n}\right] =\left\{ \left[ \mathbf{A}\right] \ |\ \mathbf{A}\in\Pi^{n}\right\} }$ where

$\displaystyle{ \left[ \mathbf{A}\right] =\left\{ \beta\mathbf{A}\ |\ \beta\in \mathbb{C},\ \left\vert \beta\right\vert =1\right\} . }$

The group operation $\displaystyle{ \ast }$ for the above equivalence class is as follows:

$\displaystyle{ \left[ \mathbf{A}\right] \ast\left[ \mathbf{B}\right] \equiv\left[ A_{1}\right] \ast\left[ B_{1}\right] \otimes\cdots\otimes\left[ A_{n}\right] \ast\left[ B_{n}\right] =\left[ A_{1}B_{1}\right] \otimes\cdots\otimes\left[ A_{n}B_{n}\right] =\left[ \mathbf{AB}\right] . }$

The equivalence class $\displaystyle{ \left[ \Pi^{n}\right] }$ forms a commutative group under operation $\displaystyle{ \ast }$. Consider the $\displaystyle{ 2n }$-dimensional vector space

$\displaystyle{ \left( \mathbb{Z}_{2}\right) ^{2n}=\left\{ \left( \mathbf{z,x}\right) :\mathbf{z},\mathbf{x}\in\left( \mathbb{Z}_{2}\right) ^{n}\right\} . }$

It forms the commutative group $\displaystyle{ (\left( \mathbb{Z}_{2}\right) ^{2n},+) }$ with operation $\displaystyle{ + }$ defined as binary vector addition. We employ the notation $\displaystyle{ \mathbf{u}=\left( \mathbf{z}|\mathbf{x}\right) ,\mathbf{v}=\left( \mathbf{z}^{\prime}|\mathbf{x}^{\prime}\right) }$ to represent any vectors $\displaystyle{ \mathbf{u,v}\in\left( \mathbb{Z}_{2}\right) ^{2n} }$ respectively. Each vector $\displaystyle{ \mathbf{z} }$ and $\displaystyle{ \mathbf{x} }$ has elements $\displaystyle{ \left( z_{1},\ldots ,z_{n}\right) }$ and $\displaystyle{ \left( x_{1},\ldots,x_{n}\right) }$ respectively with similar representations for $\displaystyle{ \mathbf{z}^{\prime} }$ and $\displaystyle{ \mathbf{x}^{\prime} }$. The symplectic product $\displaystyle{ \odot }$ of $\displaystyle{ \mathbf{u} }$ and $\displaystyle{ \mathbf{v} }$ is

$\displaystyle{ \mathbf{u}\odot\mathbf{v\equiv}\sum_{i=1}^{n}z_{i}x_{i}^{\prime}-x_{i} z_{i}^{\prime}, }$

or

$\displaystyle{ \mathbf{u}\odot\mathbf{v\equiv}\sum_{i=1}^{n}u_{i}\odot v_{i}, }$

where $\displaystyle{ u_{i}=\left( z_{i}|x_{i}\right) }$ and $\displaystyle{ v_{i}=\left( z_{i}^{\prime }|x_{i}^{\prime}\right) }$. Let us define a map $\displaystyle{ \mathbf{N}:\left( \mathbb{Z}_{2}\right) ^{2n}\rightarrow\Pi^{n} }$ as follows:

$\displaystyle{ \mathbf{N}\left( \mathbf{u}\right) \equiv N\left( u_{1}\right) \otimes\cdots\otimes N\left( u_{n}\right) . }$

Let

$\displaystyle{ \mathbf{X}\left( \mathbf{x}\right) \equiv X^{x_{1}}\otimes\cdots\otimes X^{x_{n}}, \,\,\,\,\,\,\, \mathbf{Z}\left( \mathbf{z}\right) \equiv Z^{z_{1}}\otimes\cdots\otimes Z^{z_{n}}, }$

so that $\displaystyle{ \mathbf{N}\left( \mathbf{u}\right) }$ and $\displaystyle{ \mathbf{Z}\left( \mathbf{z}\right) \mathbf{X}\left( \mathbf{x}\right) }$ belong to the same equivalence class:

$\displaystyle{ \left[ \mathbf{N}\left( \mathbf{u}\right) \right] =\left[ \mathbf{Z} \left( \mathbf{z}\right) \mathbf{X}\left( \mathbf{x}\right) \right] . }$

The map $\displaystyle{ \left[ \mathbf{N}\right] :\left( \mathbb{Z}_{2}\right) ^{2n}\rightarrow\left[ \Pi^{n}\right] }$ is an isomorphism for the same reason given as in the previous case:

$\displaystyle{ \left[ \mathbf{N}\left( \mathbf{u+v}\right) \right] =\left[ \mathbf{N}\left( \mathbf{u}\right) \right] \left[ \mathbf{N}\left( \mathbf{v}\right) \right] , }$

where $\displaystyle{ \mathbf{u,v}\in\left( \mathbb{Z}_{2}\right) ^{2n} }$. The symplectic product captures the commutation relations of any operators $\displaystyle{ \mathbf{N}\left( \mathbf{u}\right) }$ and $\displaystyle{ \mathbf{N}\left( \mathbf{v}\right) }$:

$\displaystyle{ \mathbf{N\left( \mathbf{u}\right) N}\left( \mathbf{v}\right) =\left( -1\right) ^{\left( \mathbf{u}\odot\mathbf{v}\right) }\mathbf{N}\left( \mathbf{v}\right) \mathbf{N}\left( \mathbf{u}\right) . }$

The above binary representation and symplectic algebra are useful in making the relation between classical linear error correction and quantum error correction more explicit.

By comparing quantum error correcting codes in this language to symplectic vector spaces, we can see the following. A symplectic subspace corresponds to a direct sum of Pauli algebras (i.e., encoded qubits), while an isotropic subspace corresponds to a set of stabilizers.