dwave_networkx.drawing.pegasus_layout.pegasus_node_placer_2d#

pegasus_node_placer_2d(G, scale=1.0, center=None, dim=2, crosses=False)[source]#

Generates a function to convert Pegasus indices to plottable coordinates.

Parameters:
  • G (NetworkX graph) – Pegasus graph or a subgraph of a Pegasus graph as produced by the dwave_networkx.pegasus_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.

  • crosses (boolean (optional, default False)) – If True, \(K_{4,4}\) subgraphs are shown in a cross rather than an L configuration.

Returns:

xy_coords – Function that maps a Pegasus index (u, w, k, z) in a Pegasus lattice to plottable x- and y-coordinates.

Return type:

Function