Add a method to compute gate counts per qubit #12972
Labels
good first issue
Good for newcomers
Rust
This PR or issue is related to Rust code in the repository
type: feature request
New feature or request
What should we add?
We have a method
QuantumCircuit.count_ops
method but in some scenarios you want to know the count of gates on each qubit. You can fairly easily build this view of the circuit by iterating overQuantumCirucit.data
but because the data is stored in rust it would be much more efficient to build this view of the circuit in Rust and return it to Python. We should add this method to the pythonQuantumCircuit
class but instead call an inner method defined on the rustCircuitData
struct.The text was updated successfully, but these errors were encountered: