Skip to content

Trace Rule for Expectation Values

For a density operator ρ\rho and a bounded observable AA, the expectation value is

⟨A⟩ρ=Tr⁡(ρA).\langle A\rangle_\rho = \operatorname{Tr}(\rho A).

For a projective outcome aa with projector PaP_a,

p(a)=Tr⁡(ρPa).p(a) = \operatorname{Tr}(\rho P_a).

For a general measurement effect EiE_i,

p(i)=Tr⁡(ρEi).p(i) = \operatorname{Tr}(\rho E_i).

These are not three unrelated rules. The probability formulas are trace rules applied to effects, and the expectation formula is the probability-weighted average of the outcomes of an observable. Together they extend the pure-state Born rule to pure states, randomized ensembles, open subsystems, and general measurements.

The derivations below use finite matrices. The final section explains what changes for unbounded observables such as position and momentum.

Helpful background. Density operators explains positive, trace-one states; expectation values explains the average of measurement outcomes.

In a finite-dimensional Hilbert space, the trace of an operator XX is

Tr⁡X=∑n⟨n∣X∣n⟩,\operatorname{Tr}X = \sum_n \langle n\rvert X\lvert n\rangle,

where {∣n⟩}\{\lvert n\rangle\} is any orthonormal basis.

Let another orthonormal basis be related by

∣m′⟩=∑nUnm∣n⟩\lvert m'\rangle = \sum_n U_{nm}\lvert n\rangle

for a unitary matrix UU. Then

∑m⟨m′∣X∣m′⟩=∑m,n,kUnm∗Ukm⟨n∣X∣k⟩=∑n,kδnk⟨n∣X∣k⟩=∑n⟨n∣X∣n⟩.\begin{aligned} \sum_m \langle m'\rvert X\lvert m'\rangle &= \sum_{m,n,k} U_{nm}^*U_{km} \langle n\rvert X\lvert k\rangle \\ &= \sum_{n,k} \delta_{nk} \langle n\rvert X\lvert k\rangle \\ &= \sum_n \langle n\rvert X\lvert n\rangle. \end{aligned}

The trace may be calculated in any convenient basis without changing the answer.

For finite matrices,

Tr⁡(XY)=Tr⁡(YX),\operatorname{Tr}(XY) = \operatorname{Tr}(YX),

and

Tr⁡(XYZ)=Tr⁡(ZXY)=Tr⁡(YZX).\operatorname{Tr}(XYZ) = \operatorname{Tr}(ZXY) = \operatorname{Tr}(YZX).

Cyclicity permits cyclic rotations, not arbitrary reordering. In general,

Tr⁡(XYZ)≠Tr⁡(XZY).\operatorname{Tr}(XYZ) \ne \operatorname{Tr}(XZY).

This distinction matters when observables and states do not commute.

For any vectors ∣u⟩,∣v⟩\lvert u\rangle,\lvert v\rangle and operator AA,

Tr⁡(∣u⟩⟨v∣A)=⟨v∣A∣u⟩.\operatorname{Tr} \left( \lvert u\rangle\langle v\rvert A \right) = \langle v\rvert A\lvert u\rangle.

To verify it, insert an orthonormal basis:

Tr⁡(∣u⟩⟨v∣A)=∑n⟨n∣u⟩⟨v∣A∣n⟩=⟨v∣A(∑n∣n⟩⟨n∣)∣u⟩=⟨v∣A∣u⟩.\begin{aligned} \operatorname{Tr} \left( \lvert u\rangle\langle v\rvert A \right) &= \sum_n \langle n\vert u\rangle \langle v\rvert A\lvert n\rangle \\ &= \langle v\rvert A \left( \sum_n \lvert n\rangle\langle n\rvert \right) \lvert u\rangle \\ &= \langle v\rvert A\lvert u\rangle. \end{aligned}

This identity is the cleanest bridge between trace notation and bra–ket notation.

A normalized pure state has

ρψ=∣ψ⟩⟨ψ∣.\rho_\psi = \lvert\psi\rangle\langle\psi\rvert.

The rank-one identity gives

Tr⁡(ρψA)=Tr⁡(∣ψ⟩⟨ψ∣A)=⟨ψ∣A∣ψ⟩.\begin{aligned} \operatorname{Tr}(\rho_\psi A) &= \operatorname{Tr} \left( \lvert\psi\rangle\langle\psi\rvert A \right) \\ &= \langle\psi\rvert A\lvert\psi\rangle. \end{aligned}

