Right now, the way to specify options for quantum inference is quite convoluted. For example:
Specifying alternative differentiators for the 'noiseless' backend, such as ParameterShift, only has the effect of increasing computational overhead, since the expectation values are exact irrespective of the chosen differentiator
Arguments like 'expectation_samples' do not apply when the simulator is analytic
The method of expectation computation depends on the type of the input operator, rather than on the inference engine.
For example, PauliMixin diagonals get analytic treatment, while more general diagonals use sampled expectations. We would like that PauliMixins could be set to use sampled expectations instead (currently not available).
Instead, I propose to have a QuantumInference base class, whose only public method is expectation. Two subclasses implementing the interface will be: AnalyticQuantumInference, which uses analytic expectations and the adjoint differentiator; SampledQuantumInference, which uses sampled expectations and parameter shift gradients.
Right now, the way to specify options for quantum inference is quite convoluted. For example:
ParameterShift
, only has the effect of increasing computational overhead, since the expectation values are exact irrespective of the chosen differentiatorPauliMixin
diagonals get analytic treatment, while more general diagonals use sampled expectations. We would like thatPauliMixin
s could be set to use sampled expectations instead (currently not available).Instead, I propose to have a
QuantumInference
base class, whose only public method isexpectation
. Two subclasses implementing the interface will be:AnalyticQuantumInference
, which uses analytic expectations and the adjoint differentiator;SampledQuantumInference
, which uses sampled expectations and parameter shift gradients.