Repetition code revisited
Next, we'll take a second look at the 3-bit repetition code, this time phrasing it in terms of Pauli operations. This will be our first example of a stabilizer code.
Pauli observables for the repetition code
Recall that, when we apply the 3-bit repetition code to qubits, a given qubit state vector is encoded as
Any state of this form is a valid 3-qubit encoding of a qubit state — but if we had a state that we weren't sure about, we could verify that we have a valid encoding by checking the following two equations.
The first equation states that applying operations to the leftmost two qubits of has no effect, which is to say that is an eigenvector of with eigenvalue The second equation is similar except that operations are applied to the rightmost two qubits. The idea is that, if we think about as a linear combination of standard basis states, then the first equation implies that we can only have nonzero coefficients for standard basis states where the leftmost two bits have even parity (or, equivalently, are equal), and the second equation implies that we can only have nonzero coefficients for standard basis states for which the rightmost two bits have even parity.
Equivalently, if we view the two Pauli operations and as observables, and measure both using the circuits suggested at the end of the previous section, then we would be certain to obtain measurement outcomes corresponding to eigenvalues, because is an eigenvector of both observables with eigenvalue But, the simplified version of the (combined) circuit for independently measuring both observables, shown here, is none other than the parity check circuit for the 3-bit repetition code.
The two equations above therefore imply that the parity check circuit outputs which is the syndrome that indicates that no errors have been detected.
The 3-qubit Pauli operations and are called stabilizer generators for this code, and the stabilizer of the code is the set generated by the stabilizer generators.
The stabilizer is a fundamentally important mathematical object associated with this code, and the role that it plays will be discussed as the lesson continues. For now, let's observe that we could have made a different choice for the generators and corresponding parity checks, specifically by taking in place of either of the generators we did select, but the stabilizer and the code itself would be unchanged as a result.
Error detection
Next, we'll consider bit-flip detection for the 3-bit repetition code, with a focus on the interactions and relationships among the Pauli operations that are involved: the stabilizer generators and the errors themselves.
Suppose we've encoded a qubit using the 3-bit repetition code, and a bit-flip error occurs on the leftmost qubit. This causes the state to be transformed according to the action of an operation (or error).
This error can be detected by performing the parity checks for the 3-bit repetition code, as discussed in the previous lesson, which is equivalent to nondestructively measuring the stabilizer generators and as observables.
Let's begin with the first stabilizer generator. The state has been affected by an error on the leftmost qubit, and our goal is to understand how the measurement of this stabilizer generator, as an observable, is influenced by this error. Because and anti-commute, whereas every matrix commutes with the identity matrix, it follows that anti-commutes with Meanwhile, because is a valid encoding of a qubit, acts trivially on
Therefore, is an eigenvector of with eigenvalue When the measurement associated with the observable is performed on the state the outcome is therefore certain to be the one associated with the eigenvalue
Similar reasoning can be applied to the second stabilizer generator, but this time the error commutes with the stabilizer generator rather than anti-commuting, and so the outcome for this measurement is the one associated with the eigenvalue
What we find when considering these equations is that, regardless of our original state the corrupted state is an eigenvector of both stabilizer generators, and whether the eigenvalue is or is determined by whether the error commutes or anti-commutes with each stabilizer generator. For errors represented by Pauli operations, it will always be one or the other, because any two Pauli operations either commute or anti-commute. Meanwhile, the actual state doesn't play an important role, except for the fact that the stabilizer generators act trivially on this state.
For this reason, we really don't need to concern ourselves in general with the specific encoded state we're working with. All that matters is whether the error commutes or anti-commutes with each stabilizer generator. In particular, these are the relevant equations with regard to this particular error for this code.
Here's a table with one row for each stabilizer generator and one column for each error. The entry in the table is either or depending on whether the error and the stabilizer generator commute or anti-commute. The table only includes columns for the errors corresponding to a single bit-flip, as well as no error at all, which is described by the identity tensored with itself three times. We could add more columns for other errors, but for now our focus will be on just these errors.
For each error in the table, the corresponding column therefore reveals how that error transforms any given encoding into a or eigenvector of each stabilizer generator. Equivalently, the columns describe the syndrome we would obtain from the parity checks, which are equivalent to nondestructive measurements of the stabilizer generators as observables. Of course, the table has and entries rather than and entries — and it's common to think about a syndrome as being a binary string rather than column of and entries — but we can equally well think about these vectors with and entries as syndromes to connect them directly to the eigenvalues of the stabilizer generators. In general, the syndromes tell us something about whatever error took place, and if we know that one of the four possible errors listed in the table occurred, the syndrome indicates which one it was.
Syndromes
Encodings for the 3-bit repetition code are 3-qubit states, so they're unit vectors in an 8-dimensional complex vector space. The four possible syndromes effectively split this 8 dimensional space into four 2-dimensional subspaces, where quantum state vectors in each subspace always result in the same syndrome. The following diagram illustrates specifically how the 8-dimensional space is divided up by the two stabilizer generators.
Each stabilizer generator splits the space into two subspaces of equal dimension, namely the space of eigenvectors and the space of eigenvectors for that observable. For example, the eigenvectors of are linear combinations of standard basis states for which the leftmost two bits have even parity, and the eigenvectors are linear combinations of standard basis states for which the leftmost two bits have odd parity. The situation is similar for the other stabilizer generator, except that for this one it's the rightmost two bits rather than the leftmost two bits.
The four 2-dimensional subspaces corresponding to the four possible syndromes are easy to describe in this case, owing to the fact that this is a very simple code. In particular, the subspace corresponding to the syndrome is the space spanned by and , which is the space of valid encodings (also known as the code space), and in general the spaces are spanned by the standard basis shown in the corresponding squares.
The syndromes also partition all of the 3-qubit Pauli operations into 4 equal-size collections, depending upon which syndrome that operation (as an error) would cause. For example, any Pauli operation that commutes with both stabilizer generators results in the syndrome and among the 64 possible 3-qubit Pauli operations, there are exactly 16 of them in this category (including and for instance), and likewise for the other 3 syndromes.
Both of these properties — that the syndromes partition both the state space in which encodings live and all of the Pauli operations on this space into equal-sized collections — are true in general for stabilizer codes, which we'll define precisely in the next section.
Although it's mainly an aside at this point, it's worth mentioning that Pauli operations that commute with both stabilizer generators, or equivalently Pauli operations that result in the syndrome but are not themselves proportional to elements of the stabilizer, turn out to behave just like single-qubit Pauli operations on the encoded qubit (as in, the logical qubit) for this code. For example, commutes with both stabilizer generators, but is itself not proportional to any element in the stabilizer, and indeed the effect of this operation on an encoding is equivalent to an gate on the logical qubit being encoded.
Again, this is a phenomenon that generalizes to all stabilizer codes.