Cirq
Cirq copied to clipboard
Measure expectation value of Hamiltonian
It should be optimized for the tradeoff between the number of measurements and the variance of the result (e.g. section IV.A of https://arxiv.org/pdf/1801.03524.pdf and other things like grouping together terms of the Hamiltonian). @ncrubin probably has already implemented some of this in a different context.
Blocked by #1299
#2781 is related to this.
We have PauliSumCollector to estimate expectation value of a hamiltonian represented as a linear combination of pauli observables. We also have measure_observables and measure_grouped_settings to measure a collection of (pauli string) observables for a state prepared by a given circuit. I'll go ahead and close this issue but please feel free to reopen if you think these utilities are not sufficient for your use case.