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

fix: Recompile ecc sets after #441 #484

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Binary file modified test_files/nam_6_3.rwr
Binary file not shown.
Binary file modified test_files/small_eccs.rwr
Binary file not shown.
Binary file modified tket2-py/tket2/data/nam_6_3.rwr
Binary file not shown.
16 changes: 13 additions & 3 deletions tket2/src/optimiser/badger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,16 @@ mod tests {

/// A badger optimiser using a reduced set of rewrite rules.
#[fixture]
fn badger_opt() -> DefaultBadgerOptimiser {
fn badger_opt_json() -> DefaultBadgerOptimiser {
BadgerOptimiser::default_with_eccs_json_file("../test_files/small_eccs.json").unwrap()
}

/// A badger optimiser using a reduced set of rewrite rules.
#[fixture]
fn badger_opt_compiled() -> DefaultBadgerOptimiser {
BadgerOptimiser::default_with_rewriter_binary("../test_files/small_eccs.rwr").unwrap()
}

/// A badger optimiser using the complete nam_6_3 rewrite set.
///
/// NOTE: This takes a few seconds to load.
Expand All @@ -576,7 +582,9 @@ mod tests {
}

#[rstest]
fn rz_rz_cancellation(rz_rz: Circuit, badger_opt: DefaultBadgerOptimiser) {
#[case::compiled(badger_opt_compiled())]
#[case::json(badger_opt_json())]
fn rz_rz_cancellation(rz_rz: Circuit, #[case] badger_opt: DefaultBadgerOptimiser) {
let opt_rz = badger_opt.optimise(
&rz_rz,
BadgerOptions {
Expand All @@ -589,7 +597,9 @@ mod tests {
}

#[rstest]
fn rz_rz_cancellation_parallel(rz_rz: Circuit, badger_opt: DefaultBadgerOptimiser) {
#[case::compiled(badger_opt_compiled())]
#[case::json(badger_opt_json())]
fn rz_rz_cancellation_parallel(rz_rz: Circuit, #[case] badger_opt: DefaultBadgerOptimiser) {
let mut opt_rz = badger_opt.optimise(
&rz_rz,
BadgerOptions {
Expand Down
Loading