64 lines
2.0 KiB
Plaintext
64 lines
2.0 KiB
Plaintext
---
|
||
title: SamplerResult
|
||
description: API reference for qiskit.primitives.SamplerResult
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.primitives.SamplerResult
|
||
---
|
||
|
||
# SamplerResult
|
||
|
||
<Class id="qiskit.primitives.SamplerResult" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.24/qiskit/primitives/base/sampler_result.py" signature="SamplerResult(quasi_dists, metadata)" modifiers="class">
|
||
Bases: `BasePrimitiveResult`
|
||
|
||
Result of Sampler.
|
||
|
||
```python
|
||
result = sampler.run(circuits, params).result()
|
||
```
|
||
|
||
where the i-th elements of `result` correspond to the circuit given by `circuits[i]`, and the parameter values bounds by `params[i]`. For example, `results.quasi_dists[i]` gives the quasi-probabilities of bitstrings, and `result.metadata[i]` is a metadata dictionary for this circuit and parameters.
|
||
|
||
**Parameters**
|
||
|
||
* **quasi\_dists** (*list\[*[*QuasiDistribution*](qiskit.result.QuasiDistribution "qiskit.result.QuasiDistribution")*]*) – List of the quasi-probabilities.
|
||
* **metadata** (*list\[dict]*) – List of the metadata.
|
||
|
||
## Methods
|
||
|
||
<span id="qiskit-primitives-samplerresult-decompose" />
|
||
|
||
### decompose
|
||
|
||
<Function id="qiskit.primitives.SamplerResult.decompose" signature="SamplerResult.decompose()">
|
||
Generate single experiment result objects from self.
|
||
|
||
**Return type**
|
||
|
||
Iterator\[BasePrimitiveResult]
|
||
</Function>
|
||
|
||
## Attributes
|
||
|
||
### experiments
|
||
|
||
<Attribute id="qiskit.primitives.SamplerResult.experiments">
|
||
Experiment data dicts in any inheriting result dataclass.
|
||
</Attribute>
|
||
|
||
### num\_experiments
|
||
|
||
<Attribute id="qiskit.primitives.SamplerResult.num_experiments">
|
||
Number of experiments in any inheriting result dataclass.
|
||
</Attribute>
|
||
|
||
### quasi\_dists
|
||
|
||
<Attribute id="qiskit.primitives.SamplerResult.quasi_dists" attributeTypeHint="list[QuasiDistribution]" />
|
||
|
||
### metadata
|
||
|
||
<Attribute id="qiskit.primitives.SamplerResult.metadata" attributeTypeHint="list[dict[str, Any]]" />
|
||
</Class>
|
||
|