Installation#
Note
This section is intended for those who will use the QC2-owned quantum hardware. All steps below are meant to be run on the remote lab PC, not on your local machine.
Prerequisites#
Python 3.12 or newer
uv for workspace & dependency management
Before installing, make sure you have completed the hardware-access setup described on the Autocalibration Confluence page:
an account on the lab PC you will use;
a reserved (and documented) Redis port on that PC;
access to the shared calendar to book QPU time slots.
Install the suite#
The whole toolkit is a single uv workspace. Clone it and sync everything —
including the internal links between bragi_quantum.experiments, bragi_quantum.datalayer, bragi_quantum.api and bragi_quantum.gui — with one
command:
git clone https://git.chalmers.se/mc2/qt/qc/bragi-quantum.git
cd bragi-quantum
uv sync
uv sync creates a managed virtual environment in .venv and installs all
four packages in editable mode so they work together.
Activate the environment:
source .venv/bin/activate # macOS / Linux
.venv\Scripts\activate # Windows
Alternatively, prefix commands with uv run to execute them in the managed
environment without activating it, e.g. uv run python examples/scripts/introduction/my_first_resonator_spectroscopy.py.
Optional dependency groups#
Extra tooling lives in dependency groups installed with --group:
uv sync --group test # pytest + coverage
uv sync --group dev # pre-commit, linters, formatters
uv sync --group docs # Sphinx toolchain to build this documentation, incl. PyQt6
uv sync --all-groups # everything
Note
PyQt6 lives in the docs group, not the base install. A plain
uv sync will not provide it — if something you’re running needs it,
install with uv sync --group docs (or --all-groups).
Verify the installation#
import bragi_quantum.experiments, bragi_quantum.datalayer, bragi_quantum.api, bragi_quantum.gui
print("The suite is synchronized.")
Building the documentation#
The documentation you are reading is built with Sphinx. Install the docs
group and build the HTML:
uv sync --group docs
make -C docs html
The rendered site is written to docs/_build/html/index.html. Tutorial
notebooks are not executed at build time (they require the quantum
hardware) — they are shipped with their saved outputs.
Development & linting#
This project uses pre-commit to maintain code quality. Set up the git hooks:
uv run pre-commit install
uv run pre-commit install --hook-type post-commit
The pre-commit hook enforces formatting and linting (black, ruff, isort, …).
The post-commit hook runs
utils_scripts/standardize_headers.py, which writes the standard license header into every.pyfile (deriving the contributor list fromgit log). Files it updates appear as unstaged changes — stage and commit them as a follow-up.
To run the linting checks manually:
uv run pre-commit run --all-files