Skip to content

Commit

Permalink
Fix RNG-compatibility of Sabre for large sizes
Browse files Browse the repository at this point in the history
The recent Sabre refactor (Qiskitgh-11977, 3af3cf5) inadvertently switched
the order that physical qubits were considered when modifying the front
layer after a swap insertion. This could occasionally have an impact in
the swap-chooser and extended-set population, if a swap enabled two
separate gates at once.
  • Loading branch information
jakelishman committed Apr 12, 2024
1 parent 8c2afa9 commit 902557f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/accelerate/src/sabre/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,10 @@ pub fn swap_map_trial(
let best_swap = state.choose_best_swap();
state.apply_swap(best_swap);
current_swaps.push(best_swap);
if let Some(node) = state.routable_node_on_qubit(best_swap[0]) {
if let Some(node) = state.routable_node_on_qubit(best_swap[1]) {
routable_nodes.push(node);
}
if let Some(node) = state.routable_node_on_qubit(best_swap[1]) {
if let Some(node) = state.routable_node_on_qubit(best_swap[0]) {
routable_nodes.push(node);
}
num_search_steps += 1;
Expand Down

0 comments on commit 902557f

Please sign in to comment.