Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow solver as an argument to chimera_graph and pegasus_graph #165

Open
arcondello opened this issue Apr 9, 2020 · 1 comment
Open

Comments

@arcondello
Copy link
Member

Something like

import dwave_networkx as dnx
from dwave.system import DWaveSampler

sampler = DWaveSampler(solver=dict(topology__type__eq="chimera" ))
C = dnx.chimera_graph(sampler)


sampler = DWaveSampler(solver=dict(topology__type__eq="pegasus" ))
P = dnx.pegasus_graph(sampler)

Idea suggested by @boothby

Note that

G = nx.Graph(DWaveSampler().adjacency)

already works "out of the box", but the generated graph is missing information like https://github.com/dwavesystems/dwave_networkx/blob/fc537dcee1b25124e411ad8983b23bb36352da3a/dwave_networkx/generators/chimera.py#L134 On the other hand, this syntax has the advantage of being topology agnostic.

@randomir
Copy link
Member

randomir commented Apr 9, 2020

No objections to the feature request, just a minor comment: eq operator is implied, so the filters can be simplified to topology__type="...". If you aimed for explicit, ignore my comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants