From 2ba35a2a7a21423fb0edcfed4289278f29787ea6 Mon Sep 17 00:00:00 2001 From: Raynel Sanchez <87539502+raynelfss@users.noreply.github.com> Date: Thu, 9 May 2024 23:22:52 -0400 Subject: [PATCH] Fix: Remove redundant lookup in Target (#12373) --- crates/accelerate/src/target_transpiler/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/accelerate/src/target_transpiler/mod.rs b/crates/accelerate/src/target_transpiler/mod.rs index 729dc4b9270a..4a53cd957108 100644 --- a/crates/accelerate/src/target_transpiler/mod.rs +++ b/crates/accelerate/src/target_transpiler/mod.rs @@ -1128,7 +1128,7 @@ impl Target { .all(|x| x.index() < self.num_qubits.unwrap_or_default())); } } else { - let qubit_comparison = self.gate_name_map[op_name] + let qubit_comparison = obj .getattr(py, "num_qubits")? .extract::(py)?; return Ok(qubit_comparison == _qargs.vec.len() @@ -1206,7 +1206,7 @@ impl Target { return Ok(false); } } else { - let qubit_comparison = self.gate_name_map[operation_names] + let qubit_comparison = obj .getattr(py, "num_qubits")? .extract::(py)?; return Ok(qubit_comparison == _qargs.vec.len()