The density-operator rule therefore reproduces the familiar pure-state expectation value exactly.

For a rank-one outcome

Pϕ=∣ϕ⟩⟨ϕ∣,P_\phi = \lvert\phi\rangle\langle\phi\rvert,

the same identity gives

Tr⁡(ρψPϕ)=∣⟨ϕ∣ψ⟩∣2.\begin{aligned} \operatorname{Tr}(\rho_\psi P_\phi) &= \lvert \langle\phi\vert\psi\rangle \rvert^2. \end{aligned}

This is the ordinary Born probability.

In a chosen orthonormal basis,

Tr⁡(ρA)=∑i(ρA)ii=∑i,jρijAji.\begin{aligned} \operatorname{Tr}(\rho A) &= \sum_i (\rho A)_{ii} \\ &= \sum_{i,j} \rho_{ij}A_{ji}. \end{aligned}

This formula is useful for direct matrix calculations. It also shows that off-diagonal entries of ρ\rho contribute whenever AA has matching off-diagonal matrix elements.

If the basis diagonalizes AA,

A=∑aaPa,A = \sum_a aP_a,

then

⟨A⟩ρ=∑aaTr⁡(ρPa).\langle A\rangle_\rho = \sum_a a\operatorname{Tr}(\rho P_a).

For a nondegenerate eigenbasis, this becomes

⟨A⟩ρ=∑aa ρaa.\langle A\rangle_\rho = \sum_a a\,\rho_{aa}.

In a nondegenerate measurement eigenbasis, each diagonal entry is one outcome probability. For a degenerate eigenvalue, add the entries belonging to its entire eigenspace.

If

ρ=∑ipi∣ψi⟩⟨ψi∣,\rho = \sum_i p_i \lvert\psi_i\rangle\langle\psi_i\rvert,

then linearity gives

Tr⁡(ρA)=∑ipiTr⁡(∣ψi⟩⟨ψi∣A)=∑ipi⟨ψi∣A∣ψi⟩.\begin{aligned} \operatorname{Tr}(\rho A) &= \sum_i p_i \operatorname{Tr} \left( \lvert\psi_i\rangle\langle\psi_i\rvert A \right) \\ &= \sum_i p_i \langle\psi_i\rvert A\lvert\psi_i\rangle. \end{aligned}

The trace rule combines quantum expectation within each preparation branch with the classical average over branches. Different ensembles with the same ρ\rho necessarily give the same expectation for every AA.

Let the spectral decomposition of a Hermitian observable be

A=∑aaPa.A=\sum_a aP_a.

The outcome probabilities are

p(a)=Tr⁡(ρPa),p(a) = \operatorname{Tr}(\rho P_a),

and therefore

∑aa p(a)=∑aaTr⁡(ρPa)=Tr⁡(ρA).\begin{aligned} \sum_a a\,p(a) &= \sum_a a\operatorname{Tr}(\rho P_a) \\ &= \operatorname{Tr}(\rho A). \end{aligned}

The expectation is an ensemble average over possible outcomes. It need not itself be an eigenvalue or a possible result of one trial.

For any function ff defined on the spectrum,

⟨f(A)⟩ρ=Tr⁡[ρf(A)]=∑af(a)p(a).\langle f(A)\rangle_\rho = \operatorname{Tr} \left[ \rho f(A) \right] = \sum_a f(a)p(a).

In particular,

⟨An⟩ρ=Tr⁡(ρAn),\langle A^n\rangle_\rho = \operatorname{Tr}(\rho A^n),

and the variance is

Var⁡ρ(A)=⟨(A−⟨A⟩ρI)2⟩ρ=Tr⁡(ρA2)−[Tr⁡(ρA)]2.\begin{aligned} \operatorname{Var}_\rho(A) &= \left\langle \left( A-\langle A\rangle_\rho I \right)^2 \right\rangle_\rho \\ &= \operatorname{Tr}(\rho A^2) - \left[ \operatorname{Tr}(\rho A) \right]^2. \end{aligned}

If A=A†A=A^\dagger, then Tr⁡(ρA)\operatorname{Tr}(\rho A) is real:

