Expand description
Pauli-string expectation values and pattern traces.
Pauli-string expectation values for GeneralizedTableau.
Two entry points:
GeneralizedTableau::expectation— single-Pauli⟨ψ|P|ψ⟩for aPauliWord. ConjugatesPthrough the tableau and overlaps the resulting Pauli with the sparse coefficient vector using the same formulas as the measurement code.GeneralizedTableau::trace—Σ_{P matches pattern} ⟨ψ|P|ψ⟩for aPauliPattern. Enumerates the matching Paulis and sums their expectations.
Decision 9 in the multi-backend plan calls these out as the natural primitive for the tableau backend; semantics intentionally diverge from the PauliSum trace.