Cirq
Cirq copied to clipboard
Deduplicate expectation value code in simulators
After PR #3979, we will have separate but near-identical implementations of simulate_expectation_values_sweep defined in sparse_simulator and density_matrix_simulator. it should be possible to deduplicate this code by moving it into a mutual parent class of these simulators - either SimulatorBase or a new subclass of it.
Belatedly adding the triage/accepted label, after reviewing and thinking about the desirability of follow through on this. (Which is: low priority, but still important enough to be worth keeping the issue open.)