Introduction#
D-Wave NetworkX provides tools for working with Quantum Processing Unit (QPU)
topology graphs, such as the Pegasus used on the AdvantageTM system,
and implementations of graph-theory algorithms on D-Wave quantum computers and
other binary quadratic model samplers; for example, functions such as
draw_pegasus()
provide easy visualization for Pegasus graphs; 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.
For an introduction to quantum processing unit (QPU) topologies such as the Pegasus graph, see Topology.
For an introduction to binary quadratic models (BQMs), see Binary Quadratic Models.
For an introduction to samplers, see Samplers and Composites.
Example#
This example creates a Pegasus graph (used by Advantage) and a small Zephyr graph (used by the Advantage2TM prototype made available in LeapTM in June 2022):
>>> import dwave_networkx as dnx
...
>>> # Advantage
>>> P16 = dnx.pegasus_graph(16)
...
>>> # Advantage2
>>> Z4 = dnx.zephyr_graph(4)