Skip to content

Commit

Permalink
fix: Seen circuits may be accepted again (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmondada authored Oct 4, 2023
1 parent 796323c commit 7099098
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/optimiser/taso.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ where
let rewrites = self.rewriter.get_rewrites(&circ);
for new_circ in self.strategy.apply_rewrites(rewrites, &circ) {
let new_circ_hash = new_circ.circuit_hash();
logger.log_progress(circ_cnt, Some(pq.len()), seen_hashes.len());
if !seen_hashes.insert(new_circ_hash) {
// Ignore this circuit: we've already seen it
continue;
}
circ_cnt += 1;
logger.log_progress(circ_cnt, Some(pq.len()), seen_hashes.len());
let new_circ_cost = self.cost(&new_circ);
pq.push_unchecked(new_circ, new_circ_hash, new_circ_cost);
}
Expand Down

0 comments on commit 7099098

Please sign in to comment.