Skip to content

Commit

Permalink
Test compiled small_eccs in addition to json def
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Jul 15, 2024
1 parent f12c000 commit ad1ad18
Showing 1 changed file with 13 additions and 3 deletions.
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 ad1ad18

Please sign in to comment.