---
title: Shaped (v1.1)
description: API reference for qiskit.primitives.Shaped in qiskit v1.1
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/1.1/qiskit.primitives.Shaped
---

# Shaped

*class* `qiskit.primitives.Shaped(*args, **kwargs)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.1/qiskit/primitives/containers/shape.py#L28-L50)

Bases: [`Protocol`](https://docs.python.org/3/library/typing.html#typing.Protocol)

Protocol that defines what it means to be a shaped object.

Note that static type checkers will classify `numpy.ndarray` as being [`Shaped`](#qiskit.primitives.Shaped "qiskit.primitives.Shaped"). Moreover, since this protocol is runtime-checkable, we will even have `isinstance(<numpy.ndarray instance>, Shaped) == True`.

## Attributes

### ndim

The number of array dimensions of this object.

### shape

The array shape of this object.

### size

The total dimension of this object, i.e. the product of the entries of [`shape`](#qiskit.primitives.Shaped.shape "qiskit.primitives.Shaped.shape").
