Skip to content

Commit

Permalink
fix: Recompile ecc sets after #441 (#484)
Browse files Browse the repository at this point in the history
The sets had to be updated after the changes in #441. Fixes #483
  • Loading branch information
aborgna-q committed Jul 15, 2024
1 parent e6f1adb commit 1122fa4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
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

0 comments on commit 1122fa4

Please sign in to comment.