Utilities#

Decorators#

Decorators allow for input checking and default parameter setting for algorithms.

binary_quadratic_model_sampler(which_args)

Decorator to validate sampler arguments.

Graph Indexing#

See Coordinates Conversion on instantiating the needed lattice size and setting correct domain and range for coordinates in a QPU working graph.

For the iterator versions of these functions, see the code.

Chimera#

chimera_coordinates.chimera_to_linear(q)

Convert a 4-term Chimera coordinate to a linear index.

chimera_coordinates.graph_to_chimera(g)

Return a copy of the graph g relabeled to have chimera coordinates

chimera_coordinates.graph_to_linear(g)

Return a copy of the graph g relabeled to have linear indices

chimera_coordinates.linear_to_chimera(r)

Convert a linear index to a 4-term Chimera coordinate.

chimera_sublattice_mappings(source, target)

Yields mappings from a Chimera graph into a larger Chimera graph.

find_chimera_indices(G)

Attempts to determine the Chimera indices of the nodes in graph G.

Pegasus#

pegasus_coordinates.graph_to_linear(g)

Return a copy of the graph g relabeled to have linear indices

pegasus_coordinates.graph_to_nice(g)

Return a copy of the graph p relabeled to have nice coordinates

pegasus_coordinates.graph_to_pegasus(g)

Return a copy of the graph g relabeled to have pegasus coordinates

pegasus_coordinates.linear_to_nice(r)

Convert a linear index into a 5-term nice coordinate.

pegasus_coordinates.linear_to_pegasus(r)

Convert a linear index into a 4-term Pegasus coordinate.

pegasus_coordinates.nice_to_linear(n)

Convert a 5-term nice coordinate into a linear index.

pegasus_coordinates.nice_to_pegasus(n)

Convert a 5-term nice coordinate into a 4-term Pegasus coordinate.

pegasus_coordinates.pegasus_to_linear(q)

Convert a 4-term Pegasus coordinate into a linear index.

pegasus_coordinates.pegasus_to_nice(p)

Convert a 4-term Pegasus coordinate to a 5-term nice coordinate.

pegasus_sublattice_mappings(source, target)

Yields mappings from a Chimera or Pegasus graph into a Pegasus graph.

Zephyr#

zephyr_coordinates.graph_to_linear(g)

Return a copy of the graph g relabeled to have linear indices

zephyr_coordinates.graph_to_zephyr(g)

Return a copy of the graph g relabeled to have zephyr coordinates

zephyr_coordinates.linear_to_zephyr(r)

Convert a linear index into a 5-term Zephyr coordinate.

zephyr_coordinates.zephyr_to_linear(q)

Convert a 5-term Zephyr coordinate into a linear index.

zephyr_sublattice_mappings(source, target[, ...])

Yields mappings from a Chimera or Zephyr graph into a Zephyr graph.

Exceptions#

Base exceptions and errors for D-Wave NetworkX.

All exceptions are derived from NetworkXException.

DWaveNetworkXException

Base class for exceptions in DWaveNetworkX.

DWaveNetworkXMissingSampler

Exception raised by an algorithm requiring a discrete model sampler when none is provided.