qiskit.dagcircuit.DAGCircuit.depth¶
- DAGCircuit.depth(*, recurse=False)[source]¶
Return the circuit depth. If there is control flow present, this count may only be an estimate, as the complete control-flow path cannot be staticly known.
- প্যারামিটার
recurse (bool) -- if
True
, then recurse into control-flow operations. For loops with known-length iterators are counted as if the loop had been manually unrolled (i.e. with each iteration of the loop body written out explicitly). If-else blocks take the longer case of the two branches. While loops are counted as if the loop body runs once only. Defaults toFalse
and raisesDAGCircuitError
if any control flow is present, to avoid silently returning a nonsensical number.- রিটার্নস
the circuit depth
- রিটার্ন টাইপ
int
- রেইজেস
DAGCircuitError -- if not a directed acyclic graph
DAGCircuitError -- if unknown control flow is present in a recursive call, or any control flow is present in a non-recursive call.