Stabilizer Formalism
Abstract¶
The stabilizer formalism of quantum error correction.
The stabilizer formalism is a method for creating error correcting codes using the Pauli-group. In addition to allowing certain errors to be detected and corrected, logical gates can also be performed in this framework.
Pauli-group¶
The generators of the qubit Pauli-group are
From these operators all elements of the one qubit Pauli-group can be generated. The Pauli-group is the set of Pauli-operators plus identity with all possible phases of .
The -qubit Pauli-group , , is then the -fold tensor product of elements in the one qubit Pauli-group. All elements in either commute or anit-commute,
All elements of the Pauli-group have eigenvalues or . Here, we mostly consider just the elements with eigenvalues (the Hermitian elements of the Pauli-group).
See the Pauli Group Page for more detail.
Stabilizer Codes¶
Definition¶
The stabilizers of an error correcting code are defined as
such that . The stabilizers are therefore an Abelian subgroup of the -qubit Pauli-group, , such that all logical states (states in the code space) are eigenstates of each stabilizer, that does not contain the negative identity operator.
The justification of these conditions are as follows:
:
This avoids any logical information encoded in the code space being destroyed when a stablizer is measured on .
Further Details
A state, is said to be stabilized by an operator if , meaning is a eigenstate of .
From the above definition of , it can be seen that all logical states are stabilized by . Therefore, if one were to measure or apply on any logical state they would return the state unchanged. This avoids any logical information encoded in the code space being destroyed when a stablizer is measured on . (Does it also prevent loss of logical information in general? I am currently not sure).
One can reverse this definition, and defined the code space to be the subspace of the total Hilbert space that is stabilized by all elements of . Phrased alternatively, the code space is defined as the intersection of all eigenspaces of the elements of .
:
If this condition is not met, only the trivial space can be stabilized.
Proof
Let such that . Moreover, assume they both stabilize such that
Firstly, note that given that all elements of commute or anti-commute,
Secondly, the products, and also stabilize if and individually stabilize , such that
Putting these facts together implies that
This is only true if , meaning that non-Abelian subgroups of can only stabilize a trivial subspace.
(Note, the equation is about the physical equivalence of vectors in a Hilbert space, with this equation only being satasfied for the zero vector. It is not about whether two states are physically distinguishable under global phases.)
:
If this condition is not met, only the trivial space can be stabilized.
The Role of the Stabilizers¶
The stabilizers are used to separate a Hilbert space into a series of orthogonal subspaces, as per the structure of QEC codes.
Each stabliser, , is an element of the Pauli-group and can therefore be written as
where is the projector onto the +1 eigenspace of and the projector onto the -1 eigenspace of . One can then defined the code space via the projector
which is the projector onto the intersection of all the positive eigenspaces of the stabilizers.
The intersection of all the different combinations of the positive and negative eigenspaces of the stabilizers are all pairwise orthogonal, and they define each of the orthogonal subspaces of the QEC code.
An error that maps the code space to one of these orthogonal subspaces can therefore be detected by measuring the observable who’s eigenspaces are exactly these orthogonal subspaces.
Stabilizer Generators¶
The stabilizers form an (abelian) subgroup of the -qubit Pauli-group. Hence, they can be represented in terms of a set of independent generators 💭.
The code space of a stabilizer code can then be defined from the stabilizer generators only.
To see this, let where for . If
then
Hence, any state in the +1 eigenspace of both and is also in the +1 eigenspace of their product . Therefore, the simultaneous +1 eigenspace of the generators is the simultaneous +1 eigenspace of the stabilizers, and hence, is the code space.
Moreover, only the stabilizer generators need to be measured, as the measurements of all other stabilizers can be calculated in post-processing from the measurement outcomes of the generators.
Proof
Number of Logical Qubits¶
If a code on physical qubits has stabilizer generators, then the number of logical qubits, , is given by
Proof
Each stabilizer generator is an element of the Pauli-group, meaning its +1 and -1 eigenspaces evenly split the Hilbert space.
Given a Hilbert space of -qubits, its dimension is . The dimension of the +1 eigenspace of a stabilizer generator is therefore . Hence, the constraint of a stabilizer generator can be thought of as removing one qubit from the Hilbert space.
We now aim to show that each additional stabilizer generator removes one further qubit from the Hilbert space.
Let and be stabilizer generators, such that and . Both and can be decomposed in their eigenbasis as
where
As , the projector onto simultaneous +1 eigenspace is given by
The dimension of a projector is then given by its trace, meaning the dimension of this projector is therefore
where we have used the fact that the trace of non-identity elements of the Pauli-group is zero, and as and are independent stabilizer generators.
Hence, the addition of another constraint of a stabilizer generator half’s the size of the simultaneous +1 eigenspace.
This can be generalized to independent commuting stabilizers, with each additional stabilizer generator halving the size of the simultaneous +1 eigenspace. Therefore, given stabilizer generators, the size of the simultaneous +1 eigenspace is
which is a space capable of encoding qubits.
Logical Operators¶
A logical operator is an operator that acts on encoded states in the same way as it would act on a physical state. This means all expected commutations relations must hold.
The possible logical operators of a stabilizer code are
where is the normalizer of .
All elements of the Pauli-group commute or anti-commute, and the stabilizer generators never include . Hence, the normalizer of is equal to the centralizer of .
The possible logical operators are therefore the elements of the Pauli-group that mutually commute with all elements of but are not in .
This definition ensures that states acted upon by a logical operator remain within the code space.
Proof
Let be an arbitrary state in the code space i.e., the +1 eigenspace of all stabilizers , and let . Hence, .
Now, let . We now aim to show that remains inside the code space.
This is actually easy to see as
as . Hence, if was in the +1 eigenspace of , so is .
The above was true for an arbitrary stabilizer and, given all stabilizers commute, will generalize to the application of any number of stabilizers.
Hence, if is in the simultaneous +1 eigenspace of all stabilizers, then so is .
Uniqueness¶
Logical operators are not unique, as any logical operator multiplied by a stabilizer will perform the same logical operation.
To see this, let , and assume is an arbitrary state in the code space. Then
meaning and have the same effect on the logical state.
To capture this, logical operators are formally represented by cosets of insides . Given a , the left coset
forms a set of equivalent logical operators. If , then the coset is equal to with the logical operator being the identity.
As a result of this, logical operators are studied via the quotient group of with respect to , i.e., . This quotient group combines together all the operators in that perform the same logical operator and treats them equivalently. Relationships between these set of operators (that perform the same logical operator) can then be studied.
Code Distance¶
The distance of an error correcting code is the minimum number of errors that can occur without the error being detected by the code.
For a stabilizer code, the distance is given by the minimum weight of an element in .
Justification
Errors are considered to be individual Pauli-errors acting on the qubits, with the weight of a Pauli-string - the number of qubits on which the string acts non-trivially - corresponding to the number of errors that given Pauli-string will have caused. For example,
corresponds to an error on qubits and 5. That is 3 errors, equal to the weight of the string.
Elements of are the logical operators of the stabilizer code i.e., the Pauli-string that keep states within the code space but act non-trivially on them.
Hence, if an error occurs, it will go undetected, as the state will remain in the code space but an unknown operation will have been applied.
Therefore, the minimum weight of an element in will be the distance of the code.
Measuring Stabilizer¶
All elements of are unitary. If is also Hermitian, then any stabilizer can be measured on the logic state indirectly, with the measurement outcome stored in an ancilla 💭.

