smartyfy.mrindigi.com

Quantum Computing Master Course — 014. Hermitian Matrices

Lesson 014: Hermitian Matrices

Smartyfy Quantum Computing Master Course

Starting point and objectives

The adjoint lets us describe two different matrix properties. Unitarity says an adjoint undoes a transformation. Hermiticity says a matrix equals its adjoint. By the end, you should recognize Hermitian matrices from their entries, distinguish Hermitian from unitary, calculate a pure-state expectation value, and explain why that value is real.

We use finite square matrices, with nested lists giving their rows. Vectors are columns. The dagger symbol means conjugate transpose. Our discussion of observables uses the usual finite-dimensional quantum-mechanical framework; more general measurement procedures will come later.

Recognizing Hermitian structure

A matrix A is Hermitian, or self-adjoint, when A† = A. Entry by entry, A_ij must equal conjugate(A_ji). This pairs every entry across the main diagonal with its complex conjugate. The diagonal entries pair with themselves, so they must be real: a number equals its own complex conjugate exactly when its imaginary part is zero.

Every two-by-two Hermitian matrix therefore has the form [[a, z], [conjugate(z), d]], where a and d are real and z may be complex. The diagonal entries need not be equal. Off-diagonal entries need not be real, and they need not be positive. Hermitian describes a conjugate symmetry, not a restriction to nonnegative numbers.

For real matrices, the condition reduces to A^T = A, the definition of a symmetric matrix. Complex symmetry by itself is insufficient. The matrix [[0, i], [i, 0]] equals its transpose, but its adjoint is [[0, −i], [−i, 0]], so it is not Hermitian. MIT’s complex-matrices material explains this extension of real symmetry.

Worked example: recognition and classification

Consider A = [[2, i], [−i, 3]]. Transpose it to obtain [[2, −i], [i, 3]], then conjugate to recover [[2, i], [−i, 3]]. Thus A† = A. Another quick check is that 2 and 3 are real and the lower-left entry −i is the conjugate of the upper-right entry i.

This A is not unitary. Its first column [2, −i] has squared norm 4 + 1 = 5, whereas a unitary’s columns must have squared norm one. Hermiticity does not imply norm preservation. Likewise, S = [[1, 0], [0, i]] is unitary but not Hermitian, because its second diagonal entry changes under conjugation.

Some matrices have both properties. Z = [[1, 0], [0, −1]] equals its adjoint, and Z†Z = I. If a matrix is both Hermitian and unitary, substituting A† = A into A†A = I gives A^2 = I. It is then its own inverse. The overlap does not make the two definitions interchangeable.

Expectation values connect matrices with averages

For a normalized pure state ψ and a Hermitian observable A, the expectation value is ψ†Aψ. This is a scalar: Aψ is a column, and multiplying by the bra ψ† produces one number. The observable specifies what physical quantity is being described; the state specifies how its outcomes are distributed.

IBM’s guide to specifying observables identifies observables with Hermitian operators. Multiplying Aψ inside an expectation calculation is a mathematical step. It does not assert that measuring A deterministically replaces the state by Aψ. Measurements involve outcomes and state updates, which require their own rules.

An expectation is a probability-weighted average over possible results from repeated, identically prepared experiments. It is not necessarily a possible result in a single trial. For Z, the possible values are +1 and −1. A balanced state can have expectation zero even though no individual Z measurement returns zero.

If a vector w is nonzero but not normalized, the corresponding normalized-state expectation is (w†Aw)/(w†w). The denominator removes the arbitrary scale. Forgetting it can produce a number that depends on whether the same direction was written as w or 10w. When using the shorter expression ψ†Aψ, always verify ψ†ψ = 1.

Worked example: a real answer from complex arithmetic

Use A = [[2, i], [−i, 3]] and ψ = [1, i]/sqrt(2). First check normalization: ψ†ψ = (1 + 1)/2 = 1. Next multiply the matrix by the column:

Aψ = [2 + i·i, −i + 3i]/sqrt(2) = [1, 2i]/sqrt(2).

Now use the conjugated row ψ† = [1, −i]/sqrt(2). The expectation is ψ†Aψ = (1 + (−i)(2i))/2 = (1 + 2)/2 = 3/2. Complex intermediate entries have combined into a real scalar. Notice also that Aψ has squared norm 5/2, another sign that A is not a unitary gate.

