---
title: SamplerPubResult (v2.0)
description: API reference for qiskit.primitives.SamplerPubResult in qiskit v2.0
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/2.0/qiskit.primitives.SamplerPubResult
---

# SamplerPubResult

*class* `qiskit.primitives.SamplerPubResult(data, metadata=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.0/qiskit/primitives/containers/sampler_pub_result.py#L27-L74)

Bases: [`PubResult`](/docs/api/qiskit/2.0/qiskit.primitives.PubResult "qiskit.primitives.containers.pub_result.PubResult")

Result of Sampler Pub.

Initialize a pub result.

**Parameters**

- **data** ([*DataBin*](/docs/api/qiskit/2.0/qiskit.primitives.DataBin "qiskit.primitives.DataBin")) – Result data.
- **metadata** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict)*\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str)*, Any] | None*) – Metadata specific to this pub. Keys are expected to be strings.

## Attributes

### data

Result data for the pub.

### metadata

Metadata for the pub.

## Methods

### join\_data

`join_data(names=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.0/qiskit/primitives/containers/sampler_pub_result.py#L30-L74)

Join data from many registers into one data container.

Data is joined along the bits axis. For example, for [`BitArray`](/docs/api/qiskit/2.0/qiskit.primitives.BitArray "qiskit.primitives.BitArray") data, this corresponds to bitstring concatenation.

**Parameters**

**names** (*Iterable\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str)*] | None*) – Which registers to join. Their order is maintained, for example, given `["alpha", "beta"]`, the data from register `alpha` is placed to the left of the data from register `beta`. When `None` is given, this value is set to the ordered list of register names, which will have been preserved from the input circuit order.

**Returns**

Joint data.

**Raises**

- [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError) – If specified names are empty.
- [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError) – If specified name does not exist.
- [**TypeError**](https://docs.python.org/3/library/exceptions.html#TypeError) – If specified data comes from incompatible types.

**Return type**

[BitArray](/docs/api/qiskit/2.0/qiskit.primitives.BitArray "qiskit.primitives.BitArray") | np.ndarray
