---
title: BaseSampler (v1.2)
description: API reference for qiskit.primitives.BaseSampler in qiskit v1.2
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/1.2/qiskit.primitives.BaseSampler
---

# BaseSampler

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

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/primitives/base/base_sampler.py#L154-L177)

Bases: [`BaseSamplerV1`](/docs/api/qiskit/1.2/qiskit.primitives.BaseSamplerV1 "qiskit.primitives.base.base_sampler.BaseSamplerV1")\[`T`]

DEPRECATED. Type alias for Sampler V1 base class

See [`BaseSamplerV1`](/docs/api/qiskit/1.2/qiskit.primitives.BaseSamplerV1 "qiskit.primitives.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*](https://docs.python.org/3/library/stdtypes.html#dict) *| None*) – Default options.

## Attributes

### options

Return options values for the estimator.

**Returns**

options

## Methods

### run

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

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/primitives/base/base_sampler.py#L111-L142)

Run the job of the sampling of bitstrings.

**Parameters**

- **circuits** ([*QuantumCircuit*](/docs/api/qiskit/1.2/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") *| Sequence\[*[*QuantumCircuit*](/docs/api/qiskit/1.2/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")*]*) – One of more circuit objects.
- **parameter\_values** (*Sequence\[*[*float*](https://docs.python.org/3/library/functions.html#float)*] | Sequence\[Sequence\[*[*float*](https://docs.python.org/3/library/functions.html#float)*]] | None*) – Parameters to be bound to the circuit.
- **run\_options** – Backend runtime options used for circuit execution.

**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**](https://docs.python.org/3/library/exceptions.html#ValueError) – Invalid arguments are given.

**Return type**

T

### set\_options

`set_options(**fields)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/primitives/base/base_primitive.py#L39-L45)

Set options values for the estimator.

**Parameters**

**\*\*fields** – The fields to update the options
