How can I count the gate number in the circuit?

Hello,

I have a circuit which is compiled circuit with native gate set(trapped ion). How can I count the gate number. For example:{‘MS’: 32, ‘GPI’: 15, ‘GPI2’:20}
Here is my code.

######################################################
dev = qml.device(“default.qubit”, wires=qubit_num)
my_adder_circuit = qml.from_qasm(adder_circuit.qasm())
@qml.qnode(dev)
@ionize
def circuit(x):
my_adder_circuit(wires=[i for i in range(qubit_num)])
return qml.expval(qml.PauliZ(0))
print(qml.draw(circuit)(x=0))
######################################################

Any help will be appreciated.

Hi @Cheng_Chu!
The functionally you are looking for is this one .
With qml.specs you will be able to obtain information about your circuits :rocket:
Let me know if you have any issue :slight_smile:

1 Like