Installation¶
MQT QECC is a Python package available on PyPI. It can be installed on all major operating systems with all officially supported Python versions.
Tip
We recommend using uv.
It is a fast Python package and project manager by Astral (creators of ruff).
It can replace pip and virtualenv, automatically manages virtual environments, installs packages, and can install Python itself.
It is significantly faster than pip.
If you do not have uv installed, install it with:
$ curl -LsSf https://astral.sh/uv/install.sh | sh
$ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
See the uv documentation for more information.
$ uv pip install mqt.qecc
(.venv) $ python -m pip install mqt.qecc
Verify the installation:
(.venv) $ python -c "import mqt.qecc; print(mqt.qecc.__version__)"
This prints the installed package version.
Integrating MQT QECC into Your Project¶
To use the MQT QECC Python package in your project, add it as a dependency in your pyproject.toml or setup.py.
This ensures the package is installed when your project is installed.
$ uv add mqt.qecc
[project]
# ...
dependencies = ["mqt.qecc>=<version>"]
# ...
from setuptools import setup
setup(
# ...
install_requires=["mqt.qecc>=<version>"],
# ...
)
Development Setup¶
Set up a reproducible development environment for MQT QECC. This is the recommended starting point for both bug fixes and new features. For detailed guidelines and workflows, see Contributing.
Get the code:
If you do not have write access to the munich-quantum-toolkit/qecc repository, fork the repository on GitHub (see https://docs.github.com/en/get-started/quickstart/fork-a-repo) and clone your fork locally.
$ git clone git@github.com:your_name_here/qecc.git mqt-qecc
If you have write access to the munich-quantum-toolkit/qecc repository, clone the repository locally.
$ git clone git@github.com/munich-quantum-toolkit/qecc.git mqt-qecc
Change into the project directory:
$ cd mqt-qecc
Create a branch for local development:
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
Install the project and its development dependencies:
We highly recommend using modern, fast tooling for the development workflow. We recommend using
uv. If you don’t haveuv, follow the installation instructions in the recommendation above (see tip above). See the uv documentation for more information.Install the project (including development dependencies) with
uv:$ uv sync
If you really don’t want to use
uv, you can install the project and the development dependencies into a virtual environment usingpip.$ python -m venv .venv $ source ./.venv/bin/activate (.venv) $ python -m pip install -U pip (.venv) $ python -m pip install -e . --group dev
Install pre-commit hooks to ensure code quality:
The project uses pre-commit hooks for running linters and formatting tools on each commit. These checks can be run manually via
nox, by running:$ nox -s lint
They can also be run automatically on every commit via
prek(recommended). To set this up, installprek, e.g., via:$ curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/latest/download/prek-installer.sh | sh
$ powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prek/releases/latest/download/prek-installer.ps1 | iex"
$ uv tool install prek
Then run:
$ prek install