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

1stanza.models.PYDANTIC_VERSION_MINOR_TUPLE

Value: tuple(...)

1stanza.models.PYDANTIC_V2

Value: None

1class stanza.models.BaseModelWithConfig

Bases: pydantic.BaseModel

1class stanza.models.Electrode

Bases: pydantic.BaseModel

1control_channel: int | None

Value: Field(...)

1measure_channel: int | None

Value: Field(...)

1breakout_channel: int | None

Value: Field(...)

1v_lower_bound: float | None

Value: None

1v_upper_bound: float | None

Value: None

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

Bases: str, enum.Enum

Pad type

Initialization

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

1GATE

Value: GATE

1CONTACT

Value: CONTACT

1GPIO

Value: GPIO

1ALL

Value: ALL

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

Bases: str, enum.Enum

1PLUNGER

Value: PLUNGER

1BARRIER

Value: BARRIER

1RESERVOIR

Value: RESERVOIR

1SCREEN

Value: SCREEN

1class stanza.models.ContactType

Bases: str, enum.Enum

1SOURCE

Value: SOURCE

1DRAIN

Value: DRAIN

1class stanza.models.GPIOType

Bases: str, enum.Enum

1INPUT

Value: INPUT

1OUTPUT

Value: OUTPUT

1class stanza.models.InstrumentType

Bases: str, enum.Enum

1CONTROL

Value: CONTROL

1MEASUREMENT

Value: MEASUREMENT

1GENERAL

Value: GENERAL

1BREAKOUT_BOX

Value: BREAKOUT_BOX

1class stanza.models.Gate

Bases: stanza.models.Electrode

Gate pads for inductive channels on the device

1type: stanza.models.GateType

Value: None

1class stanza.models.Contact

Bases: stanza.models.Electrode

Contact pads for conductive channels on the device

1type: stanza.models.ContactType

Value: None

1class stanza.models.GPIO

Bases: stanza.models.Electrode

General Purpose Input/Output pins for digital signals

1type: stanza.models.GPIOType

Value: None

1class stanza.models.RoutineConfig

Bases: stanza.models.BaseModelWithConfig

1name: str

Value: None

1group: str | None

Value: None

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

Value: None

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

Value: None

1convert_to_number() -> stanza.models.RoutineConfig

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

1class stanza.models.BaseInstrumentConfig

Bases: stanza.models.BaseModelWithConfig

Base instrument configuration with discriminator.

1name: str

Value: None

1ip_addr: str | None

Value: None

1serial_addr: str | None

Value: None

1port: int | None

Value: None

1type: stanza.models.InstrumentType

Value: None

1breakout_line: int | None

Value: None

1driver: str | None

Value: Field(...)

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

Bases: pydantic.BaseModel

Mixin for instruments with measurement capabilities.

1measurement_duration: float

Value: Field(...)

1sample_time: float

Value: Field(...)

1conversion_factor: float

Value: Field(...)

1machine_type: str | None

Value: Field(...)

1cluster_name: str | None

Value: Field(...)

1measurement_channels: list[int] | None

Value: Field(...)

1connection_headers: dict[str, str] | None

Value: Field(...)

1octave: str | None

Value: Field(...)

1validate_timing_constraints() -> stanza.models.MeasurementInstrumentConfigMixin

Validate logical constraints between timing parameters.

1class stanza.models.ControlInstrumentConfigMixin

Bases: pydantic.BaseModel

Mixin for instruments with control capabilities.

1slew_rate: float

Value: Field(...)

1conversion_factor: float

Value: Field(...)

1class stanza.models.MeasurementInstrumentConfig

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

Instrument configuration for measurement instruments with required timing parameters.

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

Value: None

1class stanza.models.ControlInstrumentConfig

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

Instrument configuration for control instruments.

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

Value: None

1class stanza.models.GeneralInstrumentConfig

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

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

1model_config

Value: ConfigDict(...)

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

Value: None

1class stanza.models.BreakoutBoxInstrumentConfig

Bases: stanza.models.BaseInstrumentConfig

Instrument configuration for breakout box instruments.

1model_config

Value: ConfigDict(...)

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

Value: None

1stanza.models.InstrumentConfig

Value: None

1class stanza.models.DeviceGroup

Bases: pydantic.BaseModel

Logical grouping of pads within a device.

1name: str | None

Value: None

1gates: list[str]

Value: Field(...)

1contacts: list[str] | None

Value: None

1gpios: list[str] | None

Value: None

1class stanza.models.DeviceConfig

Bases: pydantic.BaseModel

Configuration for a quantum device (Device Under Test).

1model_config

Value: ConfigDict(...)

1name: str

Value: None

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

Value: None

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

Value: None

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

Value: None

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

Value: None

1routines: list[stanza.models.RoutineConfig]

Value: []

1instruments: list[stanza.models.InstrumentConfig]

Value: None

1validate_unique_channels() -> stanza.models.DeviceConfig

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

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

Validate that routine groups exist if specified.

1validate_required_instruments() -> stanza.models.DeviceConfig