dwave_networkx.drawing.chimera_layout.chimera_layout

chimera_layout(G, scale=1.0, center=None, dim=2)[source]

Positions the nodes of graph G in a Chimera cross topology.

NumPy (http://scipy.org) is required for this function.

Parameters:
  • G (NetworkX graph) – Should be a Chimera graph or a subgraph of a Chimera graph. If every node in G has a chimera_index attribute, those are used to place the nodes. Otherwise makes a best-effort attempt to find positions.
  • scale (float (default 1.)) – Scale factor. When scale = 1, all positions fit within [0, 1] on the x-axis and [-1, 0] on the y-axis.
  • center (None or array (default None)) – Coordinates of the top left corner.
  • dim (int (default 2)) – Number of dimensions. When dim > 2, all extra dimensions are set to 0.
Returns:

pos – A dictionary of positions keyed by node.

Return type:

dict

Examples

>>> G = dnx.chimera_graph(1)
>>> pos = dnx.chimera_layout(G)