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]]. It is required that nodes are contiguously indexed starting at 0. Missed nodes will be added as isolated nodes in the coupling map.
description (str) – A string to describe the coupling map.
Methods
Add directed edge to coupling graph.
Add a physical qubit to the coupling graph as a node.
Compute the full distance matrix on pairs of nodes.
Returns the undirected distance between physical_qubit1 and physical_qubit2.
Draws the coupling map.
Return a fully connected coupling map on n qubits.
Return a coupling map of qubits connected on a grid of num_rows x num_columns.
Return a heavy hexagon graph coupling map.
Return a heavy square graph coupling map.
Return a hexagonal lattice graph coupling map.
Return a coupling map of n qubits connected in a line.
Return a coupling map of n qubits connected to each of their neighbors in a ring.
Gets the list of edges in the coupling graph.
Test if the graph is connected.
Return a set of qubits in the largest connected component.
Convert uni-directional edges into bi-directional.
Return the nearest neighbors of a physical qubit.
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.
Return a CouplingMap object for a subgraph of self.
Attributes
- description¶
- graph¶
- 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