Tr⁡(ρA)∗=Tr⁡[(ρA)†]=Tr⁡(Aρ)=Tr⁡(ρA).\begin{aligned} \operatorname{Tr}(\rho A)^* &= \operatorname{Tr} \left[ (\rho A)^\dagger \right] \\ &= \operatorname{Tr}(A\rho) \\ &= \operatorname{Tr}(\rho A). \end{aligned}

If the spectrum lies between amin⁡a_{\min} and amax⁡a_{\max}, then

amin⁡≤⟨A⟩ρ≤amax⁡.a_{\min} \le \langle A\rangle_\rho \le a_{\max}.

This follows because the expectation is a convex average of the eigenvalues. Likewise,

Var⁡ρ(A)≥0\operatorname{Var}_\rho(A)\ge0

because it is the expectation of a positive operator.

These inequalities are powerful error checks. An answer outside the spectral range or a negative variance signals a calculation or normalization mistake.

For projectors satisfying

PaPb=δabPa,∑aPa=I,P_aP_b=\delta_{ab}P_a, \qquad \sum_a P_a=I,

the trace rule gives

p(a)=Tr⁡(ρPa).p(a)=\operatorname{Tr}(\rho P_a).

The probabilities are nonnegative because both ρ\rho and PaP_a are positive. They are normalized:

∑ap(a)=Tr⁡(ρ∑aPa)=Tr⁡ρ=1.\begin{aligned} \sum_a p(a) &= \operatorname{Tr} \left( \rho\sum_aP_a \right) \\ &= \operatorname{Tr}\rho =1. \end{aligned}

For a degenerate outcome, PaP_a projects onto the full eigenspace. The probability is the sum of the density-matrix populations in any orthonormal basis of that eigenspace.

A general POVM has effects

Ei≥0,∑iEi=I.E_i\ge0, \qquad \sum_iE_i=I.

Its outcome probabilities are

p(i)=Tr⁡(ρEi).p(i)=\operatorname{Tr}(\rho E_i).

To see nonnegativity directly, write

Tr⁡(ρEi)=Tr⁡(ρ1/2Eiρ1/2)≥0,\begin{aligned} \operatorname{Tr}(\rho E_i) &= \operatorname{Tr} \left( \rho^{1/2}E_i\rho^{1/2} \right) \\ &\ge0, \end{aligned}

because ρ1/2Eiρ1/2\rho^{1/2}E_i\rho^{1/2} is positive. Completeness again gives

∑ip(i)=1.\sum_i p(i)=1.

The effects determine outcome probabilities. They do not alone determine the conditional output states of the measured system; that requires an instrument. See POVMs: First Encounter and Generalized Measurements Overview.

For a joint state ρAB\rho_{AB}, an observable local to AA is

MA⊗IB.M_A\otimes I_B.

If

ρA=Tr⁡BρAB,\rho_A = \operatorname{Tr}_B\rho_{AB},

then

Tr⁡AB[ρAB(MA⊗IB)]=Tr⁡A(ρAMA).\operatorname{Tr}_{AB} \left[ \rho_{AB}(M_A\otimes I_B) \right] = \operatorname{Tr}_A(\rho_A M_A).

This equality is the defining operational property of the partial trace: the reduced state reproduces every trace-rule prediction local to the subsystem. Correlation observables such as A⊗BA\otimes B still require the joint state.

See Reduced Density Matrices for the construction and Subsystems and Local Observables for the operator embedding.

Write a general qubit density matrix as

ρ=(pcc∗1−p).\rho = \begin{pmatrix} p&c\\ c^*&1-p \end{pmatrix}.

Using the Pauli matrices,

⟨X⟩ρ=2Re⁡c,⟨Y⟩ρ=−2Im⁡c,⟨Z⟩ρ=2p−1.\begin{aligned} \langle X\rangle_\rho &= 2\operatorname{Re}c, \\ \langle Y\rangle_\rho &= -2\operatorname{Im}c, \\ \langle Z\rangle_\rho &= 2p-1. \end{aligned}

The ZZ expectation depends on the populations, while XX and YY expose the real and imaginary parts of the coherence.

Equivalently, if

ρ=12(I+r⋅σ)\rho = \frac12 \left( I+\mathbf r\cdot\boldsymbol\sigma \right)

