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
Test if the graph is symmetric.
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.
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.
Gets the list of edges in the coupling graph.
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.
Returns the shortest undirected path between physical_qubit1 and physical_qubit2.
Return the number of physical qubits in this graph.
CouplingMap.subgraph
(nodelist)Return a CouplingMap object for a subgraph of self.