Lesson 18 · 70 min · core
Pauli Gates & the Pauli Algebra
The three Pauli matrices , , are simultaneously quantum gates (bit flip, bit-and-phase flip, phase flip), observables (spin components) and, together with , a basis of all complex matrices. We compute all nine products explicitly and condense them into , derive the commutation and anticommutation relations and , prove that every equals (with real coefficients exactly when is Hermitian), prove , and show that each Pauli gate rotates the Bloch sphere by about its own axis.
Prerequisites: The Bloch Sphere
Objectives and key results
Apply , , to the six cardinal states and read off the result, including the phases , .
Prove that each Pauli matrix is Hermitian, unitary and involutory, with eigenvalues .
Compute all nine products and use , and .
Decompose any matrix as and decide Hermiticity from the coefficients.
Describe , , as rotations by of the Bloch vector: , and cyclically.
- definition · Pauli matrices
- identity · Pauli product formula
- theorem · Pauli decomposition
- identity · Vector identity
- theorem · Paulis as π rotations
The Pauli matrices#
Definition
Pauli matrices
The Pauli matrices are the three complex matrices Together with they form the set . We write and, for , . As gates they are called the bit flip , the phase flip and the bit-and-phase flip ; in circuit libraries they are X, Y, Z (Qiskit) or PauliX, PauliY, PauliZ (PennyLane).
Unitary verified: (max deviation 0.0e+0)
Unitary verified: (max deviation 0.0e+0)
The matrix display below prints with exact entries ( instead of decimals), labels its rows and columns by , and lists the invariants that the proposition below proves for every Pauli matrix: Hermitian and unitary (hence normal), , , eigenvalues and . Read its columns as images of basis states: column is and column is . The phases are the only difference from the bit flip , and they are exactly what makes .
Unitary verified: (max deviation 0.0e+0)
Action of , , on the six cardinal states
- Step 1:swaps the two amplitudes: it is the classical NOT on basis states.
- Step 2:swaps the amplitudes and attaches the phases and : .
- Step 3:is diagonal: it leaves alone and multiplies by .
- Step 4:Linearity with ; for , .
- Step 5:Insert and and factor out .
- Step 6:With : factor out, using .
- Step 7:; for the lower sign, .
- Step 8:flips the sign of the amplitude.
Result
Each Pauli matrix is Hermitian, unitary and involutory
For : , , and therefore . Each has trace , determinant , eigenvalues and , and eigenvectors , , (eigenvalue first).
Proof (7 steps)
- Step 1:and are real and symmetric, so conjugate-transposing changes nothing.
- Step 2:Conjugation sends ; the transpose then swaps the two off-diagonal entries back.
- Step 3:Direct multiplication; for the off-diagonal entries are and , and .
- Step 4:Combine Hermiticity with : each Pauli is its own inverse and its own adjoint, so it is unitary.
- Step 5:For matrices the characteristic polynomial is ; here and , , .
- Step 6:The eigenvalues are real (as for every Hermitian matrix) and lie on the unit circle (as for every unitary matrix): only satisfy both.
- Step 7:Read off from the action on cardinal states computed above; the eigenvectors of each Pauli are the two antipodal cardinal states on its own axis.
∎
The Pauli algebra#
Multiplying two Pauli matrices never produces anything new: the product of any two is again a Pauli matrix (or ) times one of the four phases . We first compute all nine products by explicit multiplication, entry being , and then condense the table into a single formula.
All nine products
- Step 1:Proved entry by entry in the previous section.
- Step 2:Row of times column of .
- Step 3:Same two matrices in the opposite order: the sign flips.
- Step 4:Right-multiplying by negates the second column of .
- Step 5:Left-multiplying by negates the second row of .
- Step 6:Compare with .
- Step 7:Compare with .
Result
Pauli product formula and its consequences
With , , , the Kronecker delta and the Levi-Civita symbol ( for cyclic , for anticyclic, if two indices coincide), and summation over the repeated index : Consequently , , and .
Proof (6 steps)
- Step 1:The three squares equal , and vanishes whenever two indices coincide.
- Step 2:These are , , from the table, and for cyclic triples; for fixed only one gives a nonzero , so the sum over has one term.
- Step 3:These are , , , and for anticyclic triples. All nine ordered pairs are now covered.
- Step 4:Apply the formula to both orders; is symmetric so the terms cancel, and is antisymmetric, .
- Step 5:Now the antisymmetric terms cancel and the symmetric terms add. For this says : distinct Paulis anticommute.
- Step 6:Associativity, and .
∎
Quick check
What is the commutator ?
The Pauli basis of 2×2 matrices#
Definition
Hilbert–Schmidt inner product
On the complex vector space of complex matrices (dimension ), the Hilbert–Schmidt inner product is . It is the ordinary inner product of after stacking the four entries of each matrix into a column, so it is conjugate-linear in , linear in , and for .
Orthogonality of the Pauli basis
For : . Hence is an orthogonal basis of .
Proof (5 steps)
- Step 1:Every element of is Hermitian.
- Step 2:.
- Step 3:The diagonals of , , are , and : all three are traceless. The case is identical.
- Step 4:Product formula with , then tracelessness.
- Step 5:Four mutually orthogonal nonzero vectors are linearly independent; since , they form a basis.
∎
Pauli decomposition
Every has the unique expansion with . Explicitly Moreover is Hermitian if and only if all four coefficients are real.
Proof (6 steps)
- Step 1:is a basis (previous lemma), so the coefficients exist and are unique.
- Step 2:Multiply by on the left, take the trace (linear), and use .
- Step 3:swaps the rows of ; swaps them and multiplies the new rows by and ; negates the second row.
- Step 4:Add the diagonal entries of each product and halve to get the explicit formulas.
- Step 5:The adjoint is conjugate-linear and each is Hermitian.
- Step 6:, , Hermiticity of and , and cyclicity of the trace; a number equal to its own conjugate is real.
∎
Worked example:
- Step 1:is Hermitian, so all four coefficients must come out real.
- Step 2:Coefficient of : half the trace.
- Step 3:swaps the rows of .
- Step 4:and .
- Step 5:The imaginary parts cancel, as they must for a Hermitian matrix.
- Step 6:negates the second row of .
- Step 7:Reconstruction check: , and the entries add up to .
Result
The decomposition as a table. The Pauli decomposer applies to a matrix of dimension , lists the nonzero coefficients, the reconstruction error , and the Hermitian and unitary checks. The two decomposers in this section show fixed matrices (the lab's matrix is yours to decompose by hand). The first is the Hadamard gate of the next lesson; derive its coefficients before reading the table.
in the Pauli basis
- Step 1:Half the trace; is traceless.
- Step 2:swaps the rows of .
- Step 3:swaps the rows and multiplies the new rows by and , as in the theorem.
- Step 4:negates the second row of .
- Step 5:All coefficients are real, so is Hermitian; is a unit vector, so by the vector identity of the next section. The sum of equals , as for every unitary matrix.
Result
Two qubits. On two qubits the basis is the Pauli words , written as two letters with the left letter acting on qubit 0 (the most significant bit). Since , two words satisfy , so the coefficients are . The second decomposer shows the controlled-NOT gate of Module 2.3, , which flips qubit 1 exactly when qubit 0 is .
- Step 1:and .
- Step 2:Substitute and expand with the bilinearity of . As words: , , and .
- Step 3:Mixed-product rule, , and .
- Step 4:Trace check of one coefficient with ; the other three follow the same way.
- Step 5:Four coefficients and twelve zeros; the Parseval identity for an orthogonal basis confirms that nothing is missing.
Result
The table lists exactly four rows, and , all real: is Hermitian as well as unitary, like the single Paulis. The letter order matters. With the control on qubit 1 the same computation gives : every word is mirrored.
Quick check
Which expression equals the projector ?
The identity (a·σ)(b·σ) = (a·b)I + i(a×b)·σ#
Product of two Pauli vectors
For all (indeed for any vectors whose components commute with the Paulis): . In particular for every unit vector .
Proof (6 steps)
- Step 1:Expand both sums; the scalars commute with the matrices.
- Step 2:Insert the Pauli product formula for each of the nine pairs .
- Step 3:The collapses the double sum to ; in the second term exchange the order of summation.
- Step 4:is invariant under cyclic permutations, and is the component form of the cross product, e.g. .
- Step 5:Substitute both identifications.
- Step 6:and . This is what makes in the next lessons.
∎
Quick check
For and , write . What is ?
Paulis as π rotations of the Bloch sphere#
A gate acts on a density operator by . For a Pauli gate this is . Writing (lesson The Bloch Sphere), all we need is the conjugation , which the anticommutation relations settle at once.
Derivation of for
- Step 1:: conjugation by fixes itself.
- Step 2:Anticommute the first two factors, , then use .
- Step 3:The same two conjugations checked directly from the product table.
- Step 4:Linearity of and the two rules above with .
- Step 5:Same computation with and : the component along the gate's own axis survives, the two perpendicular components change sign.
- Step 6:The rotation formula at . The factor is a global phase, so each Pauli gate is the rotation by about its own axis.
- Step 7:Read off the maps from the coefficients above. Each is the rotation by about , , respectively (e.g. about : ): a half turn keeps the axis and reverses the plane perpendicular to it.
Result
Circuit · 1 qubit
The bit flip: . On the Bloch sphere the north pole is rotated by about the axis to the south pole .
Circuit · 1 qubit
The phase flip: prepares at , then . The rotation by about sends to ; the measurement probabilities in the computational basis do not change, only the relative phase does.
Quick check
A qubit with Bloch vector passes through and then . What is the component of the final Bloch vector?
Quick check
Which state is left on the same point of the Bloch sphere by the gate ?
Check it numerically. The snippet below uses the simulator's exact gate matrices to confirm , and , and then decomposes the worked example in the Pauli basis with and rebuilds it.
import { I2, matrix, PAULI_X, PAULI_Y, PAULI_Z } from '@/lib/quantum-simulator';
// The Pauli algebra: XY = iZ, YX = -iZ, XYZ = iI
const iZ = matrix.scale(PAULI_Z, { re: 0, im: 1 });
console.log('XY == iZ: ' + matrix.approxEqual(matrix.mul(PAULI_X, PAULI_Y), iZ));
console.log('YX == -iZ: ' + matrix.approxEqual(matrix.mul(PAULI_Y, PAULI_X), matrix.scale(iZ, -1)));
console.log('XYZ == iI: ' + matrix.approxEqual(matrix.mulAll(PAULI_X, PAULI_Y, PAULI_Z), matrix.scale(I2, { re: 0, im: 1 })));
// Pauli decomposition of B = [[1, 2+i], [2-i, -1]] with b_P = Tr(P B) / 2
const B = matrix.fromRows([[[1, 0], [2, 1]], [[2, -1], [-1, 0]]]);
const names = ['I', 'X', 'Y', 'Z'];
const paulis = [I2, PAULI_X, PAULI_Y, PAULI_Z];
let rebuilt = matrix.zeros(2);
paulis.forEach((P, k) => {
const t = matrix.trace(matrix.mul(P, B));
const b = t.re / 2;
console.log('b_' + names[k] + ' = ' + b.toFixed(4) + ' (imaginary part ' + Math.abs(t.im / 2).toFixed(4) + ')');
rebuilt = matrix.add(rebuilt, matrix.scale(P, b));
});
console.log('sum_P b_P P == B: ' + matrix.approxEqual(rebuilt, B));Expected output
XY == iZ: true YX == -iZ: true XYZ == iI: true b_I = 0.0000 (imaginary part 0.0000) b_X = 2.0000 (imaginary part 0.0000) b_Y = -1.0000 (imaginary part 0.0000) b_Z = 1.0000 (imaginary part 0.0000) sum_P b_P P == B: true
References
- M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, 10th anniversary ed., Cambridge University Press (2010), §2.1.3 (the Pauli matrices) and §4.2 (single qubit operations).doi:10.1017/CBO9780511976667
- J. Preskill, Lecture Notes for Physics 219: Quantum Computation, Chapter 2 (foundations: the qubit, Pauli operators and the Bloch sphere).theory.caltech.edu
Hands-on labs
Pauli products and the Pauli decomposition
2 steps · auto-gradedOpen labMultiply two Pauli matrices by hand to see (and why the order matters), then expand a Hermitian matrix in the Pauli basis using .