dwave_networkx.pegasus_torus#

pegasus_torus(m, node_list=None, edge_list=None, offset_lists=None, offsets_index=None)[source]#

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

Parameters:
  • m (int) – Size parameter for the Pegasus lattice. Connectivity of all nodes is \(13 + min(m - 1, 2)\)

  • node_list (iterable (optional, default None)) – Iterable of nodes in the graph. If None, nodes are generated for an undiluted torus calculated from m as described below. The node list must describe a subset of the torus nodes to be maintained in the graph using the coordinate node labeling scheme.

  • edge_list (iterable (optional, default None)) – Iterable of edges in the graph. If None, edges are generated for an undiluted torus calculated from m as described below. The edge list must describe a subgraph of the torus, using the coordinate node labeling scheme.

  • offset_lists (pair of lists, optional (default None)) – Directly controls the offsets. Each list in the pair must have length 12 and contain even integers. If offset_lists is not None, the offsets_index parameter must be None.

  • offsets_index (int, optional (default None)) – A number between 0 and 7, inclusive, that selects a preconfigured set of topological parameters. If both the offsets_index and offset_lists parameters are None, the offsets_index parameters is set to zero. At least one of these two parameters must be None.

Returns:

G – A Pegasus torus for size parameter \(m\) using the coordinate labeling system.

Return type:

NetworkX Graph

A Pegasus torus is a generalization of the standard Pegasus graph whereby degree-fifteen connectivity is maintained, but the boundary condition is modified to enforce an additional translational-invariance symmetry [RH]. Local connectivity in the Pegasus torus is identical to connectivity for Pegasus graph nodes away from the boundary. A tile consists of 24 nodes, and the torus has \(m - 1\) by \(m - 1\) tiles. Tile displacement modulo \(m - 1\) defines an automorphism.

See pegasus_graph() for additional information.

Examples

>>> G = dnx.pegasus_torus(4)  # a 3x3 tile pegasus torus (connectivity 15)
>>> len(G) # 3*3*24
216
>>> any([len(list(G.neighbors(n))) != 15 for n in G.nodes])
False