Skip to content

Commit

Permalink
Merge pull request #58 from CQCL/release/pytket-1-23
Browse files Browse the repository at this point in the history
Release 0.33.0
  • Loading branch information
cqc-melf committed Jan 10, 2024
2 parents b5d6da2 + 9c74396 commit e51d08d
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 25 deletions.
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Description

Please summarise the changes.

# Related issues

Please mention any github issues addressed by this PR.

# Checklist

- [ ] I have performed a self-review of my code.
- [ ] I have commented hard-to-understand parts of my code.
- [ ] I have made corresponding changes to the public API documentation.
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] I have updated the changelog with any user-facing changes.
28 changes: 16 additions & 12 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:
os: ['ubuntu-22.04', 'macos-12', 'windows-2022']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/*
- name: Set up Python 3.9
if: github.event_name == 'push' || github.event_name == 'schedule'
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Build and test (3.9)
Expand All @@ -41,7 +41,7 @@ jobs:
run: |
./.github/workflows/build-test nomypy
- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build and test including remote checks (3.10) mypy
Expand All @@ -56,18 +56,18 @@ jobs:
./.github/workflows/build-test nomypy
- name: Set up Python 3.11
if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'schedule'
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build and test (3.11)
if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'schedule'
shell: bash
run: |
./.github/workflows/build-test nomypy
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: github.event_name == 'release' || contains(github.ref, 'refs/heads/wheel')
with:
name: artefacts
name: artefact-${{ matrix.os }}
path: wheelhouse/
- name: Install docs dependencies
if: (matrix.os == 'ubuntu-22.04') && (github.event_name == 'pull_request' || github.event_name == 'schedule' )
Expand All @@ -87,9 +87,13 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Download all wheels
uses: actions/download-artifact@v3
# downloading all three files into the wheelhouse
# all files are identical, so there will only be one file
uses: actions/download-artifact@v4
with:
path: wheelhouse
pattern: artefact-*
merge-multiple: true
- name: Put them all in the dist folder
run: |
mkdir dist
Expand All @@ -107,15 +111,15 @@ jobs:
needs: publish_to_pypi
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Download all wheels
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: wheelhouse
- name: Install pip, wheel
Expand All @@ -132,7 +136,7 @@ jobs:
mkdir extensions
./build-docs -d ${GITHUB_WORKSPACE}/.github/workflows/docs/extensions/api
- name: Upload docs as artefact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: .github/workflows/docs/extensions

Expand All @@ -150,4 +154,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4.0.1
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
name: build docs
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Upgrade pip and install wheel
Expand All @@ -31,7 +31,7 @@ jobs:
cd .github/workflows/docs
mkdir extensions
./build-docs -d ${GITHUB_WORKSPACE}/.github/workflows/docs/extensions
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: pytket-extension-docs
path: .github/workflows/docs/extensions/
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Update pip
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ tests and is accepted after review, it will be merged in.

All code should be formatted using
[black](https://black.readthedocs.io/en/stable/), with default options. This is
checked on the CI. The CI is currently using version 20.8b1.
checked on the CI. The CI is currently using version 22.3.

#### Type annotation

Expand Down
2 changes: 1 addition & 1 deletion _metadata.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__extension_version__ = "0.32.0"
__extension_version__ = "0.33.0"
__extension_name__ = "pytket-cirq"
6 changes: 6 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
~~~~~~~~~

0.33.0 (January 2024)
---------------------

* Updated pytket version requirement to 1.23.
* Implement ``backend_info`` property.

0.32.0 (November 2023)
----------------------

Expand Down
9 changes: 8 additions & 1 deletion pytket/extensions/cirq/backends/cirq.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
from pytket.backends.resulthandle import _ResultIdTuple
from pytket.utils.results import KwargTypes
from pytket.utils.outcomearray import OutcomeArray
from pytket.extensions.cirq._metadata import __extension_version__
from .cirq_convert import tk_to_cirq
from .cirq_utils import _get_default_uids

Expand Down Expand Up @@ -102,7 +103,13 @@ def required_predicates(self) -> List[Predicate]:

@property
def backend_info(self) -> Optional[BackendInfo]:
return None
return BackendInfo(
type(self).__name__,
None,
__extension_version__,
None,
self._gate_set_predicate.gate_set,
)

@property
def characterisation(self) -> Optional[dict]:
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
author_email="tket-support@cambridgequantum.com",
python_requires=">=3.8",
project_urls={
"Documentation": "https://tket.quantinuum.com/extensions/pytket-cirq/api/index.html",
"Documentation": "https://tket.quantinuum.com/extensions/pytket-cirq/index.html",
"Source": "https://github.com/CQCL/pytket-cirq",
"Tracker": "https://github.com/CQCL/pytket-cirq/issues",
},
Expand All @@ -44,10 +44,10 @@
packages=find_namespace_packages(include=["pytket.*"]),
include_package_data=True,
install_requires=[
"pytket ~= 1.22",
"pytket ~= 1.23",
"cirq-core ~= 1.0",
"cirq-google ~= 1.0",
"protobuf ~= 3.20, < 4.0",
"protobuf >= 3.20, < 5.0",
],
classifiers=[
"Environment :: Console",
Expand Down
21 changes: 19 additions & 2 deletions tests/test_cirq_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,26 @@ def test_invalid_n_shots_in_sim_backends(cirq_backend: _CirqSimBackend) -> None:
CirqCliffordSimBackend(),
],
)
def test_backend_info_and_characterisation_are_none(
def test_characterisation_are_none(
cirq_backend: _CirqBaseBackend,
) -> None:
b = cirq_backend
assert b.backend_info is None
assert b.characterisation is None


@pytest.mark.parametrize(
"cirq_backend",
[
CirqDensityMatrixSampleBackend(),
CirqDensityMatrixSimBackend(),
CirqStateSampleBackend(),
CirqStateSimBackend(),
CirqCliffordSampleBackend(),
CirqCliffordSimBackend(),
],
)
def test_backend_info(cirq_backend: _CirqBaseBackend) -> None:
b = cirq_backend
assert b.backend_info is not None
assert b.backend_info.name == b.__class__.__name__
assert b.backend_info.gate_set == b._gate_set_predicate.gate_set

0 comments on commit e51d08d

Please sign in to comment.