Currently, when using the QPUDevice.expval method, both pyQuil's measure_observables as well as PennyLane's generate_samples methods are called. This leads to redundancy, as both methods generate samples, while only those from measure_observables are actually (currently) used in the estimation of the expectation value. See the discussion at #42 (comment).
We could either over-ride generate_samples when using measure_observables, or try to use the samples from generate_samples and the error mitigation routines from measure_observables.
Currently, when using the
QPUDevice.expvalmethod, both pyQuil'smeasure_observablesas well as PennyLane'sgenerate_samplesmethods are called. This leads to redundancy, as both methods generate samples, while only those frommeasure_observablesare actually (currently) used in the estimation of the expectation value. See the discussion at #42 (comment).We could either over-ride
generate_sampleswhen usingmeasure_observables, or try to use the samples fromgenerate_samplesand the error mitigation routines frommeasure_observables.