---
title: QpyDataV13ToV17Model (latest version)
description: API reference for ibm_quantum_schemas.common.QpyDataV13ToV17Model in the latest version of qiskit-ibm-runtime
source: https://quantum.cloud.ibm.com/docs/en/api/qiskit-ibm-runtime/ibm-quantum-schemas-common-qpy-data-v13-to-v17-model
---

# QpyDataV13ToV17Model

*pydantic model* `QpyDataV13ToV17Model`

[GitHub](https://github.com/Qiskit/ibm-quantum-schemas/tree/0.10.20260723/ibm_quantum_schemas/common/qpy.py#L326-L329)

Bases: [`QpyDataModel`](/docs/api/qiskit-ibm-runtime/ibm-quantum-schemas-common-qpy-data-model "ibm_quantum_schemas.common.qpy.QpyDataModel"), `Generic`\[`T`]

QPY encoded circuit list with restricted version range.

### b64\_data

*field*

Type: `str`

Base-64 encoded data of the QPY serialization of some Qiskit objects.

**Validated by**

- `cross_validate_qpy_info`

### num\_programs

*field*

Type: `int`

The number of distinct elements in the Python encoding.

**Constraints**

- **ge** = 1

**Validated by**

- `cross_validate_qpy_info`

### qpy\_version

*field*

Type: `int`

The QPY encoding version.

**Constraints**

- **ge** = 13
- **le** = 17

**Validated by**

- `cross_validate_qpy_info`

### cross\_validate\_qpy\_info

*validator* `cross_validate_qpy_info`

[GitHub](https://github.com/Qiskit/ibm-quantum-schemas/tree/0.10.20260723/ibm_quantum_schemas/common/qpy.py#L92-L106)

Check that the encoded qpy information matches expectations.

### from\_python

*classmethod* `from_python(data, qpy_version=17)`

[GitHub](https://github.com/Qiskit/ibm-quantum-schemas/tree/0.10.20260723/ibm_quantum_schemas/common/qpy.py#L127-L149)

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.QpyDataV13ToV17Model.to_python "ibm_quantum_schemas.common.QpyDataV13ToV17Model.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 base64 encode in the new model instance.
- **qpy\_version** (*int*) – The QPY version to encode with.

**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/qpy.py#L108-L125)

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

When `use_cached` is false, or when no cached version exists, [`b64_data`](#ibm_quantum_schemas.common.QpyDataV13ToV17Model.b64_data "ibm_quantum_schemas.common.QpyDataV13ToV17Model.b64_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*]
