Skip to content
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

feat!: HSeries ops #573

Merged
merged 8 commits into from
Sep 4, 2024
Merged

feat!: HSeries ops #573

merged 8 commits into from
Sep 4, 2024

Conversation

ss2165
Copy link
Member

@ss2165 ss2165 commented Sep 2, 2024

Move Hseries specifc ops to its own extension (some duplicates).
Trim Tk2Ops down in to some small "textbook" set. Tk1 removed as it can be made up of Rz.Rx.Rz. Can be used in canonical {Tk1, TK2} based passes in a standalone extension.

Lowering from Tk2Ops to Hseries ops in progress : #579

Closes #571

BREAKING CHANGE: Rename lazy extension to "hseries" and add hseries ops. Tk2Ops: remove "f64" from Rx, Rz; remove ZZPhase, ZZMax, PhasedX, TK1.

@ss2165 ss2165 changed the title HSeries ops feat!: HSeries ops Sep 2, 2024
@ss2165 ss2165 changed the base branch from main to ss/no-angle-add September 2, 2024 17:08
pub use pytket::lower_to_pytket;

pub mod tuple_unpack;
pub use tuple_unpack::find_tuple_unpack_rewrites;

/// Replace all operations in a HUGR according to a mapping.
pub fn replace_ops<S: Into<OpType>>(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these functions probably belong in hugr crate

Copy link

codecov bot commented Sep 2, 2024

Codecov Report

Attention: Patch coverage is 91.86047% with 14 lines in your changes missing coverage. Please review.

Project coverage is 82.84%. Comparing base (62351fb) to head (e94c424).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tket2-hseries/src/extension/hseries.rs 90.00% 1 Missing and 12 partials ⚠️
tket2/src/passes/commutation.rs 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #573      +/-   ##
==========================================
+ Coverage   82.79%   82.84%   +0.05%     
==========================================
  Files          45       45              
  Lines        6113     6184      +71     
  Branches     6113     6184      +71     
==========================================
+ Hits         5061     5123      +62     
- Misses        770      771       +1     
- Partials      282      290       +8     
Flag Coverage Δ
rust 82.84% <91.86%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from ss/no-angle-add to main September 3, 2024 06:21
@ss2165 ss2165 force-pushed the ss/hseries branch 3 times, most recently from 68a725d to 1c1e464 Compare September 3, 2024 17:47
@ss2165 ss2165 changed the base branch from main to ss/angle-nonparam September 3, 2024 17:49
@ss2165 ss2165 requested a review from doug-q September 3, 2024 17:52
@ss2165 ss2165 marked this pull request as ready for review September 3, 2024 17:52
@ss2165 ss2165 requested a review from a team as a code owner September 3, 2024 17:52
Copy link
Contributor

@doug-q doug-q left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. It's wierd to me that there is no CY, but no need to address that now.

Why is Tk1Op removed? Perhaps this could be addressed in the commit message.

@@ -43,21 +43,19 @@ use crate::extension::REGISTRY;
pub enum Tk2Op {
H,
CX,
CZ,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why no CY?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

PhasedX,
ZZPhase,
CZ,
TK1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened to TK1?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In description

Tk2Op::Rz => Tk1OpType::Rz,
Tk2Op::Rx => Tk1OpType::Rx,
Tk2Op::Ry => Tk1OpType::Ry,
Tk2Op::Toffoli => Tk1OpType::CCX,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth reordering these as you did in ops.rs

Base automatically changed from ss/angle-nonparam to main September 4, 2024 08:44
@ss2165 ss2165 enabled auto-merge September 4, 2024 09:41
@ss2165 ss2165 disabled auto-merge September 4, 2024 09:56
@ss2165 ss2165 added this pull request to the merge queue Sep 4, 2024
Merged via the queue into main with commit e6acc88 Sep 4, 2024
15 checks passed
@ss2165 ss2165 deleted the ss/hseries branch September 4, 2024 10:14
github-merge-queue bot pushed a commit that referenced this pull request Sep 4, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.3.0](tket2-py-v0.2.1...tket2-py-v0.3.0)
(2024-09-04)


### ⚠ BREAKING CHANGES

* 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

* HSeries ops ([#573](#573))
([e6acc88](e6acc88))
* remove Tk2Op::AngleAdd
([#567](#567))
([42cc82f](42cc82f))
* replace f64 with angle type for tk2 ops
([#578](#578))
([d14631f](d14631f))
* Update rust hugr dependency to `0.12.0`, and python hugr to `0.8.0`
([#568](#568))
([258a7c5](258a7c5))


### Bug Fixes

* quantum extension name wrong way round
([#582](#582))
([06a6838](06a6838))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
github-merge-queue bot pushed a commit that referenced this pull request Sep 4, 2024
## 🤖 New release
* `tket2`: 0.1.1 -> 0.2.0
* `tket2-hseries`: 0.1.1 -> 0.2.0

<details><summary><i><b>Changelog</b></i></summary><p>

## `tket2`
<blockquote>

##
[0.2.0](tket2-v0.1.1...tket2-v0.2.0)
- 2024-09-04

### Bug Fixes
- [**breaking**] quantum extension name wrong way round
([#582](#582))

### New Features
- Extend Command::optype lifetime
([#562](#562))
- [**breaking**] Update rust hugr dependency to `0.12.0`, and python
hugr to `0.8.0` ([#568](#568))
- [**breaking**] remove Tk2Op::AngleAdd
([#567](#567))
- [**breaking**] angle type no longer parametric.
([#577](#577))
- [**breaking**] HSeries ops
([#573](#573))
- [**breaking**] replace f64 with angle type for tk2 ops
([#578](#578))
- more angle ops (construct, deconstruct, radians, equality)
([#581](#581))
</blockquote>

## `tket2-hseries`
<blockquote>

##
[0.2.0](tket2-hseries-v0.1.1...tket2-hseries-v0.2.0)
- 2024-09-04

### New Features
- [**breaking**] Update rust hugr dependency to `0.12.0`, and python
hugr to `0.8.0` ([#568](#568))
- [**breaking**] HSeries ops
([#573](#573))
- [**breaking**] replace f64 with angle type for tk2 ops
([#578](#578))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move PhasedX, ZZPhase, ZZMax to hseries extension
2 participants