---
title: SamplexModelSSV1 (latest version)
description: API reference for ibm_quantum_schemas.common.SamplexModelSSV1 in the latest version of qiskit-ibm-runtime
source: https://quantum.cloud.ibm.com/docs/en/api/qiskit-ibm-runtime/ibm-quantum-schemas-common-samplex-model-ssv-1
---

# SamplexModelSSV1

*pydantic model* `SamplexModelSSV1`

[GitHub](https://github.com/Qiskit/ibm-quantum-schemas/tree/0.9.20260612/ibm_quantum_schemas/common/samplex.py#L93-L96)

Bases: [`SamplexModel`](/docs/api/qiskit-ibm-runtime/ibm-quantum-schemas-common-samplex-model "ibm_quantum_schemas.common.samplex.SamplexModel")

A samplex model constrained to use samplex serialization version (SSV) 1.

### samplex\_json

*field*

Type: `str [Required]`

A JSON string representing the samplex.

**Validated by**

- `cross_validate_ssv_version`

### ssv

*field*

Type: `int [Required]`

The samplex serialization version.

**Constraints**

- **ge** = 1
- **le** = 1

**Validated by**

- `cross_validate_ssv_version`

### cross\_validate\_ssv\_version

*validator* `cross_validate_ssv_version`

[GitHub](https://github.com/Qiskit/ibm-quantum-schemas/tree/0.9.20260612/ibm_quantum_schemas/common/samplex.py#L32-L49)

Check that the reported version matches the encoded version.

### from\_samplex

*classmethod* `from_samplex(samplex, ssv=None)`

[GitHub](https://github.com/Qiskit/ibm-quantum-schemas/tree/0.9.20260612/ibm_quantum_schemas/common/samplex.py#L71-L90)

Create a model instance from a samplex.

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

**Parameters**

- **samplex** (*Samplex*) – The samplex to encode into the model.
- **ssv** (*int | None*)

**Returns**

A new model instance.

### to\_samplex

`to_samplex(use_cached=False)`

[GitHub](https://github.com/Qiskit/ibm-quantum-schemas/tree/0.9.20260612/ibm_quantum_schemas/common/samplex.py#L53-L69)

Return a decoded samplex instance.

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

**Parameters**

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

**Returns**

A samplex.

**Return type**

*Samplex*
