{"id":22882492,"url":"https://github.com/cqcl/pytket-iqm","last_synced_at":"2025-05-07T04:48:20.076Z","repository":{"id":50345230,"uuid":"518809312","full_name":"CQCL/pytket-iqm","owner":"CQCL","description":"pytket-iqm, extensions for pytket quantum SDK","archived":false,"fork":false,"pushed_at":"2025-04-25T13:01:37.000Z","size":6822,"stargazers_count":4,"open_issues_count":3,"forks_count":5,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-07T04:48:03.797Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CQCL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-28T10:57:36.000Z","updated_at":"2025-04-02T12:06:41.000Z","dependencies_parsed_at":"2023-02-05T17:16:01.616Z","dependency_job_id":"d5f9b8e0-0982-4f63-8382-f1cacc2b16b6","html_url":"https://github.com/CQCL/pytket-iqm","commit_stats":{"total_commits":33,"total_committers":6,"mean_commits":5.5,"dds":0.3939393939393939,"last_synced_commit":"474a15e04bb9a86aa6691dc40eefdc4e91fc724e"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Fpytket-iqm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Fpytket-iqm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Fpytket-iqm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Fpytket-iqm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CQCL","download_url":"https://codeload.github.com/CQCL/pytket-iqm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252816523,"owners_count":21808702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T18:17:58.681Z","updated_at":"2025-05-07T04:48:20.067Z","avatar_url":"https://github.com/CQCL.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pytket-iqm\n\n[![Slack](https://img.shields.io/badge/Slack-4A154B?style=for-the-badge\u0026logo=slack\u0026logoColor=white)](https://tketusers.slack.com/join/shared_invite/zt-18qmsamj9-UqQFVdkRzxnXCcKtcarLRA#)\n[![Stack Exchange](https://img.shields.io/badge/StackExchange-%23ffffff.svg?style=for-the-badge\u0026logo=StackExchange)](https://quantumcomputing.stackexchange.com/tags/pytket)\n\n[Pytket](https://tket.quantinuum.com/api-docs/index.html) is a python module\nproviding an extensive set of tools for compiling and executing quantum circuits.\n\n`pytket-iqm` is an extension to `pytket` that allows `pytket` circuits to be\nexecuted on [IQM](https://meetiqm.com/)'s quantum devices and simulators.\n\nSome useful links:\n- [API Documentation](https://tket.quantinuum.com/extensions/pytket-iqm/)\n\n## Getting started\n\n`pytket-iqm` is available for Python 3.10, 3.11 and 3.12, on Linux, macOS\nand Windows. To install, run:\n\n```shell\npip install pytket-iqm\n```\n\nThis will install `pytket` if it isn't already installed, and add new classes\nand methods into the `pytket.extensions` namespace.\n\nAPI documentation is available\n[here](https://tket.quantinuum.com/extensions/pytket-iqm/).\n\nUnder the hood, `pytket-iqm` uses `iqm-client` to interact with the devices. See\nthe IQM Client [documentation](https://iqm-finland.github.io/iqm-client/) and\nPytket [documentation](https://tket.quantinuum.com/api-docs/) for more info.\n\nTo use the integration, initialise an `IQMBackend`, construct a Pytket circuit,\ncompile it and run. Here is a small example of running a GHZ state circuit:\n\n```python\nfrom pytket.extensions.iqm import IQMBackend\nfrom pytket.circuit import Circuit\n\nbackend = IQMBackend(device=\"garnet\", api_token=\"API_TOKEN\")\n\ncircuit = Circuit(3, 3)\ncircuit.H(0)\ncircuit.CX(0, 1)\ncircuit.CX(0, 2)\ncircuit.measure_all()\ncompiled_circuit = backend.get_compiled_circuit(circuit)\n\nresult = backend.run_circuit(compiled_circuit, n_shots=100)\nprint(result.get_shots())\n```\n\nNote that the API token can be provided explicitly as an argument when\nconstructing the backend; alternatively it can be stored in pytket config (see\n`IQMConfig.set_iqm_config()`); or it can be stored in a file whose location is\ngiven by the environment variable `IQM_TOKENS_FILE`.\n\nThe IQM Client documentation includes the [set of currently supported\ninstructions]\n(https://iqm-finland.github.io/iqm-client/api/iqm.iqm_client.models.Instruction.html).\n`pytket-iqm` retrieves the set from the IQM backend during the initialisation;\nthen `get_compiled_circuit()` takes care of compiling the circuit into the\nform suitable to run on the backend.\n\nDuring the backend initialisation, `pytket-iqm` also retrieves the names of\nphysical qubits and qubit connectivity.\n\n(Note: At the moment IQM does not provide a quantum computing service open to the \ngeneral public. Please contact their [sales team](https://www.meetiqm.com/contact/)\nto set up your access to an IQM quantum computer.)\n\n## Bugs and feature requests\n\nPlease file bugs and feature requests on the GitHub\n[issue tracker](https://github.com/CQCL/pytket-iqm/issues).\n\n## Development\n\nTo install an extension in editable mode, simply change to its subdirectory\nwithin the `modules` directory, and run:\n\n```shell\npip install -e .\n```\n\n## Contributing\n\nPull requests are welcome. To make a PR, first fork the repo, make your proposed\nchanges on the `main` branch, and open a PR from your fork. If it passes\ntests and is accepted after review, it will be merged in.\n\n### Code style\n\n#### Formatting\n\nAll code should be formatted using\n[black](https://black.readthedocs.io/en/stable/), with default options. This is\nchecked on the CI.\n\n#### Type annotation\n\nOn the CI, [mypy](https://mypy.readthedocs.io/en/stable/) is used as a static\ntype checker and all submissions must pass its checks. You should therefore run\n`mypy` locally on any changed files before submitting a PR. Because of the way\nextension modules embed themselves into the `pytket` namespace this is a little\ncomplicated, but it should be sufficient to run the script `modules/mypy-check`\n(passing as a single argument the root directory of the module to test). The\nscript requires `mypy` 0.800 or above.\n\n#### Linting\n\nWe use [pylint](https://pypi.org/project/pylint/) on the CI to check compliance\nwith a set of style requirements (listed in `.pylintrc`). You should run\n`pylint` over any changed files before submitting a PR, to catch any issues.\n\n### Tests\n\nTo run the tests:\n\n```shell\ncd tests\npip install -r test-requirements.txt\npytest\n```\n\nBy default, the remote tests, which run against the real backend server, are \nskipped. To enable them, set the environment variable\n`PYTKET_RUN_REMOTE_TESTS=1` and make sure you have your API token stored either\nin pytket config or in a file whose location is given by the environment\nvariable `IQM_TOKENS_FILE`.\n\nWhen adding a new feature, please add a test for it. When fixing a bug, please\nadd a test that demonstrates the fix.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcqcl%2Fpytket-iqm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcqcl%2Fpytket-iqm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcqcl%2Fpytket-iqm/lists"}