dwave_networkx.zephyr_sublattice_mappings#
- zephyr_sublattice_mappings(source, target, offset_list=None)[source]#
Yields mappings from a Chimera or Zephyr graph into a Zephyr graph.
A sublattice mapping is a function from nodes of
a
zephyr_graph(m_s, t)
to nodes of azephyr_graph(m_t, t)
wherem_s <= m_t
,a
chimera_graph(m_s, n_s, t)
to nodes of azephyr_graph(m_t, t)
wherem_s <= 2*m_t
andn_s <= 2*m_t
, ora
chimera_graph(m_s, n_s, 2*t)
to nodes of azephyr_graph(m_t, t)
wherem_s <= m_t
andn_s <= m_t
.
This sublattice mapping is used to identify subgraphs of the target Zephyr graph which are isomorphic to the source 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 image of the source graph.
The tile parameter of Chimera graphs must be either the same or double that of the target Zephyr graphs; if both graphs are Zephyr graphs, the tile parameters must be the same. The mappings produced preserve the linear ordering of tile indices; see the
_zephyr_zephyr_sublattice_mapping
,_double_chimera_zephyr_sublattice_mapping
, and_single_chimera_zephyr_sublattice_mapping
internal functions in the source code.- Parameters:
source (NetworkX Graph) – The Chimera or Zephyr graph that nodes are input from.
target (NetworkX Graph) – The Zephyr 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. 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
, which can be collected and passed intooffset_list
in a later session.
Notes
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 Zephyr graphs permit permutations of major tile indices on a per-row and per-column basis in addition to reflections of the grid that induce inversion of orthogonal minor offsets and rotations that induce inversions of minor offsets, orientation, or both. Although the full set of sublattice mappings would take those isomorphisms into account, this function does not handle that complex task.