I wanted to calculate the count of each gate used in the specific quantum circuit. For example in the below circuit, the result should be something like:
{'rz': 1, 'h': 4, 'cx': 3, 'measure': 4}
I saw a similar question asked, but it counts all the gates only in the longest path of the dag circuit which it creates using circuit_to_dag
.