diff --git a/crates/circuit/src/dag_circuit.rs b/crates/circuit/src/dag_circuit.rs index a27927eea8f8..6a80ddabd378 100644 --- a/crates/circuit/src/dag_circuit.rs +++ b/crates/circuit/src/dag_circuit.rs @@ -6203,8 +6203,8 @@ impl DAGCircuit { dag: StableDiGraph::with_capacity(num_nodes, num_edges), qregs: PyDict::new_bound(py).unbind(), cregs: PyDict::new_bound(py).unbind(), - qargs_cache: IndexedInterner::with_capacity(num_qubits), - cargs_cache: IndexedInterner::with_capacity(num_clbits), + qargs_interner: Interner::with_capacity(num_qubits), + cargs_interner: Interner::with_capacity(num_clbits), qubits: BitData::with_capacity(py, "qubits".to_string(), num_qubits), clbits: BitData::with_capacity(py, "clbits".to_string(), num_clbits), global_phase: Param::Float(0.), diff --git a/crates/circuit/src/interner.rs b/crates/circuit/src/interner.rs index 69a459fe7f95..1ad50b5150fe 100644 --- a/crates/circuit/src/interner.rs +++ b/crates/circuit/src/interner.rs @@ -99,10 +99,10 @@ where } pub fn with_capacity(capacity: usize) -> Self { - Self { - entries: Vec::with_capacity(capacity), - index_lookup: HashMap::with_capacity(capacity), - } + Self(IndexSet::with_capacity_and_hasher( + capacity, + ::ahash::RandomState::new(), + )) } }