Skip to main content
IBM Quantum Platform

Observable terms

qiskit_addon_cutting.utils.observable_terms

Utilities for working with the unique terms of a collection of SparsePauliOps.

gather_unique_observable_terms

gather_unique_observable_terms(observables)

GitHub

Inspect the contents of each observable to find and return the unique Pauli terms.

Return type

PauliList

Parameters

observables (Sequence[Pauli | SparsePauliOp] | PauliList)

reconstruct_observable_expvals_from_terms

reconstruct_observable_expvals_from_terms(observables, term_expvals)

GitHub

Reconstruct the expectation values given the expectation value of each unique term.

Return type

list[complex]

Parameters

  • observables (Iterable[Pauli | SparsePauliOp] | PauliList)
  • term_expvals (Mapping[Pauli, float |complex])
Was this page helpful?
Report a bug or request content on GitHub.