# CouplingMap¶

class CouplingMap(couplinglist=None, description=None)[source]

Bases: object

Directed graph specifying fixed coupling.

Nodes correspond to physical qubits (integers) and directed edges correspond to permitted CNOT gates

Create coupling graph. By default, the generated coupling has no nodes.

Parameters
• couplinglist (list or None) – An initial coupling graph, specified as an adjacency list containing couplings, e.g. [[0,1], [0,2], [1,2]].

• description (str) – A string to describe the coupling map.

Methods

 add_edge Add directed edge to coupling graph. add_physical_qubit Add a physical qubit to the coupling graph as a node. distance Returns the undirected distance between physical_qubit1 and physical_qubit2. draw Draws the coupling map. from_full Return a fully connected coupling map on n qubits. from_grid Return qubits connected on a grid of num_rows x num_columns. from_line Return a fully connected coupling map on n qubits. from_ring Return a fully connected coupling map on n qubits. get_edges Gets the list of edges in the coupling graph. is_connected Test if the graph is connected. largest_connected_component Return a set of qubits in the largest connected component. make_symmetric Convert uni-directional edges into bi-directional. neighbors Return the nearest neighbors of a physical qubit. reduce Returns a reduced coupling map that corresponds to the subgraph of qubits selected in the mapping. shortest_undirected_path Returns the shortest undirected path between physical_qubit1 and physical_qubit2. size Return the number of physical qubits in this graph. subgraph Return a CouplingMap object for a subgraph of self.

Attributes

distance_matrix

Return the distance matrix for the coupling map.

is_symmetric

Test if the graph is symmetric.

Return True if symmetric, False otherwise

physical_qubits

Returns a sorted list of physical_qubits