Installation¶
MQT ProblemSolver 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.problemsolver
python -m pip install mqt.problemsolver
Verify the installation:
python -c "import mqt.problemsolver; print(mqt.problemsolver.__version__)"
This prints the installed package version.
Integrating MQT ProblemSolver into Your Project¶
To use the MQT ProblemSolver 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.problemsolver
[project]
# ...
dependencies = ["mqt.problemsolver>=<version>"]
# ...
from setuptools import setup
setup(
# ...
install_requires=["mqt.problemsolver>=<version>"],
# ...
)
Development Setup¶
Set up a reproducible development environment for MQT ProblemSolver. 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/problemsolver 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/problemsolver.git mqt-problemsolverIf you have write access to the munich-quantum-toolkit/problemsolver repository, clone the repository locally.
git clone git@github.com/munich-quantum-toolkit/problemsolver.git mqt-problemsolverChange into the project directory:
cd mqt-problemsolverCreate a branch for local development:
git checkout -b name-of-your-bugfix-or-featureNow 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 syncIf 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 python -m pip install -U pip 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 lintThey 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 | shpowershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prek/releases/latest/download/prek-installer.ps1 | iex"uv tool install prekThen run:
prek install