All the above formulas are valid for pure states σ σ only. Prominently in thermodynamics and quantum optics, also mixed states are of importance; these are described by a positive trace-class operator ρ ρ = ∑ ∑ i p i | ψ ψ i ⟩ ⟩ ⟨ ⟨ ψ ψ i | , the statistical operator or density matrix. The expectation value then can be obtained as