dwave_networkx.drawing.zephyr_layout.draw_zephyr

draw_zephyr(G, **kwargs)[source]

Draws graph G in a Zephyr topology.

If linear_biases and/or quadratic_biases are provided, these are visualized on the plot.

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

  • linear_biases (dict (optional, default {})) – Biases as a dict, of form {node: bias, …}, where keys are nodes in G and biases are numeric.

  • quadratic_biases (dict (optional, default {})) – Biases as a dict, of form {edge: bias, …}, where keys are edges in G and biases are numeric. Self-loop edges (i.e., \(i=j\)) are treated as linear biases.

  • kwargs (optional keywords) – See draw_networkx() for a description of optional keywords, with the exception of the pos parameter, which is unsupported. If the linear_biases or quadratic_biases parameters are provided, any provided node_color or edge_color arguments are ignored.

Examples

This example plots a Zephyr graph with size parameter 2.

>>> import networkx as nx
>>> import dwave_networkx as dnx
>>> import matplotlib.pyplot as plt   
>>> G = dnx.zephyr_graph(2)
>>> dnx.draw_zephyr(G)    
>>> plt.show()