Skip to content

Commit

Permalink
Fix: Remove redundant lookup in Target (Qiskit#12373)
Browse files Browse the repository at this point in the history
  • Loading branch information
raynelfss committed May 10, 2024
1 parent ab6c00f commit 2ba35a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/accelerate/src/target_transpiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<usize>(py)?;
return Ok(qubit_comparison == _qargs.vec.len()
Expand Down Expand Up @@ -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::<usize>(py)?;
return Ok(qubit_comparison == _qargs.vec.len()
Expand Down

0 comments on commit 2ba35a2

Please sign in to comment.