dwave_networkx.pegasus_sublattice_mappings#

pegasus_sublattice_mappings(source, target, offset_list=None)[source]#

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

A sublattice mapping is a function from nodes of a pegasus_graph(m_s) or chimera_graph(m_c, n_c, 4) to nodes of a pegasus_graph(m_t) with m_s <= m_t or m_c <= m_t - 1 and n_c <= m_t - 1. This is used to identify subgraphs of the target Pegasus graphs which are isomorphic to the source graph. However, if the target graph is not of perfect yield, these functions do not generally produce isomorphisms (for example, if a node is missing in the target graph, it may still appear in the image of the source graph).

Note that we require the tile parameter of Chimera graphs to be 4, and the mappings produced are not exhaustive. The mappings take the form

(y, x, u, k) -> (t_offset, y+y_offset, x+x_offset, u, k)

when the source is a Chimera graph, or

(t, y, x, u, k) -> ((t + t_offset)%3, y+y_offset, x+x_offset, u, k)

when the source is a Pegasus graph; preserving the orientation and tile index of nodes. We use the notation of Chimera coordinates and Pegasus nice coordinates above, but the mapping produced will respect the labelings of the source and target graph. Note, the notation above for Pegasus->Pegasus mappings is only suggestive. See _pegasus_pegasus_sublattice_mapping for a precise formula.

Academic note: the full group of isomorphisms of a Chimera graph includes mappings which permute tile indices on a per-row and per-column basis, in addition to reflections and rotations of the grid of unit tiles where rotations by 90 and 270 degrees induce a change in orientation. The isomorphisms of Pegasus graphs permit the swapping across rows and columns of odd couplers, as well as a reflection about the main antidiagonal which induces a change in orientation. The full set of sublattice mappings would take those isomorphisms into account; we do not undertake that complexity here.

Parameters:
  • source (NetworkX Graph) – The Chimera or Pegasus graph that nodes are input from

  • target (NetworkX Graph) – The Pegasus graph that nodes are output to

  • offset_list (iterable (tuple), optional (default None)) – An iterable of offsets. This can be used to reconstruct a set of mappings, as the offset used to generate a single mapping is stored in the offset attribute of that mapping.

Yields:

mapping (function) – A function from nodes of the source graph, to nodes of the target graph. The offset used to generate this mapping is stored in mapping.offset – these can be collected and passed into offset_list in a later session.