> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.conductorquantum.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.conductorquantum.com/_mcp/server.

# stanza.models



## Module Contents

### Classes

| Name | Description |
|------|-------------|
| [`BaseModelWithConfig`](#stanzamodelsbasemodelwithconfig) | None |
| [`Electrode`](#stanzamodelselectrode) | None |
| [`PadType`](#stanzamodelspadtype) | Pad type |
| [`GateType`](#stanzamodelsgatetype) | str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
| [`ContactType`](#stanzamodelscontacttype) | str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
| [`GPIOType`](#stanzamodelsgpiotype) | str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
| [`InstrumentType`](#stanzamodelsinstrumenttype) | str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
| [`Gate`](#stanzamodelsgate) | Gate pads for inductive channels on the device |
| [`Contact`](#stanzamodelscontact) | Contact pads for conductive channels on the device |
| [`GPIO`](#stanzamodelsgpio) | General Purpose Input/Output pins for digital signals |
| [`RoutineConfig`](#stanzamodelsroutineconfig) | None |
| [`BaseInstrumentConfig`](#stanzamodelsbaseinstrumentconfig) | Base instrument configuration with discriminator. |
| [`MeasurementInstrumentConfigMixin`](#stanzamodelsmeasurementinstrumentconfigmixin) | Mixin for instruments with measurement capabilities. |
| [`ControlInstrumentConfigMixin`](#stanzamodelscontrolinstrumentconfigmixin) | Mixin for instruments with control capabilities. |
| [`MeasurementInstrumentConfig`](#stanzamodelsmeasurementinstrumentconfig) | Instrument configuration for measurement instruments with required timing parameters. |
| [`ControlInstrumentConfig`](#stanzamodelscontrolinstrumentconfig) | Instrument configuration for control instruments. |
| [`GeneralInstrumentConfig`](#stanzamodelsgeneralinstrumentconfig) | Instrument configuration for general instruments with both control and measurement capabilities. |
| [`BreakoutBoxInstrumentConfig`](#stanzamodelsbreakoutboxinstrumentconfig) | Instrument configuration for breakout box instruments. |
| [`DeviceGroup`](#stanzamodelsdevicegroup) | Logical grouping of pads within a device. |
| [`DeviceConfig`](#stanzamodelsdeviceconfig) | Configuration for a quantum device (Device Under Test). |

### Data

`PYDANTIC_VERSION_MINOR_TUPLE`
`PYDANTIC_V2`
`InstrumentConfig`

### API

```python
stanza.models.PYDANTIC_VERSION_MINOR_TUPLE
```

**Value**: `tuple(...)`


```python
stanza.models.PYDANTIC_V2
```

**Value**: `None`


```python
class stanza.models.BaseModelWithConfig
```

**Bases**: `pydantic.BaseModel`

```python
class stanza.models.Electrode
```

**Bases**: `pydantic.BaseModel`

```python
control_channel: int | None
```

**Value**: `Field(...)`


```python
measure_channel: int | None
```

**Value**: `Field(...)`


```python
breakout_channel: int | None
```

**Value**: `Field(...)`


```python
v_lower_bound: float | None
```

**Value**: `None`


```python
v_upper_bound: float | None
```

**Value**: `None`


```python
validate_control_channel_required_when_no_measure_channel() -> stanza.models.Electrode
```


```python
validate_control_channel_requires_v_bounds() -> stanza.models.Electrode
```


```python
class stanza.models.PadType
```

**Bases**: `str`, `enum.Enum`

Pad type

### Initialization

Initialize self.  See help(type(self)) for accurate signature.


```python
GATE
```

**Value**: `GATE`


```python
CONTACT
```

**Value**: `CONTACT`


```python
GPIO
```

**Value**: `GPIO`


```python
ALL
```

**Value**: `ALL`


```python
__str__() -> str
```


```python
class stanza.models.GateType
```

**Bases**: `str`, `enum.Enum`

```python
PLUNGER
```

**Value**: `PLUNGER`


```python
BARRIER
```

**Value**: `BARRIER`


```python
RESERVOIR
```

**Value**: `RESERVOIR`


```python
SCREEN
```

**Value**: `SCREEN`


```python
class stanza.models.ContactType
```

**Bases**: `str`, `enum.Enum`

```python
SOURCE
```

**Value**: `SOURCE`


```python
DRAIN
```

**Value**: `DRAIN`


```python
class stanza.models.GPIOType
```

**Bases**: `str`, `enum.Enum`

```python
INPUT
```

**Value**: `INPUT`


```python
OUTPUT
```

**Value**: `OUTPUT`


```python
class stanza.models.InstrumentType
```

**Bases**: `str`, `enum.Enum`

```python
CONTROL
```

**Value**: `CONTROL`


```python
MEASUREMENT
```

**Value**: `MEASUREMENT`


```python
GENERAL
```

**Value**: `GENERAL`


```python
BREAKOUT_BOX
```

**Value**: `BREAKOUT_BOX`


```python
class stanza.models.Gate
```

**Bases**: `stanza.models.Electrode`

Gate pads for inductive channels on the device

```python
type: stanza.models.GateType
```

**Value**: `None`


```python
class stanza.models.Contact
```

**Bases**: `stanza.models.Electrode`

Contact pads for conductive channels on the device

```python
type: stanza.models.ContactType
```

**Value**: `None`


```python
class stanza.models.GPIO
```

**Bases**: `stanza.models.Electrode`

General Purpose Input/Output pins for digital signals

```python
type: stanza.models.GPIOType
```

**Value**: `None`


```python
class stanza.models.RoutineConfig
```

**Bases**: `stanza.models.BaseModelWithConfig`

```python
name: str
```

**Value**: `None`


```python
group: str | None
```

**Value**: `None`


```python
parameters: dict[str, typing.Any] | None
```

**Value**: `None`


```python
routines: list[stanza.models.RoutineConfig] | None
```

**Value**: `None`


```python
convert_to_number() -> stanza.models.RoutineConfig
```

Convert float values to int if they have no fractional part.


```python
class stanza.models.BaseInstrumentConfig
```

**Bases**: `stanza.models.BaseModelWithConfig`

Base instrument configuration with discriminator.

```python
name: str
```

**Value**: `None`


```python
ip_addr: str | None
```

**Value**: `None`


```python
serial_addr: str | None
```

**Value**: `None`


```python
port: int | None
```

**Value**: `None`


```python
type: stanza.models.InstrumentType
```

**Value**: `None`


```python
breakout_line: int | None
```

**Value**: `None`


```python
driver: str | None
```

**Value**: `Field(...)`


```python
check_comm_type() -> stanza.models.BaseInstrumentConfig
```


```python
class stanza.models.MeasurementInstrumentConfigMixin
```

**Bases**: `pydantic.BaseModel`

Mixin for instruments with measurement capabilities.

```python
measurement_duration: float
```

**Value**: `Field(...)`


```python
sample_time: float
```

**Value**: `Field(...)`


```python
conversion_factor: float
```

**Value**: `Field(...)`


```python
machine_type: str | None
```

**Value**: `Field(...)`


```python
cluster_name: str | None
```

**Value**: `Field(...)`


```python
measurement_channels: list[int] | None
```

**Value**: `Field(...)`


```python
connection_headers: dict[str, str] | None
```

**Value**: `Field(...)`


```python
octave: str | None
```

**Value**: `Field(...)`


```python
validate_timing_constraints() -> stanza.models.MeasurementInstrumentConfigMixin
```

Validate logical constraints between timing parameters.


```python
class stanza.models.ControlInstrumentConfigMixin
```

**Bases**: `pydantic.BaseModel`

Mixin for instruments with control capabilities.

```python
slew_rate: float
```

**Value**: `Field(...)`


```python
conversion_factor: float
```

**Value**: `Field(...)`


```python
class stanza.models.MeasurementInstrumentConfig
```

**Bases**: `stanza.models.MeasurementInstrumentConfigMixin`, `stanza.models.BaseInstrumentConfig`

Instrument configuration for measurement instruments with required timing parameters.

```python
type: typing.Literal[stanza.models.InstrumentType]
```

**Value**: `None`


```python
class stanza.models.ControlInstrumentConfig
```

**Bases**: `stanza.models.ControlInstrumentConfigMixin`, `stanza.models.BaseInstrumentConfig`

Instrument configuration for control instruments.

```python
type: typing.Literal[stanza.models.InstrumentType]
```

**Value**: `None`


```python
class stanza.models.GeneralInstrumentConfig
```

**Bases**: `stanza.models.ControlInstrumentConfigMixin`, `stanza.models.MeasurementInstrumentConfigMixin`, `stanza.models.BaseInstrumentConfig`

Instrument configuration for general instruments with both control and measurement capabilities.

```python
model_config
```

**Value**: `ConfigDict(...)`


```python
type: typing.Literal[stanza.models.InstrumentType]
```

**Value**: `None`


```python
class stanza.models.BreakoutBoxInstrumentConfig
```

**Bases**: `stanza.models.BaseInstrumentConfig`

Instrument configuration for breakout box instruments.

```python
model_config
```

**Value**: `ConfigDict(...)`


```python
type: typing.Literal[stanza.models.InstrumentType]
```

**Value**: `None`


```python
stanza.models.InstrumentConfig
```

**Value**: `None`


```python
class stanza.models.DeviceGroup
```

**Bases**: `pydantic.BaseModel`

Logical grouping of pads within a device.

```python
name: str | None
```

**Value**: `None`


```python
gates: list[str]
```

**Value**: `Field(...)`


```python
contacts: list[str] | None
```

**Value**: `None`


```python
gpios: list[str] | None
```

**Value**: `None`


```python
class stanza.models.DeviceConfig
```

**Bases**: `pydantic.BaseModel`

Configuration for a quantum device (Device Under Test).

```python
model_config
```

**Value**: `ConfigDict(...)`


```python
name: str
```

**Value**: `None`


```python
gates: dict[str, stanza.models.Gate]
```

**Value**: `None`


```python
contacts: dict[str, stanza.models.Contact]
```

**Value**: `None`


```python
gpios: dict[str, stanza.models.GPIO]
```

**Value**: `None`


```python
groups: dict[str, stanza.models.DeviceGroup]
```

**Value**: `None`


```python
routines: list[stanza.models.RoutineConfig]
```

**Value**: `[]`


```python
instruments: list[stanza.models.InstrumentConfig]
```

**Value**: `None`


```python
validate_unique_channels() -> stanza.models.DeviceConfig
```

Ensure that all channels are unique across gates, contacts, and gpios


```python
validate_groups() -> stanza.models.DeviceConfig
```


```python
_validate_routine_group(
    routine: stanza.models.RoutineConfig,
    available_groups: set[str],
    path: str = ''
) -> stanza.models.DeviceConfig
```


```python
validate_routine_groups() -> stanza.models.DeviceConfig
```

Validate that routine groups exist if specified.


```python
validate_required_instruments() -> stanza.models.DeviceConfig
```