- DAGCircuit.size(*, recurse=False)¶
Return the number of operations. If there is control flow present, this count may only be an estimate, as the complete control-flow path cannot be statically known.
bool) – if
True, then recurse into control-flow operations. For loops with known-length iterators are counted unrolled. If-else blocks sum both of the two branches. While loops are counted as if the loop body runs once only. Defaults to
DAGCircuitErrorif any control flow is present, to avoid silently returning a mostly meaningless number.
the circuit size
- Return type