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 Taso optimiser #104

Merged
merged 18 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
13 changes: 8 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ lazy_static = "1.4.0"
cgmath = "0.18.0"
num-rational = "0.4"
num-complex = { version = "0.4", optional = true }
tket-json-rs = { git = "https://github.com/CQCL/tket-json-rs", rev = "619db15d3", features = [
"tket2ops",
] }
tket-json-rs = { workspace = true }
rayon = "1.5"
tket-rs = { optional = true, git = "https://github.com/CQCL-DEV/tket-rs", rev = "bd7e8e04" }
thiserror = "1.0.28"
Expand All @@ -41,6 +39,8 @@ strum = "0.25.0"
fxhash = "0.2.1"
rmp-serde = { version = "1.1.2", optional = true }
delegate = "0.10.0"
csv = { version = "1.2.2", optional = true }
chrono = { version ="0.4.30", optional = true }
bytemuck = "1.14.0"

[features]
Expand All @@ -52,7 +52,7 @@ pyo3 = [
"quantinuum-hugr/pyo3",
]
tkcxx = ["dep:tket-rs", "dep:num-complex"]
portmatching = ["dep:portmatching", "dep:rmp-serde"]
portmatching = ["dep:portmatching", "dep:rmp-serde", "dep:csv", "dep:chrono"]

[dev-dependencies]
rstest = "0.18.1"
Expand All @@ -66,11 +66,14 @@ harness = false

[workspace]

members = ["pyrs", "compile-matcher"]
members = ["pyrs", "compile-matcher", "taso-optimiser"]

[workspace.dependencies]

quantinuum-hugr = { git = "https://github.com/CQCL-DEV/hugr", rev = "bc9692b" }
portgraph = { version = "0.9", features = ["serde"] }
pyo3 = { version = "0.19" }
itertools = { version = "0.11.0" }
tket-json-rs = { git = "https://github.com/CQCL/tket-json-rs", rev = "619db15d3", features = [
"tket2ops",
] }
14 changes: 10 additions & 4 deletions src/json/op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,22 @@ impl TryFrom<&OpType> for JsonOp {

let json_optype = if let Ok(t2op) = leaf.clone().try_into() {
match t2op {
T2Op::CX => JsonOpType::CX,
T2Op::H => JsonOpType::H,
T2Op::CX => JsonOpType::CX,
T2Op::T => JsonOpType::T,
T2Op::S => JsonOpType::S,
T2Op::X => JsonOpType::X,
T2Op::Y => JsonOpType::Y,
T2Op::Z => JsonOpType::Z,
T2Op::Tdg => JsonOpType::Tdg,
T2Op::Sdg => JsonOpType::Sdg,
T2Op::ZZMax => JsonOpType::ZZMax,
T2Op::Measure => JsonOpType::Measure,
T2Op::RzF64 => JsonOpType::Rz,
T2Op::RxF64 => JsonOpType::Rx,
T2Op::TK1 => JsonOpType::TK1,
T2Op::PhasedX => JsonOpType::PhasedX,
T2Op::ZZMax => JsonOpType::ZZMax,
T2Op::ZZPhase => JsonOpType::ZZPhase,
_ => return Err(err()),
T2Op::TK1 => JsonOpType::TK1,
}
} else if let LeafOp::CustomOp(b) = leaf {
let ext = (*b).as_ref();
Expand Down
1 change: 1 addition & 0 deletions src/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// pub mod redundancy;
// pub mod pattern;
// pub mod squash;
#[cfg(feature = "portmatching")]
pub mod taso;
// use rayon::prelude::*;

Expand Down
Loading