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 the nodes of a chimera_graph(m_s, n_s, t) to the nodes of a chimera_graph(m_t, n_t, t) with m_s <= m_t and n_s <= n_t. This sublattice mapping is used to identify subgraphs of the target Chimera graph that are isomorphic to the source Chimera graph. However, if the target graph is not of perfect yield,[1] this function does not generally produce isomorphisms; for example, if a node is missing in the target graph, it may still appear in the source graph’s image.

Note that this function does 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. Although the notation of Chimera coordinates is used, either or both of the target graphs may have integer or coordinate labels.

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

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

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

Yields:

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

Notes

The full group of a Chimera graph’s isomorphisms 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. Although the full set of sublattice mappings would take those isomorphisms into account, this function does not handle that complex task.