and

A=a0I+a⋅σ,A = a_0I+\mathbf a\cdot\boldsymbol\sigma,

then

⟨A⟩ρ=a0+r⋅a.\langle A\rangle_\rho = a_0+\mathbf r\cdot\mathbf a.

This compact formula follows from Tr⁡(σiσj)=2δij\operatorname{Tr}(\sigma_i\sigma_j)=2\delta_{ij}.

For example, take

ρ=(0.60.2+0.1i0.2−0.1i0.4),A=2I+3Z.\rho=\begin{pmatrix}0.6&0.2+0.1i\\0.2-0.1i&0.4\end{pmatrix}, \qquad A=2I+3Z.

The Bloch vector is (0.4,−0.2,0.2)(0.4,-0.2,0.2), whose squared length is 0.24<10.24<1, so this is a valid mixed state. The two possible readings of AA are 55 and −1-1, with probabilities 0.60.6 and 0.40.4. Thus

⟨A⟩=0.6(5)+0.4(−1)=2.6,Var⁡(A)=9(1−0.22)=8.64.\langle A\rangle=0.6(5)+0.4(-1)=2.6, \qquad \operatorname{Var}(A)=9(1-0.2^2)=8.64.

The mean lies between the possible readings, but is not itself a reading.

For 0≤η≤10\le\eta\le1, define two effects

E±=12(I±ηZ).E_\pm = \frac12 \left( I\pm\eta Z \right).

They are positive and satisfy E++E−=IE_++E_-=I. If the state’s Bloch component is

rz=Tr⁡(ρZ),r_z=\operatorname{Tr}(\rho Z),

then

p(±)=12(1±ηrz).p(\pm) = \frac12 \left( 1\pm\eta r_z \right).

At η=1\eta=1, this is the projective ZZ measurement. At η=0\eta=0, both outcomes have probability 1/21/2 regardless of the state. Intermediate values model a noisy or unsharp binary measurement at the level of effects. If the recorded numbers are +1+1 and −1-1, their mean is ηrz\eta r_z and their second moment is 11. The first-moment operator is ηZ\eta Z, but its square is η2I\eta^2 I, not the measurement’s second-moment operator II. For a POVM use ∑ixinEi\sum_i x_i^n E_i for the nnth moment of the recorded values xix_i; powers of one observable describe its spectral measurement.

In an infinite-dimensional Hilbert space, a density operator is trace class. If AA is bounded, then ρA\rho A is trace class and Tr⁡(ρA)\operatorname{Tr}(\rho A) is well-defined.

For an unbounded self-adjoint AA, start with its spectral projections PA(Δ)P_A(\Delta). They define the probability measure

μρ(Δ)=Tr⁡[ρPA(Δ)].\mu_\rho(\Delta)=\operatorname{Tr}[\rho P_A(\Delta)].

A finite expectation exists when ∫∣a∣ dμρ(a)<∞\int |a|\,d\mu_\rho(a)<\infty, and then ⟨A⟩ρ=∫a dμρ(a)\langle A\rangle_\rho=\int a\,d\mu_\rho(a). The notation Tr⁡(ρA)\operatorname{Tr}(\rho A) is often used for this spectral average, but interpreting it as the trace of an ordinary operator product requires additional conditions.

For a pure state, finite absolute first moment means ψ∈D(∣A∣1/2)\psi\in D(|A|^{1/2}); it need not imply ψ∈D(A)\psi\in D(A). Finite second moment means ψ∈D(A)\psi\in D(A) and gives ⟨A2⟩=∥Aψ∥2\langle A^2\rangle=\|A\psi\|^2, without requiring ψ∈D(A2)\psi\in D(A^2). Thus “the mean exists” and “the vector AψA\psi exists” are different assertions. See Expectation values for the spectral formulation.

Cyclicity is safe for a bounded operator times a trace-class operator, and for two Hilbert–Schmidt factors. Unbounded factors require separate domain and convergence checks; finite-dimensional rearrangements alone do not justify them.

The representation-independent formulation is developed in States as Positive Linear Functionals.

Cyclic does not mean commutative. A trace permits cyclic rotation of finite matrix factors, not an arbitrary exchange of two factors.

A mean is not a single outcome. Check the eigenvalues to identify possible readings, and use the trace to average their probabilities.

