Pytket is a python module for interfacing with tket, a quantum computing toolkit and optimising compiler developed by Quantinuum.
pytket-qiskit is an extension to pytket that allows pytket circuits to be
executed on IBM Quantum backends and simulators via Qiskit, and provides conversion utilities between pytket and Qiskit circuit representations.
Some useful links:
pytket-qiskit is compatible with Python versions 3.10 to 3.13 on Linux, MacOS
and Windows. To install, run:
pip install pytket-qiskitThis will install pytket if it isn't already installed, and add new classes
and methods into the pytket.extensions namespace.
Please file bugs and feature requests on the Github issue tracker.
To install an extension in editable mode run:
pip install -e .We have set up the repo to be used with uv. You can use also:
uv sync --python 3.12to install the package. This will automatically pick up all requirements for the tests as well.
Pull requests are welcome. To make a PR, first fork the repo, make your proposed
changes on the main branch, and open a PR from your fork. If it passes
tests and is accepted after review, it will be merged in.
All code should be formatted using ruff, with default options. This is checked on the CI.
On the CI, mypy is used as a static
type checker and all submissions must pass its checks. You should therefore run
mypy locally on any changed files before submitting a PR. You can run them with:
uv run mypy --config-file=mypy.ini --no-incremental --explicit-package-bases pytket testsWe use ruff on the CI to check compliance with a set of style requirements (listed in ruff.toml).
You should run ruff over any changed files before submitting a PR, to catch any issues.
An easy way to meet all formatting and linting requirements is to issue pre-commit run --all-files.
If you are using uv running uv run pre-commit run --all-files --show-diff-on-failure will install the package and run all the checks.
To run the tests for this module:
- ensure you have installed
pytest,hypothesis, and any modules listed in thedev-dependenciessection of thepyproject.tomlfile; (If you are using uv this will be picked up automatically.) - run
pytest.
When adding a new feature, please add a test for it. When fixing a bug, please add a test that demonstrates the fix.