About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
BaseSamplerV2
class qiskit.primitives.BaseSamplerV2
Bases: ABC
Sampler V2 base class.
A Sampler returns samples of quantum circuit outputs.
All sampler implementations must implement default value for the shots
in the run()
method if None
is given both as a kwarg
and in all of the pubs.
Methods
run
abstract run(pubs, *, shots=None)
Run and collect samples from each pub.
Parameters
- pubs (Iterable[SamplerPubLike]) – An iterable of pub-like objects. For example, a list of circuits or tuples
(circuit, parameter_values)
. - shots (int | None) – The total number of shots to sample for each sampler pub that does not specify its own shots. If
None
, the primitive’s default shots value will be used, which can vary by implementation.
Returns
The job object of Sampler’s result.
Return type
Was this page helpful?
Report a bug or request content on GitHub.