Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK Go to the latest version
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.

DataBin

class qiskit.primitives.DataBin(*, shape=(), **data)

GitHub

Bases: ShapedMixin

Namespace for storing data.

data = DataBin(
    alpha=BitArray.from_bitstrings(["0010"]),
    beta=np.array([1.2])
)
 
print("alpha data:", data.alpha)
print("beta data:", data.beta)

Parameters

  • data – Name/value data to place in the data bin.
  • shape (ShapeInput) – The leading shape common to all entries in the data bin. This defaults to the trivial leading shape of () that is compatible with all objects.

Raises

  • ValueError – If a name overlaps with a method name on this class.
  • ValueError – If some value is inconsistent with the provided shape.

Attributes

ndim

shape

size


Methods

items

items()

GitHub

Return a view of field names and values

Return type

ItemsView[str, Any]

keys

keys()

GitHub

Return a view of field names.

Return type

KeysView[str]

values

values()

GitHub

Return a view of values.

Return type

ValuesView[Any]

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