French
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

Sampler

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

Bases : BaseSampler

Sampler class.

Sampler is a reference implementation of BaseSampler.

Run Options
  • shots (None or int) – The number of shots. If None, it calculates the probabilities. Otherwise, it samples from multinomial distributions.

  • seed (np.random.Generator or int) – Set a fixed seed or generator for the multinomial distribution. If shots is None, this option is ignored.

Paramètres
  • circuits – circuits to be executed

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

  • options – Default options.

Lève

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

Methods

close

Close the session and free resources

run

Run the job of the sampling of bitstrings.

set_options

Set options values for the estimator.

Attributes

circuits

Quantum circuits to be sampled.

Renvoie

The quantum circuits to be sampled.

options

Return options values for the estimator.

Type renvoyé

Options

Renvoie

options

parameters

Parameters of quantum circuits.

Renvoie

List of the parameters in each quantum circuit.