In Qiskit 1.2, Sampler and Estimator objects are getting phased out. When trying to replace them with the newest StatevectorSampler and StatevectorEstimator, StatevectorSampler cause no issues but the transition to StatevectorEstimator is not seamless.
Indeed, the following code involving a StatevectorSampler smp
is correct and yields the expected result :
smp.run([cir], shots=128)
However, I do not know how to specify the number of shots for an StatevectorEstimator est
, it seems only possible to specify a precision, which is not what I want. In the end, I can’t even retrieve how many shots would have been necessary to reach such a precision. I cannot get the code below to simulate a given amount of shots.
est.run([(cir, ope, par)]).result()[0].data.evs