dwave_networkx.drawing.chimera_layout.draw_chimera

draw_chimera(G, **kwargs)[source]

Draws graph G in a Chimera cross topology.

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

Parameters:
  • G (NetworkX graph) – Should be a Chimera graph or a subgraph of a Chimera graph.
  • linear_biases (dict (optional, default {})) – A dict of biases associated with each node in G. Should be of form {node: bias, …}. Each bias should be numeric.
  • quadratic_biases (dict (optional, default {})) – A dict of biases associated with each edge in G. Should be of form {edge: bias, …}. Each bias should be numeric. Self-loop edges (i.e., \(i=j\)) are treated as linear biases.
  • kwargs (optional keywords) – See networkx.draw_networkx() for a description of optional keywords, with the exception of the pos parameter which is not used by this function. If linear_biases or quadratic_biases are provided, any provided node_color or edge_color arguments are ignored.

Examples

>>> # Plot 2x2 Chimera unit cells
>>> import networkx as nx
>>> import dwave_networkx as dnx
>>> import matplotlib.pyplot as plt  # doctest: +SKIP
>>> G = dnx.chimera_graph(2, 2, 4)
>>> dnx.draw_chimera(G)  # doctest: +SKIP
>>> plt.show()  # doctest: +SKIP