-
Notifications
You must be signed in to change notification settings - Fork 6
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: Script for CircuitMatcher precompilation #89
Conversation
src/bin/compile-matcher.rs
Outdated
short, | ||
long, | ||
value_name = "FILE", | ||
help = "Sets the input file or folder to use. It is either a JSON file of Quartz-generated ECCs or a folder with TK1 circuits in JSON format." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps the quartz vs tk1 input parameters could be different flags, but this is alright for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(maybe with an clap::ArgGroup
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, we will need to encode how these patterns are translated into rewrites. This data is given implicitly in the ECC file but not if the patterns are in a folder. I'll add a TODO.
Cargo.toml
Outdated
@@ -62,12 +64,16 @@ urlencoding = "2.1.2" | |||
name = "bench_main" | |||
harness = false | |||
|
|||
[[bin]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the best option here would be to make a sub-package in the workspace (similar to pyrs
), so we don't pollute the package.
Co-authored-by: Agustín Borgna <[email protected]>
compile-matcher/Cargo.toml
Outdated
clap = { version = "4.4.2", features = ["derive"] } | ||
tket2 = { path = "../", features = ["portmatching"] } | ||
quantinuum-hugr = { workspace = true } | ||
itertools = "0.11.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also used by tket2
, so add it to the workspace.dependencies
to avoid version mismatches (as with quantinuum-hugr
).
As an example, you can run
It should give you the following output:
You can get the ECC file in this example from my
feature/bench-patterns
branch: