diff --git a/crates/accelerate/src/split_2q_unitaries.rs b/crates/accelerate/src/split_2q_unitaries.rs index 6950ea59021..ac2577c2fc2 100644 --- a/crates/accelerate/src/split_2q_unitaries.rs +++ b/crates/accelerate/src/split_2q_unitaries.rs @@ -28,6 +28,9 @@ pub fn split_2q_unitaries( dag: &mut DAGCircuit, requested_fidelity: f64, ) -> PyResult<()> { + if !dag.get_op_counts().contains_key("unitary") { + return Ok(()); + } let nodes: Vec = dag.op_nodes(false).collect(); for node in nodes {