# How can I know the number of qubits used in a job in qiskit?

How can I know the number of qubits used in a job in qiskit?

I can always do something like

retrieve_job = provider.backend.retrieve_job(job_id)
retrieve_job.circuits()[i].draw(),


where i is the ith-circuit. However, if I have a large number of circuits in a job, I don't want to check manually which qubits my circuit used (I am sure that before the transpilation I never use all of the qubits).

• To clarify, you're trying to find the qubits that were used for each circuit sent to the job? Could you maybe give an example of a circuit before/after transpilation, and use that to describe the metric you're looking for? Jun 13, 2022 at 14:19
• Uhmm it's not even a metric, I just would like to check which qubits were used after the transpilation. My guess is that there should be a built-in method to say "you used qubits 12,4 of the device ibmq_something, but I may be wrong in that the method exists. Jun 13, 2022 at 18:38
• Ohh, I see, so for example, you submitted a job that used a 2-qubit circuit to a 5-qubit QPU, you're interested in finding out which 2 qubits were used on the actual hardware to execute the job. Is that correct? Jun 13, 2022 at 18:45
• Yes, exactly, that's it. Jun 13, 2022 at 19:42
• Got it. I'm not personally aware of any feature that enables this, but perhaps a qiskit developer would know more .. Jun 13, 2022 at 22:45

def find_active_qubits(circuit):