Overview
Stanza is a Python framework for building tune-up sequences for quantum devices. It provides a clean, type-safe architecture that separates device configuration from routine implementation, with automatic logging and resource management.
What is Stanza?
Stanza helps you characterize and calibrate quantum devices by providing:
- YAML-based device configuration - Define your device topology once, reuse it everywhere
- Decorator-based routines - Write tune-up sequences as simple Python functions
- Automatic logging - Sessions and data are logged automatically in HDF5 or JSONL formats
- Resource management - Access devices, loggers, and instruments through a unified context
- Result chaining - Build complex workflows by passing results between routines
- Type safety - Built on Pydantic for configuration validation and type checking
Architecture
Stanza separates concerns into three layers:
1. Configuration Layer (YAML)
Define your device topology, routine parameters, and instrument connections:
2. Routine Layer (Python)
Implement your tune-up logic as decorated functions:
3. Execution Layer (Runner)
Orchestrate resources, merge parameters, and execute routines:
Key Features
Device Abstraction
Access quantum devices through a unified interface:
Automatic Logging
Data is logged automatically when you use a RoutineRunner
:
Result Chaining
Build multi-step workflows by accessing results from previous routines:
Nested Routines
Organize complex tune-up sequences hierarchically:
Execute all nested routines with a single call:
Supported Instruments
Stanza includes drivers for:
- QDAC-II (QDevil) - Control and measurement via TCPIP
- OPX (Quantum Machines) - RF measurement with QUA integration
Custom drivers can be implemented using the protocol-based interface.
Installation
Install the base package:
Or with Quantum Machines support:
Next Steps
- Quickstart Guide - Get up and running in 5 minutes
- Device Configuration - Learn how to configure devices
- Routines - Write your first tune-up sequence
- Data Logging - Understand logging and data formats
- Drivers - Implement custom instrument drivers