Skip to navigation

stanza.models

Module Contents

Classes

NameDescription
BaseModelWithConfigNone
ElectrodeNone
PadTypePad type
GateTypestr(object=”) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
ContactTypestr(object=”) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
GPIOTypestr(object=”) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
InstrumentTypestr(object=”) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
GateGate pads for inductive channels on the device
ContactContact pads for conductive channels on the device
GPIOGeneral Purpose Input/Output pins for digital signals
RoutineConfigNone
BaseInstrumentConfigBase instrument configuration with discriminator.
MeasurementInstrumentConfigMixinMixin for instruments with measurement capabilities.
ControlInstrumentConfigMixinMixin for instruments with control capabilities.
MeasurementInstrumentConfigInstrument configuration for measurement instruments with required timing parameters.
ControlInstrumentConfigInstrument configuration for control instruments.
GeneralInstrumentConfigInstrument configuration for general instruments with both control and measurement capabilities.
BreakoutBoxInstrumentConfigInstrument configuration for breakout box instruments.
DeviceGroupLogical grouping of pads within a device.
DeviceConfigConfiguration for a quantum device (Device Under Test).

Data

PYDANTIC_VERSION_MINOR_TUPLE PYDANTIC_V2 InstrumentConfig

API

stanza.models.PYDANTIC_VERSION_MINOR_TUPLE

Value: tuple(...)

stanza.models.PYDANTIC_V2

Value: None

class stanza.models.BaseModelWithConfig

Bases: pydantic.BaseModel

class stanza.models.Electrode

Bases: pydantic.BaseModel

control_channel: int | None

Value: Field(...)

measure_channel: int | None

Value: Field(...)

breakout_channel: int | None

Value: Field(...)

v_lower_bound: float | None

Value: None

v_upper_bound: float | None

Value: None

validate_control_channel_required_when_no_measure_channel() -> stanza.models.Electrode
validate_control_channel_requires_v_bounds() -> stanza.models.Electrode
class stanza.models.PadType

Bases: str, enum.Enum

Pad type

Initialization

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

GATE

Value: GATE

CONTACT

Value: CONTACT

GPIO

Value: GPIO

ALL

Value: ALL

__str__() -> str
class stanza.models.GateType

Bases: str, enum.Enum

PLUNGER

Value: PLUNGER

BARRIER

Value: BARRIER

RESERVOIR

Value: RESERVOIR

SCREEN

Value: SCREEN

class stanza.models.ContactType

Bases: str, enum.Enum

SOURCE

Value: SOURCE

DRAIN

Value: DRAIN

class stanza.models.GPIOType

Bases: str, enum.Enum

INPUT

Value: INPUT

OUTPUT

Value: OUTPUT

class stanza.models.InstrumentType

Bases: str, enum.Enum

CONTROL

Value: CONTROL

MEASUREMENT

Value: MEASUREMENT

GENERAL

Value: GENERAL

BREAKOUT_BOX

Value: BREAKOUT_BOX

class stanza.models.Gate

Bases: stanza.models.Electrode

Gate pads for inductive channels on the device

type: stanza.models.GateType

Value: None

class stanza.models.Contact

Bases: stanza.models.Electrode

Contact pads for conductive channels on the device

type: stanza.models.ContactType

Value: None

class stanza.models.GPIO

Bases: stanza.models.Electrode

General Purpose Input/Output pins for digital signals

type: stanza.models.GPIOType

Value: None

class stanza.models.RoutineConfig

Bases: stanza.models.BaseModelWithConfig

name: str

Value: None

group: str | None

Value: None

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

Value: None

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

Value: None

convert_to_number() -> stanza.models.RoutineConfig

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

class stanza.models.BaseInstrumentConfig

Bases: stanza.models.BaseModelWithConfig

Base instrument configuration with discriminator.

name: str

Value: None

ip_addr: str | None

Value: None

serial_addr: str | None

Value: None

port: int | None

Value: None

type: stanza.models.InstrumentType

Value: None

breakout_line: int | None

Value: None

driver: str | None

Value: Field(...)

check_comm_type() -> stanza.models.BaseInstrumentConfig
class stanza.models.MeasurementInstrumentConfigMixin

Bases: pydantic.BaseModel

Mixin for instruments with measurement capabilities.

measurement_duration: float

Value: Field(...)

sample_time: float

Value: Field(...)

conversion_factor: float

Value: Field(...)

machine_type: str | None

Value: Field(...)

cluster_name: str | None

Value: Field(...)

measurement_channels: list[int] | None

Value: Field(...)

connection_headers: dict[str, str] | None

Value: Field(...)

octave: str | None

Value: Field(...)

validate_timing_constraints() -> stanza.models.MeasurementInstrumentConfigMixin

Validate logical constraints between timing parameters.

class stanza.models.ControlInstrumentConfigMixin

Bases: pydantic.BaseModel

Mixin for instruments with control capabilities.

slew_rate: float

Value: Field(...)

conversion_factor: float

Value: Field(...)

class stanza.models.MeasurementInstrumentConfig

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

Instrument configuration for measurement instruments with required timing parameters.

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

Value: None

class stanza.models.ControlInstrumentConfig

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

Instrument configuration for control instruments.

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

Value: None

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.

model_config

Value: ConfigDict(...)

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

Value: None

class stanza.models.BreakoutBoxInstrumentConfig

Bases: stanza.models.BaseInstrumentConfig

Instrument configuration for breakout box instruments.

model_config

Value: ConfigDict(...)

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

Value: None

stanza.models.InstrumentConfig

Value: None

class stanza.models.DeviceGroup

Bases: pydantic.BaseModel

Logical grouping of pads within a device.

name: str | None

Value: None

gates: list[str]

Value: Field(...)

contacts: list[str] | None

Value: None

gpios: list[str] | None

Value: None

class stanza.models.DeviceConfig

Bases: pydantic.BaseModel

Configuration for a quantum device (Device Under Test).

model_config

Value: ConfigDict(...)

name: str

Value: None

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

Value: None

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

Value: None

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

Value: None

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

Value: None

routines: list[stanza.models.RoutineConfig]

Value: []

instruments: list[stanza.models.InstrumentConfig]

Value: None

validate_unique_channels() -> stanza.models.DeviceConfig

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

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

Validate that routine groups exist if specified.

validate_required_instruments() -> stanza.models.DeviceConfig