Skip to main content
IBM Quantum Platform
Diese Seite stammt aus einer alten Version von Qiskit SDK und ist in der aktuellen Version nicht mehr vorhanden. Wir empfehlen Ihnen, auf die neueste Version umzusteigen. Weitere Informationen finden Sie in den Versionshinweisen.

BaseSampler

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

GitHub

Bases: BasePrimitive, Generic[T]

Sampler base class

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

Parameters

options (dict | 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

  • circuits (QuantumCircuit | Sequence[QuantumCircuit]) – One of more circuit objects.
  • parameter_values (Sequence[float] | Sequence[Sequence[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 – 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

War diese Seite hilfreich?
Melden Sie auf GitHub einen Fehler, einen Tippfehler oder fordern Sie Inhalte an.