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 layout.

Unit cells are rendered in a cross layout.

Parameters:
  • G (NetworkX graph) – Chimera graph or subgraph of a Chimera graph. If every node in G has a chimera_index attribute, the node position in the chimera_index attribute is used to place each node. Otherwise, a best-effort attempt is made to find the node positions.

  • scale (float (default 1.)) – Scale factor. If 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. If dim > 2, all extra dimensions are set to 0.

Returns:

pos – Dictionary of positions keyed by node.

Return type:

dict

Examples

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