fix: Always load parameter expressions as half turns in the decoder#1083
Merged
fix: Always load parameter expressions as half turns in the decoder#1083
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1083 +/- ##
==========================================
- Coverage 79.14% 79.06% -0.08%
==========================================
Files 115 115
Lines 13390 13397 +7
Branches 12608 12615 +7
==========================================
- Hits 10597 10592 -5
- Misses 2139 2150 +11
- Partials 654 655 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
aborgna-q
commented
Aug 29, 2025
Comment on lines
+687
to
+690
| /// * `type_hint` - A hint for the type of the parameter we want to load. | ||
| /// This lets us decide between using [`ConstRotation`] and [`ConstF64`] | ||
| /// for constants. The actual returned type may be different. | ||
| pub fn load_half_turns_parameter( |
Collaborator
Author
There was a problem hiding this comment.
If we remove the type hints here and, e.g. load always as floats, then the badger pass fails since it's not expecting having to optimize constF4 -> Rotation::from_halfturns before running.
It also leads to unnecessary boilerplate.
ss2165
reviewed
Aug 29, 2025
| @@ -725,7 +727,8 @@ impl WireTracker { | |||
| PytketParam::InputVariable { name } => { | |||
| // Special case for the name "pi": inserts a `ConstRotation(PI)` instead. | |||
| match (name, type_hint) { | |||
Collaborator
Author
There was a problem hiding this comment.
Changed to "inserts a constant"
ss2165
approved these changes
Aug 29, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Aug 29, 2025
🤖 I have created a release *beep* *boop* --- ## [0.12.6](tket-py-v0.12.5...tket-py-v0.12.6) (2025-08-29) ### Bug Fixes * Incorrect ZZMax decoding from pytket ([#1083](#1083)) ([4752663](4752663)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: Agustín Borgna <agustin.borgna@quantinuum.com>
Closed
Merged
github-merge-queue bot
pushed a commit
that referenced
this pull request
Sep 15, 2025
## 🤖 New release * `tket`: 0.14.0 -> 0.15.0 (✓ API compatible changes) * `tket-qsystem`: 0.20.1 -> 0.21.0 (✓ API compatible changes) <details><summary><i><b>Changelog</b></i></summary><p> ## `tket` <blockquote> ## [0.15.0](tket-v0.14.0...tket-v0.15.0) - 2025-09-15 ### Bug Fixes - [**breaking**] Fix rotation -> float param type conversion ([#1061](#1061)) - Pytket barrier operations not being decoded ([#1069](#1069)) - Always load parameter expressions as half turns in the decoder ([#1083](#1083)) - Move attribute to come after all the cases. ([#1112](#1112)) ### New Features - Capture pytket's output permutation explicitly in the hugr connectivity ([#1075](#1075)) - Add ResourceScope ([#1052](#1052)) - [**breaking**] Remove unnecessary Arc from PytketDecoder method ([#1114](#1114)) - [**breaking**] Remove deprecated definitions ([#1113](#1113)) </blockquote> ## `tket-qsystem` <blockquote> ## [0.21.0](tket-qsystem-v0.20.1...tket-qsystem-v0.21.0) - 2025-09-15 ### Bug Fixes - [**breaking**] Fix rotation -> float param type conversion ([#1061](#1061)) - Pytket barrier operations not being decoded ([#1069](#1069)) - *(qystem)* fix angle bug in CZ decomposition ([#1080](#1080)) - Always load parameter expressions as half turns in the decoder ([#1083](#1083)) ### New Features - Add a `borrow_array` type replacement pass ([#975](#975)) - Add gpu module ([#1090](#1090)) - [**breaking**] Remove unnecessary Arc from PytketDecoder method ([#1114](#1114)) - [**breaking**] Remove deprecated definitions ([#1113](#1113)) ### Refactor - [**breaking**] Factor out wasm extension code into compute module ([#1089](#1089)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). --------- Co-authored-by: Agustín Borgna <121866228+aborgna-q@users.noreply.github.com> Co-authored-by: Alec Edgington <54802828+cqc-alec@users.noreply.github.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ZZMaxbeing lowered as aZZPhase(𝛑/2)instead ofZZPhase(1/2).PytketDecoder::load_parametertoPytketDecoder::load_half_turnsto properly convey it's behaviour.BEGIN_COMMIT_OVERRIDE
fix: Incorrect ZZMax decoding from pytket (#1083)
END_COMMIT_OVERRIDE