# Qubits specification on IBMQ devices

As it is shown here, CNOT gates between different qubits have different error rates. I have the following questions:

1) While defining a circuit on QISkit, does q[0] always correspond to the same qubit on a device (e.g. the qubit labeled q0 on the device manual)? If so, how can I only use for example qubit 12 and 13 of ibmq_16_melbourne (just as an example)?

2) If one job is being executed on a device, say for instance using 3 qubits, is any other job running on that device at the same time?

3) How many CNOT gates one circuit can have so that its error stays reasonable? Basically, how deep can a circuit be on any of the devices to get a reasonable result?

Thank you.

1) While defining a circuit on QISkit, does q[0] always correspond to the same qubit on a device
(e.g. the qubit labeled q0 on the device manual)? If so, how can I only use for example qubit 12 and
13 of ibmq_16_melbourne (just as an example)?


The way Qiskit works with quantum circuit and backends is:

1. Generate the quantum circuit with the API. The quantum circuit is stored in a QuantumCircuit object.
2. Transform this QuantumCircuit object into a DAGCircuit object which represents the same quantum circuit but uses a DAG instead of a list of gates.
3. Give this DAGCircuit object to the compiler. The compiler takes care of multiple things:
1. Respecting the topology of the backend you are compiling for. This is the step that will bother you as the compiler will probably "shuffle" (not in a random way of course) your qubits. One exception I see is when the circuit already respects the backend topology. In this case the compiler may not change the qubits.
2. Respecting the basis gates used by the backend.
3. Optimising your circuit. This step might also be problematic. I don't know if such an optimisation is present in the Qiskit compiler, but if the compiler tries to optimise also with respect to the errors rates then you might end up with "shuffled" qubits.

You will need to check what I am saying experimentally.

2) If one job is being executed on a device, say for instance using 3 qubits, is any other job being
ran on that device at the same time?


It seems unlikely to me but lets wait for the answer of one of the developers of Qiskit.

3) How many CNOT gates one circuit can have so that its error stays reasonable? Basically, how
deep can a circuit be on any of the devices to get a reasonable result?


Very few.

If you limit yourself to Q12 and Q13 then the CX gate between the two has a probability of failure of 0.041. This means that applying only CX gates, you have a probability of success of $$(1 - 0.041)^n$$ with $$n$$ being the number of CX gates applied. For $$10$$ CX gates, the probability is $$\approx 0.66$$. For $$20$$ gates, the probability of success drops to $$\approx 0.43$$.

When mapping a circuit to a quantum device using Qiskit, the choice of which virtual qubits (the ones in your circuit) get mapped onto which physical (device) qubits depends on whether you let qiskit decide or you implement your own initial_layout. By default, qiskit will pick the most connected subset of the device graph that fits your circuit. These qubits are usually not the lowest noise qubits. If you want to select specific qubits, you can pass a layout using the initial_layout keyword argument to either execute or compile. Note that there may be some additional permutation of the qubit labels during the swap mapping phase, in order to lower the number of swap gates needed, if any.