dwave_networkx.drawing.chimera_layout.chimera_layout¶
-
chimera_layout(G, scale=1.0, center=None, dim=2)[source]¶ Positions the nodes in a Chimera lattice.
NumPy (http://scipy.org) is required for this function.
Parameters: - G (graph) – A networkx graph. Should be a Chimera graph or a subgraph of a Chimera graph. If every node in G has a ‘chimera_index’ attribute, then those are used to place the nodes. Otherwise will attempt to find positions, but is not guarunteed to succeed.
- scale (float (default 1.)) – Scale factor. When scale = 1 the all positions will 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: Examples
>>> G = dnx.chimera_graph(1) >>> pos = dnx.chimera_layout(G)