A schematic of the circuit used to measure the stabilizer on the logical state .
Assume that is a stabilizer of the logical state such that . Let be some correctable error that has occurred on the logical state, such that or , depending on whether is in the positive or negative eigenspace of .
The input state into the circuit is , where labels the ancillary space and the subscript now doubles as a label for the space of the logical state.
The output state is then
Proof
Therefore, if , the second term will go to zero and the output state becomes
such that if one measures on the ancilla they will get the outcome +1 (syndrome bit 0) with certainty.
If , the first term will go to zero and the output state becomes
such that a measurement performed on the ancilla now gives the outcome -1 (syndrome bit 1) with certainty.
By performing the above circuit and measuring the ancilla one can therefore determine if the logical state is in the +1 or -1 eigenspace of the stabilizer .
This is an example of generalised measurement and Naimark’s dilation theorem.
Parity Measurements Circuits
When discussing the 2-bit repetition code it was noted that the measurement of the stabilizer was akin to performing a parity check on the qubits. Specifically, a logical qubit was encoded into space such that
It was then seen that it was possible to perform error detection on the set of errors by measuring the stabilizer . If occurs, the state stays in the code space and measuring the stabilizer gives the output +1 (syndrome bit 0). If either an or occurs, the state is mapped into the space , and a measurement of the stabilizer gives the output -1 (syndrome bit 1).
A simpler circuit can be used for measuring stabilizers that perform a parity check. The circuit for performing the parity check in the 2-bit repetition code is shown in the below figure.

A circuit that checks the parity of two qubits and stores the result in an ancilla. and are used to label the two physical qubits used to create the single logical qubit.
Firstly, the parity of two bits, , is given by . This will be zero if both bits are zero or both bits are one. If the bits differ, it will be one.
Now, note that the action of a CNOT gate on some arbitrary computational basis state can be written as
This works because a CNOT gate applies an gate to the second qubit if the first qubit is . This gate will flip the second qubit, which can be done by adding 1 to it. Hence, if nothing is added to the second qubit and it remains . If then 1 is added to , flipping it.
From here, consider that if it is not known if an error has occurred on an arbitrary qubit encoded into the code space, , the state can be written as
The input into the circuit is then
The action of the first CNOT gate is then
as . The action of the second CNOT gate is then
as . Hence, if is measured on the computational basis then the parity is output with certainty.
Virtual Paulis¶
Stabilzers can also be formalised in terms of virtual Paulis.
Here, elements of are chosen, , such that the single-qubit commutation relations are obeyed as expected.
The stabilzer group can then be chosen to be
where . These are independent, mutually commuting, and do not contain .
The normaliser of this stabilzer group is then
which are the logical operators of the code.
More Details
As detailed here, the eigenbasis of these stabilzers can be labeled by bit-strings , such that
As the code space is defined as the +1 eigenspace of the stabilzers, using this basis the code space can be defined as the space spanned by the states
where is the zero bit-string of length .
Consistency check:
There are possible code-words, meaning qubits can be encoded.
Elements in the normaliser act only on the final bits, and hence manipulate the code words (and hence the logical information) without effecting the first bits, keeping the state in the code space.
If a correctable error acts on the encoded state, it will map the first zeros bits to some other bit-string. This will then be the syndrome of the error correcting code, which will be extracted when the stabilzer generators are measured.