thank you for your interest in Graphix!
The aim of graphix is to make the measurement-based quantum computing (MBQC) accessible by creating a one-stop environment to study and research MBQC.
We recommend to fork the repository before working on new features, whether that being an existing issue or your own idea.
Once created, you'll need to clone the repository, and you can follow below to set up the environment. We recommend you use a project manager like uv, but you may prefer to manage your own virtual environment with conda env or pipenv.
git clone git@github.com:<username>/graphix.git
cd graphix
pip install uv
uv sync --extra devTo run individual checks:
uv run ruff check .
uv run ruff format --check .
uv run mypy
uv run pyright
uv run pytestYou can also run the full CI test suite locally:
uv run noxBefore committing, format the code and check test coverage:
uv run ruff check --fix .
uv run ruff format .
uv run pytest --cov=./graphix --cov-report=xml --cov-report=term --doctest-modulesIf you use VS Code for development, add a .vscode/settings.json file to
enable the linter and basic type checking on save:
{
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.organizeImports.ruff": "explicit",
"source.fixAll.ruff": "explicit"
}
},
"python.analysis.typeCheckingMode": "basic"
}If graphix is installed with uv sync or pip install -e, mypy may fail to type-check other Python projects that import graphix, showing the following error:
error: Skipping analyzing "graphix": module is installed, but missing library stubs or py.typed marker [import-untyped]
To work around this, install graphix in strict editable mode:
uv sync --config-setting editable_mode=strictOr similarly with pip:
pip install -e . --config-setting editable_mode=strictSee pypa/setuptools#3518 for more details.