Skip to main content

cmtqoutilities

PyPI

cmtqoutilities is a Python toolkit that provides high-level APIs to control and automate a diverse range of laboratory hardware devices used in quantum optics and condensed matter experiments. The package offers abstraction layers for devices such as pressure controllers, serial interfaces, positioning stages, databases, and data acquisition tools.


🚀 Key Features

  • 🧪 Experiment automation through a unified Operator class
  • 📡 Instrument control for Zaber actuators, Numato relays, Picoscope oscilloscopes, Atto IDS3010 sensors, and more
  • 🧾 Database integration for logging and tracking experimental metadata
  • 🗃️ Filesystem and code snapshot utilities for reproducible research
  • ⚙️ Cross-platform support for Windows and Unix-like systems

🧱 Module Overview

modOp.py

Defines the Operator class — a central controller for experiments, handling setup configuration, data and code paths, database connections, and version management.

notify.py

Status messages to the cmtqo Element room through a hookshot webhook. Give the Operator the URL (Operator(..., webhook="https://hookshot.mbot.ethz.ch/webhook/<id>")) or set the environment variable MODOP_WEBHOOK, or put the URL on one line in ~/.webhook next to ~/.passwd (the file that holds the database password); without any of these, nothing is posted. Every non-test runExperiment() then announces its start (operator, type, intention, comment, script, data folder) and, from inside the detached run.py, its end with the elapsed time or, if it dies, the tail of the traceback. Test runs (test=True) stay silent. Arbitrary progress messages go out with op.notify("scan 3/10 done"), from the notebook or from within the experiment script, prefixed with setup name and mid; from utilities.notify import notify is the bare function. A failing webhook only prints a warning and never interrupts a measurement.

database.py

Handles experimental metadata logging, MySQL interactions, and retrieval of recent or historical experiment data.

pressureControl.py

Provides an interface to communicate with pressure controllers over serial, supporting pressure reading and basic control commands.

zaber*.py

Multiple modules to control Zaber linear actuators (LRQ600, LSQ150, etc.), supporting movement, homing, and axis configuration. The legacy modules (zaberLRQ600, zaberLRQ600YZ, zaberLRQ600XYZ, zaberLSQ150) each hard-code one configuration with a single microstep size. New setups use zaberChain, where every axis carries its own model, device number, microstep, travel and direction, read from the device documentation below:

from utilities import zaberChain as zc
stage = zc.ZaberChain('/dev/zaber0')          # default zc.SENSORHEAD: X-LRQ600BL-E01 x=1, y=2 + X-LSM025A-E03 z=3
stage.home(); stage.getPos(); stage.moveTo([10, 20, 5]); stage.moveAxis('z', 5.2); stage.setCoordSys('here')
stage.fullStep('x')                           # microstepping period for knife_edge.fit_edge(periodic=True)
stage.checkSettings(); stage.warnings(); stage.info()
# another chain: zc.ZaberChain(port, axes=[zc.Axis('x', 1, 'X-LRQ600BL-E01', invert=True), zc.Axis('z', 2, 'X-LSM025A-E03')])

Device documentation (links to the ASCII protocol manual, datasheet and the factory default settings) is shipped with the package: from utilities import devices; devices.list(); print(devices.doc("X-LRQ600BL-E01")) (sources in utilities/devices/). The factory defaults are in utilities/devices/<device>.json, and zaberLRQ600.checkSettings(stage, axis) lists every live setting that differs from them (modified soft limits, speeds, ...). Manufacturer PDFs are archived on the group share (//home.phys.ethz.ch/cmtqo/manuals/), not in this repository.

numatoLabRL002.py

Enables control of Numato Lab USB relay modules for hardware switching tasks.

picoscope.py, ps4000a.py

Modules for acquiring data from PicoTech oscilloscopes (e.g. PS4000 series), integrating with the experiment automation flow.

attoIDS3010.py

Interface to Atto IDS3010 displacement sensors, providing sub-nanometer position measurement capabilities.

operatorManualSetup.py

Support functions for setting up manual experimental configurations, such as pre-alignment or testing.

picam.py, photodiode.py

HTTP clients for the daemons on the experiment Raspberry Pi (deployed with delicont): the HQ camera (picam-server) and the knife-edge photodiode readout (pd-server, ADS1115). knife_edge.py has the scan helper and the erf / w(z) fits for beam-size measurements.

Device clients from their own packages: digipigi, delimux, stitchlockin

These devices keep client and documentation in their own repositories and publish a client package on PyPI. cmtqoutilities depends on them and re-exports them, so every client is reached the same way:

from utilities import digipigi, delimux, stitchlockin, picam, photodiode

Use attribute access afterwards (dp = digipigi.DigiPigi(HOST="digipigi1")); don't deep-import through the alias (from utilities.digipigi.x import ... loads the module a second time).


📦 Installation

The modop infrastructure to run experiments is optimally enabled in the following way: Create a virtual environment as

python -m venv ~/.ve/modop

Then activate it and install the cmtqoutilities package

source ~/.ve/modop/bin/activate
pip install cmtqoutilities

or in a windows power shell

~/.ve/modop/Scripts/Activate.ps1
pip install cmtqoutilities

While still in the modop virtual environment install the kernel

python -m ipykernel install --user --name=modop --display-name "Python (modop)"

You can then develop in ipython notebooks and run the experiments with the mopdop infrastructure.

Requires Python 3.8 or higher. Dependencies include numpy, scipy, requests, pyserial, pymysql, nbconvert, jupyter, the device client packages digipigi, delimux and stitchlockin, and hardware-specific libraries.

Metadata

Release files for cmtqoutilities 0.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cmtqoutilities 0.11.0
File Size Uploaded Provenance Actions
cmtqoutilities-0.11.0.tar.gz 77.8 kB Without provenance Details for cmtqoutilities-0.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cmtqoutilities 0.11.0
File Interpreter ABI Platform Actions
cmtqoutilities-0.11.0-py3-none-any.whl Python 3 none any Details for cmtqoutilities-0.11.0-py3-none-any.whl

Total release size: 175.1 kB

Release files / cmtqoutilities-0.11.0.tar.gz

Download URL cmtqoutilities-0.11.0.tar.gz
Size 77.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4aef0fc51fa723e1b6da12f4706b100ffffdfb32fcfd990c63e9d91d2ba72931
BLAKE2b-256 checksum
How to use checksums
c2636ec7cd9d4d5abf578ecdae880801af79dfb64c92431e40590221c7f632d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release files / cmtqoutilities-0.11.0-py3-none-any.whl

Download URL cmtqoutilities-0.11.0-py3-none-any.whl
Size 97.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8366d4fd4efcaabbe0498ad3ae052ac0b42c0a910deeff36d4b4b92d34c3f743
BLAKE2b-256 checksum
How to use checksums
9d22e87d4d08f8d81526f14fb179de43784817b5801bfab05871285e1d85c455
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Security for cmtqoutilities 0.11.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.11.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page