Extension for pytket, providing access to IQM backends
Pytket is a python module providing an extensive set of tools for compiling and executing quantum circuits.
pytket-iqm is an extension to
pytket that allows
pytket circuits to be
executed on IQM's quantum devices and simulators.
pytket-iqm is available for Python 3.10, 3.11 and 3.12, on Linux, macOS
and Windows. To install, run:
pip install pytket-iqm
This will install
pytket if it isn't already installed, and add new classes
and methods into the
API documentation is available here.
To use the integration, initialise an
IQMBackend, construct a Pytket circuit,
compile it and run. Here is a small example of running a GHZ state circuit:
from pytket.extensions.iqm import IQMBackend
from pytket.circuit import Circuit
backend = IQMBackend(
circuit = Circuit(3, 3)
compiled_circuit = backend.get_compiled_circuit(circuit)
result = backend.run_circuit(compiled_circuit, n_shots=100)
The IQM Client documentation includes the [set of currently supported
pytket-iqm retrieves the set from the IQM backend during the initialisation;
get_compiled_circuit() takes care of compiling the circuit into the
form suitable to run on the backend.
During the backend initialisation,
pytket-iqm also retrieves the names of
physical qubits and qubit connectivity. You can override the qubit connectivity
by providing the
arch parameter to the
IQMBackend constructor, but it generally
does not make sense, since the IQM server reports the valid quantum architecture
relevant to the given backend URL.
(Note: At the moment IQM does not provide a quantum computing service open to the general public. Please contact our sales team to set up your access to an IQM quantum computer.)
Bugs and feature requests
Please file bugs and feature requests on the GitHub issue tracker.
To install an extension in editable mode, simply change to its subdirectory
modules directory, and run:
pip install -e .
Pull requests are welcome. To make a PR, first fork the repo, make your proposed
changes on the
develop 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 black, 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. Because of the way
extension modules embed themselves into the
pytket namespace this is a little
complicated, but it should be sufficient to run the script
(passing as a single argument the root directory of the module to test). The
mypy 0.800 or above.
We use pylint on the CI to check compliance
with a set of style requirements (listed in
.pylintrc). You should run
pylint over any changed files before submitting a PR, to catch any issues.
To run the tests:
pip install -r test-requirements.txt
By default, the remote tests, which run against the real backend server, are skipped. To enable them, set the following environment variables:
When adding a new feature, please add a test for it. When fixing a bug, please add a test that demonstrates the fix.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for pytket_iqm-0.11.0-py3-none-any.whl