Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.
Important

IBM Quantum Platform is moving and this version will be sunset on July 1. To get started on the new platform, read the migration guide.

Sampler

class Sampler(circuits: Iterable[QuantumCircuit] | QuantumCircuit, *args, parameters: Iterable[Iterable[Parameter]] | None = None, **kwargs)

GitHub

Bases: qiskit.primitives.base_sampler.BaseSampler

Sampler class

Parameters

  • circuits – circuits to be executed
  • parameters – Parameters of each of the quantum circuits. Defaults to [circ.parameters for circ in circuits].

Raises

QiskitError – if some classical bits are not used for measurements.


Methods

close

Sampler.close()

Close the session and free resources


Attributes

circuits

Quantum circuits to be sampled.

Returns

The quantum circuits to be sampled.

parameters

Parameters of quantum circuits.

Returns

List of the parameters in each quantum circuit.

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