# IBMQ backends: How can I know the repetition rate and depth limits of real devices?

When trying to execute complex quantum circuits on IBMQ real devices, one can encounter a typical error (ERROR_RUNNING_JOB) with the message 'Circuit runtime is greater than the device repetition rate [8020]'.

I think am fully concerned on what refers to circuit fidelity and transpile optimizations. However, what I'm trying to get is just what are those device repetition rates that my circuit runtime should be smaller than (my goal is to study current device limits for executions of a quantum algorithm depending on the parameters given, which affects significantly on the circuit runtime).

What's more, how can I calculate the circuit runtime depending on its depth (and I suppose types and number of gates being required)?

For example, someone asked 7 months ago how to fix the 8020 error, which is "simply" fixed by reducing the circuit size, but at which point does someone have to reduce it depending on the real device (like ibmq_16_melbourne or ibmq_manhattan)?

This is a late answer. But while going through some old questions, I found this and thought I should add an answer here in case someone run into this issue in the future.

To calculate the estimated run time on your circuit, you can do this as follow:

Transpile your circuit into the basis gate set $$U3$$ and $$CX$$. The reason for this is because all single qubit gates can be implemented very quickly on the quantum computer. We are just talking about implementing them on physical qubits here, not fault-tolerance implementation. Once your circuit is in this basis, you can use Directed Acylic Graph to find the longest path. Note that, the longest path here is the path with the most CNOT (CX) gates. This is because, when there are more than one single qubit gate next to each other, it can be condensed down to a single $$U3$$ gate. Once at this step, retreive the quantum hardware properties to extract the time do each of the CNOT in your longest path then add them up. For the single qubit $$U3$$ gate, you can take it to be maximum time of the single qubit gates listed... since the time of $$U3$$ gate is so much less compare to $$CNOT$$ gate, it shouldn't be a big deal.

First make sure to import the following

from qiskit.dagcircuit import DAGCircuit
from qiskit.converters import circuit_to_dag
from qiskit.compiler import transpile


Step 1:

transpile_circuit = transpile(circuit, basis_gates=['u3', 'cx'] )

Step2:

dag_circuit = circuit_to_dag(transpile_circuit)

Step 3:

 dag_circuit.count_ops_longest_path()

This will give you a dictionary, something like: {'u3': 10, 'cx': 25, 'measure': 5}

Now use Qiskit BackendProperties to retrieve the gate time like what discussed above.