Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e645d6c
Add new tket-qec crate with Iceberg code extension.
cqc-alec Feb 23, 2026
1667c12
Check that k is even.
cqc-alec Feb 26, 2026
73dc14b
Document function argument.
cqc-alec Feb 26, 2026
72e2317
Merge branch 'main' into ae/logical-iceberg
cqc-alec Feb 26, 2026
659caf3
Merge branch 'main' into ae/logical-iceberg
cqc-alec Mar 9, 2026
5b896fe
Merge branch 'main' into ae/logical-iceberg
cqc-alec Mar 11, 2026
ec5bc6a
Add "tket." prefix to extension names.
cqc-alec Mar 11, 2026
88509ff
Use lowercase names for operations.
cqc-alec Mar 11, 2026
683ee30
Use `as_nat()` and switch from `usize` to `u64`.
cqc-alec Mar 11, 2026
1ceaf81
Use future bools as measurement outputs, instead of bools.
cqc-alec Mar 12, 2026
a05d402
Remove multi-Pauli ops.
cqc-alec Mar 12, 2026
0cfe0db
Add dynamically-indexed versions of ops.
cqc-alec Mar 13, 2026
14b72b7
Refactor.
cqc-alec Mar 16, 2026
bec7f3e
Simplify.
cqc-alec Mar 16, 2026
6eb850d
Add a "free" operation.
cqc-alec Mar 16, 2026
0666117
Revert "Remove multi-Pauli ops."
cqc-alec Mar 17, 2026
8b251bc
Add dynamically-indexed versions of restored ops.
cqc-alec Mar 17, 2026
c50b85e
Add module-level docs.
cqc-alec Mar 16, 2026
afa242f
Validate that indices are unequal for intra-block operations.
cqc-alec Mar 17, 2026
c6a5236
Merge branch 'main' into ae/logical-iceberg
cqc-alec Mar 17, 2026
6bf54dd
Merge branch 'main' into ae/logical-iceberg
cqc-alec Mar 19, 2026
370b1ac
Fixes for hugr 0.26.
cqc-alec Mar 19, 2026
ce152f5
Update lockfile.
cqc-alec Mar 19, 2026
3ad44c6
Link to Iceberg paper.
cqc-alec Mar 19, 2026
a4dcced
Add note about dynamic and static indices.
cqc-alec Mar 19, 2026
1a927ba
Remove parentheses.
cqc-alec Mar 19, 2026
c838ec7
Error instead of panicking for invalid TypeArgs.
cqc-alec Mar 19, 2026
c72d3bb
Merge branch 'main' into ae/logical-iceberg
cqc-alec Mar 19, 2026
8ab78ca
Add tests for invalid TypeArgs.
cqc-alec Mar 19, 2026
f718fe5
Remove `all_but_one_ry`.
cqc-alec Mar 23, 2026
7e41bd0
Merge branch 'main' into ae/logical-iceberg
cqc-alec Mar 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/change-filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ rust:
- "badger-optimiser/**"
- "compile-rewriter/**"
- "tket1-passes/**"
- "tket-qec/**"

python:
- *rust-core
Expand Down
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ members = [
"tket-qsystem",
"tket1-passes",
"qis-compiler",
"tket-qec",
]
default-members = ["tket", "tket-qsystem"]

Expand Down
23 changes: 23 additions & 0 deletions tket-qec/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "tket-qec"
version = "0.1.0"
edition.workspace = true
rust-version.workspace = true

license.workspace = true
readme = "README.md"
# documentation = "https://docs.rs/tket-qec"
homepage.workspace = true
repository.workspace = true
description = "HUGR extensions for logical operations on QEC codes."
keywords = ["Quantum", "Quantinuum"]
categories = ["compilers"]

[lints]
workspace = true

[dependencies]
hugr.workspace = true
semver = "1.0.27"
strum = { workspace = true, features = ["derive"] }
tket-qsystem = { version = "0.23.0", path = "../tket-qsystem" }
9 changes: 9 additions & 0 deletions tket-qec/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# tket-qec

HUGR extensions for logical operations on QEC codes.

## License

This project is licensed under Apache License, Version 2.0 ([LICENSE][] or <http://www.apache.org/licenses/LICENSE-2.0>).

[LICENSE]: https://github.com/quantinuum/tket2/blob/main/LICENCE
50 changes: 50 additions & 0 deletions tket-qec/src/iceberg.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//! HUGR extension for logical operations on the
//! [Iceberg code](https://arxiv.org/abs/2211.06703).
//!
//! The extension `tket.qec.iceberg.types` provides one new type: this is the
//! code block for the [[k+2, k, 2]] Iceberg code (parametrized by an even
//! integer k >= 2). This is a linear (non-copyable) type.
//!
//! ```
//! use tket_qec::iceberg::types::block_type;
//!
//! let block = block_type(6);
//! assert!(!block.copyable());
//! ```
//!
//! The extension `tket.qec.iceberg.ops` provides operations that act on this
//! block type.
//!
//! To allocate a new block, with all (logical) qubits initialized to zero, use
//! an `alloc_zero` operation. This is parametrized by k (the number of logical
//! qubits):
//!
//! ```
//! use tket_qec::iceberg::ops::EXTENSION;
//!
//! let alloczero = EXTENSION
//! .instantiate_extension_op("alloc_zero", [8.into()])
//! .unwrap();
//! ```
//!
//! Use the `free` operation to free a previously allocated block.
//!
//! Some of the operations (such as `all_x` or `cx_transverse`) operate purely
//! at the block level. Others (such as `x` or `cx`) take one or more indices
//! as parameters: these are (64-bit unsigned) integers less than `k`, which
//! address logical qubits within the block. Some operations also take an angle,
//! represented as a float in radians.
//!
//! All operations that take indices come in two versions, "static" and
//! "dynamic", depending on whether the indices are parameters to the operation
//! itself (in which case they must be statically known) or dynamic (in which
//! case they are integer inputs to the operation). The dynamic versions have
//! names ending in `_d`. For example, `x_d` takes a block and an integer as
//! inputs, and outputs the block. Note that whereas the static versions are
//! infallible (validity of indices is checked on construction), the dynamic
//! versions will panic if the indices are invalid. When frontends generate
//! dynamic operations compilers should attempt to transform them to static
//! operations where possible.

pub mod ops;
pub mod types;
Loading
Loading