Skip to main content
IBM Quantum Platform

Pauli operations and observables

Pauli matrices play a central role in the stabilizer formalism. We'll begin the lesson with a discussion of Pauli matrices, including some of their basic algebraic properties, and we'll also discuss how Pauli matrices (and tensor products of Pauli matrices) can describe measurements.


Pauli operation basics

Here are the Pauli matrices, including the 2×22\times 2 identity matrix and the three non-identity Pauli matrices.

I=(1001)X=(0110)Y=(0ii0)Z=(1001)\mathbb{I} = \begin{pmatrix} 1 & 0\\ 0 & 1 \end{pmatrix} \qquad X = \begin{pmatrix} 0 & 1\\ 1 & 0 \end{pmatrix} \qquad Y = \begin{pmatrix} 0 & -i\\ i & 0 \end{pmatrix} \qquad Z = \begin{pmatrix} 1 & 0\\ 0 & -1 \end{pmatrix}

Properties of Pauli matrices

All four of the Pauli matrices are both unitary and Hermitian. We used the names σx,\sigma_x, σy,\sigma_y, and σz\sigma_z to refer to the non-identity Pauli matrices earlier in the series, but it is conventional to instead use the capital letters X,X, Y,Y, and ZZ in the context of error correction. This convention was followed in the previous lesson, and we'll continue to do this for the remaining lessons.

Different non-identity Pauli matrices anti-commute with one another.

XY=YXXZ=ZXYZ=ZYXY = -YX \qquad XZ = -ZX \qquad YZ = -ZY

These anti-commutation relations are simple and easy to verify by performing the multiplications, but they're critically important, in the stabilizer formalism and elsewhere. As we will see, the minus signs that emerge when the ordering between two different non-identity Pauli matrices is reversed in a matrix product correspond precisely to the detection of errors in the stabilizer formalism.

We also have the multiplication rules listed here.

XX=YY=ZZ=IXY=iZYZ=iXZX=iYXX = YY = ZZ = \mathbb{I} \qquad XY = iZ \qquad YZ = iX \qquad ZX = iY

That is, each Pauli matrix is its own inverse (which is always true for any matrix that is both unitary and Hermitian), and multiplying two different non-identity Pauli matrices together is always ±i\pm i times the remaining non-identity Pauli matrix. In particular, up to a phase factor, YY is equivalent to XZ,X Z, which explains our focus on XX and ZZ errors and apparent lack of interest in YY errors in quantum error correction; XX represents a bit-flip, ZZ represents a phase-flip, and so (up to a global phase factor) YY represents both of those errors occurring simultaneously on the same qubit.

Pauli operations on multiple qubits

The four Pauli matrices all represent operations (which could be errors) on a single qubit — and by tensoring them together we obtain operations on multiple qubits. As a point of terminology, when we refer to an n-qubit Pauli operation, we mean a tensor product of any nn Pauli matrices, such as the examples shown here, for which n=9.n=9.

IIIIIIIIIXXIIIIIIIXYZIIIXYZ\begin{gathered} \mathbb{I} \otimes \mathbb{I} \otimes \mathbb{I} \otimes \mathbb{I} \otimes \mathbb{I} \otimes \mathbb{I} \otimes \mathbb{I} \otimes \mathbb{I} \otimes \mathbb{I} \\[1mm] X \otimes X \otimes \mathbb{I} \otimes \mathbb{I} \otimes \mathbb{I} \otimes \mathbb{I} \otimes \mathbb{I} \otimes \mathbb{I} \otimes \mathbb{I} \\[1mm] X \otimes Y \otimes Z \otimes \mathbb{I} \otimes \mathbb{I} \otimes \mathbb{I} \otimes X \otimes Y \otimes Z \end{gathered}

Often, the term Pauli operation refers to a tensor product of Pauli matrices along with a phase factor, or sometimes just certain phase factors such as ±1\pm 1 and ±i.\pm i. There are good reasons to allow for phase factors like this from a mathematical viewpoint — but, to keep things as simple as possible, we'll use the term Pauli operation in this course to refer to a tensor product of Pauli matrices without the possibility of a phase factor different than 1.

The weight of an nn-qubit Pauli operation is the number of non-identity Pauli matrices in the tensor product. For instance, the first example above has weight 0,0, the second has weight 2,2, and the third has weight 6.6. Intuitively speaking, the weight of an nn-qubit Pauli operation is the number of qubits on which it acts non-trivially. It's typical that quantum error correcting codes are designed so that they can detect and correct errors represented by Pauli operations so long as their weight isn't too high.

Pauli operations as generators

It's sometimes useful to consider collections of Pauli operations as generators of sets (more specifically, groups) of operations, in an algebraic sense that you may recognize if you're familiar with group theory. If you're not familiar with group theory, that's OK — it's not essential for the lesson. A familiarity with the basics of group theory is, however, strongly recommended for those interested in exploring quantum error correction in greater depth.

