dwave-networkx#

Deprecated since version 0.8.19: dwave-networkx is deprecated and will be replaced by dwave-graphs in Ocean 10. Most functionality previously provided by dwave-networkx is now available as part of dwave-graphs under the dwave.graphs namespace.

Reference documentation for dwave-networkx:

About dwave-networkx#

dwave-networkx is an extension of NetworkX—a Python language package for exploration and analysis of networks and network algorithms—for users of D-Wave quantum computers. It provides tools for working with quantum processing unit (QPU) topology graphs, such as the Pegasus used on the AdvantageTM quantum computer, and implementations of graph-theory algorithms on D-Wave quantum computers and other binary quadratic model (BQM) samplers.

This example generates a Pegasus graph of the size used by Advantage QPUs.

>>> import dwave_networkx as dnx
>>> graph = dnx.pegasus_graph(16)

Functions such as draw_pegasus() provide easy visualization for Pegasus graphs while functions such as maximum_cut() or min_vertex_cover() provide graph algorithms useful to optimization problems that fit well with D‑Wave quantum computers.

Like D‑Wave quantum computers, all other supported samplers must have sample_qubo and sample_ising methods for solving Ising and QUBO models and return an iterable of samples in order of increasing energy. You can set a default sampler using the set_default_sampler() function.

Usage Information#