Skip to content

Commit

Permalink
Chore: Remove redundant code
Browse files Browse the repository at this point in the history
- Remove redundant transformation of PyObject to PyTuple.
- Remove debugging print statement.
  • Loading branch information
raynelfss committed Apr 5, 2024
1 parent 506b1bd commit f8064bf
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions crates/accelerate/src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
#![allow(clippy::too_many_arguments)]

use hashbrown::{HashMap, HashSet};
use pyo3::{
prelude::*,
pyclass,
types::{PyDict, PyTuple},
};
use pyo3::{prelude::*, pyclass, types::PyDict};

#[pyclass(mapping, module = "qiskit._accelerate.target")]
#[derive(Clone, Debug)]
Expand Down Expand Up @@ -164,14 +160,6 @@ impl Target {
// Obtain nested qarg hashmap
let mut qargs_val: HashMap<isize, PyObject> = HashMap::new();
for (qarg, values) in properties {
// Obtain source qargs
let qarg = match qarg.downcast::<PyTuple>() {
Ok(tuple) => tuple,
Err(e) => panic!(
"Failed to downcast q_args from the provided properties: {:?}.",
e
),
};
// Obtain qarg hash for mapping
let qarg_hash = match qarg.hash() {
Ok(vec) => vec,
Expand All @@ -190,7 +178,6 @@ impl Target {
};
// Store qargs hash value.
self.qarg_hash_table.insert(qarg_hash, qarg.clone());
println!("{:?}: {:?}", qarg, qarg_hash);
if !qarg.is_empty() && qarg.len() != instruction_num_qubits {
panic!("The number of qubits for {:?} does not match the number of qubits in the properties dictionary: {:?}", &instruction_name, qarg)
}
Expand Down

0 comments on commit f8064bf

Please sign in to comment.