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

docs: Expand the main module and README docs #298

Merged
merged 7 commits into from
Apr 29, 2024
Merged

Conversation

aborgna-q
Copy link
Collaborator

Adds a small usage example to the landing pages (the README and the main module doc).

drive-by: Re-export Hugr, so users can type the returned circuits without including the full crate.

@aborgna-q aborgna-q requested a review from acl-cqc March 1, 2024 14:49
Copy link

codecov bot commented Mar 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.69%. Comparing base (40e79d9) to head (102ea90).
Report is 1 commits behind head on main.

❗ Current head 102ea90 differs from pull request most recent head f728db7. Consider uploading reports for the commit f728db7 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #298      +/-   ##
==========================================
- Coverage   84.98%   84.69%   -0.30%     
==========================================
  Files          35       35              
  Lines        4442     4442              
  Branches     4290     4290              
==========================================
- Hits         3775     3762      -13     
- Misses        487      501      +14     
+ Partials      180      179       -1     

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

@@ -1,15 +1,60 @@
# tket2
# tket2: The Hardware Agnostic Quantum Compiler
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel the hardware agnosticism is not new to TKET2 but is inherited from TKET1, and so in that respect we really are "Version 2 of the TKET compiler" (as you remove), or the sequel of, spawn of, etc. (Now Hypertket really is spawn of TKET1 for its multithreaded/distributed capabilities, but there...)

I'd say the big emphasis of TKET2 is on composable rewrites, rather than largely-monolithic "passes". That and the hypertket aspects/characteristics. YMMV though....

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the "version 2" is already implicit from the name, and the previous subtitle didn't explain what this lib is really about.

This is a short one-liner, the actual crate content should be explained below. I'm happy to change the subtitle to something better :)

[build_status]: https://github.com/CQCL-DEV/hugr/workflows/Continuous%20integration/badge.svg?branch=main
[msrv]: https://img.shields.io/badge/rust-1.75.0%2B-blue.svg
[codecov]: https://img.shields.io/codecov/c/gh/CQCL/tket2?logo=codecov

TKET2 is an open source quantum compiler developed by Quantinuum. Central to
Copy link
Contributor

Choose a reason for hiding this comment

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

It is a bit of a shame to repeat these words exactly from the rust crate docs...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These two are read from different places. The crate docs only really appear in docs.rs, whereas the readme is for github/crates.io.

We could make the crate docs more technical at some point, this is just so we have something useful here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I mean, it's a shame not to be able to link between them / copy text (they seem to be aimed at very similar audiences), but I admit I don't see a good way to do that, so ok nvm

tket2/src/lib.rs Outdated
//! println!("{:?}", command.optype());
//! }
//!
//! # // TODO: Waiting for mermaid support in hugr.
Copy link
Contributor

Choose a reason for hiding this comment

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

This one is different from README

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Re-enabled this now that we've updated to hugr 0.3

@@ -19,4 +56,5 @@ pub mod portmatching;
mod utils;

pub use circuit::Circuit;
pub use hugr::Hugr;
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems sensible

@aborgna-q aborgna-q requested a review from acl-cqc April 19, 2024 14:34
Copy link
Contributor

@acl-cqc acl-cqc left a comment

Choose a reason for hiding this comment

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

Ok, I am probably not the best person to define the role of TKET1 vs TKET2, so I'll go quiet on that one ;-). One suggested change, otherwise looks good to me, thanks

README.md Outdated

TKET2 circuits are represented using the HUGR IR defined in the
[quantinuum-hugr] crate. The [`Circuit`] trait provides a high level interface
for working with HUGRs representing quantum circuits, and defines a HUGR
Copy link
Contributor

Choose a reason for hiding this comment

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

Phrasing/grammar: this and suggests that the subject on the left, i.e. The [```Circuit```] trait, defines the HUGR extension ;-). How about:

...[quantinuum-hugr] crate. TKET2 augments Hugr with
* The [`Circuit`] trait, providing a high-level interface for working with HUGRs representing quantum circuits
* a HUGR extension with quantum operations
* A composable pass system for optimising circuits
* A number of built-in passes for common optimisations

@aborgna-q aborgna-q added this pull request to the merge queue Apr 29, 2024
Merged via the queue into main with commit b93b51d Apr 29, 2024
9 checks passed
@aborgna-q aborgna-q deleted the docs/more-examples branch April 29, 2024 10:08
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.

2 participants