diff --git a/crates/accelerate/src/unitary_synthesis.rs b/crates/accelerate/src/unitary_synthesis.rs index 439b9ba80f67..cadec93f09f8 100644 --- a/crates/accelerate/src/unitary_synthesis.rs +++ b/crates/accelerate/src/unitary_synthesis.rs @@ -17,7 +17,7 @@ use std::sync::OnceLock; use approx::relative_eq; use hashbrown::{HashMap, HashSet}; -use indexmap::IndexMap; +use indexmap::{IndexMap, IndexSet}; use itertools::Itertools; use ndarray::prelude::*; use num_complex::{Complex, Complex64}; @@ -627,8 +627,8 @@ fn get_2q_decomposers_from_target( } let target_basis_set = get_target_basis_set(target, qubits[0]); - let available_1q_basis: HashSet<&str> = - HashSet::from_iter(target_basis_set.get_bases().map(|basis| basis.as_str())); + let available_1q_basis: IndexSet<&str> = + IndexSet::from_iter(target_basis_set.get_bases().map(|basis| basis.as_str())); let mut decomposers: Vec = Vec::new(); #[inline] @@ -689,10 +689,10 @@ fn get_2q_decomposers_from_target( // If our 2q basis gates are a subset of cx, ecr, or cz then we know TwoQubitBasisDecomposer // is an ideal decomposition and there is no need to bother calculating the XX embodiments // or try the XX decomposer - let available_basis_set: HashSet<&str> = available_2q_basis.keys().copied().collect(); + let available_basis_set: IndexSet<&str> = available_2q_basis.keys().copied().collect(); #[inline] - fn check_goodbye(basis_set: &HashSet<&str>) -> bool { + fn check_goodbye(basis_set: &IndexSet<&str>) -> bool { basis_set.iter().all(|gate| GOODBYE_SET.contains(gate)) }