{"id":22882498,"url":"https://github.com/cqcl/pytket-pennylane","last_synced_at":"2025-08-02T12:09:33.188Z","repository":{"id":60847521,"uuid":"531939120","full_name":"CQCL/pytket-pennylane","owner":"CQCL","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-06T12:56:41.000Z","size":6992,"stargazers_count":6,"open_issues_count":3,"forks_count":2,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-06-22T22:17:05.373Z","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,"zenodo":null}},"created_at":"2022-09-02T13:35:18.000Z","updated_at":"2025-05-22T12:04:46.000Z","dependencies_parsed_at":"2023-02-10T15:01:47.708Z","dependency_job_id":"3aa28c6b-c17e-4401-b987-f70812d3746f","html_url":"https://github.com/CQCL/pytket-pennylane","commit_stats":{"total_commits":75,"total_committers":8,"mean_commits":9.375,"dds":0.6933333333333334,"last_synced_commit":"4f19588217cd8a629dfd3de8a33257e2b352b271"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/CQCL/pytket-pennylane","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Fpytket-pennylane","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Fpytket-pennylane/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Fpytket-pennylane/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Fpytket-pennylane/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CQCL","download_url":"https://codeload.github.com/CQCL/pytket-pennylane/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CQCL%2Fpytket-pennylane/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268385863,"owners_count":24242105,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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:18:01.146Z","updated_at":"2025-08-02T12:09:33.152Z","avatar_url":"https://github.com/CQCL.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pytket-pennylane\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/) extension and [PennyLane](https://github.com/PennyLaneAI/pennylane) plugin which allows pytket backends and compilation to be used as a PennyLane device.\n\nPytket is a quantum SDK python package which provides state of the art compilation for quantum\ncircuits and a unified interface for execution on a number of \"backends\" (devices and simulators).\nPennyLane is a package for differentiable programming of quantum computer, which also provides a way\nto execute circuits on a variety of \"devices\". This package allows users to easily leverage the \ndifferentiablecircuits of PennyLane combined with the compilation available in Pytket.\n\nThe package is available for python 3.10, 3.11 and 3.12, and can be installed by\ncloning and installing from source, or via pip:\n\n```shell\npip install pytket-pennylane\n```\n\nAPI documentation is [here](https://tket.quantinuum.com/extensions/pytket-pennylane/api/).\n\nSee the PennyLane [documentation](https://pennylane.readthedocs.io) and Pytket [documentation](https://tket.quantinuum.com/api-docs/) to get an intro to PennyLane and Pytket.\n\nTo use the integration once installed, initialise your pytket backend (in this example, an `AerBackend` which uses Qiskit Aer), and construct a PennyLane `PytketDevice` using this backend:\n\n```python\nimport pennylane as qml\nfrom pytket.extensions.qiskit import AerBackend\n\n# initialise pytket backend\npytket_backend = AerBackend()\n\n# construct PennyLane device\ndev = qml.device(\n    \"pytket.pytketdevice\",\n    wires=2,\n    pytket_backend=pytket_backend,\n    shots=1000\n)\n\n# define a PennyLane Qnode with this device\n@qml.qnode(dev)\ndef my_quantum_function(x, y):\n    qml.RZ(x, wires=0)\n    qml.RX(y, wires=1)\n    return qml.expval(qml.PauliZ(0) @ qml.PauliZ(1))\n\n# call the node\nprint(my_quantum_function(0.1, 0.2))\n\n```\n\nThe example above uses the Pytket default compilation pass for the backend, you can change the optimisation\nlevel of the default backend pass (0, 1 or 2) by setting the `optimisation_level` parameter:\n\n```python\ndev = qml.device(\n    \"pytket.pytketdevice\",\n    wires=2,\n    pytket_backend=pytket_backend,\n    optimisation_level=2,\n    shots=1000\n)\n```\n\nYou can also use any Pytket [compilation pass](https://tket.quantinuum.com/user-manual/manual_compiler.html) using the `compilation_pass` parameter, which is used instead of the default pass:\n\n```python\nfrom pytket.passes import PauliSimp, SequencePass\n\n# use a Chemistry optimised pass before the backend's default pass\n\ncustom_pass = SequencePass([PauliSimp(), pytket_backend.default_compilation_pass()])\n\ndev = qml.device(\n    \"pytket.pytketdevice\",\n    wires=2,\n    pytket_backend=pytket_backend,\n    compilation_pass=custom_pass,\n    shots=1000\n)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcqcl%2Fpytket-pennylane","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcqcl%2Fpytket-pennylane","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcqcl%2Fpytket-pennylane/lists"}