dwave_networkx.drawing.zephyr_layout.zephyr_layout¶
- zephyr_layout(G, scale=1.0, center=None, dim=2)[source]¶
Positions the nodes of graph G in a Zephyr topology.
NumPy is required for this function.
- Parameters
G (NetworkX graph) – A Zephyr graph or a subgraph of a Zephyr graph, as produced by the
dwave_networkx.zephyr_graph()
function.scale (float (default 1.)) – Scale factor. A setting of
scale = 1
fits all positions 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 – Positions as a dictionary keyed by node.
- Return type
Examples
This example gives the positions of a Zephyr lattice of size 2.
>>> G = dnx.zephyr_graph(2) >>> pos = dnx.zephyr_layout(G)