English
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

qiskit.transpiler.CouplingMap.distance

CouplingMap.distance(physical_qubit1, physical_qubit2)[source]

Returns the undirected distance between physical_qubit1 and physical_qubit2.

Parameters
  • physical_qubit1 (int) – A physical qubit

  • physical_qubit2 (int) – Another physical qubit

Returns

The undirected distance

Return type

int

Raises

CouplingError – if the qubits do not exist in the CouplingMap