├── .github └── workflows │ ├── docs.yml │ ├── docs │ ├── _static │ │ ├── Quantinuum_logo_black.png │ │ ├── Quantinuum_logo_white.png │ │ └── custom.css │ ├── build-docs │ ├── conf.py │ ├── intro.txt │ ├── requirements.txt │ └── templates │ │ └── searchbox.html │ └── issue.yml ├── .gitignore ├── LICENSE ├── README.md └── dev-utils └── generate_mgit.sh /.github/workflows/docs.yml: -------------------------------------------------------------------------------- 1 | name: publish docs 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | docs: 10 | name: Build and publish docs 11 | runs-on: ubuntu-20.04 12 | steps: 13 | - uses: actions/checkout@v3 14 | with: 15 | fetch-depth: '0' 16 | - name: Set up Python 3.9 17 | uses: actions/setup-python@v4 18 | with: 19 | python-version: '3.9' 20 | - name: Install pip, wheel 21 | run: pip install -U pip wheel 22 | - name: Install docs dependencies 23 | run: | 24 | pip install -r .github/workflows/docs/requirements.txt 25 | - name: Build docs 26 | timeout-minutes: 20 27 | run: | 28 | cd .github/workflows/docs 29 | mkdir extensions 30 | ./build-docs -a -i -d ${GITHUB_WORKSPACE}/.github/workflows/docs/extensions 31 | - name: Configure git 32 | run: | 33 | git config --global user.email "tket-bot@cambridgequantum.com" 34 | git config --global user.name "«$GITHUB_WORKFLOW» github action" 35 | - name: Check out gh-pages branch 36 | run: git checkout gh-pages 37 | - name: Remove old docs 38 | run: git rm -r --ignore-unmatch docs/api 39 | - name: Add generated docs to repository 40 | run: | 41 | mkdir -p docs 42 | mv .github/workflows/docs/extensions docs/api 43 | git add -f docs/api 44 | git commit --allow-empty -m "Add generated documentation." 45 | - name: Publish docs 46 | run: git push origin gh-pages:gh-pages 47 | -------------------------------------------------------------------------------- /.github/workflows/docs/_static/Quantinuum_logo_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CQCL/pytket-extensions/65d5477ea00793a3f65946e895352956bc635cc7/.github/workflows/docs/_static/Quantinuum_logo_black.png -------------------------------------------------------------------------------- /.github/workflows/docs/_static/Quantinuum_logo_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CQCL/pytket-extensions/65d5477ea00793a3f65946e895352956bc635cc7/.github/workflows/docs/_static/Quantinuum_logo_white.png -------------------------------------------------------------------------------- /.github/workflows/docs/_static/custom.css: -------------------------------------------------------------------------------- 1 | .wy-side-nav-search, 2 | .wy-nav-top { 3 | background: #5A46BE; 4 | } 5 | 6 | .wy-grid-for-nav, 7 | .wy-body-for-nav, 8 | .wy-nav-side, 9 | .wy-side-scroll, 10 | .wy-menu, 11 | .wy-menu-vertical { 12 | background-color: #FFFFFF; 13 | } 14 | 15 | .wy-menu-vertical a:hover { 16 | background-color: #d9d9d9; 17 | } 18 | 19 | .btn-link:visited, 20 | .btn-link, 21 | a:visited, 22 | .a.reference.external, 23 | .a.reference.internal, 24 | .wy-menu-vertical a, 25 | .wy-menu-vertical li, 26 | .wy-menu-vertical ul, 27 | .span.pre, 28 | .sig-param, 29 | .std.std-ref, 30 | 31 | html[data-theme=light] { 32 | --pst-color-inline-code: rgb(199, 37, 78) !important; 33 | } 34 | 35 | .sig-name { 36 | font-size: 1.25rem; 37 | } -------------------------------------------------------------------------------- /.github/workflows/docs/build-docs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import argparse 4 | from pathlib import Path 5 | import shutil 6 | import subprocess 7 | import sys 8 | 9 | DOCS_DIR = Path(sys.argv[0]).absolute().parent 10 | MODULES_DIR = DOCS_DIR.parent.parent.parent / "modules" 11 | MANUAL_LINK = "https://cqcl.github.io/pytket/manual/index.html" 12 | EXAMPLES_LINK = "https://github.com/CQCL/pytket/tree/main/examples" 13 | PYTKET_DOCS_LINK = "https://cqcl.github.io/tket/pytket/api/index.html" 14 | PYTKET_AQT_DOCS_LINK = "https://cqcl.github.io/pytket-aqt/api/index.html" 15 | PYTKET_BRAKET_DOCS_LINK = "https://cqcl.github.io/pytket-braket/api/index.html" 16 | PYTKET_CIRQ_DOCS_LINK = "https://cqcl.github.io/pytket-cirq/api/index.html" 17 | PYTKET_IONQ_DOCS_LINK = "https://cqcl.github.io/pytket-ionq/api/index.html" 18 | PYTKET_IQM_DOCS_LINK = "https://cqcl.github.io/pytket-iqm/api/index.html" 19 | PYTKET_PENNYLANE_DOCS_LINK = "https://cqcl.github.io/pytket-pennylane/api/index.html" 20 | PYTKET_PROJECTQ_DOCS_LINK = "https://cqcl.github.io/pytket-projectq/api/index.html" 21 | PYTKET_PYQUIL_DOCS_LINK = "https://cqcl.github.io/pytket-pyquil/api/index.html" 22 | PYTKET_PYSIMPLEX_DOCS_LINK = "https://cqcl.github.io/pytket-pysimplex/api/index.html" 23 | PYTKET_PYZX_DOCS_LINK = "https://cqcl.github.io/pytket-pyzx/api/index.html" 24 | PYTKET_QIR_DOCS_LINK = "https://cqcl.github.io/pytket-qir/api/index.html" 25 | PYTKET_QISKIT_DOCS_LINK = "https://cqcl.github.io/pytket-qiskit/api/index.html" 26 | PYTKET_QSHARP_DOCS_LINK = "https://cqcl.github.io/pytket-qsharp/api/index.html" 27 | PYTKET_QUANTINUUM_DOCS_LINK = "https://cqcl.github.io/pytket-quantinuum/api/index.html" 28 | PYTKET_CUTENSORNET_LINK = "https://cqcl.github.io/pytket-cutensornet/api/index.html" 29 | PYTKET_QULACS_DOCS_LINK = "https://cqcl.github.io/pytket-qulacs/api/index.html" 30 | PYTKET_QUJAX_DOCS_LINK = "https://cqcl.github.io/pytket-qujax/api/index.html" 31 | PYTKET_STIM_DOCS_LINK = "https://cqcl.github.io/pytket-stim/api/index.html" 32 | 33 | 34 | def remove_dir(dirpath): 35 | if dirpath.exists() and dirpath.is_dir(): 36 | shutil.rmtree(dirpath) 37 | 38 | 39 | def fix_links(filepath): 40 | with open(filepath, "r", encoding="utf8") as f: 41 | content = f.read() 42 | content = content.replace("pytket._tket", "pytket") 43 | with open(filepath, "w", encoding="utf8") as f: 44 | f.write(content) 45 | 46 | 47 | if __name__ == "__main__": 48 | parser = argparse.ArgumentParser( 49 | description="Build HTML documentation for one or more modules." 50 | ) 51 | parser.add_argument( 52 | "-m", 53 | "--modules", 54 | nargs="*", 55 | default=[], 56 | help="names of modules to build (without the `pytket-` prefix)", 57 | ) 58 | parser.add_argument("-a", "--all", action="store_true", help="build all modules") 59 | parser.add_argument("-i", "--index", action="store_true", help="build index page") 60 | parser.add_argument("-d", "--dest", help="copy artifacts into destination folder") 61 | args = parser.parse_args() 62 | 63 | if args.index: 64 | print("Building index page...") 65 | index_rst = DOCS_DIR / "index.rst" 66 | with open(DOCS_DIR / "intro.txt", "r") as f: 67 | content = f.readlines() 68 | content.append( 69 | "\n.. toctree::\n\t:caption: Extensions:\n\t:maxdepth: 1\n\n" 70 | ) 71 | 72 | content.append(f"\tpytket-aqt <{PYTKET_AQT_DOCS_LINK}>\n") 73 | content.append(f"\tpytket-braket <{PYTKET_BRAKET_DOCS_LINK}>\n") 74 | content.append(f"\tpytket-cirq <{PYTKET_CIRQ_DOCS_LINK}>\n") 75 | content.append(f"\tpytket-ionq <{PYTKET_IONQ_DOCS_LINK}>\n") 76 | content.append(f"\tpytket-iqm <{PYTKET_IQM_DOCS_LINK}>\n") 77 | content.append(f"\tpytket-pennylane <{PYTKET_PENNYLANE_DOCS_LINK}>\n") 78 | content.append(f"\tpytket-projectq <{PYTKET_PROJECTQ_DOCS_LINK}>\n") 79 | content.append(f"\tpytket-pyquil <{PYTKET_PYQUIL_DOCS_LINK}>\n") 80 | content.append(f"\tpytket-pysimplex <{PYTKET_PYSIMPLEX_DOCS_LINK}>\n") 81 | content.append(f"\tpytket-pyzx <{PYTKET_PYZX_DOCS_LINK}>\n") 82 | content.append(f"\tpytket-qir <{PYTKET_QIR_DOCS_LINK}>\n") 83 | content.append(f"\tpytket-qiskit <{PYTKET_QISKIT_DOCS_LINK}>\n") 84 | content.append(f"\tpytket-qsharp <{PYTKET_QSHARP_DOCS_LINK}>\n") 85 | content.append(f"\tpytket-quantinuum <{PYTKET_QUANTINUUM_DOCS_LINK}>\n") 86 | content.append(f"\tpytket-cutensornet <{PYTKET_CUTENSORNET_LINK}>\n") 87 | content.append(f"\tpytket-qulacs <{PYTKET_QULACS_DOCS_LINK}>\n") 88 | content.append(f"\tpytket-qujax <{PYTKET_QUJAX_DOCS_LINK}>\n") 89 | content.append(f"\tpytket-stim <{PYTKET_STIM_DOCS_LINK}>\n") 90 | 91 | content.append( 92 | "\n.. toctree::\n\t:caption: More documentation:\n\t:maxdepth: 1\n\n" 93 | ) 94 | content.append(f"\tpytket <{PYTKET_DOCS_LINK}>\n") 95 | content.append(f"\tManual <{MANUAL_LINK}>\n") 96 | content.append(f"\tExample notebooks <{EXAMPLES_LINK}>\n") 97 | 98 | with open(index_rst, "w") as f: 99 | f.writelines(content) 100 | remove_dir(DOCS_DIR / "build") 101 | subprocess.run( 102 | [ 103 | "sphinx-build", 104 | "-b", 105 | "html", 106 | "-D", 107 | f"project=pytket-extensions", 108 | "-D", 109 | "templates_path=templates", 110 | ".", 111 | "build", 112 | ], 113 | cwd=DOCS_DIR, 114 | ) 115 | index_rst.unlink() 116 | 117 | if args.dest is not None: 118 | dest = Path(args.dest) 119 | if args.index: 120 | for f in (DOCS_DIR / "build").iterdir(): 121 | if f.is_dir(): 122 | shutil.copytree(f, dest / f.name, dirs_exist_ok=True) 123 | else: 124 | shutil.copy(f, dest) 125 | -------------------------------------------------------------------------------- /.github/workflows/docs/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Configuration file for the Sphinx documentation builder. 4 | # See https://www.sphinx-doc.org/en/master/usage/configuration.html 5 | 6 | copyright = "2023 Quantinuum" 7 | author = "Quantinuum" 8 | 9 | extensions = [ 10 | "sphinx.ext.autodoc", 11 | "sphinx.ext.autosummary", 12 | "sphinx.ext.intersphinx", 13 | "sphinx.ext.mathjax", 14 | "sphinx_copybutton", 15 | ] 16 | 17 | html_theme = "sphinx_book_theme" 18 | 19 | html_theme_options = { 20 | "repository_url": "https://github.com/CQCL/pytket-extensions", 21 | "use_repository_button": True, 22 | "use_issues_button": True, 23 | "logo": { 24 | "image_light": "Quantinuum_logo_black.png", 25 | "image_dark": "Quantinuum_logo_white.png", 26 | }, 27 | } 28 | 29 | html_static_path = ["_static"] 30 | 31 | html_css_files = ["custom.css"] 32 | 33 | # -- Extension configuration ------------------------------------------------- 34 | 35 | pytketdoc_base = "https://cqcl.github.io/tket/pytket/api/" 36 | 37 | intersphinx_mapping = { 38 | "https://docs.python.org/3/": None, 39 | pytketdoc_base: None, 40 | "https://qiskit.org/documentation/": None, 41 | "http://docs.qulacs.org/en/latest/": None, 42 | } 43 | 44 | autodoc_member_order = "groupwise" 45 | 46 | # The following code is for resolving broken hyperlinks in the doc. 47 | 48 | import re 49 | from typing import Any, Dict, List, Optional 50 | from urllib.parse import urljoin 51 | 52 | from docutils import nodes 53 | from docutils.nodes import Element, TextElement 54 | from sphinx.application import Sphinx 55 | from sphinx.environment import BuildEnvironment 56 | 57 | # Mappings for broken hyperlinks that intersphinx cannot resolve 58 | external_url_mapping = { 59 | "BasePass": urljoin(pytketdoc_base, "passes.html#pytket.passes.BasePass"), 60 | "Predicate": urljoin(pytketdoc_base, "predicates.html#pytket.predicates.Predicate"), 61 | "ResultHandle": urljoin( 62 | pytketdoc_base, 63 | "backends.html#pytket.backends.resulthandle.ResultHandle", 64 | ), 65 | "BackendResult": urljoin( 66 | pytketdoc_base, 67 | "backends.html#pytket.backends.backendresult.BackendResult", 68 | ), 69 | "Circuit": urljoin(pytketdoc_base, "circuit_class.html#pytket.circuit.Circuit"), 70 | "BasisOrder": urljoin(pytketdoc_base, "circuit.html#pytket.circuit.BasisOrder"), 71 | "QubitPauliOperator": urljoin( 72 | pytketdoc_base, "utils.html#pytket.utils.QubitPauliOperator" 73 | ), 74 | "QubitPauliString": urljoin( 75 | pytketdoc_base, "pauli.html#pytket.pauli.QubitPauliString" 76 | ), 77 | } 78 | 79 | # Correct mappings for intersphinx to resolve 80 | custom_internal_mapping = { 81 | "pytket.utils.outcomearray.OutcomeArray": "pytket.utils.OutcomeArray", 82 | "pytket.utils.operators.QubitPauliOperator": "pytket.utils.QubitPauliOperator", 83 | "pytket.backends.backend.Backend": "pytket.backends.Backend", 84 | "qiskit.dagcircuit.dagcircuit.DAGCircuit": "qiskit.dagcircuit.DAGCircuit", 85 | "qiskit.providers.basebackend.BaseBackend": "qiskit.providers.BaseBackend", 86 | "qiskit.qobj.qasm_qobj.QasmQobj": "qiskit.qobj.QasmQobj", 87 | "qiskit.result.result.Result": "qiskit.result.Result", 88 | } 89 | 90 | 91 | def add_reference( 92 | app: Sphinx, env: BuildEnvironment, node: Element, contnode: TextElement 93 | ) -> Optional[nodes.reference]: 94 | # Fix references in docstrings that are inherited from the base pytket.backends.Backend class. 95 | mapping = app.config.external_url_mapping 96 | if node.astext() in mapping: 97 | newnode = nodes.reference( 98 | "", 99 | "", 100 | internal=False, 101 | refuri=mapping[node.astext()], 102 | reftitle=node.get("reftitle", node.astext()), 103 | ) 104 | newnode.append(contnode) 105 | return newnode 106 | return None 107 | 108 | 109 | def correct_signature( 110 | app: Sphinx, 111 | what: str, 112 | name: str, 113 | obj: Any, 114 | options: Dict, 115 | signature: str, 116 | return_annotation: str, 117 | ) -> (str, str): 118 | new_signature = signature 119 | new_return_annotation = return_annotation 120 | for k, v in app.config.custom_internal_mapping.items(): 121 | if signature is not None: 122 | new_signature = new_signature.replace(k, v) 123 | if return_annotation is not None: 124 | new_return_annotation = new_return_annotation.replace(k, v) 125 | # e.g. Replace by CXConfigType.Snake to avoid silent failure in later stages. 126 | if new_signature is not None: 127 | enums_signature = re.findall(r"<.+?\: \d+>", new_signature) 128 | for e in enums_signature: 129 | new_signature = new_signature.replace(e, e[1 : e.find(":")]) 130 | 131 | if new_return_annotation is not None: 132 | enums_return = re.findall(r"<.+?\: \d+>", new_return_annotation) 133 | for e in enums_return: 134 | new_return_annotation = new_return_annotation.replace(e, e[1 : e.find(":")]) 135 | 136 | return new_signature, new_return_annotation 137 | 138 | 139 | def setup(app): 140 | app.add_config_value("custom_internal_mapping", {}, "env") 141 | app.add_config_value("external_url_mapping", {}, "env") 142 | app.connect("missing-reference", add_reference) 143 | app.connect("autodoc-process-signature", correct_signature) 144 | -------------------------------------------------------------------------------- /.github/workflows/docs/intro.txt: -------------------------------------------------------------------------------- 1 | Extension Modules 2 | ================= 3 | 4 | The pytket extensions are separate python modules which allow pytket to interface with backends from a range of providers including quantum devices from Quantinuum and IBM. 5 | In pytket a ``Backend`` represents a connection to a QPU (Quantum Processing Unit) or simulator for processing quantum circuits. One can also access additional quantum devices and simulators via the cloud through the extensions for `Azure `_ and `Braket `_ . 6 | 7 | Additionally, the extensions allow pytket to cross-compile circuits from different quantum computing libraries with the extensions for `qiskit `_, `cirq `_ and `pennylane `_ . This enables pytket's compilation features to be used in conjunction with other software tools. 8 | 9 | The additional modules can be installed adding the extension name to the installation command for pytket. For example pytket-quantinuum can be installed by running 10 | 11 | :: 12 | 13 | pip install pytket-quantinuum 14 | 15 | The types of ``Backend`` available in pytket are the following 16 | 17 | Types of Backend 18 | ================ 19 | 20 | * **QPUs** - These are real quantum computers that return shots based results. E.g the `QuantinuumBackend `_ . 21 | * **Cloud Access** - Cloud backends allow pytket to interface with cloud platforms to access additional QPUs and simulators. E.g `BraketBackend `_ . 22 | * **Emulators** - These classically simulate a circuit and produce shots based results. Sometimes emulators use a noise model and have connectivity constraints to emulate real QPUs. E.g. `IBMQEmulatorBackend `_ . 23 | * **Statevector Simulators** - Calculates the pure quantum state prepared by a circuit returning a vector/ndarray. Examples of statevector simulators are the `ForestStateBackend `_ and the `AerStateBackend `_ . 24 | * **Unitary Simulators** - Unitary simulators calculate the unitary operator that is applied by a circuit. A unitary matrix/ndarray is returned `AerUnitaryBackend `_ is an example of such a simulator. 25 | * **Density Matrix Simulators** - These simulators compute the density matrix prepared by a circuit. The result can be a statistical mixture of states in contrast to statevector simulation. E.g. `CirqDensityMatrixSampleBackend `_ . 26 | * **Other specialised simulators** - There are extensions for simulating specific types of circuit. For instance the `SimplexBackend `_ is designed to simulate Clifford circuits. 27 | 28 | A full list of available pytket backends is shown below. 29 | 30 | QPUs 31 | ==== 32 | 33 | `IBMQBackend `_ 34 | - A backend for running circuits on remote IBMQ devices. 35 | 36 | `IonQBackend `_ 37 | - A backend for running circuits on remote IONQ devices. 38 | 39 | `ForestBackend `_ 40 | - A backend for running circuits on remote Rigetti devices. 41 | 42 | `AQTBackend `_ 43 | - Interface to an AQT device or simulator. 44 | 45 | `QuantinuumBackend `_ 46 | - Interface to a remote Quantinuum device or simulator. There are currently two Quantinuum devices offered (H1-1 and H1-2). 47 | 48 | `IQMBackend `_ 49 | - Interface to an IQM device or simulator. 50 | 51 | Cloud access 52 | ============ 53 | 54 | `AzureBackend `_ 55 | - Backend for running circuits remotely using Azure Quantum devices and simulators. 56 | 57 | `BraketBackend `_ 58 | - Interface to Amazon Braket service. 59 | 60 | Emulators 61 | ========= 62 | 63 | `IBMQEmulatorBackend `_ 64 | - A backend which uses the `AerBackend `_ to emulate the behavior of IBMQBackend. 65 | 66 | `QuantinuumBackend `_ 67 | - The QuantinuumBackend has two available emulators namely H1-1E and H1-2E. These are device specific emulators for the H1-1 and H1-2 devices. These emualtors run remotely on a server. 68 | 69 | Statevector Simulators 70 | ======================= 71 | 72 | `CirqStateSampleBackend `_ 73 | - Backend for Cirq statevector simulator sampling. 74 | 75 | `CirqStateSimBackend `_ 76 | - Backend for Cirq statevector simulator state return. 77 | 78 | `AerStateBackend `_ 79 | - Backend for running simulations on the Qiskit Aer Statevector simulator. 80 | 81 | `ForestStateBackend `_ 82 | - State-based interface to a Rigetti device. 83 | 84 | `ProjectQBackend `_ 85 | - Backend for running statevector simulations on the ProjectQ simulator. 86 | 87 | Unitary Simulators 88 | ================== 89 | 90 | `AerUnitaryBackend `_ 91 | - Backend for running simulations on the Qiskit Aer Unitary simulator. 92 | 93 | Density Matrix Simulator 94 | ======================== 95 | 96 | `CirqDensityMatrixSampleBackend `_ 97 | - Backend for Cirq density matrix simulator sampling. 98 | 99 | `CirqDensityMatrixSimBackend `_ 100 | - Backend for Cirq density matrix simulator density_matrix return. 101 | 102 | Clifford Simulators 103 | =================== 104 | 105 | `CirqCliffordSampleBackend `_ 106 | - Backend for Cirq Clifford simulator sampling. 107 | 108 | `CirqCliffordSimBackend `_ 109 | - Backend for Cirq Clifford simulator state return. 110 | 111 | `SimplexBackend `_ 112 | - Backend for simulating Clifford circuits using pysimplex. 113 | 114 | `StimBackend `_ 115 | - Backend for simulating Clifford circuits using Stim. 116 | 117 | Other 118 | ===== 119 | 120 | `AerBackend `_ 121 | - Backend for running simulations on the Qiskit Aer QASM simulator. This simulator is noiseless by default but can take a user defined ``NoiseModel``. 122 | 123 | `QulacsBackend `_ 124 | - Backend for running simulations of variational quantum circuits on the Qulacs simulator. 125 | 126 | `QsharpSimulatorBackend `_ 127 | - Backend for simulating a circuit using the QDK. 128 | 129 | `QsharpToffoliSimulatorBackend `_ 130 | - Backend for simulating a Toffoli circuit using the QDK. 131 | 132 | `QsharpEstimatorBackend `_ 133 | - Backend for estimating resources of a circuit using the QDK. 134 | 135 | .. _pytket: https://cqcl.github.io/tket/pytket/api/ 136 | .. _Quantinuum: https://quantinuum.com 137 | -------------------------------------------------------------------------------- /.github/workflows/docs/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx >= 4.5, < 6.2.0 2 | sphinx_book_theme ~= 1.0.1 3 | sphinx-copybutton 4 | -------------------------------------------------------------------------------- /.github/workflows/docs/templates/searchbox.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CQCL/pytket-extensions/65d5477ea00793a3f65946e895352956bc635cc7/.github/workflows/docs/templates/searchbox.html -------------------------------------------------------------------------------- /.github/workflows/issue.yml: -------------------------------------------------------------------------------- 1 | name: New issue 2 | 3 | on: 4 | issues: 5 | types: [opened] 6 | 7 | jobs: 8 | jira_task: 9 | name: Create Jira issue 10 | runs-on: ubuntu-20.04 11 | steps: 12 | - name: Login 13 | uses: atlassian/gajira-login@v3.0.0 14 | env: 15 | JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} 16 | JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} 17 | JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} 18 | - name: Create Bug 19 | uses: atlassian/gajira-create@v3.0.0 20 | if: contains(github.event.issue.labels.*.name, 'bug') 21 | with: 22 | project: TKET 23 | issuetype: Bug 24 | summary: «[pytket-extensions] ${{ github.event.issue.title }}» 25 | description: ${{ github.event.issue.html_url }} 26 | - name: Create Task 27 | uses: atlassian/gajira-create@v3.0.0 28 | if: "! contains(github.event.issue.labels.*.name, 'bug')" 29 | with: 30 | project: TKET 31 | issuetype: Task 32 | summary: «[pytket-extensions] ${{ github.event.issue.title }}» 33 | description: ${{ github.event.issue.html_url }} 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .eggs 2 | *.egg-info 3 | build 4 | dist 5 | *.pyc 6 | .vscode 7 | .mypy_cache 8 | .hypothesis 9 | _metadata.py 10 | !modules/*/_metadata.py 11 | obj 12 | docs/extensions 13 | .ipynb_checkpoints -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **This repository is archived.** 2 | 3 | See [this page](https://tket.quantinuum.com/api-docs/extensions.html) for 4 | details of the currently-supported extensions. 5 | -------------------------------------------------------------------------------- /dev-utils/generate_mgit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # file to generate bash files, clone, commit, push, and open PR on a selected subset of all pytket extensions 4 | 5 | # run `bash mgitclone.sh` to clone all the repos 6 | # run `bash mgit.sh status` to run `git status` on all repos 7 | # run `bash mgit.sh add .` to run `git add .` on all repos 8 | # run `bash mgitnewbranch.sh new/branch` to generate a new branch from develop with the name `new/branch` on all repos 9 | 10 | echo "#!/bin/bash" > mgit.sh 11 | echo "#!/bin/bash" > mgitclone.sh 12 | echo "#!/bin/bash" > mgitcommit.sh 13 | echo "#!/bin/bash" > mgitnewbranch.sh 14 | echo "#!/bin/bash" > mgitopenpr.sh 15 | echo "#!/bin/bash" > mgitrename.sh 16 | echo "#!/bin/bash" > mgitcopy.sh 17 | 18 | # choose the list of the extensions you want to use 19 | # list of all extensions: "aqt" "braket" "cirq" "ionq" "iqm" "pennylane" "projectq" "pyquil" "pysimplex" "pyzx" "qir" "qiskit" "qsharp" "quantinuum" "cutensornet" "qulacs" "qujax" "stim" 20 | for ext in "aqt" "braket" "cirq" "ionq" "iqm" "pennylane" "projectq" "pyquil" "pysimplex" "pyzx" "qir" "qiskit" "qsharp" "quantinuum" "cutensornet" "qulacs" "qujax" "stim" 21 | do 22 | 23 | echo "git clone git@github.com:CQCL/pytket-$ext.git" >> mgitclone.sh 24 | 25 | echo "" >> mgit.sh 26 | echo "cd pytket-$ext" >> mgit.sh 27 | echo "pwd" >> mgit.sh 28 | echo "git \$1 \$2 \$3 \$4 " >> mgit.sh 29 | echo "cd .." >> mgit.sh 30 | echo "" >> mgit.sh 31 | 32 | echo "" >> mgitcommit.sh 33 | echo "cd pytket-$ext" >> mgitcommit.sh 34 | echo "pwd" >> mgitcommit.sh 35 | echo "git commit -m\"\$1\"" >> mgitcommit.sh 36 | echo "cd .." >> mgitcommit.sh 37 | echo "" >> mgitcommit.sh 38 | 39 | echo "" >> mgitnewbranch.sh 40 | echo "cd pytket-$ext" >> mgitnewbranch.sh 41 | echo "pwd" >> mgitnewbranch.sh 42 | echo "git checkout develop" >> mgitnewbranch.sh 43 | echo "git pull" >> mgitnewbranch.sh 44 | echo "git checkout -b \$1" >> mgitnewbranch.sh 45 | echo "cd .." >> mgitnewbranch.sh 46 | echo "" >> mgitnewbranch.sh 47 | 48 | echo "" >> mgitopenpr.sh 49 | echo "cd pytket-$ext" >> mgitopenpr.sh 50 | echo "pwd" >> mgitopenpr.sh 51 | echo "git checkout \$2" >> mgitopenpr.sh 52 | echo "git push" >> mgitopenpr.sh 53 | echo "cd .." >> mgitopenpr.sh 54 | echo "firefox https://github.com/CQCL/pytket-$ext/compare/\$1...\$2 &" >> mgitopenpr.sh 55 | echo "" >> mgitopenpr.sh 56 | 57 | echo "" >> mgitrename.sh 58 | echo "cd pytket-$ext" >> mgitrename.sh 59 | echo "pwd" >> mgitrename.sh 60 | echo "mv \$1 \$2" >> mgitrename.sh 61 | echo "cd .." >> mgitrename.sh 62 | echo "" >> mgitrename.sh 63 | 64 | echo "" >> mgitcopy.sh 65 | echo "cd pytket-$ext" >> mgitcopy.sh 66 | echo "pwd" >> mgitcopy.sh 67 | echo "cp \$1 \$2" >> mgitcopy.sh 68 | echo "cd .." >> mgitcopy.sh 69 | echo "" >> mgitcopy.sh 70 | 71 | done 72 | 73 | echo "" 74 | echo "file mgit.sh:" 75 | 76 | cat mgit.sh 77 | 78 | echo "" 79 | echo "file mgitclone.sh:" 80 | 81 | cat mgitclone.sh 82 | 83 | echo "" 84 | echo "file mgitcommit.sh:" 85 | 86 | cat mgitcommit.sh 87 | 88 | echo "" 89 | echo "file mgitnewbranch.sh:" 90 | 91 | cat mgitnewbranch.sh 92 | 93 | echo "" 94 | echo "file mgitopenpr.sh:" 95 | 96 | cat mgitopenpr.sh 97 | 98 | 99 | 100 | 101 | --------------------------------------------------------------------------------