Sampler
class Sampler(circuits: Iterable[QuantumCircuit] | QuantumCircuit, *args, parameters: Iterable[Iterable[Parameter]] | None = None, **kwargs)
Bases: qiskit.primitives.base_sampler.BaseSampler
Aer implementation of Sampler class.
Run Options
- shots (None or int) – The number of shots. If None, it calculates the probabilities exactly. Otherwise, it samples from multinomial distributions.
- seed (int) – Set a fixed seed for
seed_simulator
. If shots is None, this option is ignored.
Note
Precedence of seeding is as follows:
seed_simulator
in runtime (i.e. in__call__()
)seed
in runtime (i.e. in__call__()
)seed_simulator
ofbackend_options
.- default.
Parameters
- circuits – Circuits to be executed.
- parameters – Parameters of each of the quantum circuits. Defaults to
[circ.parameters for circ in circuits]
. - backend_options – Options passed to AerSimulator.
- transpile_options – Options passed to transpile.
- skip_transpilation – if True, transpilation is skipped.
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.