CouplingMap

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

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.

Attributes

CouplingMap.is_symmetric

Test if the graph is symmetric.

CouplingMap.physical_qubits

Returns a sorted list of physical_qubits

Methods

CouplingMap.add_edge(src, dst)

Add directed edge to coupling graph.

CouplingMap.add_physical_qubit(physical_qubit)

Add a physical qubit to the coupling graph as a node.

CouplingMap.distance(physical_qubit1, …)

Returns the undirected distance between physical_qubit1 and physical_qubit2.

CouplingMap.draw()

Draws the coupling map.

CouplingMap.from_full(num_qubits[, …])

Return a fully connected coupling map on n qubits.

CouplingMap.from_grid(num_rows, num_columns)

Return qubits connected on a grid of num_rows x num_columns.

CouplingMap.from_line(num_qubits[, …])

Return a fully connected coupling map on n qubits.

CouplingMap.from_ring(num_qubits[, …])

Return a fully connected coupling map on n qubits.

CouplingMap.get_edges()

Gets the list of edges in the coupling graph.

CouplingMap.is_connected()

Test if the graph is connected.

CouplingMap.reduce(mapping)

Returns a reduced coupling map that corresponds to the subgraph of qubits selected in the mapping.

CouplingMap.shortest_undirected_path(…)

Returns the shortest undirected path between physical_qubit1 and physical_qubit2.

CouplingMap.size()

Return the number of physical qubits in this graph.

CouplingMap.subgraph(nodelist)

Return a CouplingMap object for a subgraph of self.