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

Positions the nodes of graph G in a Zephyr topology.

  • G (NetworkX graph) – Zephyr graph or a subgraph of a Zephyr graph as produced by the dwave_networkx.zephyr_graph() function.

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


pos – Positions as a dictionary keyed by node.

Return type:



This example gives the positions of a Zephyr lattice of size 2.

>>> G = dnx.zephyr_graph(2)
>>> pos = dnx.zephyr_layout(G)