Skip to content

Commit 9494d93

Browse files
authored
Merge pull request #59 from CQCL/release/1-11-0
Release/1 11 0
2 parents 2c41e11 + a5d7a89 commit 9494d93

30 files changed

+252
-163
lines changed

.github/workflows/build_and_test.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -33,40 +33,40 @@ jobs:
3333
with:
3434
fetch-depth: '0'
3535
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/*
36-
- name: Set up Python 3.8
36+
- name: Set up Python 3.9
3737
if: github.event_name == 'push' || github.event_name == 'schedule'
3838
uses: actions/setup-python@v4
3939
with:
40-
python-version: '3.8'
41-
- name: Build and test (3.8)
40+
python-version: '3.9'
41+
- name: Build and test (3.9)
4242
if: github.event_name == 'push' || github.event_name == 'schedule'
4343
shell: bash
4444
run: |
4545
./.github/workflows/build-test nomypy
46-
- name: Set up Python 3.9
46+
- name: Set up Python 3.10
4747
uses: actions/setup-python@v4
4848
with:
49-
python-version: '3.9'
50-
- name: Build and test including remote checks (3.9) mypy
49+
python-version: '3.10'
50+
- name: Build and test including remote checks (3.10) mypy
5151
if: (matrix.os == 'macos-12') && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'release' || github.event_name == 'schedule' )
5252
shell: bash
5353
run: |
5454
./.github/workflows/build-test mypy
5555
env:
5656
PYTKET_RUN_REMOTE_TESTS: 1
57-
- name: Build and test including remote checks (3.9) nomypy
57+
- name: Build and test including remote checks (3.10) nomypy
5858
if: (matrix.os != 'macos-12') && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'release' || github.event_name == 'schedule')
5959
shell: bash
6060
run: |
6161
./.github/workflows/build-test nomypy
6262
env:
6363
PYTKET_RUN_REMOTE_TESTS: 1
64-
- name: Set up Python 3.10
64+
- name: Set up Python 3.11
6565
if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'schedule'
6666
uses: actions/setup-python@v4
6767
with:
68-
python-version: '3.10'
69-
- name: Build and test (3.10)
68+
python-version: '3.11'
69+
- name: Build and test (3.11)
7070
if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'schedule'
7171
shell: bash
7272
run: |
@@ -117,10 +117,10 @@ jobs:
117117
- uses: actions/checkout@v3
118118
with:
119119
fetch-depth: '0'
120-
- name: Set up Python 3.9
120+
- name: Set up Python 3.10
121121
uses: actions/setup-python@v4
122122
with:
123-
python-version: '3.9'
123+
python-version: '3.10'
124124
- name: Download all wheels
125125
uses: actions/download-artifact@v3
126126
with:

.github/workflows/docs.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ jobs:
1414
runs-on: ubuntu-22.04
1515
steps:
1616
- uses: actions/checkout@v3
17-
- name: Set up Python 3.9
17+
- name: Set up Python 3.10
1818
uses: actions/setup-python@v4
1919
with:
20-
python-version: 3.9
20+
python-version: '3.10'
2121
- name: Upgrade pip and install wheel
2222
run: pip install --upgrade pip wheel
2323
- name: Install pytket qiskit
24-
run: |
25-
pip install .
24+
run: pip install .
2625
- name: Install docs dependencies
2726
run: |
2827
pip install -r .github/workflows/docs/requirements.txt
-39.2 KB
Loading

.github/workflows/docs/build-docs

+6-7
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
import argparse
44
import datetime
5-
from importlib import import_module
6-
from pathlib import Path
75
import shutil
86
import subprocess
97
import sys
8+
from importlib import import_module
9+
from pathlib import Path
1010

1111
DOCS_DIR = Path(sys.argv[0]).absolute().parent
1212
MODULES_DIR = DOCS_DIR.parent.parent.parent
@@ -16,6 +16,7 @@ PYTKET_QISKIT_PYPI_LINK = "https://pypi.org/project/pytket-qiskit/"
1616
PYTKET_QISKIT_GITHUB = "https://github.com/CQCL/pytket-qiskit"
1717
MODULE = "qiskit"
1818

19+
1920
def get_module_version():
2021
m = import_module(f"pytket.extensions.{MODULE}")
2122
return m._metadata.__extension_version__.split(".")
@@ -51,12 +52,10 @@ def build_module_docs():
5152
)
5253
content.append(f"\tpytket <{PYTKET_DOCS_LINK}>\n")
5354
content.append(f"\tpytket extensions <{PYTKET_EX_DOCS_LINK}>\n")
54-
content.append(
55-
"\n.. toctree::\n\t:caption: Links:\n\t:maxdepth: 1\n\n"
56-
)
55+
content.append("\n.. toctree::\n\t:caption: Links:\n\t:maxdepth: 1\n\n")
5756
content.append(f"\tbug tracker <{PYTKET_QISKIT_GITHUB}/issues>\n")
5857
content.append(f"\tGitHub <{PYTKET_QISKIT_GITHUB}>\n")
59-
content.append(f"\tPyPi <{PYTKET_QISKIT_PYPI_LINK}>\n")
58+
content.append(f"\tPyPi <{PYTKET_QISKIT_PYPI_LINK}>\n")
6059

6160
with open(index_rst, "w") as f:
6261
f.writelines(content)
@@ -102,4 +101,4 @@ if __name__ == "__main__":
102101
MODULES_DIR / "docs" / "build",
103102
dest,
104103
dirs_exist_ok=True,
105-
)
104+
)

.github/workflows/docs/conf.py

+21-5
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,24 @@
1010
"sphinx.ext.autosummary",
1111
"sphinx.ext.intersphinx",
1212
"sphinx.ext.mathjax",
13+
"sphinx_copybutton",
1314
]
1415

15-
html_theme = "sphinx_rtd_theme"
16+
pygments_style = "borland"
17+
18+
html_theme = "sphinx_book_theme"
19+
20+
html_theme_options = {
21+
"repository_url": "https://github.com/CQCL/pytket-qiskit",
22+
"use_repository_button": True,
23+
"use_issues_button": True,
24+
}
25+
26+
html_static_path = ["_static"]
27+
28+
html_css_files = ["custom.css"]
29+
30+
html_logo = "Quantinuum_logo.png"
1631

1732
# -- Extension configuration -------------------------------------------------
1833

@@ -29,13 +44,14 @@
2944

3045
# The following code is for resolving broken hyperlinks in the doc.
3146

32-
from sphinx.application import Sphinx
47+
import re
48+
from typing import Any, Dict, List, Optional
49+
from urllib.parse import urljoin
50+
3351
from docutils import nodes
3452
from docutils.nodes import Element, TextElement
53+
from sphinx.application import Sphinx
3554
from sphinx.environment import BuildEnvironment
36-
from urllib.parse import urljoin
37-
import re
38-
from typing import Any, Dict, List, Optional
3955

4056
# Mappings for broken hyperlinks that intersphinx cannot resolve
4157
external_url_mapping = {

.github/workflows/docs/intro.txt

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
pytket-extensions
22
=================
33

4-
.. image:: Quantinuum_logo.png
5-
:width: 160px
6-
:align: right
7-
8-
94
These extensions enable ``pytket` to be used in conjunction with other
105
platforms. Each extension adds either new methods to the ``pytket`` package to
116
convert between circuit representations, or new backends to which ``pytket``
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
sphinx ~= 4.3.2
2-
sphinx_rtd_theme
2+
sphinx_book_theme
3+
sphinx-copybutton

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ build
44
dist
55
*.pyc
66
.vscode
7+
.venv
78
.mypy_cache
89
.hypothesis
910
obj

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ representations.
1414

1515
## Getting started
1616

17-
`pytket-qiskit` is available for Python 3.8, 3.9 and 3.10, on Linux, MacOS
17+
`pytket-qiskit` is available for Python 3.9, 3.10 and 3.11, on Linux, MacOS
1818
and Windows. To install, run:
1919

2020
```pip install pytket-qiskit```

_metadata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__extension_version__ = "0.33.0"
1+
__extension_version__ = "0.34.0"
22
__extension_name__ = "pytket-qiskit"

docs/_static/custom.css

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
.caption-text {
20+
color: #000000;
21+
}
22+
23+
.btn-link:visited,
24+
.btn-link,
25+
a:visited,
26+
.a.reference.external,
27+
.a.reference.internal,
28+
.wy-menu-vertical a,
29+
.wy-menu-vertical li,
30+
.wy-menu-vertical ul,
31+
.span.pre,
32+
.sig-param,
33+
.std.std-ref,
34+
a {
35+
color: #544d4d;
36+
}
37+
38+
:root {
39+
--pst-color-inline-code: 199, 37, 78 !important;
40+
}
41+
42+
.sig-name {
43+
font-size: 1.25rem;
44+
}

docs/changelog.rst

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Changelog
22
~~~~~~~~~
33

4+
0.34.0 (January 2023)
5+
---------------------
6+
7+
* Handle more multi-controlled gates in ``tk_to_qiskit`` and ``qiskit_to_tk`` converters (including CnY and CnZ).
8+
* Drop support for Python 3.8; add support for 3.11.
9+
* Fix ordering of registers in statevector simulation results.
10+
* Remove ``reverse_index`` argument in ``tk_to_qiskit()``.
11+
* Updated pytket version requirement to 1.11.
12+
413
0.33.0 (December 2022)
514
----------------------
615

docs/intro.txt

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
pytket-qiskit
22
==================================
33

4-
.. raw:: html
5-
6-
<embed>
7-
<div style="width:100%; display:flex; align-items:center; justify-content:end; transform: translateY(-85px); margin-bottom: -75px">
8-
<img src="_images/Quantinuum_logo.png" width="100" height="100"></img>
9-
</div>
10-
</embed>
11-
12-
.. image:: Quantinuum_logo.png
13-
:width: 0px
14-
:height: 0px
15-
:align: right
16-
174
IBM's `Qiskit <https://qiskit.org>`_ is an open-source framework for quantum
185
computation, ranging from high-level algorithms to low-level circuit
196
representations, simulation and access to the `IBMQ <https://www.research.ibm.com/ibm-q/>`_ Experience devices.
@@ -22,7 +9,7 @@ representations, simulation and access to the `IBMQ <https://www.research.ibm.co
229
run on IBM backends and simulators, as well as conversion to and from Qiskit
2310
representations.
2411

25-
``pytket-qiskit`` is available for Python 3.8, 3.9 and 3.10, on Linux, MacOS and
12+
``pytket-qiskit`` is available for Python 3.9, 3.10 and 3.11, on Linux, MacOS and
2613
Windows. To install, run:
2714

2815
::
@@ -89,7 +76,7 @@ and several types of simulator.
8976
- Unitary simulator
9077

9178
* [1] ``AerBackend`` is noiseless by default and has no architecture. However it can accept a user defined ``NoiseModel`` and ``Architecture``.
92-
* In addition to the backends above the pytket-qiskit extension also has the ``TketBackend``. This allows a tket ``Backend``s and compilation passes to be used directly through qiskit. see the `Notebook example <https://github.com/CQCL/pytket/blob/main/examples/qiskit_integration.ipynb>`_ on qiskit integration.
79+
* In addition to the backends above the pytket-qiskit extension also has the ``TketBackend``. This allows a tket ``Backend`` to be used directly through qiskit. see the `notebook example <https://github.com/CQCL/pytket/blob/main/examples/qiskit_integration.ipynb>`_ on qiskit integration.
9380

9481
Default Compilation
9582
===================

mypy.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[mypy]
2-
python_version = 3.8
2+
python_version = 3.9
33
warn_unused_configs = True
44

55
disallow_untyped_decorators = False

pytket/extensions/qiskit/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019-2022 Cambridge Quantum Computing
1+
# Copyright 2019-2023 Cambridge Quantum Computing
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

pytket/extensions/qiskit/backends/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019-2022 Cambridge Quantum Computing
1+
# Copyright 2019-2023 Cambridge Quantum Computing
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

pytket/extensions/qiskit/backends/aer.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019-2022 Cambridge Quantum Computing
1+
# Copyright 2019-2023 Cambridge Quantum Computing
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -160,14 +160,12 @@ def process_circuits(
160160
handle_list: List[Optional[ResultHandle]] = [None] * len(circuits)
161161
circuit_batches, batch_order = _batch_circuits(circuits, n_shots_list)
162162

163-
reverse_index = replace_implicit_swaps = (
164-
self.supports_state or self.supports_unitary
165-
)
163+
replace_implicit_swaps = self.supports_state or self.supports_unitary
166164

167165
for (n_shots, batch), indices in zip(circuit_batches, batch_order):
168166
qcs = []
169167
for tkc in batch:
170-
qc = tk_to_qiskit(tkc, reverse_index, replace_implicit_swaps)
168+
qc = tk_to_qiskit(tkc, replace_implicit_swaps)
171169
if self.supports_state:
172170
qc.save_state()
173171
elif self.supports_unitary:
@@ -350,7 +348,7 @@ def get_result(self, handle: ResultHandle, **kwargs: KwargTypes) -> BackendResul
350348
raise CircuitNotRunError(handle)
351349

352350
res = job.result()
353-
backresults = qiskit_result_to_backendresult(res, reverse_index=False)
351+
backresults = qiskit_result_to_backendresult(res)
354352
for circ_index, backres in enumerate(backresults):
355353
newhandle = ResultHandle(handle[0], circ_index)
356354
self._cache[newhandle]["result"] = backres

pytket/extensions/qiskit/backends/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021-2022 Cambridge Quantum Computing
1+
# Copyright 2021-2023 Cambridge Quantum Computing
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

pytket/extensions/qiskit/backends/ibm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019-2022 Cambridge Quantum Computing
1+
# Copyright 2019-2023 Cambridge Quantum Computing
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

pytket/extensions/qiskit/backends/ibmq_emulator.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019-2022 Cambridge Quantum Computing
1+
# Copyright 2019-2023 Cambridge Quantum Computing
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -55,7 +55,7 @@
5555

5656

5757
class IBMQEmulatorBackend(Backend):
58-
"""A backend which uses the ibmq_qasm_simulator to emulate the behaviour of
58+
"""A backend which uses the AerBackend simulator to emulate the behaviour of
5959
IBMQBackend. Performs the same compilation and predicate checks as IBMQBackend.
6060
Requires a valid IBMQ account.
6161

0 commit comments

Comments
 (0)