Suppose that P1,,PrP_1, \ldots, P_r are nn-qubit Pauli operations. When we refer to the set generated by P1,,Pr,P_1, \ldots, P_r, we mean the set of all matrices that can be obtained by multiplying these matrices together, in any combination and in any order we choose, taking each one as many times as we like. The notation used to refer to this set is P1,,Pr.\langle P_1, \ldots, P_r \rangle.

For example, the set generated by the three non-identity Pauli matrices is as follows.

X,Y,Z={αP:α{1,i,1,i},  P{I,X,Y,Z}}\langle X, Y, Z \rangle = \bigl\{\alpha P\,:\,\alpha\in\{1,i,-1,-i\},\; P\in\{\mathbb{I},X,Y,Z\} \bigr\}

This can be reasoned through the multiplication rules listed earlier. There are 16 different matrices in this set, which is commonly called the Pauli group.

For a second example, if we remove Y,Y, we obtain half of the Pauli group.

X,Z={I,X,Z,iY,I,X,Z,iY}\langle X, Z\rangle = \{ \mathbb{I}, X, Z, -iY, -\mathbb{I}, -X, -Z, iY \}

Here's one final example (for now), where this time we have n=2.n=2.

XX,ZZ={II,XX,ZZ,YY}\langle X \otimes X, Z \otimes Z\rangle = \{ \mathbb{I}\otimes\mathbb{I}, X\otimes X, Z\otimes Z, -Y\otimes Y \}

In this case we obtain just four elements, owing to the fact that XXX\otimes X and ZZZ\otimes Z commute:

(XX)(ZZ)=(XZ)(XZ)=(ZX)(ZX)=(ZX)(ZX)=(ZZ)(XX).\begin{aligned} (X\otimes X)(Z\otimes Z) & = (XZ) \otimes (XZ)\\ & = (-ZX)\otimes (-ZX)\\ & = (ZX)\otimes (ZX)\\ & = (Z\otimes Z)(X\otimes X). \end{aligned}

Pauli observables

Pauli matrices, and nn-qubit Pauli operations more generally, are unitary, and therefore they describe unitary operations on qubits. But they're also Hermitian matrices, and for this reason they describe measurements, as will now be explained.

Hermitian matrix observables

Consider first an arbitrary Hermitian matrix A.A. When we refer to AA as an observable, we're associating with AA a certain uniquely defined projective measurement. In words, the possible outcomes are the distinct eigenvalues of A,A, and the projections that define the measurement are the ones that project onto the spaces spanned by the corresponding eigenvectors of A.A. So, the outcomes for such a measurement happen to be real numbers — but because matrices have only finitely many eigenvalues, there will only be finitely many different measurement outcomes for a given choice of A.A.

In greater detail, by the spectral theorem, it is possible to write

A=k=1mλkΠkA = \sum_{k = 1}^m \lambda_k \Pi_k

for distinct real number eigenvalues λ1,,λm\lambda_1,\ldots,\lambda_m and projections Π1,,Πm\Pi_1,\ldots,\Pi_m satisfying

Π1++Πm=I.\Pi_1 + \cdots + \Pi_m = \mathbb{I}.

Such an expression of a matrix is unique up to the ordering of the eigenvalues. Another way to say this is that, if we insist that the eigenvalues are ordered in decreasing value λ1>λ2>>λm,\lambda_1 > \lambda_2 > \cdots > \lambda_m, then there's only one way to write AA in the form above.

Based on this expression, the measurement we associate with the observable AA is the projective measurement described by the projections Π1,,Πm,\Pi_1,\ldots,\Pi_m, and the eigenvalues λ1,,λm\lambda_1,\ldots,\lambda_m are understood to be the measurement outcomes corresponding to these projections.

Measurements from Pauli operations

Let's see what measurements of the sort just described look like for Pauli operations, starting with the three non-identity Pauli matrices. These matrices have spectral decompositions as follows.

X=++Y=+i+iiiZ=0011\begin{gathered} X = \vert {+} \rangle\langle {+} \vert - \vert {-} \rangle\langle {-} \vert\\ Y = \vert {+i} \rangle\langle {+i} \vert - \vert {-i} \rangle\langle {-i} \vert\\ Z = \vert {0} \rangle\langle {0} \vert - \vert {1} \rangle\langle {1} \vert \end{gathered}

The measurements defined by X,X, Y,Y, and Z,Z, viewed as observables, are therefore the projective measurements defined by the following sets of projections, respectively.

{++,}{+i+i,ii}{00,11}\begin{gathered} \bigl\{\vert {+} \rangle\langle {+} \vert, \vert {-} \rangle\langle {-} \vert \bigr\} \\ \bigl\{\vert {+i} \rangle\langle {+i} \vert, \vert {-i} \rangle\langle {-i} \vert\bigr\} \\ \bigl\{\vert {0} \rangle\langle {0} \vert, \vert {1} \rangle\langle {1} \vert\bigr\} \end{gathered}

In all three cases, the two possible measurement outcomes are the eigenvalues +1+1 and 1.-1. Such measurements are commonly called XX-measurements, YY-measurements, and ZZ-measurements. We encountered these measurements in the "General measurements" lesson of "General formulation of quantum information," where they arose in the context of quantum state tomography.

