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!: get pauli propagation + examples working with new hugr builder #465

Merged
merged 7 commits into from
Jul 10, 2024

Conversation

ss2165
Copy link
Member

@ss2165 ss2165 commented Jul 9, 2024

BEGIN_COMMIT_OVERRIDE
feat!: get pauli propagation + examples working with new hugr builder #465

Currently requires some horrible hacks like converting nodes via ints and loading operations from bytes. This will be cleared up by fully using the hugr package Node, Wire, ops, types in the TK2Circuit interface instead of ad-hoc bindings in a follow up PR.

Release-As: 0.1.0a1

BREAKING CHANGE: Dfg binding removed, replaced with builder from hugr package.
END_COMMIT_OVERRIDE

@ss2165 ss2165 requested a review from aborgna-q July 9, 2024 14:50
@ss2165 ss2165 requested a review from a team as a code owner July 9, 2024 14:50
pyproject.toml Outdated
@@ -36,7 +38,8 @@ mypy = "^1.10.1"
hypothesis = "^6.105.1"
graphviz = "^0.20"
pre-commit = "^3.7.1"
guppylang = "^0.6.0"
# guppylang = "^0.6.0"
guppylang = { git = "https://github.com/CQCL/guppylang", rev = "3da3936" }
Copy link
Member Author

Choose a reason for hiding this comment

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

needed for hugr-py compatibility

Copy link
Collaborator

Choose a reason for hiding this comment

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

This will prevent us from releasing new tket2-py versions. Can we do a guppy release soon?

@@ -178,7 +178,7 @@ impl Tk2Circuit {
Ok(self.clone())
}

fn node_op(&self, node: PyNode) -> PyResult<PyCustomOp> {
fn node_op(&self, node: PyNode) -> PyResult<Cow<[u8]>> {
Copy link
Member Author

Choose a reason for hiding this comment

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

temporary hack

Copy link
Collaborator

Choose a reason for hiding this comment

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

😬

Currently requires some horrible hacks like converting nodes via ints and loading operations from bytes. This will be cleared up by fully using the `hugr` package Node, Wire, ops, types in the `TK2Circuit` interface instead of ad-hoc bindings in a follow up PR.
Copy link

codecov bot commented Jul 9, 2024

Codecov Report

Attention: Patch coverage is 97.91667% with 3 lines in your changes missing coverage. Please review.

Project coverage is 82.19%. Comparing base (c40e1a9) to head (6340ef1).

Files Patch % Lines
tket2-py/tket2/ops.py 33.33% 2 Missing ⚠️
tket2-py/tket2/circuit/build.py 98.82% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #465      +/-   ##
==========================================
- Coverage   82.22%   82.19%   -0.04%     
==========================================
  Files          60       60              
  Lines        5919     5920       +1     
  Branches     5410     5399      -11     
==========================================
- Hits         4867     4866       -1     
- Misses        793      798       +5     
+ Partials      259      256       -3     
Flag Coverage Δ
python 96.73% <97.91%> (-0.32%) ⬇️
rust 80.79% <ø> (-0.04%) ⬇️

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.

Copy link
Collaborator

@aborgna-q aborgna-q left a comment

Choose a reason for hiding this comment

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

Nice

I'm not a fan of the [:] prefix after CircBuild.add, but things look much cleaner now.

pyproject.toml Outdated
@@ -36,7 +38,8 @@ mypy = "^1.10.1"
hypothesis = "^6.105.1"
graphviz = "^0.20"
pre-commit = "^3.7.1"
guppylang = "^0.6.0"
# guppylang = "^0.6.0"
guppylang = { git = "https://github.com/CQCL/guppylang", rev = "3da3936" }
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will prevent us from releasing new tket2-py versions. Can we do a guppy release soon?

@@ -178,7 +178,7 @@ impl Tk2Circuit {
Ok(self.clone())
}

fn node_op(&self, node: PyNode) -> PyResult<PyCustomOp> {
fn node_op(&self, node: PyNode) -> PyResult<Cow<[u8]>> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

😬

Comment on lines 115 to 120
FLOAT_T = tys.Opaque(
extension="arithmetic.float.types",
id="float64",
args=[],
bound=tys.TypeBound.Copyable,
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be defined in hugr-py. Open an issue there?

Copy link
Member Author

@ss2165 ss2165 Jul 9, 2024

Choose a reason for hiding this comment

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

will do a PR adding some standard extension types

Copy link
Member Author

Choose a reason for hiding this comment

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

@ss2165
Copy link
Member Author

ss2165 commented Jul 9, 2024

Will wait for hugr-py 0.4 release before mergin

@ss2165 ss2165 enabled auto-merge July 10, 2024 13:19
@ss2165 ss2165 added this pull request to the merge queue Jul 10, 2024
Merged via the queue into main with commit cab0d87 Jul 10, 2024
16 checks passed
@ss2165 ss2165 deleted the ss/hugr-build branch July 10, 2024 13:26
github-merge-queue bot pushed a commit that referenced this pull request Jul 10, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.1.0a2](tket2-py-v0.1.0...tket2-py-v0.1.0a2)
(2024-07-10)


### ⚠ BREAKING CHANGES

* `Dfg` binding removed, replaced with builder from `hugr` package.

### Features

* Add `lhs` and `rhs` bindings to `Rule`
([#440](#440))
([49b1c89](49b1c89))
* get pauli propagation + examples working with new hugr builder
[#465](#465)
([cab0d87](cab0d87))

---
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: Agustin Borgna <[email protected]>
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.

2 participants