-
Notifications
You must be signed in to change notification settings - Fork 11
refactor(tket2-hseries): use smaller angle decompositions for CZ and CCX #883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #883 +/- ##
=======================================
Coverage 82.53% 82.54%
=======================================
Files 72 72
Lines 8862 8861 -1
Branches 8590 8589 -1
=======================================
Hits 7314 7314
Misses 1104 1104
+ Partials 444 443 -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:
|
qartik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Matches the spec at https://github.com/quantinuum-dev/qir-qtm/blob/gate-reference/README.md#controlled-z-gate-cz but I am afraid that spec itself needs an additional verification.
| let a = self.add_phased_x(a, pi, pi)?; | ||
| let [a, b] = self.build_zz_max(a, b)?; | ||
| let a = self.add_phased_x(a, pi, pi_2)?; | ||
| let [a, b] = self.build_zz_max(a, b)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't zz_max deprecated? Or is it not considered deprecated in tket2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's just a utility method for zz_phase(pi/2) (the convention is add_ for primitives and build_ for decompositions)
cqc-alec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified the decompositions are correct up to global phase.
## 🤖 New release
* `tket2`: 0.10.0 -> 0.11.0 (✓ API compatible changes)
* `tket2-hseries`: 0.13.0 -> 0.14.0 (⚠ API breaking changes)
### ⚠ `tket2-hseries` breaking changes
```text
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/enum_missing.ron
Failed in:
enum tket2_hseries::lazify_measure::LazifyMeasurePassError, previously in file /tmp/.tmpd3CB3X/tket2-hseries/src/lazify_measure.rs:63
enum tket2_hseries::lazify_measure::LazifyMeasureRewrite, previously in file /tmp/.tmpd3CB3X/tket2-hseries/src/lazify_measure.rs:110
--- failure enum_variant_missing: pub enum variant removed or renamed ---
Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/enum_variant_missing.ron
Failed in:
variant QSystemPassError::LazyMeasureError, previously in file /tmp/.tmpd3CB3X/tket2-hseries/src/lib.rs:58
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/function_missing.ron
Failed in:
function tket2_hseries::lazify_measure::replace_measure_ops, previously in file /tmp/.tmpd3CB3X/tket2-hseries/src/lazify_measure.rs:79
--- failure module_missing: pub module removed or renamed ---
Description:
A publicly-visible module cannot be imported by its prior path. A `pub use` may have been removed, or the module may have been renamed, removed, or made non-public.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/module_missing.ron
Failed in:
mod tket2_hseries::lazify_measure, previously in file /tmp/.tmpd3CB3X/tket2-hseries/src/lazify_measure.rs:1
--- failure struct_missing: pub struct removed or renamed ---
Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/struct_missing.ron
Failed in:
struct tket2_hseries::lazify_measure::LazifyMeasurePass, previously in file /tmp/.tmpd3CB3X/tket2-hseries/src/lazify_measure.rs:46
--- failure trait_added_supertrait: non-sealed trait added new supertraits ---
Description:
A non-sealed trait added one or more supertraits, which breaks downstream implementations of the trait
ref: https://doc.rust-lang.org/cargo/reference/semver.html#generic-bounds-tighten
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/trait_added_supertrait.ron
Failed in:
trait tket2_hseries::extension::qsystem::QSystemOpBuilder gained ArrayOpBuilder in file /tmp/.tmpYKdcGW/tket2/tket2-hseries/src/extension/qsystem.rs:222
```
<details><summary><i><b>Changelog</b></i></summary><p>
## `tket2`
<blockquote>
##
[0.11.0](tket2-v0.10.0...tket2-v0.11.0)
- 2025-05-22
### New Features
- [**breaking**] Add `ReplaceBoolPass`
([#854](#854))
### Refactor
- Use black_box from standard library.
([#878](#878))
</blockquote>
## `tket2-hseries`
<blockquote>
##
[0.14.0](tket2-hseries-v0.13.0...tket2-hseries-v0.14.0)
- 2025-05-22
### Bug Fixes
- *(tket2-hseries)* ensure deterministic lowering using maps
([#884](#884))
### New Features
- *(tket2-hseries)* [**breaking**] insert RuntimeBarrier across qubits
in a Barrier ([#866](#866))
- [**breaking**] Add `ReplaceBoolPass`
([#854](#854))
- *(tket2-hseries)* Remove `static_array<tket2.bool>` before
`replace_bool`ing. ([#885](#885))
### Refactor
- *(tket2-hseries)* use smaller angle decompositions for CZ and CCX
([#883](#883))
</blockquote>
</p></details>
---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
---------
Co-authored-by: Seyon Sivarajah <[email protected]>
Closes #882