# How to get information about 'qubit location' or 'variable of qubit location' in qiskit docs?

I have something problem with using qiskit. I searched several qiskit docs to get 'qubit location' or 'variables' that represent qubit.

I searched three documents below.

qiskit.transpiler.passes.layout.sabre_layout
qiskit.transpiler.passes.routing.sabre_swap
qiskit.dagcircuit.DAGCircuit


However, I couldn't get the information about qubit location in these docs. SABRE algorithm use qubit location to switch qubit's location to execute on the real quantum hardware with satisfying its coupling graph. That's why I'm sure that these docs will contain information about qubit location to use them. But I can't find it. Could you help me?

If I need to find out some other docs, please let me know. Thank you.

One way you can find the qubits layout in a particular hardware and along with their layout is as follow:

provider = IBMQ.load_account()
backend = provider.get_backend('ibmq_lima')
from qiskit.transpiler import CouplingMap
num_qubits = backend.configuration().n_qubits
qubit_layout = CouplingMap( getattr(backend.configuration(), 'coupling_map', None) ).reduce([i for i in range(num_qubits)])
print('\n qubit_layout: \n', qubit_layout)
qubit_layout.draw()  #This will print out the graph at the bottom


You will get a printout of the qubit coupling map, which is how the qubits are connected together. This then can be use to reconstruct the layout or position of the qubit as you see at the graph at the bottom.

qubit_layout:
[[0, 1], [1, 0], [1, 2], [1, 3], [2, 1], [3, 1], [3, 4], [4, 3]]


• You can potentially run into an error when execute qubit_layout.draw() in your own local machine. If this is the case you can test this script through the Jupyter notebook within the IBM Quantum lab.
• Thank you for your opinion. However the real thing I wanna know it not kind like this. I wanna know the variables that can manipulate qubit location.
– 김동민
Aug 24 at 1:31