Quantum Computing Master Course — 022. Pauli X Y and Z Gates
Lesson 022: Pauli X Y and Z Gates
Smartyfy Quantum Computing Master Course
Prerequisites and objectives
The Pauli matrices are three basic operators that appear throughout quantum computing. You will calculate their action on arbitrary amplitudes, identify their eigenstates, compare their gate and observable roles, and verify their multiplication relations. Lessons 013–015 provide the unitary, Hermitian, and eigenvector tools needed here.
Three explicit matrices
In the computational basis, X = [[0, 1], [1, 0]], Y = [[0, −i], [i, 0]], and Z = [[1, 0], [0, −1]]. Acting on ψ = [α, β], they give Xψ = [β, α], Yψ = [−iβ, iα], and Zψ = [α, −β].
These formulas are often more reliable than informal gate nicknames. X swaps the amplitudes. Z changes their relative sign when both are nonzero. Y combines a swap with specific phase factors. The factor multiplying each coordinate matters; Y is not obtained merely by swapping and then guessing an overall sign.
The IBM single-system framework gives these standard matrix conventions. Other conventions occasionally move global phases into gate definitions, so compare matrices when reconciling two sources.
Basis-state actions
X|0⟩ = |1⟩ and X|1⟩ = |0⟩. Z|0⟩ = |0⟩ and Z|1⟩ = −|1⟩. Y|0⟩ = i|1⟩ and Y|1⟩ = −i|0⟩. For an isolated basis-state input, the extra signs or i factors are global phases and do not change the physical output state.
However, keep those factors when applying the gate to a superposition. The two basis components can acquire different phases, making their relative phase observable through later interference. Simplifying each branch independently by discarding its phase can change the joint sum.
Worked example on a complex state
Take ψ = [√3/2, i/2]. Its squared norm is 3/4 + 1/4 = 1. X gives [i/2, √3/2], with computational-basis probabilities one quarter and three quarters. Z gives [√3/2, −i/2], leaving those basis probabilities at three quarters and one quarter.
For Y, the first amplitude is −i(i/2) = 1/2 and the second is i√3/2. Thus Yψ = [1/2, i√3/2]. Its probabilities are one quarter and three quarters. X and Y exchange the same probability weights here, but their output relative phases differ, so a probability list alone does not identify the gate.
![The normalized input [square root three over two, i over two] separately feeds gates X, Y, Z. Outputs are [i/2,√3/2], [1/2,i√3/2], [√3/2,−i/2]. Probability bars in zero,one order are one quarter,three quarters for X and Y and three quarters,one quarter for Z.](https://smartyfy.mrindigi.com/wp-content/uploads/2026/10/quantum-022-pauli-amplitudes-and-probabilities.png)
Hermitian, unitary, and self-inverse
Each Pauli matrix equals its adjoint. For Y, transposition swaps the two off-diagonal entries and conjugation changes their signs, returning the original matrix. Each also squares to I. For example, applying Y twice gives [−i(iα), i(−iβ)] = [α, β].
Hermiticity makes the matrices suitable as observables in the finite-dimensional framework. Unitarity makes them suitable as ideal gates. These are two different uses of the same mathematical object. Applying X is a state transformation; measuring the X observable is an experiment with outcomes and a state-update rule.
Since each Pauli is Hermitian and unitary, its eigenvalues are +1 and −1. The positive and negative Z eigenstates are |0⟩ and |1⟩. The X eigenstates are |+⟩ and |−⟩. The Y eigenstates are |r⟩ = [1, i]/√2 and |l⟩ = [1, −i]/√2, with eigenvalues +1 and −1 respectively.
Worked example identifying a Y eigenstate
Apply Y to r: its first coordinate is −i(i/√2) = 1/√2 and the second is i/√2. The output equals r, proving eigenvalue +1. Applying Y to l gives [−1, i]/√2 = −l, proving eigenvalue −1.
A measurement of Y on r therefore returns the value +1 with certainty. A computational-basis measurement on r instead gives zero or one with equal probabilities. An observable’s numerical values and the classical bit labels used to record them are related by a chosen convention, not automatically identical.
Multiplication and order
The cyclic products are XY = iZ, YZ = iX, and ZX = iY. Reversing each pair changes the sign: YX = −iZ, ZY = −iX, and XZ = −iY. Distinct Pauli matrices anticommute, meaning their reversed products differ by a minus sign.
For example, XY has diagonal entries i and −i, so it equals iZ. This is ordinary matrix multiplication: Y acts first in XYψ. Do not read the order as a chronological left-to-right gate list without translating it.
There is a subtle physical point. XY and YX produce output state vectors differing by an overall minus sign for every fixed input, so those standalone transformations have the same pure-state predictions. Their matrices still differ. When a transformation is applied only in one coherent control branch, such a phase can become relative to another branch. We will examine this distinction carefully later.
Expectations describe three kinds of information
For normalized ψ = [α, β], the expectations are ⟨X⟩ = 2 Re(α*β), ⟨Y⟩ = 2 Im(α*β), and ⟨Z⟩ = |α|² − |β|². Here Re and Im mean real and imaginary part. These formulas follow directly from ψ†Pψ for each Pauli P.
For the worked state [√3/2, i/2], α*β = i√3/4, giving expectations zero, √3/2, and one half. The Z expectation reflects the population difference; X and Y depend on the phase relationship. Later the Bloch sphere will organize these three real numbers geometrically.
Four exercises with worked solutions
-
Apply X, Y, and Z to [3/5, 4/5].
Solution. X gives [4/5, 3/5]. Y gives [−4i/5, 3i/5]. Z gives [3/5, −4/5]. Each output’s squared norm is 16/25 + 9/25 = 1, though its phases and coordinate order can differ.
-
Verify Y² = I using Y|0⟩ and Y|1⟩.
Solution. Y(i|1⟩) = i(−i)|0⟩ = |0⟩. Likewise Y(−i|0⟩) = (−i)i|1⟩ = |1⟩. Agreement with I on both basis vectors proves equality on all inputs.
-
Find the X, Y, and Z expectations for |+⟩.
Solution. α = β = 1/√2, so α*β = 1/2. The expectations are one, zero, and zero. This agrees with |+⟩ being an X eigenstate of eigenvalue +1.
-
Compare XZ and ZX on |+⟩. Are the final pure physical states distinguishable?
Solution. XZ|+⟩ = X|−⟩ = −|−⟩, while ZX|+⟩ = Z|+⟩ = |−⟩. They differ only by global phase and are not distinguishable as these standalone outputs. The operator matrices nevertheless anticommute.
Five explained multiple-choice questions
-
Y[α, β] is: A. [β, α]. B. [α, −β]. C. [−iβ, iα]. D. [iα, iβ].
Answer: C. Multiply the stated Y rows by the input column.
-
Each Pauli matrix is: A. Only Hermitian. B. Only unitary. C. Neither. D. Both Hermitian and unitary.
Answer: D. It equals its adjoint and squares to I.
-
The positive Y eigenstate is: A. |0⟩. B. [1, i]/√2. C. |−⟩. D. The zero vector.
Answer: B. Applying Y returns that normalized vector unchanged.
-
XY equals: A. iZ. B. Z. C. −X. D. I.
Answer: A. Its diagonal entries are i and −i.
-
Applying a Pauli and measuring that Pauli are: A. The same procedure. B. Both always random gates. C. Different operations. D. Both reset.
Answer: C. A gate transforms a state; an observable measurement produces a value with a corresponding update.
Pitfalls and summary
Retain branch-dependent phases, keep matrix order, and distinguish gate action from measurement. The Pauli matrices supply a small, testable set of transformations and observables that will appear in circuits, noise models, and error correction.
Primary sources and further study
These sources support the definitions and context. The numerical examples, exercises, and explanations here were prepared for this lesson. Research papers are optional advanced reading.