Site Tools


qutip-expectation-values

Expectation Values

Expectation values are the measurable quantities from quantum simulations. For an observable $O$ and state $\rho$, the expectation is $\langle O \rangle = \text{Tr}(O\rho)$. All quantum measurements (Stern-Gerlach, photon counting, etc.) yield statistics described by expectation values.

In QuTiP simulations, pass a list of operators to mesolve or mcsolve to compute expectation values at each time point.

from qutip import *
import numpy as np
 
H = 0.5 * sigmaz()
c_ops = [0.1 * sigmam()]
times = np.linspace(0, 10, 100)
psi0 = basis(2, 1)
 
# Compute <σ_z>, <σ_x>, and <σ_-σ_+> (population)
e_ops = [sigmaz(), sigmax(), sigmam() * sigmap()]
result = mesolve(H, psi0, times, c_ops, e_ops)
 
# result.expect is a list of arrays
# result.expect[0] is <σ_z>(t)
# result.expect[1] is <σ_x>(t)
# result.expect[2] is <σ_-σ_+>(t)

Common Observables

Two-level systems:

  • Population difference: $\sigma_z = |0\rangle\langle 0| - |1\rangle\langle 1|$
  • Excited state population: $|1\rangle\langle 1| = (1 - \sigma_z)/2$
  • Coherence: $\sigma_- = |0\rangle\langle 1|$, $\sigma_+ = |1\rangle\langle 0|$

Harmonic oscillators:

  • Photon number: $a^\dagger a$ (number operator)
  • Quadrature: $X = (a + a^\dagger)/\sqrt{2}$, $P = -i(a - a^\dagger)/\sqrt{2}$

QuTiP computes expectation values via matrix trace, which is efficient and numerically stable.

qutip-expectation-values.md · Last modified: by 127.0.0.1