Skip to main contentIBM Quantum Documentation Mirror

BaseSampler

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

GitHub(opens in a new tab)

Bases: BaseSamplerV1[T]

DEPRECATED. Type alias for Sampler V1 base class

See BaseSamplerV1 for details.

Deprecated since version 1.2

The class qiskit.primitives.base.base_sampler.BaseSampler is deprecated as of qiskit 1.2. It will be removed no earlier than 3 months after the release date. The BaseSampler class is a type alias for the BaseSamplerV1 interface that has been deprecated in favor of explicitly versioned interface classes. It is recommended to migrate all implementations to use BaseSamplerV2. However, for implementations incompatible with BaseSamplerV2, BaseSampler can be replaced with the explicitly versioned BaseSamplerV1 class.

Parameters

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


Attributes

options

Return options values for the estimator.

Returns

options


Methods

run

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

GitHub(opens in a new tab)

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)

GitHub(opens in a new tab)

Set options values for the estimator.

Parameters

**fields – The fields to update the options