How neonel21/qkit-gla works
What this repository is
Qkit is a Python-based quantum measurement framework. Its architecture centers on three concerns: controlling laboratory hardware, orchestrating measurement runs, and storing/analyzing the resulting data. The repository is organized as a reusable package plus notebooks, GUI tools, and hardware/service extensions.
Core startup and runtime bootstrap
The qkit.core package is the runtime backbone. Startup is not a single monolith; it is assembled through staged initialization modules in qkit/core/s_init, which handle logging, directory setup, module discovery, update checks, service loading, instrument creation, and final user initialization. This makes startup a pipeline of environment preparation, hardware/service binding, then session readiness.
Instrument abstraction layer
Hardware access is concentrated in qkit/core/instrument_base*, instrument_tools.py, and the large qkit/drivers collection. Drivers wrap specific device families such as VNAs, microwave sources, AWGs, DAQs, power supplies, cryostat controllers, and virtual/dummy instruments. The architectural boundary here is “instrument interface vs. concrete hardware implementation,” allowing measurement code to depend on a common driver contract rather than vendor APIs directly.
Measurement orchestration layer
The qkit.measure package defines how experiments are structured. It contains shared measurement base classes, sample/JSON handling, and domain-specific measurement modules for spectroscopy, transport, oscilloscope, and time-domain experiments. Time-domain support is especially layered, with waveform generation, pulse sequences, AWG loading, and Quantum Machines integration separated into distinct submodules.
Data flow from instruments to stored experiments
Typical runtime flow is: notebook or GUI triggers a measurement object → measurement code talks to instrument drivers → acquired arrays/scalars are written into the storage layer → analysis and viewers consume the saved HDF5 output. The repository’s design clearly separates live acquisition from persisted data handling, which is important for traceability and post-processing.
Storage subsystem
Persistent experiment data is handled by qkit.storage, which is HDF5-centric and built around file, dataset, library, and view helpers. This is the primary data boundary in the system: the measurement layer produces structured data, while the storage layer owns file organization, metadata, date/time handling, and HDF5-specific conventions. The README and docs indicate support for 1D/2D/3D data plus a viewer.
Analysis and fitting subsystem
qkit.analysis contains post-acquisition computation tools: resonator fitting, circle fits, IV-curve analysis, avoided crossing fits, point tracking, and related helpers. This is not part of the measurement path; it is downstream of storage and is intended for notebook-driven or offline analysis. The circle-fit subpackage is a notable specialized subsystem with both “classic” and newer implementations.
User-facing interaction: notebooks and GUI
The repo exposes two main interaction styles. First, Jupyter notebooks/templates under qkit/doc/notebooks and templates/ provide the primary scripting and tutorial surface for experiments and analysis. Second, qkit.gui provides graphical tools such as qviewkit and plotting helpers for browsing data and monitoring runs. The launch scripts and jupyter_lab_config.py indicate that notebook-based operation is a first-class runtime mode.
Communication and network services
qkit.core.lib.com and qkit.core.lib.network support internal communication patterns, including TCP client utilities and signal-based service coordination. This is complemented by a set of service-oriented components under qkit/services, which provide standalone or companion processes for lab infrastructure rather than direct measurement logic.
External/service-oriented device control
The qkit.services tree contains hardware-facing service processes such as switchboxes, nitrogen control, cryostat/fridge monitoring, step attenuator servers, and other Raspberry Pi–style utility servers. These services act as remote control or automation endpoints for equipment that is better managed outside the main measurement process, often via local network or process boundaries.
Documentation, examples, and sample data
The qkit/doc tree is substantial and includes notebooks, sample HDF5 data, and Sphinx docs. This is not just documentation; it reflects how the framework is intended to be used: interactive notebooks for measurements and analysis, sample artifacts for reproducibility, and generated docs for module-level discovery. The templates in templates/ reinforce that new experiments are expected to start from notebook templates.
Main entry points: measurement_base.py Measure · s_init Startup · __init__.py Services · hdf_file.py Storage
Components 21
Runtime
Startup, hardware access, and measurement execution
- Startup · Staged initialization for logging, directories, services, instruments, and user startup.
qkit/core/s_init - Core · Main package entry points and runtime coordination helpers.
qkit/core/__init__.py - Instruments · Common instrument base classes and tooling that define the driver contract.
qkit/core/instrument_base.py - Drivers · Concrete instrument implementations for VNAs, sources, AWGs, DAQs, cryo hardware, and virtual devices.
qkit/drivers/__init__.py - Measure · Measurement base classes, JSON/sample handling, and experiment coordination.
qkit/measure/measurement_base.py - Spectroscopy · Spectroscopy-specific measurement flows and helpers.
qkit/measure/spectroscopy/spectroscopy.py - Transport · Transport and IV-style measurement routines.
qkit/measure/transport/transport.py - Time Domain · Pulse-based experiments, waveform generation, AWG loading, and Quantum Machines support.
qkit/measure/timedomain/measure_td.py - AWG Pipeline · Waveform generation and AWG/tAWG loading utilities.
qkit/measure/timedomain/awg/generate_waveform.py - QM Layer · Quantum Machines qubit experiment wrappers, configs, and scripts.
qkit/measure/timedomain/quantum_machine/qm_qkit_wrapper.py
Data
Persistence and offline analysis
- Storage · HDF5 file, dataset, library, and view handling for persisted experiment data.
qkit/storage/hdf_file.py - Analysis · Post-acquisition fitting, tracking, and resonator analysis tools.
qkit/analysis/__init__.py - Circle Fit · Specialized resonator circle-fit implementations and calibration helpers.
qkit/analysis/circle_fit/circle_fit_classic/circlefit.py
User Interfaces
Notebook and GUI entry points
Extensions
Standalone service processes and device-side helpers
- Services · Standalone control and monitoring services for lab infrastructure.
qkit/services/__init__.py - Raspi Misc · Raspberry Pi-style control servers for cryo, nitrogen, attenuators, motors, and related utilities.
qkit/services/raspi_misc - SurveilKit · Monitoring client/server and GUI for cryostat or facility supervision.
qkit/services/qsurveilkit - Config · Environment-specific configuration templates and runtime settings.
qkit/config/environment.py
Docs & Templates
Tutorials, samples, and experiment templates
- Templates · Starter notebook templates for new measurement and analysis workflows.
templates
Connections 26
- Core → Startup: boots · Core runtime is initialized through the staged startup pipeline.
- Startup → Config: loads · Startup resolves environment and service configuration.
- Startup → Instruments: creates · Startup prepares instrument abstractions and device registry.
- Startup → Services: binds · Startup can load service endpoints and companion processes.
- Instruments → Drivers: implements · Drivers provide concrete hardware backends behind the shared interface.
- Measure → Instruments: uses · Measurement orchestration talks to instruments through the common API.
- Measure → Storage: writes · Measurements persist results and metadata into HDF5 storage.
- Measure → Spectroscopy: specializes · Spectroscopy builds on the shared measurement base.
- Measure → Transport: specializes · Transport experiments build on the shared measurement base.
- Measure → Time Domain: specializes · Time-domain experiments build on the shared measurement base.
- Time Domain → AWG Pipeline: includes · Time-domain experiments depend on waveform generation and AWG loading.
- Time Domain → QM Layer: includes · Time-domain experiments can delegate to Quantum Machines integrations.
- AWG Pipeline → Drivers: loads · AWG pipelines push sequences to instrument drivers.
- QM Layer → Drivers: controls · QM experiments coordinate hardware through driver-backed interfaces.
- Storage → Analysis: feeds · Persisted experiment data is consumed by offline analysis.
- Analysis → Circle Fit: contains · Circle-fit routines are a central analysis specialization.
- GUI → QViewKit: hosts · The GUI package includes the main data viewer application.
- GUI → Storage: browses · GUI tools read saved HDF5 experiments for inspection.
- Notebooks → Measure: drives · Notebook workflows commonly instantiate and run measurements.
- Notebooks → Analysis: explores · Notebooks are also used for post-processing and fitting.
- Templates → Notebooks: starts from · Templates seed new notebook-based workflows.
- Services → Raspi Misc: includes · The services tree includes multiple Raspberry Pi utility servers.
- Services → SurveilKit: includes · The services tree includes monitoring and supervision tooling.
- Raspi Misc → Drivers: mirrors · Service processes often expose device control used by drivers or clients.
- SurveilKit → Storage: observes · Monitoring services can track lab state and related data.
- Config → Services: configures · Configuration determines which services and devices are available.