Of course, a ZZ-measurement is essentially just a standard basis measurement and an XX measurement is a measurement with respect to the plus/minus basis of a qubit — but, as these measurements are described here, we're taking the eigenvalues +1+1 and 1-1 to be the actual measurement outcomes.

The same prescription can be followed for Pauli operations on n2n\geq 2 qubits, though it must be stressed that there will still be just two possible outcomes for the measurements described in this way: +1+1 and 1,-1, which are the only possible eigenvalues of Pauli operations. The two corresponding projections will therefore have rank higher than one in this case. More precisely, for every non-identity nn-qubit Pauli operation, the 2n2^n dimensional state space always splits into two subspaces of eigenvectors having equal dimension, so the two projections that define the associated measurement will both have rank 2n1.2^{n-1}.

The measurement described by an nn-qubit Pauli operation, considered as an observable, is therefore not the same thing as a measurement with respect to an orthonormal basis of eigenvectors of that operation, nor is it the same thing as independently measuring each of the corresponding Pauli matrices independently, as observables, on nn qubits. Both of those alternatives would necessitate 2n2^n possible measurement outcomes, but here we have just the two possible outcomes +1+1 and 1.-1.

For example, consider the 2-qubit Pauli operation ZZZ\otimes Z as an observable. We can effectively take the tensor product of the spectral decompositions to obtain one for the tensor product.

ZZ=(0011)(0011)=(0000+1111)(0101+1010)\begin{aligned} Z\otimes Z & = (\vert 0\rangle\langle 0\vert - \vert 1\rangle\langle 1\vert) \otimes (\vert 0\rangle\langle 0\vert - \vert 1\rangle\langle 1\vert)\\ & = \bigl( \vert 00\rangle\langle 00\vert + \vert 11\rangle\langle 11\vert \bigr) - \bigl( \vert 01\rangle\langle 01\vert + \vert 10\rangle\langle 10\vert \bigr) \end{aligned}

That is, we have ZZ=Π0Π1Z\otimes Z = \Pi_0 - \Pi_1 for

Π0=0000+1111andΠ1=0101+1010,\Pi_0 = \vert 00\rangle\langle 00\vert + \vert 11\rangle\langle 11\vert \quad\text{and}\quad \Pi_1 = \vert 01\rangle\langle 01\vert + \vert 10\rangle\langle 10\vert,

so these are the two projections that define the measurement. If, for instance, we were to measure a ϕ+\vert\phi^+\rangle Bell state nondestructively using this measurement, then we would be certain to obtain the outcome +1,+1, and the state would be unchanged as a result of the measurement. In particular, the state would not collapse to 00\vert 00\rangle or 11.\vert 11\rangle.

Nondestructive implementation through phase estimation

For any nn-qubit Pauli operation, we can perform the measurement associated with that observable nondestructively using phase estimation.

Here's a circuit based on phase estimation that works for any Pauli matrix P,P, where the measurement is being performed on the top qubit. The outcomes 00 and 11 of the standard basis measurement in the circuit correspond to the eigenvalues +1+1 and 1,-1, just like we usually have for phase estimation with one control qubit. (Note that the control qubit is on the bottom in this diagram, whereas in the "Phase estimation and factoring" lesson of "Fundamentals of quantum algorithms" the control qubits were drawn on the top.)

Circuit for measuring a Pauli observable using phase estimation

A similar method works for Pauli operations on multiple qubits. For example, the following circuit diagram illustrates a nondestructive measurement of the 33-qubit Pauli observable P2P1P0,P_2\otimes P_1\otimes P_0, for any choice of P0,P1,P2{X,Y,Z}.P_0,P_1,P_2 \in \{X,Y,Z\}.

Circuit for measuring a 3-qubit Pauli observable using phase estimation

This approach generalizes to nn-qubit Pauli observables, for any n,n, in the natural way. Of course, we only need to include controlled-unitary gates for non-identity tensor factors of Pauli observables when implementing such measurements; controlled-identity gates are simply identity gates and can therefore be omitted. This means that lower weight Pauli observables require smaller circuits to be implemented through this approach.

Notice that, irrespective of n,n, these phase-estimation circuits have just a single control qubit, which is consistent with the fact that there are just two possible measurement outcomes for these measurements. Using more control qubits wouldn't reveal additional information because these measurements are already perfect using a single control qubit. (One way to see this is directly from the general procedure for phase estimation: the assumption U2=IU^2 = \mathbb{I} renders any additional control qubits beyond the first pointless.)

Here's a specific example, of a nondestructive implementation of a ZZZ\otimes Z measurement, which is relevant to the description of the 3-bit repetition code as a stabilizer code that we'll see shortly.

Circuit for measuring a ZZ observable using phase estimation

In this case, and for tensor products of more than two ZZ observables more generally, the circuit can be simplified.

Simplified circuit for measuring a ZZ observable

Thus, this measurement is equivalent to nondestructively measuring the parity (or XOR) of the standard basis states of two qubits.

Was this page helpful?
Report a bug or request content on GitHub.