---
title: OpenQasm3DataModel (latest version)
description: API reference for ibm_quantum_schemas.common.OpenQasm3DataModel in the latest version of qiskit-ibm-runtime
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit-ibm-runtime/ibm-quantum-schemas-common-open-qasm-3-data-model
---

# OpenQasm3DataModel

*pydantic model* `OpenQasm3DataModel`

[GitHub](https://github.com/Qiskit/ibm-quantum-schemas/tree/0.10.20260723/ibm_quantum_schemas/common/qasm.py#L30-L96)

Bases: `BaseModel`, `Generic`\[`T`]

OpenQASM3-encoded objects.

### data

*field*

Type: `list`\[`str`]

A list of OpenQASM3 serialized programs.

### from\_python

*classmethod* `from_python(data)`

[GitHub](https://github.com/Qiskit/ibm-quantum-schemas/tree/0.10.20260723/ibm_quantum_schemas/common/qasm.py#L75-L96)

Create a model instance from Python data of the correct type.

The returned instance owns a reference to the provided data. This instance may be returned by [`to_python()`](#ibm_quantum_schemas.common.OpenQasm3DataModel.to_python "ibm_quantum_schemas.common.OpenQasm3DataModel.to_python") depending on the value of `use_cached`. Users of this class are responsible for managing cached instances of the data and possible side-effects of their mutations.

**Parameters**

**data** (*list\[T]*) – The data to string encode in the new model instance.

**Returns**

A new model instance.

**Return type**

*Self*

### to\_python

`to_python(use_cached=False)`

[GitHub](https://github.com/Qiskit/ibm-quantum-schemas/tree/0.10.20260723/ibm_quantum_schemas/common/qasm.py#L46-L73)

Return a Python representation of the encoded data in the model.

When `use_cached` is false, or when no cached version exists, [`data`](#ibm_quantum_schemas.common.OpenQasm3DataModel.data "ibm_quantum_schemas.common.OpenQasm3DataModel.data") is decoded and loaded into a new Python instance. Users of this class are responsible for managing cached instances of the Python data and possible side-effects of their mutations.

**Parameters**

**use\_cached** (*bool*) – Whether to return the cached instance (if it exists).

**Returns**

Python data.

**Return type**

list\[*T*]

### num\_programs

Type: `int`

The number of programs in this encoded circuit.
