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: add angle type to tket2 extension #231

Merged
merged 7 commits into from
Nov 10, 2023
Merged

feat: add angle type to tket2 extension #231

merged 7 commits into from
Nov 10, 2023

Conversation

ss2165
Copy link
Member

@ss2165 ss2165 commented Nov 9, 2023

moved from hugr CQCL/hugr#670

Closes #217

Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Merging #231 (8d035b2) into main (10bdd1b) will increase coverage by 1.10%.
The diff coverage is 95.02%.

@@            Coverage Diff             @@
##             main     #231      +/-   ##
==========================================
+ Coverage   75.12%   76.23%   +1.10%     
==========================================
  Files          30       31       +1     
  Lines        4041     4280     +239     
  Branches     4041     4280     +239     
==========================================
+ Hits         3036     3263     +227     
- Misses        829      830       +1     
- Partials      176      187      +11     
Files Coverage Δ
tket2/src/extension.rs 91.11% <100.00%> (+0.86%) ⬆️
tket2/src/ops.rs 85.79% <100.00%> (+0.07%) ⬆️
tket2/src/extension/angle.rs 94.87% <94.87%> (ø)

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

github-merge-queue bot pushed a commit to CQCL/hugr that referenced this pull request Nov 9, 2023
move test operations to test-only extension


BREAKING_CHANGES: angle types now moved to CQCL/tket2 repo
CQCL/tket2#231
Closes #646
Ok(FunctionType::new_linear(vec![angle]))
}

fn angle_def(extension: &Extension) -> &TypeDef {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe this is a wider question about the extensions API, but it seems strange that this function (and some others -- type_var, angle_custom_type, atrunc_sig etc) need to take their own extension as an argument. I suppose it is because angle_custom_type is exposed at the module level? But it feels like it should be unnecessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

Inside angle.rs, I use these functions to construct the extension. Outside, it uses the lazy static reference to the extension. If I used the static reference here it would cause unbounded recursion on construction - there is probably a nicer way of doing this where that isn't a problem!

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK, maybe something to ponder but this LGTM.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have an issue to raise already about needing a temporary register containing types in order to be able to create validated type schemes, perhaps we can rethink the definition API as part of that.

@ss2165 ss2165 added this pull request to the merge queue Nov 10, 2023
Merged via the queue into main with commit 488fa88 Nov 10, 2023
11 checks passed
@ss2165 ss2165 deleted the feat/angles branch November 10, 2023 09:21
github-merge-queue bot pushed a commit that referenced this pull request May 24, 2024
## 🤖 New release
* `tket2`: 0.1.0-alpha.1

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

## `tket2`
<blockquote>

##
[0.0.0-alpha.1](https://github.com/CQCL/tket2/releases/tag/tket2-v0.0.0-alpha.1)
- 2024-05-24

### Bug Fixes
- Check for rewrite composition in badger
([#255](#255))
- induced cycles in depth optimisation
([#264](#264))
- Encode opaque symbolic constants
([#273](#273))
- Correctly detect custom ops by name
([#281](#281))
- Track input linear units in `Command`
([#310](#310))
- Don't convert tket2 measurements into tket1 ops
([#331](#331))

### Documentation
- Expand the main module and README docs
([#298](#298))

### New Features
- add angle type to tket2 extension
([#231](#231))
- bindings for circuit cost and hash
([#252](#252))
- Implement `PyErr` conversion locally in `tket2-py`
([#258](#258))
- Add a "progress timeout" to badger
([#259](#259))
- [**breaking**] Add lexicographic cost
([#270](#270))
- rewrite tracing ([#267](#267))
- Move pre/post rewrite cost to the RewriteStrategy API
([#276](#276))
- [**breaking**] Lexicographic cost fn
([#277](#277))
- Return rewrite strategies as a generator
([#275](#275))
- add qalloc, qfree, reset ops
([#284](#284))
- [**breaking**] Support any ops in portmatching
([#293](#293))
- Add `PatternMatch::nodes` and `subcircuit` + matching example
([#299](#299))
- Use `IncomingPort` and `OutgoingPort` instead of `Port` where
possible. ([#296](#296))
- expose Tk2Op name ([#307](#307))

### Refactor
- Move tket2 code to a workspace member
([#210](#210))
- Restructure the python code
([#211](#211))
- s/taso/badger/ ([#228](#228))
- Move python bindings from `tket2` to `tket2-py`
([#235](#235))
- rename t2op ([#256](#256))

### Testing
- Add small parallel badger test
([#237](#237))
- fix non-deterministic badger test
([#245](#245))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Agustin Borgna <agustin.borgna@quantinuum.com>
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.

Port Angle types from hugr repo
2 participants