Coherences can contribute. Diagonal populations suffice when the observable is diagonal in the same basis. Otherwise retain the off-diagonal terms in ∑ijρijAji\sum_{ij}\rho_{ij}A_{ji}.

Local and joint predictions differ. A reduced state determines a local observable; a correlation between two subsystems generally needs their joint state.

  1. Prove the rank-one trace identity
Tr⁡(∣u⟩⟨v∣A)=⟨v∣A∣u⟩.\operatorname{Tr} \left( \lvert u\rangle\langle v\rvert A \right) = \langle v\rvert A\lvert u\rangle.
Solution

Insert an orthonormal basis:

Tr⁡(∣u⟩⟨v∣A)=∑n⟨n∣u⟩⟨v∣A∣n⟩=⟨v∣A(∑n∣n⟩⟨n∣)∣u⟩=⟨v∣A∣u⟩.\begin{aligned} \operatorname{Tr} \left( \lvert u\rangle\langle v\rvert A \right) &= \sum_n \langle n\vert u\rangle \langle v\rvert A\lvert n\rangle \\ &= \langle v\rvert A \left( \sum_n \lvert n\rangle\langle n\rvert \right) \lvert u\rangle \\ &= \langle v\rvert A\lvert u\rangle. \end{aligned}
  1. Starting from matrices, show that
Tr⁡(ρA)=∑i,jρijAji.\operatorname{Tr}(\rho A) = \sum_{i,j}\rho_{ij}A_{ji}.
Solution

By matrix multiplication,

(ρA)ii=∑jρijAji.(\rho A)_{ii} = \sum_j\rho_{ij}A_{ji}.

Summing the diagonal entries gives

Tr⁡(ρA)=∑i(ρA)ii=∑i,jρijAji.\operatorname{Tr}(\rho A) = \sum_i(\rho A)_{ii} = \sum_{i,j}\rho_{ij}A_{ji}.
  1. Let AA have smallest and largest eigenvalues amin⁡,amax⁡a_{\min},a_{\max}. Prove that every density operator obeys
amin⁡≤Tr⁡(ρA)≤amax⁡.a_{\min} \le \operatorname{Tr}(\rho A) \le a_{\max}.
Solution

With A=∑aaPaA=\sum_a aP_a, define

p(a)=Tr⁡(ρPa).p(a)=\operatorname{Tr}(\rho P_a).

These probabilities are nonnegative and sum to one. Therefore

Tr⁡(ρA)=∑aa p(a)\operatorname{Tr}(\rho A) = \sum_a a\,p(a)

is a convex average of the eigenvalues and lies between their minimum and maximum.

  1. Show that
Var⁡ρ(A)=Tr⁡(ρA2)−Tr⁡(ρA)2\operatorname{Var}_\rho(A) = \operatorname{Tr}(\rho A^2) - \operatorname{Tr}(\rho A)^2

is nonnegative.

Solution

Let

δA=A−⟨A⟩ρI.\delta A = A-\langle A\rangle_\rho I.

Because (δA)2(\delta A)^2 is positive,

Tr⁡[ρ(δA)2]≥0.\operatorname{Tr} \left[ \rho(\delta A)^2 \right] \ge0.

Expanding and using Tr⁡ρ=1\operatorname{Tr}\rho=1 gives

Tr⁡[ρ(δA)2]=Tr⁡(ρA2)−Tr⁡(ρA)2.\operatorname{Tr} \left[ \rho(\delta A)^2 \right] = \operatorname{Tr}(\rho A^2) - \operatorname{Tr}(\rho A)^2.

Thus the variance is nonnegative.

  1. Prove that a POVM {Ei}\{E_i\} gives normalized, nonnegative probabilities.
Solution

For each effect,

p(i)=Tr⁡(ρ1/2Eiρ1/2)≥0p(i) = \operatorname{Tr} \left( \rho^{1/2}E_i\rho^{1/2} \right) \ge0

because the operator inside the trace is positive. Completeness gives

∑ip(i)=Tr⁡(ρ∑iEi)=Tr⁡ρ=1.\begin{aligned} \sum_i p(i) &= \operatorname{Tr} \left( \rho\sum_iE_i \right) \\ &= \operatorname{Tr}\rho =1. \end{aligned}
  1. For
