dwave.embedding.drawing.draw_chimera_bqm#
- draw_chimera_bqm(bqm, width=None, height=None)[source]#
Represent a binary quadratic model as a Chimera graph.
- Parameters:
bqm (
BinaryQuadraticModel) – Binary quadratic model equivalent to a Chimera graph or subgraph produced bychimera_graph(), with nodes and edges labeled as integers.width (int, optional) – Number of cells for the graph width. If
widthandheightare not specified, assumes square cell dimensions.height (int, optional) – Number of cells for the graph height. If
widthandheightare not specified, assumes square cell dimensions.
Examples
>>> from dimod import BinaryQuadraticModel >>> from dwave.embedding.drawing import draw_chimera_bqm ... >>> Q = {(0, 0): 2, (1, 1): 1, (2, 2): 0, (3, 3): -1, (4, 4): -2, ... (5, 5): -2, (6, 6): -2, (7, 7): -2, (0, 4): 2, (0, 4): -1, ... (1, 7): 1, (1, 5): 0, (2, 5): -2, (2, 6): -2, (3, 4): -2, ... (3, 7): -2} >>> draw_chimera_bqm(BinaryQuadraticModel.from_qubo(Q), width=1, height=1)