From 9b7abff278fa3c62e81d09fd0db6e1997ca218a9 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Fri, 24 May 2024 15:59:32 +0100
Subject: [PATCH] chore(tket2): release v0.1.0-alpha.1 (#357)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
## 🤖 New release
* `tket2`: 0.1.0-alpha.1
Changelog
## `tket2`
##
[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](https://github.com/CQCL/tket2/pull/255))
- induced cycles in depth optimisation
([#264](https://github.com/CQCL/tket2/pull/264))
- Encode opaque symbolic constants
([#273](https://github.com/CQCL/tket2/pull/273))
- Correctly detect custom ops by name
([#281](https://github.com/CQCL/tket2/pull/281))
- Track input linear units in `Command`
([#310](https://github.com/CQCL/tket2/pull/310))
- Don't convert tket2 measurements into tket1 ops
([#331](https://github.com/CQCL/tket2/pull/331))
### Documentation
- Expand the main module and README docs
([#298](https://github.com/CQCL/tket2/pull/298))
### New Features
- add angle type to tket2 extension
([#231](https://github.com/CQCL/tket2/pull/231))
- bindings for circuit cost and hash
([#252](https://github.com/CQCL/tket2/pull/252))
- Implement `PyErr` conversion locally in `tket2-py`
([#258](https://github.com/CQCL/tket2/pull/258))
- Add a "progress timeout" to badger
([#259](https://github.com/CQCL/tket2/pull/259))
- [**breaking**] Add lexicographic cost
([#270](https://github.com/CQCL/tket2/pull/270))
- rewrite tracing ([#267](https://github.com/CQCL/tket2/pull/267))
- Move pre/post rewrite cost to the RewriteStrategy API
([#276](https://github.com/CQCL/tket2/pull/276))
- [**breaking**] Lexicographic cost fn
([#277](https://github.com/CQCL/tket2/pull/277))
- Return rewrite strategies as a generator
([#275](https://github.com/CQCL/tket2/pull/275))
- add qalloc, qfree, reset ops
([#284](https://github.com/CQCL/tket2/pull/284))
- [**breaking**] Support any ops in portmatching
([#293](https://github.com/CQCL/tket2/pull/293))
- Add `PatternMatch::nodes` and `subcircuit` + matching example
([#299](https://github.com/CQCL/tket2/pull/299))
- Use `IncomingPort` and `OutgoingPort` instead of `Port` where
possible. ([#296](https://github.com/CQCL/tket2/pull/296))
- expose Tk2Op name ([#307](https://github.com/CQCL/tket2/pull/307))
### Refactor
- Move tket2 code to a workspace member
([#210](https://github.com/CQCL/tket2/pull/210))
- Restructure the python code
([#211](https://github.com/CQCL/tket2/pull/211))
- s/taso/badger/ ([#228](https://github.com/CQCL/tket2/pull/228))
- Move python bindings from `tket2` to `tket2-py`
([#235](https://github.com/CQCL/tket2/pull/235))
- rename t2op ([#256](https://github.com/CQCL/tket2/pull/256))
### Testing
- Add small parallel badger test
([#237](https://github.com/CQCL/tket2/pull/237))
- fix non-deterministic badger test
([#245](https://github.com/CQCL/tket2/pull/245))
---
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
---
Cargo.lock | 8 ++--
Cargo.toml | 5 +--
README.md | 67 ++++++------------------------
badger-optimiser/Cargo.toml | 5 ++-
compile-rewriter/Cargo.toml | 5 ++-
tket2-py/Cargo.toml | 5 ++-
tket2/CHANGELOG.md | 11 +++++
tket2/Cargo.toml | 11 ++++-
tket2/README.md | 81 +++++++++++++++++++++++++++++++++++++
9 files changed, 128 insertions(+), 70 deletions(-)
create mode 100644 tket2/CHANGELOG.md
create mode 100644 tket2/README.md
diff --git a/Cargo.lock b/Cargo.lock
index cbb8b152..68d024eb 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -98,7 +98,7 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
[[package]]
name = "badger-optimiser"
-version = "0.0.0-alpha.1"
+version = "0.0.0"
dependencies = [
"clap",
"hugr",
@@ -305,7 +305,7 @@ dependencies = [
[[package]]
name = "compile-rewriter"
-version = "0.0.0-alpha.1"
+version = "0.0.0"
dependencies = [
"clap",
"hugr",
@@ -1737,7 +1737,7 @@ dependencies = [
[[package]]
name = "tket2"
-version = "0.0.0-alpha.1"
+version = "0.1.0-alpha.1"
dependencies = [
"bytemuck",
"cgmath",
@@ -1778,7 +1778,7 @@ dependencies = [
[[package]]
name = "tket2-py"
-version = "0.0.0-alpha.1"
+version = "0.0.0"
dependencies = [
"derive_more",
"hugr",
diff --git a/Cargo.toml b/Cargo.toml
index 6a36015c..fbe411c3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,12 +7,11 @@ members = ["tket2", "tket2-py", "compile-rewriter", "badger-optimiser"]
default-members = ["tket2"]
[workspace.package]
-version = "0.0.0-alpha.1"
rust-version = "1.75"
edition = "2021"
homepage = "https://github.com/CQCL/tket2"
-license-file = "LICENCE"
-# authors
+repository = "https://github.com/CQCL/tket2"
+license = "Apache-2.0"
[workspace.lints.rust]
missing_docs = "warn"
diff --git a/README.md b/README.md
index 285630f0..3bb60239 100644
--- a/README.md
+++ b/README.md
@@ -1,73 +1,30 @@
# tket2: The Hardware Agnostic Quantum Compiler
-[![build_status][]](https://github.com/CQCL-DEV/tket2/actions)
-![msrv][]
+[![build_status][]](https://github.com/CQCL/tket2/actions)
[![codecov][]](https://codecov.io/gh/CQCL/tket2)
- [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
TKET2's design is its hardware agnosticism which allows researchers and
quantum software developers to take advantage of its state of the art
compilation for many different quantum architectures.
-Circuits are represented using the HUGR IR defined in the
-[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 rewrite utilities and passes for common optimisations
-
-This crate is interoperable with [`tket1`] circuits via its
-serial encoding.
-
- [hugr]: https://lib.rs/crates/hugr
- [`Circuit`]: https://docs.rs/tket2/latest/tket2/trait.Circuit.html
- [`tket1`]: https://github.com/CQCL/tket
-
-# Using TKET2
-
-Defining a circuit in TKET2 is currently done by using the low-level [hugr Builder] API, or by loading tket1 circuits from JSON files.
-
- [hugr Builder]: https://docs.rs/hugr/latest/hugr/builder/index.html
-
-```rust
-use tket2::{Circuit, Hugr};
+`tket2` is available as a rust crate on [crates.io](https://crates.io/crates/tket2) and as
+a python package on [PyPI](https://pypi.org/project/tket2/).
-// Load a tket1 circuit.
-let mut circ: Hugr = tket2::json::load_tk1_json_file("test_files/barenco_tof_5.json").unwrap();
-
-assert_eq!(circ.qubit_count(), 9);
-assert_eq!(circ.num_gates(), 170);
-
-// Traverse the circuit and print the gates.
-for command in circ.commands() {
- println!("{:?}", command.optype());
-}
-
-// Render the circuit as a mermaid diagram.
-println!("{}", circ.mermaid_string());
-
-// Optimise the circuit.
-tket2::passes::apply_greedy_commutation(&mut circ);
-```
-
-## Features
-
-- `portmatching`
- Enables pattern matching using the `portmatching` crate.
-
-- `rewrite-tracing`
- Adds opt-in tracking of the rewrites applied to a circuit.
+See the respective
+[Rust](https://github.com/CQCL/tket2/blob/main/rust/README.md) and
+[Python](https://github.com/CQCL/tket2/blob/main/python/README.md) READMEs for
+more information.
## Developing TKET2
-See [DEVELOPMENT.md](DEVELOPMENT.md) for instructions on setting up the development environment.
+See [DEVELOPMENT.md][] for instructions on setting up the development environment.
## License
This project is licensed under Apache License, Version 2.0 ([LICENSE][] or http://www.apache.org/licenses/LICENSE-2.0).
- [LICENSE]: LICENCE
+ [build_status]: https://github.com/CQCL/tket2/workflows/Continuous%20integration/badge.svg?branch=main
+ [codecov]: https://img.shields.io/codecov/c/gh/CQCL/tket2?logo=codecov
+ [LICENSE]: https://github.com/CQCL/tket2/blob/main/LICENCE
+ [DEVELOPMENT.md]: https://github.com/CQCL/tket2/blob/main/DEVELOPMENT.md
diff --git a/badger-optimiser/Cargo.toml b/badger-optimiser/Cargo.toml
index f6b883fa..3f64a035 100644
--- a/badger-optimiser/Cargo.toml
+++ b/badger-optimiser/Cargo.toml
@@ -1,10 +1,11 @@
[package]
name = "badger-optimiser"
+version = "0.0.0"
edition = { workspace = true }
-version = { workspace = true }
rust-version = { workspace = true }
homepage = { workspace = true }
-license-file = { workspace = true }
+license = { workspace = true }
+publish = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/compile-rewriter/Cargo.toml b/compile-rewriter/Cargo.toml
index 491ef215..1fe86945 100644
--- a/compile-rewriter/Cargo.toml
+++ b/compile-rewriter/Cargo.toml
@@ -1,10 +1,11 @@
[package]
name = "compile-rewriter"
+version = "0.0.0"
edition = { workspace = true }
-version = { workspace = true }
rust-version = { workspace = true }
homepage = { workspace = true }
-license-file = { workspace = true }
+license = { workspace = true }
+publish = false
[dependencies]
clap = { workspace = true, features = ["derive"] }
diff --git a/tket2-py/Cargo.toml b/tket2-py/Cargo.toml
index 602cf599..ac2dff56 100644
--- a/tket2-py/Cargo.toml
+++ b/tket2-py/Cargo.toml
@@ -1,10 +1,11 @@
[package]
name = "tket2-py"
+version = "0.0.0"
edition = { workspace = true }
-version = { workspace = true }
rust-version = { workspace = true }
homepage = { workspace = true }
-license-file = { workspace = true }
+license = { workspace = true }
+publish = false
[lints]
workspace = true
diff --git a/tket2/CHANGELOG.md b/tket2/CHANGELOG.md
new file mode 100644
index 00000000..481426c7
--- /dev/null
+++ b/tket2/CHANGELOG.md
@@ -0,0 +1,11 @@
+# Changelog
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [Unreleased]
+
+## [0.1.0-alpha.1](https://github.com/CQCL/tket2/releases/tag/tket2-v0.1.0-alpha.1) - 2024-05-24
+
+Initial alpha release of the library
diff --git a/tket2/Cargo.toml b/tket2/Cargo.toml
index f2fa6928..0e81385a 100644
--- a/tket2/Cargo.toml
+++ b/tket2/Cargo.toml
@@ -1,10 +1,17 @@
[package]
name = "tket2"
+version = "0.1.0-alpha.1"
edition = { workspace = true }
-version = { workspace = true }
rust-version = { workspace = true }
+
+license = { workspace = true }
+readme = "README.md"
+documentation = "https://docs.rs/tket2"
homepage = { workspace = true }
-license-file = { workspace = true }
+repository = { workspace = true }
+description = "Quantinuum's TKET2 Quantum Compiler"
+keywords = ["Quantum", "Quantinuum"]
+categories = ["compilers"]
[lints]
workspace = true
diff --git a/tket2/README.md b/tket2/README.md
new file mode 100644
index 00000000..fa644b32
--- /dev/null
+++ b/tket2/README.md
@@ -0,0 +1,81 @@
+# tket2: The Hardware Agnostic Quantum Compiler
+
+[![build_status][]](https://github.com/CQCL/tket2/actions)
+![msrv][]
+[![codecov][]](https://codecov.io/gh/CQCL/tket2)
+
+TKET2 is an open source quantum compiler developed by Quantinuum. Central to
+TKET2's design is its hardware agnosticism which allows researchers and
+quantum software developers to take advantage of its state of the art
+compilation for many different quantum architectures.
+
+Circuits are represented using the HUGR IR defined in the
+[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 rewrite utilities and passes for common optimisations
+
+This crate is interoperable with [`tket1`] circuits via its
+serial encoding.
+
+# Using TKET2
+
+Defining a circuit in TKET2 is currently done by using the low-level [hugr Builder] API, or by loading tket1 circuits from JSON files.
+
+```rust
+use tket2::{Circuit, Hugr};
+
+// Load a tket1 circuit.
+let mut circ: Hugr = tket2::json::load_tk1_json_file("test_files/barenco_tof_5.json").unwrap();
+
+assert_eq!(circ.qubit_count(), 9);
+assert_eq!(circ.num_gates(), 170);
+
+// Traverse the circuit and print the gates.
+for command in circ.commands() {
+ println!("{:?}", command.optype());
+}
+
+// Render the circuit as a mermaid diagram.
+println!("{}", circ.mermaid_string());
+
+// Optimise the circuit.
+tket2::passes::apply_greedy_commutation(&mut circ);
+```
+
+Please read the [API documentation here][].
+
+## Features
+
+- `portmatching`
+ Enables pattern matching using the [`portmatching`][] crate.
+
+- `rewrite-tracing`
+ Adds opt-in tracking of the rewrites applied to a circuit.
+
+## Recent Changes
+
+See [CHANGELOG][] for a list of changes. The minimum supported rust
+version will only change on major releases.
+
+## Developing TKET2
+
+See [DEVELOPMENT.md][] for instructions on setting up the development environment.
+
+## License
+
+This project is licensed under Apache License, Version 2.0 ([LICENSE][] or http://www.apache.org/licenses/LICENSE-2.0).
+
+ [build_status]: https://github.com/CQCL/tket2/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
+ [hugr]: https://lib.rs/crates/hugr
+ [hugr Builder]: https://docs.rs/hugr/latest/hugr/builder/index.html
+ [API documentation here]: https://docs.rs/tket2/
+ [`Circuit`]: https://docs.rs/tket2/latest/tket2/trait.Circuit.html
+ [`tket1`]: https://github.com/CQCL/tket
+ [`portmatching`]: https://lib.rs/crates/portmatching
+ [LICENSE]: https://github.com/CQCL/tket2/blob/main/LICENCE
+ [CHANGELOG]: https://github.com/CQCL/tket2/blob/main/tket2/CHANGELOG.md
+ [DEVELOPMENT.md]: https://github.com/CQCL/tket2/blob/main/DEVELOPMENT.md