Thank you for considering contributing to Divi!
Divi is an open-source Python library designed for distributed quantum program execution. Whether you're here to fix bugs, improve documentation, build new features, or test our code on different platforms, your contributions are highly appreciated.
- Examples written in the Divi framework (divi-examples)
- Bug fixes
- New features or enhancements
- Benchmarking and testing improvements
- Backend integrations
- Local simulator integrations
Click "Fork" at the top right of the main repository and clone your fork:
git clone https://github.com/your-username/divi.git
cd diviDivi uses uv for dependency management:
curl -LsSf https://astral.sh/uv/install.sh | shThis installs the dev, testing, and docs groups by default:
uv syncFor AI work, add the extra:
uv sync --extra ai # divi-ai dependenciesWe use pre-commit hooks to enforce formatting and license headers automatically:
pre-commit installYou can run all hooks manually with:
pre-commit run -a- Create a new branch with a descriptive name, e.g.
git checkout -b feature/implementation-of-qaoa - Make your changes
- Add or update tests for new behaviour
- Ensure all tests pass (see Testing below)
- Format the code (see Code Style below)
- Push your code and create a pull request
We use the following tools for formatting:
- Black for code formatting
- isort for import sorting (configured with the Black profile)
- autoflake for removing unused imports (runs via pre-commit)
Run all formatters before committing:
uv run black .
uv run isort .All new or updated .py files (outside docs/) must include the license header from LICENSES/.license-header. This is enforced by pre-commit hooks.
Run the full test suite with:
uv run pytestFor faster runs:
uv run pytest -n auto| Marker | Description |
|---|---|
requires_api_key |
Cloud API tests (need a Qoro API key) |
algo |
Algorithm-level tests |
e2e |
Slow integration tests (run only when explicitly requested) |
API tests require a Qoro API key. Set the QORO_API_KEY environment variable or use the --api-key option:
QORO_API_KEY=your-key uv run pytest --run-api-tests
# or
uv run pytest --run-api-tests --api-key your-keyuv run pytest --cov=diviuv sync --group docscd docs
make buildcd docs
make devcd docs
make serveWe follow Conventional Commits. This is enforced by a commit-msg hook.
Examples:
feat: add beam search aggregation strategy
fix: resolve duplicate object warnings in docs
docs: update backends user guide with execution config
test: add auth token resolution tests
If you have questions or want to discuss a feature before starting work, feel free to open an issue or start a discussion on the repository.