Graph Generators#

Generators for graphs, such the graphs (topologies) of D-Wave System QPUs.

D-Wave Systems#

chimera_graph(m[, n, t, create_using, ...])

Creates a Chimera lattice of size (m, n, t).

pegasus_graph(m[, create_using, node_list, ...])

Creates a Pegasus graph with size parameter m.

zephyr_graph(m[, t, create_using, ...])

Creates a Zephyr graph with grid parameter m and tile parameter t.

Example#

This example uses the the chimera_graph() function to create a Chimera lattice of size (1, 1, 4), which is a single unit cell in Chimera topology, and the find_chimera() function to determine the Chimera indices.

>>> import networkx as nx
>>> import dwave_networkx as dnx
>>> G = dnx.chimera_graph(1, 1, 4)
>>> chimera_indices = dnx.find_chimera_indices(G)
>>> print chimera_indices
{0: (0, 0, 0, 0),
 1: (0, 0, 0, 1),
 2: (0, 0, 0, 2),
 3: (0, 0, 0, 3),
 4: (0, 0, 1, 0),
 5: (0, 0, 1, 1),
 6: (0, 0, 1, 2),
 7: (0, 0, 1, 3)}
Indices of a Chimera unit cell.

Indices of a Chimera unit cell found by creating a lattice of size (1, 1, 4).#

Toruses#

chimera_torus(m[, n, t, node_list, edge_list])

Creates a defect-free Chimera lattice of size \((m, n, t)\) subject to periodic boundary conditions.

pegasus_torus(m[, node_list, edge_list, ...])

Creates a Pegasus graph modified to allow for periodic boundary conditions and translational invariance.

zephyr_torus(m[, t, node_list, edge_list])

Creates a Zephyr graph modified to allow for periodic boundary conditions and translational invariance.

Other Graphs#

markov_network(potentials)

Creates a Markov Network from potentials.