dwave_networkx.chimera_sublattice_mappings#

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

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

A sublattice mapping is a function from nodes of a chimera_graph(m_s, n_s, t) to nodes of a chimera_graph(m_t, n_t, t) with m_s <= m_t and n_s <= n_t. This is used to identify subgraphs of the target Chimera graphs which are isomorphic to the source Chimera 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 do not produce mappings between Chimera graphs of different tile parameters, and the mappings produced are not exhaustive. The mappings take the form

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

preserving the orientation and tile index of nodes. We use the notation of Chimera coordinates above, but either or both of the target graph may have integer or coordinate labels.

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 cells where rotations by 90 and 270 degrees induce 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 graph that nodes are input from

  • target (NetworkX Graph) – The Chimera graph that nodes are input from

  • 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.