Skip to content

Commit

Permalink
Remove heuristic
Browse files Browse the repository at this point in the history
  • Loading branch information
lmondada committed Oct 3, 2023
1 parent 1996f2a commit e628060
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/optimiser/taso.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,14 @@ where

let rewrites = self.rewriter.get_rewrites(&circ);
for new_circ in self.strategy.apply_rewrites(rewrites, &circ) {
let new_circ_cost = self.cost(&new_circ);
if pq.len() > PRIORITY_QUEUE_CAPACITY / 2 && new_circ_cost > *pq.max_cost().unwrap()
{
// Ignore this circuit: it's too big
continue;
}
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;
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 e628060

Please sign in to comment.