Follow-up to #13002 that adds qubits and clbits to the dag when num_qubits or num_clbits are non-zero. This would enable, for example, directly appending instructions using an iterator (https://github.com/Qiskit/qiskit/pull/13032) after creating a new rust DAGCircuit. The alternative is making users add the qubits/clbits manually.
I don't think this is 100% necessary but it definitely increases the usability of with_capacity, in fact, this is how it's done in CircuitData (L238-251).
Summary
Follow-up to #13002 that adds qubits and clbits to the dag when
num_qubits
ornum_clbits
are non-zero. This would enable, for example, directly appending instructions using an iterator (https://github.com/Qiskit/qiskit/pull/13032) after creating a new rustDAGCircuit
. The alternative is making users add the qubits/clbits manually.I don't think this is 100% necessary but it definitely increases the usability of
with_capacity
, in fact, this is how it's done inCircuitData
(L238-251).Details and comments