Spanish
Idiomas
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

# CouplingMap¶

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

Bases: `object`

Directed graph specifying fixed coupling.

Nodes correspond to physical qubits (integers) and directed edges correspond to permitted CNOT gates, with source and destination corresponding to control and target qubits, respectively.

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

Parámetros
• 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_edge` Add directed edge to coupling graph. `add_physical_qubit` Add a physical qubit to the coupling graph as a node. `compute_distance_matrix` Compute the full distance matrix on pairs of nodes. `connected_components` Separate a `CouplingMap` into subgraph `CouplingMap` for each connected component. `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 a coupling map of qubits connected on a grid of num_rows x num_columns. `from_heavy_hex` Return a heavy hexagon graph coupling map. `from_heavy_square` Return a heavy square graph coupling map. `from_hexagonal_lattice` Return a hexagonal lattice graph coupling map. `from_line` Return a coupling map of n qubits connected in a line. `from_ring` Return a coupling map of n qubits connected to each of their neighbors in a ring. `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

description
graph
distance_matrix

Return the distance matrix for the coupling map.

For any qubits where there isn’t a path available between them the value in this position of the distance matrix will be `math.inf`.

is_symmetric

Test if the graph is symmetric.

Return True if symmetric, False otherwise

physical_qubits

Returns a sorted list of physical_qubits