qiskit.result.sampled_expectation_value¶
- sampled_expectation_value(dist, oper)[source]¶
Computes expectation value from a sampled distribution
Note that passing a raw dict requires bit-string keys.
- Paramètres
dist (Counts or QuasiDistribution or ProbDistribution or dict) – Input sampled distribution
oper (str or Pauli or PauliOp or PauliSumOp or SparsePauliOp) – The operator for the observable
- Renvoie
The expectation value
- Type renvoyé
float
- Lève
QiskitError – if the input distribution or operator is an invalid type