dwave_networkx.drawing.chimera_layout.draw_chimera#

draw_chimera(G, **kwargs)[source]#

Draws graph G in a Chimera layout.

Unit cells are rendered in a cross layout.

Parameters:
  • G (NetworkX graph) – Chimera graph or a subgraph of a Chimera graph.

  • linear_biases (dict (optional, default {})) – Linear biases for all nodes of G as a dict of the form {node: bias, ...}, where each bias is numeric. If specified, the linear biases are visualized on the plot.

  • quadratic_biases (dict (optional, default {})) – Quadratic biases for all edges of G as a dict of the form {edge: bias, ...}, where each bias is 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 the pos parameter. If the linear_biases or quadratic_biases parameters are specified, the draw_networkx() node_color or edge_color parameters are ignored.

Examples

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