From 1370d6545f3b49392ea688a1fb40dbc381881675 Mon Sep 17 00:00:00 2001 From: hugrbot Date: Tue, 1 Oct 2024 15:10:45 +0100 Subject: [PATCH 1/5] chore(py): release tket2-py 0.4.0 --- .release-please-manifest.json | 2 +- tket2-py/CHANGELOG.md | 42 +++++++++++++++++++++++++++++++++++ tket2-py/pyproject.toml | 2 +- tket2-py/tket2/__init__.py | 2 +- 4 files changed, 45 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d8e626ad..69ea3514 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,4 +1,4 @@ { - "tket2-py": "0.3.0", + "tket2-py": "0.4.0", "tket2-eccs": "0.1.0" } \ No newline at end of file diff --git a/tket2-py/CHANGELOG.md b/tket2-py/CHANGELOG.md index 4d36bc06..0f0bd741 100644 --- a/tket2-py/CHANGELOG.md +++ b/tket2-py/CHANGELOG.md @@ -1,5 +1,47 @@ # Changelog +## [0.4.0](https://github.com/CQCL/tket2/compare/tket2-py-v0.3.0...tket2-py-v0.4.0) (2024-10-01) + + +### ⚠ BREAKING CHANGES + +* Made all errors `non_exhaustive`, and renamed some fields for clarity. +* "tket2.angle" extension replaced with "tket2.rotation" extension with rotation type and simplified set of operations. +* TryFrom implementations for extension op structs removed, use `cast` +* quantum extension renamed from "quantum.tket2" to "tket2.quantum" +* Parametric Tk2Ops take angle type rather than float. +* Rename lazy extension to "hseries" and add hseries ops. +* `Tk2Op::AngleAdd` removed, use `fadd` from the hugr float ops standard extension +* Updated to latest hugr version (`hugr-rs 0.12` / `hugr-py 0.8`). ECCs need to be recompiled. + +### Features + +* `BadgerOptimiser.load_precompiled`, `BadgerOptimiser.compile_eccs` and `passes.badger_pass` now take an optional `cost_fn` parameter to specify the cost function to minimise. Supported values are `'cx'` (default behaviour) and `'rz'`. ([83ebfcb](https://github.com/CQCL/tket2/commit/83ebfcb9156fb5516f877155939062d11c7196d5)) +* HSeries ops ([#573](https://github.com/CQCL/tket2/issues/573)) ([e6acc88](https://github.com/CQCL/tket2/commit/e6acc881d7ab67c584e6622d387bf2025209f8b8)) +* remove Tk2Op::AngleAdd ([#567](https://github.com/CQCL/tket2/issues/567)) ([42cc82f](https://github.com/CQCL/tket2/commit/42cc82f0ee6e77dffb2f55c53613a7c4c8687824)) +* replace f64 with angle type for tk2 ops ([#578](https://github.com/CQCL/tket2/issues/578)) ([d14631f](https://github.com/CQCL/tket2/commit/d14631f762f7ad2cf7db65e66b11cc38a54966ef)) +* simplify angle extension in to a half turns rotation type ([#611](https://github.com/CQCL/tket2/issues/611)) ([0723937](https://github.com/CQCL/tket2/commit/0723937a8aed69302359fbd2383a01a77adc6b36)) +* Support encoding float and sympy ops ([#618](https://github.com/CQCL/tket2/issues/618)) ([74dcbf7](https://github.com/CQCL/tket2/commit/74dcbf757c1c2ae57bf313c61296df270167ee7d)) +* **tket2-hseries:** cli extension dumping ([#584](https://github.com/CQCL/tket2/issues/584)) ([abf292f](https://github.com/CQCL/tket2/commit/abf292f82b858840eeb067394105dbc62feb3230)) +* Update rust hugr dependency to `0.12.0`, and python hugr to `0.8.0` ([#568](https://github.com/CQCL/tket2/issues/568)) ([258a7c5](https://github.com/CQCL/tket2/commit/258a7c5ec25ee2665c524a174704944f0c19729e)) + + +### Bug Fixes + +* quantum extension name wrong way round ([#582](https://github.com/CQCL/tket2/issues/582)) ([06a6838](https://github.com/CQCL/tket2/commit/06a68386ce6d0b1376ed369da2a42d3b3eaa056a)) +* remove TryFrom for extension ops use `cast` ([#592](https://github.com/CQCL/tket2/issues/592)) ([5ca29af](https://github.com/CQCL/tket2/commit/5ca29af3a7cc6ce6d8b3261b342015da94f4aab0)) +* Support hugr packages, fix the notebooks ([#622](https://github.com/CQCL/tket2/issues/622)) ([1cf9dcb](https://github.com/CQCL/tket2/commit/1cf9dcb7ba80dd236916bcf86a1fa0f5459fd349)) + + +### Documentation + +* Add tket2-py module docstring ([#539](https://github.com/CQCL/tket2/issues/539)) ([8ef7a57](https://github.com/CQCL/tket2/commit/8ef7a5736294cf462b0694c235f0d10316c68f68)) + + +### Miscellaneous Chores + +* Replace thiserror with derive_more 1.0 ([#624](https://github.com/CQCL/tket2/issues/624)) ([2250ce7](https://github.com/CQCL/tket2/commit/2250ce76f3019deee1d7e1206aa7843a745fe988)) + ## [0.3.0](https://github.com/CQCL/tket2/compare/tket2-py-v0.2.1...tket2-py-v0.3.0) (2024-09-04) diff --git a/tket2-py/pyproject.toml b/tket2-py/pyproject.toml index 6e5af4ff..f4219037 100644 --- a/tket2-py/pyproject.toml +++ b/tket2-py/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "tket2" -version = "0.3.0" +version = "0.4.0" requires-python = ">=3.10,<3.13" description = "Quantinuum's TKET2 Quantum Compiler" license = { file = "LICENCE" } diff --git a/tket2-py/tket2/__init__.py b/tket2-py/tket2/__init__.py index ca065ce8..2a2d55a7 100644 --- a/tket2-py/tket2/__init__.py +++ b/tket2-py/tket2/__init__.py @@ -16,4 +16,4 @@ # This is updated by our release-please workflow, triggered by this # annotation: x-release-please-version -__version__ = "0.3.0" +__version__ = "0.4.0" From e12d170831b7fc90f048d045d71e8a393f4438d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= Date: Tue, 1 Oct 2024 16:30:56 +0200 Subject: [PATCH 2/5] Fix duplicated changelog entries --- tket2-py/CHANGELOG.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tket2-py/CHANGELOG.md b/tket2-py/CHANGELOG.md index 0f0bd741..e4d45dd0 100644 --- a/tket2-py/CHANGELOG.md +++ b/tket2-py/CHANGELOG.md @@ -8,27 +8,17 @@ * Made all errors `non_exhaustive`, and renamed some fields for clarity. * "tket2.angle" extension replaced with "tket2.rotation" extension with rotation type and simplified set of operations. * TryFrom implementations for extension op structs removed, use `cast` -* quantum extension renamed from "quantum.tket2" to "tket2.quantum" -* Parametric Tk2Ops take angle type rather than float. -* Rename lazy extension to "hseries" and add hseries ops. -* `Tk2Op::AngleAdd` removed, use `fadd` from the hugr float ops standard extension -* Updated to latest hugr version (`hugr-rs 0.12` / `hugr-py 0.8`). ECCs need to be recompiled. ### Features * `BadgerOptimiser.load_precompiled`, `BadgerOptimiser.compile_eccs` and `passes.badger_pass` now take an optional `cost_fn` parameter to specify the cost function to minimise. Supported values are `'cx'` (default behaviour) and `'rz'`. ([83ebfcb](https://github.com/CQCL/tket2/commit/83ebfcb9156fb5516f877155939062d11c7196d5)) -* HSeries ops ([#573](https://github.com/CQCL/tket2/issues/573)) ([e6acc88](https://github.com/CQCL/tket2/commit/e6acc881d7ab67c584e6622d387bf2025209f8b8)) -* remove Tk2Op::AngleAdd ([#567](https://github.com/CQCL/tket2/issues/567)) ([42cc82f](https://github.com/CQCL/tket2/commit/42cc82f0ee6e77dffb2f55c53613a7c4c8687824)) -* replace f64 with angle type for tk2 ops ([#578](https://github.com/CQCL/tket2/issues/578)) ([d14631f](https://github.com/CQCL/tket2/commit/d14631f762f7ad2cf7db65e66b11cc38a54966ef)) * simplify angle extension in to a half turns rotation type ([#611](https://github.com/CQCL/tket2/issues/611)) ([0723937](https://github.com/CQCL/tket2/commit/0723937a8aed69302359fbd2383a01a77adc6b36)) * Support encoding float and sympy ops ([#618](https://github.com/CQCL/tket2/issues/618)) ([74dcbf7](https://github.com/CQCL/tket2/commit/74dcbf757c1c2ae57bf313c61296df270167ee7d)) * **tket2-hseries:** cli extension dumping ([#584](https://github.com/CQCL/tket2/issues/584)) ([abf292f](https://github.com/CQCL/tket2/commit/abf292f82b858840eeb067394105dbc62feb3230)) -* Update rust hugr dependency to `0.12.0`, and python hugr to `0.8.0` ([#568](https://github.com/CQCL/tket2/issues/568)) ([258a7c5](https://github.com/CQCL/tket2/commit/258a7c5ec25ee2665c524a174704944f0c19729e)) ### Bug Fixes -* quantum extension name wrong way round ([#582](https://github.com/CQCL/tket2/issues/582)) ([06a6838](https://github.com/CQCL/tket2/commit/06a68386ce6d0b1376ed369da2a42d3b3eaa056a)) * remove TryFrom for extension ops use `cast` ([#592](https://github.com/CQCL/tket2/issues/592)) ([5ca29af](https://github.com/CQCL/tket2/commit/5ca29af3a7cc6ce6d8b3261b342015da94f4aab0)) * Support hugr packages, fix the notebooks ([#622](https://github.com/CQCL/tket2/issues/622)) ([1cf9dcb](https://github.com/CQCL/tket2/commit/1cf9dcb7ba80dd236916bcf86a1fa0f5459fd349)) From 78ca5f3d0a2075d24de18c6d966bc25d40dc34b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= Date: Tue, 1 Oct 2024 16:32:45 +0200 Subject: [PATCH 3/5] Update tket2 version on example notebooks --- tket2-py/examples/1-Getting-Started.ipynb | 4 ++-- tket2-py/examples/2-Rewriting-Circuits.ipynb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tket2-py/examples/1-Getting-Started.ipynb b/tket2-py/examples/1-Getting-Started.ipynb index 5a540ed8..63be3482 100644 --- a/tket2-py/examples/1-Getting-Started.ipynb +++ b/tket2-py/examples/1-Getting-Started.ipynb @@ -55,8 +55,8 @@ "\n", "# Uncomment one of these lines depending on whether you are using a published\n", "# version of tket2 or a local build.\n", - "#!uv pip install \"tket2>=0.4.0,<0.5\"\n", - "!cd ../../ && maturin develop --quiet --uv" + "!uv pip install \"tket2>=0.4.0,<0.5\"\n", + "#!cd ../../ && maturin develop --quiet --uv" ] }, { diff --git a/tket2-py/examples/2-Rewriting-Circuits.ipynb b/tket2-py/examples/2-Rewriting-Circuits.ipynb index 512b1f63..b1367ccd 100644 --- a/tket2-py/examples/2-Rewriting-Circuits.ipynb +++ b/tket2-py/examples/2-Rewriting-Circuits.ipynb @@ -29,7 +29,7 @@ "source": [ "!uv pip install \\\n", " \"pytket>=1.30.0,<2\" \\\n", - " \"tket2>=0.3.0,<0.4\" \\\n", + " \"tket2>=0.4.0,<0.5\" \\\n", " \"guppylang>=0.10.0,<0.11\" \\\n", " \"hugr>=0.8.1,<0.9\"" ] From 0359ecc02e584d955d7cf55b125c8d887d2ef98a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= Date: Tue, 1 Oct 2024 16:34:38 +0200 Subject: [PATCH 4/5] Update uv lock --- uv.lock | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/uv.lock b/uv.lock index db059f7f..45f6243c 100644 --- a/uv.lock +++ b/uv.lock @@ -1,7 +1,5 @@ version = 1 requires-python = ">=3.10, <3.13" -resolution-markers = [ -] [manifest] members = [ @@ -782,7 +780,7 @@ wheels = [ [[package]] name = "tket2" -version = "0.3.0" +version = "0.4.0" source = { editable = "tket2-py" } dependencies = [ { name = "hugr" }, From 9373f133c0e2e8592070a2386bb2fd8290c9e6f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= <121866228+aborgna-q@users.noreply.github.com> Date: Thu, 3 Oct 2024 09:29:34 +0100 Subject: [PATCH 5/5] Keep only python-related changes in the changelog --- tket2-py/CHANGELOG.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tket2-py/CHANGELOG.md b/tket2-py/CHANGELOG.md index e4d45dd0..83972ebd 100644 --- a/tket2-py/CHANGELOG.md +++ b/tket2-py/CHANGELOG.md @@ -5,33 +5,19 @@ ### ⚠ BREAKING CHANGES -* Made all errors `non_exhaustive`, and renamed some fields for clarity. * "tket2.angle" extension replaced with "tket2.rotation" extension with rotation type and simplified set of operations. -* TryFrom implementations for extension op structs removed, use `cast` ### Features * `BadgerOptimiser.load_precompiled`, `BadgerOptimiser.compile_eccs` and `passes.badger_pass` now take an optional `cost_fn` parameter to specify the cost function to minimise. Supported values are `'cx'` (default behaviour) and `'rz'`. ([83ebfcb](https://github.com/CQCL/tket2/commit/83ebfcb9156fb5516f877155939062d11c7196d5)) * simplify angle extension in to a half turns rotation type ([#611](https://github.com/CQCL/tket2/issues/611)) ([0723937](https://github.com/CQCL/tket2/commit/0723937a8aed69302359fbd2383a01a77adc6b36)) -* Support encoding float and sympy ops ([#618](https://github.com/CQCL/tket2/issues/618)) ([74dcbf7](https://github.com/CQCL/tket2/commit/74dcbf757c1c2ae57bf313c61296df270167ee7d)) -* **tket2-hseries:** cli extension dumping ([#584](https://github.com/CQCL/tket2/issues/584)) ([abf292f](https://github.com/CQCL/tket2/commit/abf292f82b858840eeb067394105dbc62feb3230)) ### Bug Fixes -* remove TryFrom for extension ops use `cast` ([#592](https://github.com/CQCL/tket2/issues/592)) ([5ca29af](https://github.com/CQCL/tket2/commit/5ca29af3a7cc6ce6d8b3261b342015da94f4aab0)) * Support hugr packages, fix the notebooks ([#622](https://github.com/CQCL/tket2/issues/622)) ([1cf9dcb](https://github.com/CQCL/tket2/commit/1cf9dcb7ba80dd236916bcf86a1fa0f5459fd349)) -### Documentation - -* Add tket2-py module docstring ([#539](https://github.com/CQCL/tket2/issues/539)) ([8ef7a57](https://github.com/CQCL/tket2/commit/8ef7a5736294cf462b0694c235f0d10316c68f68)) - - -### Miscellaneous Chores - -* Replace thiserror with derive_more 1.0 ([#624](https://github.com/CQCL/tket2/issues/624)) ([2250ce7](https://github.com/CQCL/tket2/commit/2250ce76f3019deee1d7e1206aa7843a745fe988)) - ## [0.3.0](https://github.com/CQCL/tket2/compare/tket2-py-v0.2.1...tket2-py-v0.3.0) (2024-09-04)