Skip to content

draw_topology functions error when linear xor quadratic biases is provided #232

@kevinchern

Description

@kevinchern

Description
draw_topology functions, e.g., draw_pegasus, errors when you supply linear biases and not quadratic biases (vice versa too)

To Reproduce

import dwave_networkx as dnx
G = dnx.pegasus_graph(3)
# This case works as expected
dnx.draw_pegasus(G,  linear_biases={117:-1}, quadratic_biases={(128, 130): -1})
# This case errors out
try:
    dnx.draw_pegasus(G, quadratic_biases={(128, 130): -1})
except Exception as e:
    print(e)
# This case errors out
try:
    dnx.draw_pegasus(G, linear_biases={117:-1})
except Exception as e:
    print(e)

Additional context
Culprit: https://github.com/dwavesystems/dwave-networkx/blob/0.8.14/dwave_networkx/drawing/qubit_layout.py#L117C1-L120

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions