# steelelab-delft/stlab architecture

> Architecture diagram of the GitHub repository steelelab-delft/stlab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/steelelab-delft/stlab
- Repository: https://github.com/steelelab-delft/stlab

## Overview

stlab is a laboratory measurement and analysis environment: users run measurement scripts that configure instruments, acquire experimental data, and analyze or present results. Its clearest documented-in-code workflow is AWG pulse construction and sequencing for experiments; separate capabilities include VISA instrument drivers, networked temperature access, advanced spectroscopy, and analysis utilities. The AWG sequencer and instrument hierarchy have source-index or excerpt support; other branches are shown as capabilities from the repository tree, without inferred call chains. The README describes the project broadly, so detailed subsystem behavior is not established there.

Main entry points: [`AWG/Sequencer/Rabi_tone_tune_up.py`](https://github.com/steelelab-delft/stlab/blob/master/AWG/Sequencer/Rabi_tone_tune_up.py) (Rabi tune-up), [`devices/instrument.py`](https://github.com/steelelab-delft/stlab/blob/master/devices/instrument.py) (VISA instrument), [`devices/Tektronics_Sequencer/AWG_programming_functions.py`](https://github.com/steelelab-delft/stlab/blob/master/devices/Tektronics_Sequencer/AWG_programming_functions.py) (AWG programming), [`devices/PNAN5222A.py`](https://github.com/steelelab-delft/stlab/blob/master/devices/PNAN5222A.py) (PNA extension)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_awg["AWG sequencing"]
  node_pulse["Pulse library<br/>[Pulse_lib.py]"]
  node_element["Sequence elements<br/>[element.py]"]
  node_sequence["Sequence model<br/>[sequence.py]"]
  node_station["AWG station<br/>[AWG_station.py]"]
  node_awgprogram["AWG programming"]
end

subgraph group_drivers["Instrument drivers"]
  node_awgdriver["AWG520 driver"]
  node_vna["PNA driver<br/>[PNAN5221A.py]"]
  node_pna2["PNA extension<br/>[PNAN5222A.py]"]
  node_basepna["VNA base<br/>[basepna.py]"]
  node_visa["VISA instrument<br/>[instrument.py]"]
  node_baseinstrument["Instrument base<br/>[base_instrument.py]"]
  node_awgdevice["Tektronix AWG"]
end

subgraph group_services["Lab services"]
  node_bfwrapper["BluFors client<br/>[BFWrapper.py]"]
  node_bfdaemon["BluFors daemon<br/>[BFDaemon.py]"]
  node_oldserver["Temperature server<br/>[server.py]"]
  node_mysocket["Socket helper<br/>[MySocket.py]"]
end

subgraph group_measurements["Measurement scripts"]
  node_rabi["Rabi tune-up"]
  node_twotone["Two-tone spectroscopy"]
  node_stark["Stark shifting<br/>[stark_shifter.py]"]
end

subgraph group_analysis["Analysis utilities"]
  node_s11fit["S11 fitting<br/>[S11fit.py]"]
  node_tlmodel["Transmission-line model<br/>[TLmodel.py]"]
  node_readdata["Data reading<br/>[readdata.py]"]
  node_writematrix["Matrix writing<br/>[writematrix.py]"]
  node_stlabdict["Measurement data<br/>[stlabdict.py]"]
end

node_researcher(("Experimenter"))
node_labinstruments(("Lab instruments"))
node_awgunit["Tektronix AWG hardware"]
node_temperaturecontrol["Fridge temperature control"]

node_researcher -->|"runs"| node_rabi
node_rabi -->|"constructs pulses"| node_pulse
node_rabi -->|"adds pulses"| node_element
node_rabi -->|"configures"| node_station
node_rabi -->|"uses"| node_sequence
node_rabi -->|"uses"| node_awgdriver
node_awgprogram -->|"creates"| node_pulse
node_awgprogram -->|"creates"| node_element
node_awgprogram -->|"configures"| node_awgdevice
node_awgdriver -->|"controls"| node_awgunit
node_awgdevice -->|"inherits"| node_visa
node_vna -->|"inherits"| node_basepna
node_pna2 -->|"uses"| node_vna
node_pna2 -->|"uses"| node_visa
node_basepna -->|"inherits"| node_visa
node_visa -->|"inherits"| node_baseinstrument
node_bfwrapper -->|"queries remotely"| node_temperaturecontrol
node_oldserver -->|"sends response"| node_mysocket
node_bfdaemon -.->|"serves readings"| node_temperaturecontrol

click node_rabi "https://github.com/steelelab-delft/stlab/blob/master/AWG/Sequencer/Rabi_tone_tune_up.py"
click node_pulse "https://github.com/steelelab-delft/stlab/blob/master/AWG/Sequencer/Pulse_lib.py"
click node_element "https://github.com/steelelab-delft/stlab/blob/master/AWG/Sequencer/element.py"
click node_sequence "https://github.com/steelelab-delft/stlab/blob/master/AWG/Sequencer/sequence.py"
click node_station "https://github.com/steelelab-delft/stlab/blob/master/AWG/Sequencer/AWG_station.py"
click node_awgdriver "https://github.com/steelelab-delft/stlab/blob/master/AWG/Sequencer/AWG520_driver_beta.py"
click node_awgprogram "https://github.com/steelelab-delft/stlab/blob/master/devices/Tektronics_Sequencer/AWG_programming_functions.py"
click node_vna "https://github.com/steelelab-delft/stlab/blob/master/devices/PNAN5221A.py"
click node_pna2 "https://github.com/steelelab-delft/stlab/blob/master/devices/PNAN5222A.py"
click node_basepna "https://github.com/steelelab-delft/stlab/blob/master/devices/basepna.py"
click node_visa "https://github.com/steelelab-delft/stlab/blob/master/devices/instrument.py"
click node_baseinstrument "https://github.com/steelelab-delft/stlab/blob/master/devices/base_instrument.py"
click node_awgdevice "https://github.com/steelelab-delft/stlab/blob/master/devices/Tektronix_AWG520.py"
click node_twotone "https://github.com/steelelab-delft/stlab/blob/master/advanced_measurements/TwoToneSpectroscopy.py"
click node_stark "https://github.com/steelelab-delft/stlab/blob/master/advanced_measurements/stark_shifter.py"
click node_bfwrapper "https://github.com/steelelab-delft/stlab/blob/master/devices/BFWrapper.py"
click node_bfdaemon "https://github.com/steelelab-delft/stlab/blob/master/devices/BFDaemon/BFDaemon.py"
click node_oldserver "https://github.com/steelelab-delft/stlab/blob/master/devices/BFDaemonOld/server/server.py"
click node_mysocket "https://github.com/steelelab-delft/stlab/blob/master/misc/MySocket.py"
click node_s11fit "https://github.com/steelelab-delft/stlab/blob/master/misc/S11fit.py"
click node_tlmodel "https://github.com/steelelab-delft/stlab/blob/master/misc/TLmodel.py"
click node_readdata "https://github.com/steelelab-delft/stlab/blob/master/misc/readdata.py"
click node_writematrix "https://github.com/steelelab-delft/stlab/blob/master/misc/writematrix.py"
click node_stlabdict "https://github.com/steelelab-delft/stlab/blob/master/misc/stlabdict.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pulse,node_element,node_sequence,node_station,node_awgprogram toneBlue
class node_awgdriver,node_vna,node_pna2,node_basepna,node_visa,node_baseinstrument,node_awgdevice toneAmber
class node_bfwrapper,node_bfdaemon,node_oldserver,node_mysocket toneMint
class node_rabi,node_twotone,node_stark toneRose
class node_s11fit,node_tlmodel,node_readdata,node_writematrix,node_stlabdict,node_researcher,node_labinstruments,node_awgunit,node_temperaturecontrol toneIndigo
```

## Components

### AWG sequencing

- [Pulse library](https://github.com/steelelab-delft/stlab/blob/master/AWG/Sequencer/Pulse_lib.py): `AWG/Sequencer/Pulse_lib.py`
- [Sequence elements](https://github.com/steelelab-delft/stlab/blob/master/AWG/Sequencer/element.py): `AWG/Sequencer/element.py`
- [Sequence model](https://github.com/steelelab-delft/stlab/blob/master/AWG/Sequencer/sequence.py): `AWG/Sequencer/sequence.py`
- [AWG station](https://github.com/steelelab-delft/stlab/blob/master/AWG/Sequencer/AWG_station.py): `AWG/Sequencer/AWG_station.py`
- [AWG programming](https://github.com/steelelab-delft/stlab/blob/master/devices/Tektronics_Sequencer/AWG_programming_functions.py): `devices/Tektronics_Sequencer/AWG_programming_functions.py`

### Instrument drivers

- [AWG520 driver](https://github.com/steelelab-delft/stlab/blob/master/AWG/Sequencer/AWG520_driver_beta.py): `AWG/Sequencer/AWG520_driver_beta.py`
- [PNA driver](https://github.com/steelelab-delft/stlab/blob/master/devices/PNAN5221A.py): `devices/PNAN5221A.py`
- [PNA extension](https://github.com/steelelab-delft/stlab/blob/master/devices/PNAN5222A.py): `devices/PNAN5222A.py`
- [VNA base](https://github.com/steelelab-delft/stlab/blob/master/devices/basepna.py): `devices/basepna.py`
- [VISA instrument](https://github.com/steelelab-delft/stlab/blob/master/devices/instrument.py): `devices/instrument.py`
- [Instrument base](https://github.com/steelelab-delft/stlab/blob/master/devices/base_instrument.py): `devices/base_instrument.py`
- [Tektronix AWG](https://github.com/steelelab-delft/stlab/blob/master/devices/Tektronix_AWG520.py): `devices/Tektronix_AWG520.py`

### Lab services

- [BluFors client](https://github.com/steelelab-delft/stlab/blob/master/devices/BFWrapper.py): `devices/BFWrapper.py`
- [BluFors daemon](https://github.com/steelelab-delft/stlab/blob/master/devices/BFDaemon/BFDaemon.py): `devices/BFDaemon/BFDaemon.py`
- [Temperature server](https://github.com/steelelab-delft/stlab/blob/master/devices/BFDaemonOld/server/server.py): `devices/BFDaemonOld/server/server.py`
- [Socket helper](https://github.com/steelelab-delft/stlab/blob/master/misc/MySocket.py): `misc/MySocket.py`

### Measurement scripts

- [Rabi tune-up](https://github.com/steelelab-delft/stlab/blob/master/AWG/Sequencer/Rabi_tone_tune_up.py): `AWG/Sequencer/Rabi_tone_tune_up.py`
- [Two-tone spectroscopy](https://github.com/steelelab-delft/stlab/blob/master/advanced_measurements/TwoToneSpectroscopy.py): `advanced_measurements/TwoToneSpectroscopy.py`
- [Stark shifting](https://github.com/steelelab-delft/stlab/blob/master/advanced_measurements/stark_shifter.py): `advanced_measurements/stark_shifter.py`

### Analysis utilities

- [S11 fitting](https://github.com/steelelab-delft/stlab/blob/master/misc/S11fit.py): `misc/S11fit.py`
- [Transmission-line model](https://github.com/steelelab-delft/stlab/blob/master/misc/TLmodel.py): `misc/TLmodel.py`
- [Data reading](https://github.com/steelelab-delft/stlab/blob/master/misc/readdata.py): `misc/readdata.py`
- [Matrix writing](https://github.com/steelelab-delft/stlab/blob/master/misc/writematrix.py): `misc/writematrix.py`
- [Measurement data](https://github.com/steelelab-delft/stlab/blob/master/misc/stlabdict.py): `misc/stlabdict.py`

### Other components

- **Experimenter**
- **Lab instruments**
- **Tektronix AWG hardware**
- **Fridge temperature control**

## Connections

- Experimenter → Rabi tune-up: runs (evidence: `AWG/Sequencer/Rabi_tone_tune_up.py`)
- Rabi tune-up → Pulse library: constructs pulses (evidence: `AWG/Sequencer/Rabi_tone_tune_up.py`)
- Rabi tune-up → Sequence elements: adds pulses (evidence: `AWG/Sequencer/Rabi_tone_tune_up.py`)
- Rabi tune-up → AWG station: configures (evidence: `AWG/Sequencer/Rabi_tone_tune_up.py`)
- Rabi tune-up → Sequence model: uses (evidence: `AWG/Sequencer/Rabi_tone_tune_up.py`)
- Rabi tune-up → AWG520 driver: uses (evidence: `AWG/Sequencer/Rabi_tone_tune_up.py`)
- AWG programming → Pulse library: creates (evidence: `devices/Tektronics_Sequencer/AWG_programming_functions.py`)
- AWG programming → Sequence elements: creates (evidence: `devices/Tektronics_Sequencer/AWG_programming_functions.py`)
- AWG programming → Tektronix AWG: configures (evidence: `devices/Tektronics_Sequencer/AWG_programming_functions.py`)
- AWG520 driver → Tektronix AWG hardware: controls (evidence: `AWG/Sequencer/AWG520_driver_beta.py`)
- Tektronix AWG → VISA instrument: inherits (evidence: `devices/Tektronix_AWG520.py`)
- PNA driver → VNA base: inherits (evidence: `devices/PNAN5221A.py`)
- PNA extension → PNA driver: uses (evidence: `devices/PNAN5222A.py`)
- PNA extension → VISA instrument: uses (evidence: `devices/PNAN5222A.py`)
- VNA base → VISA instrument: inherits (evidence: `devices/basepna.py`)
- VISA instrument → Instrument base: inherits (evidence: `devices/instrument.py`)
- BluFors client → Fridge temperature control: queries remotely (evidence: `devices/BFWrapper.py`)
- Temperature server → Socket helper: sends response (evidence: `devices/BFDaemonOld/server/server.py`)
- BluFors daemon → Fridge temperature control: serves readings