ρ=(pcc∗1−p),\rho = \begin{pmatrix} p&c\\ c^*&1-p \end{pmatrix},

derive the three Pauli expectations.

Solution

Direct multiplication gives

Tr⁡(ρX)=c+c∗=2Re⁡c,Tr⁡(ρY)=i(c−c∗)=−2Im⁡c,Tr⁡(ρZ)=p−(1−p)=2p−1.\begin{aligned} \operatorname{Tr}(\rho X) &= c+c^* = 2\operatorname{Re}c, \\ \operatorname{Tr}(\rho Y) &= i(c-c^*) = -2\operatorname{Im}c, \\ \operatorname{Tr}(\rho Z) &= p-(1-p) = 2p-1. \end{aligned}

The signs agree with the convention

Y=(0−ii0).Y = \begin{pmatrix} 0&-i\\ i&0 \end{pmatrix}.
  1. An unsharp detector has effects E±=(I±ηZ)/2E_\pm=(I\pm\eta Z)/2 and records the numbers ±1\pm1. For η=3/5\eta=3/5 and ⟨Z⟩=1/5\langle Z\rangle=1/5, calculate its outcome probabilities, mean, and variance. Compare the variance with that of a spectral measurement of the operator M=ηZM=\eta Z on the same state. Why do the means agree but the variances differ?
Solution

The probabilities are p(+)=14/25p(+)=14/25 and p(−)=11/25p(-)=11/25. Thus the recorded mean is 3/253/25, the second moment is one, and

Var⁡(x)=1−(3/25)2=616625.\operatorname{Var}(x)=1-(3/25)^2=\frac{616}{625}.

For a spectral measurement of MM, the possible values are ±3/5\pm3/5, with probabilities 3/53/5 and 2/52/5. Its mean is again 3/253/25, but

Var⁡(M)=η2−η2⟨Z⟩2=216625.\operatorname{Var}(M)=\eta^2-\eta^2\langle Z\rangle^2 =\frac{216}{625}.

The first-moment operator ∑±(±1)E±=M\sum_\pm(\pm1)E_\pm=M determines the mean, but the detector’s second-moment operator is ∑±(±1)2E±=I\sum_\pm(\pm1)^2E_\pm=I, rather than M2M^2. The extra readout variance is 1−η2=16/251-\eta^2=16/25. At η=1\eta=1 the two measurements coincide; at η=0\eta=0 the detector still outputs a fair random sign while M=0M=0 always reads zero.

  1. Verify the reduced-state identity in a product basis:
Tr⁡AB[ρAB(MA⊗IB)]=Tr⁡A(ρAMA).\operatorname{Tr}_{AB} \left[ \rho_{AB}(M_A\otimes I_B) \right] = \operatorname{Tr}_A(\rho_A M_A).
Solution

Write the joint matrix elements as

ρiμ,jν=⟨i,μ∣ρAB∣j,ν⟩.\rho_{i\mu,j\nu} = \langle i,\mu\rvert \rho_{AB} \lvert j,\nu\rangle.

Then

Tr⁡AB[ρAB(MA⊗IB)]=∑i,j,μρiμ,jμ(MA)ji.\operatorname{Tr}_{AB} \left[ \rho_{AB}(M_A\otimes I_B) \right] = \sum_{i,j,\mu} \rho_{i\mu,j\mu} (M_A)_{ji}.

The reduced-state entries are

(ρA)ij=∑μρiμ,jμ.(\rho_A)_{ij} = \sum_\mu \rho_{i\mu,j\mu}.

Substitution gives

∑i,j(ρA)ij(MA)ji=Tr⁡A(ρAMA).\sum_{i,j} (\rho_A)_{ij}(M_A)_{ji} = \operatorname{Tr}_A(\rho_A M_A).
  • L. E. Ballentine, Quantum Mechanics: A Modern Development, 2nd ed., World Scientific (2014), Ch. 3.
  • A. S. Holevo, Probabilistic and Statistical Aspects of Quantum Theory, 2nd ed., Edizioni della Normale (2011), Ch. 2.
  • M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, 10th anniversary ed., Cambridge University Press (2010), Secs. 2.2 and 2.4.
  • J. Watrous, The Theory of Quantum Information, Cambridge University Press (2018), Ch. 2.