dwave_networkx.drawing.zephyr_layout.draw_zephyr#
- draw_zephyr(G, **kwargs)[source]#
Draws graph
Gin a Zephyr topology.- Parameters:
G (NetworkX graph) – Zephyr graph or a subgraph of a Zephyr graph as produced by the
dwave_networkx.zephyr_graph()function.linear_biases (dict (optional, default {})) – Linear biases as a dict of the form
{node: bias, ...}, where keys are nodes inGand biases are numeric. If specified, the linear biases are visualized on the plot.quadratic_biases (dict (optional, default {})) – Quadratic biases as a dict of the form
{edge: bias, ...}, where keys are edges inGand biases are numeric. Self-loop edges (i.e., \(i=j\)) are treated as linear biases. If specified, the quadratic biases are visualized on the plot.kwargs (optional keywords) – Parameters in
draw_networkx(), except for theposparameter. If thelinear_biasesorquadratic_biasesparameters are specified, thedraw_networkx()node_colororedge_colorparameters 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()