Deprecate legacy iterable access to CircuitInstruction
#12631
Labels
mod: circuit
Related to the core of the `QuantumCircuit` class or the circuit library
Rust
This PR or issue is related to Rust code in the repository
Milestone
Ever since the scalar type of
QuantumCircuit.data
changed from a 3-tuple of(Operation, list[Qubit], list[Clbit])
to the record-likeCircuitInstruction
in #8093, we've maintained the iterable interfaces as a legacy format that makes it appear tuple-like for the purposes offor inst, qargs, cargs in qc.data
and such.The new-style format has been around two years now and using the legacy format involves memory and runtime penalties (to allocate new lists rather than re-using the same interned tuples). We should deprecate the legacy interface pending removal in Qiskit 2.0 to push any remaining users onto the modern form.
The text was updated successfully, but these errors were encountered: