diff --git a/crates/circuit/src/dag_circuit.rs b/crates/circuit/src/dag_circuit.rs index 1a88dd15e0a8..0df93f03eeb0 100644 --- a/crates/circuit/src/dag_circuit.rs +++ b/crates/circuit/src/dag_circuit.rs @@ -2188,7 +2188,7 @@ def _format(operand): /// flow is present in a non-recursive call. #[pyo3(signature= (*, recurse=false))] fn depth(&self, py: Python, recurse: bool) -> PyResult { - if self.qubits.is_empty() && self.clbits.is_empty() { + if self.qubits.is_empty() && self.clbits.is_empty() && self.vars_info.is_empty() { return Ok(0); }