For a diagonal example, take D = [[1, 0], [0, 4]] and φ = [1/2, sqrt(3)/2]. Then φ†Dφ = 1·(1/4) + 4·(3/4) = 13/4. Here the diagonal basis already gives the possible values 1 and 4, with probabilities 1/4 and 3/4. Their average 3.25 lies between them and need not equal either outcome.

Hermitian matrix A has real diagonal2,3 and conjugate off-diagonal entries i,−i. It equals its adjoint, but its first column has squared norm5 so it is not unitary. For normalized psi=[1,i]/square root2, Apsi=[1,2i]/square root2 and expectation psi†Apsi=3/2.
Hermitian and unitary are different conditions. This Hermitian observable gives a real expectation value even though applying its matrix in an intermediate calculation does not preserve state norm. Open full-size diagram

Why the answer must be real

Let q = ψ†Aψ. A scalar’s adjoint is its complex conjugate. Taking the adjoint of the entire product reverses its order, giving conjugate(q) = ψ†A†ψ. If A is Hermitian, this equals ψ†Aψ = q. A scalar equal to its conjugate is real, which proves the claim without choosing particular matrix entries.

This proof works for any column ψ, although the interpretation as a normalized-state expectation requires normalization. It does not prove q is positive. For Z and ψ = |1⟩, q = −1. Positivity is an additional property that only some Hermitian matrices possess.

Real linear combinations of Hermitian matrices remain Hermitian: if A and B are Hermitian and r and s are real, then (rA + sB)† = rA + sB. Products require care. Since (AB)† = BA, a product of two Hermitian matrices is Hermitian exactly when they commute. This is another place where preserving matrix order matters.

Practice exercises with worked solutions

  1. Exercise 1. Complete M = [[a, 2 + i], [b, 4]] so it is Hermitian.

    Solution. The diagonal condition requires a to be any real number. The off-diagonal condition requires b = conjugate(2 + i) = 2 − i. The existing diagonal entry 4 already satisfies the real requirement.

  2. Exercise 2. Find the Z expectation for ψ = [sqrt(3)/2, i/2].

    Solution. The squared magnitudes are 3/4 and 1/4, totaling one. Zψ = [sqrt(3)/2, −i/2]. Multiplying by ψ† gives 3/4 + (−i/2)(−i/2) = 3/4 − 1/4 = 1/2. It is the average of outcomes +1 and −1.

  3. Exercise 3. For w = [1, 2] and D = [[1, 0], [0, 4]], calculate the normalized expectation.

    Solution. Dw = [1, 8], so w†Dw = 1 + 16 = 17. Also w†w = 1 + 4 = 5. Dividing gives 17/5. Using 17 alone would incorrectly treat w as normalized.

  4. Exercise 4. X = [[0, 1], [1, 0]] and Z are Hermitian. Is XZ Hermitian?

    Solution. XZ = [[0, −1], [1, 0]], while its adjoint is [[0, 1], [−1, 0]] = ZX. These differ, so XZ is not Hermitian. Hermitian factors do not guarantee a Hermitian product.

Knowledge check

  1. 1. Hermitian means: A. A†A = I. B. A† = A. C. All entries are real. D. Every entry is positive.

    Answer: B. Equality with the adjoint is the definition.

  2. 2. A Hermitian diagonal entry must be: A. One. B. Positive. C. Real. D. Zero.

    Answer: C. It must equal its own conjugate.

  3. 3. A normalized-state expectation is: A. ψ†Aψ. B. Aψ alone. C. ψ^T Aψ in every case. D. The largest entry of A.

    Answer: A. The bra-matrix-ket product produces the scalar expectation.

  4. 4. An expectation of zero guarantees: A. Every result is zero. B. A is zero. C. The state is zero. D. None of these.

    Answer: D. Positive and negative outcomes can average to zero.

  5. 5. If A is both Hermitian and unitary, then: A. A^2 = I. B. A = 0. C. A has only positive entries. D. A must equal I.

    Answer: A. Substitute A† = A into the unitary condition.

Pitfalls and summary

Check conjugate pairs rather than visual symmetry. Keep the observable, its expectation, and an actual measurement result distinct. A Hermitian matrix guarantees real expectation values, not positive ones, and usually does not preserve state norms when multiplied directly. The next lesson introduces eigenvectors, which explain the special directions associated with definite observable values.

Primary sources and further study

Original examples and exercises accompany these verified primary references. This lesson requires no runnable code or external account.