dwavesystems / dwavesystems/dwave-graphs

draw_topology functions error when linear xor quadratic biases is provided

Open
#232 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
95
Forks
62
Avg merge
7d 18h
Merged PRs (30d)
1

Description

**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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.