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) – A Pegasus graph or a subgraph of a Pegasus graph, as produced by the dwave_networkx.pegasus_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.

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

Returns

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

Return type

function