qualang-tools
raw JSON → 0.22.0 verified Mon Apr 27 auth: no python
A Python package providing tools and utilities for QUA quantum control programs, developed by the QUA platform team. It includes functionality for wiring, configuration, data handling, and integration with QOP (Quantum Orchestration Platform). Current version 0.22.0, requires Python 3.9-3.13, with regular releases on GitHub.
pip install qualang-tools Common errors
error ModuleNotFoundError: No module named 'qualang_tools' ↓
cause Package not installed or typo in package name (underscore vs hyphen).
fix
Install using 'pip install qualang-tools' and import with 'import qualang_tools'.
error AttributeError: module 'qualang_tools' has no attribute 'Program' ↓
cause Importing Program from qualang_tools instead of from qm.qua.
fix
Use 'from qm.qua import Program'.
error qm_qua version mismatch: qualang-tools requires qm-qua >= 1.2.3 ↓
cause Installed qm-qua version is too old.
fix
Upgrade qm-qua: pip install --upgrade qm-qua.
Warnings
deprecated Use of 'fetch_all' has been replaced by 'fetch_results' since qm-qua>=1.2.3. ↓
fix Replace fetch_all with fetch_results.
breaking Breaking change in v0.21.0: qm-qua requirement bumped to >=1.2.3; callable_from_qua may break with older qm-qua. ↓
fix Upgrade qm-qua to 1.2.3 or later.
breaking Breaking change in v0.20.0: callable_from_qua not compatible with qm-qua <= 1.2.0. ↓
fix Upgrade qm-qua to >=1.2.2 or later.
gotcha Be careful with the import: 'from qm.qua import Program', not from qualang_tools. ↓
fix Use correct import path from qm-qua library.
Imports
- qmm
from qm import QuantumMachinesManager as qmm - simulate wrong
from qualang_tools import simulatecorrectfrom qm.qua import simulate - Program wrong
from qualang_tools.qua import Programcorrectfrom qm.qua import Program
Quickstart
from qualang_tools.wirer import ConnectivityQuantumDotQubits
from qm import QuantumMachinesManager
from qm.qua import Program, simulate
import os
qop_ip = os.environ.get('QOP_IP', 'localhost')
qmm = QuantumMachinesManager(host=qop_ip)
# Example: create a simple QUA program
with Program() as prog:
pass
# Simulate
simulate(qmm, prog)