Calculate the expectation value of Pauli operators given a state prepared by prep_program.
PauliSumthen the returned value is a single
float, otherwise the returned value is an array of values, one for each
PauliTermin the list.
If your program contains measurements or noisy gates, this method may not do what you want. If the execution of
quil_programis non-deterministic then the final wavefunction from which the expectation value is calculated only represents a stochastically generated sample and the wavefunctions returned by different
wavefunctioncalls will generally be different.
Parameters: Return type: Returns:
Either a float or array floats depending on