Skip to main contentIBM Quantum Documentation
You are viewing the API reference for an old version of Qiskit SDK. Switch to latest version

BaseSampler

qiskit.primitives.BaseSampler(*, options=None)

GitHub(opens in a new tab)

Bases: BasePrimitive, Generic(opens in a new tab)[T]

Sampler base class

Base class of Sampler that calculates quasi-probabilities of bitstrings from quantum circuits.

Parameters

options (dict(opens in a new tab) | None) – Default options.


Attributes

circuits

Quantum circuits to be sampled.

Returns

The quantum circuits to be sampled.

options

Return options values for the estimator.

Returns

options

parameters

Parameters of quantum circuits.

Returns

List of the parameters in each quantum circuit.


Methods

run

run(circuits, parameter_values=None, **run_options)

Run the job of the sampling of bitstrings.

Parameters

Returns

The job object of the result of the sampler. The i-th result corresponds to circuits[i] evaluated with parameters bound as parameter_values[i].

Raises

ValueError(opens in a new tab) – Invalid arguments are given.

Return type

T

set_options

set_options(**fields)

Set options values for the estimator.

Parameters

**fields – The fields to update the options

Was this page helpful?
Report a bug or request content on GitHub.