dwave_networkx.zephyr_graph#

zephyr_graph(m, t=4, create_using=None, node_list=None, edge_list=None, data=True, coordinates=False, check_node_list=False, check_edge_list=False)[source]#

Creates a Zephyr graph with grid parameter m and tile parameter t.

The Zephyr topology is described in [BRK].

Parameters:
  • m (int) – Grid parameter for the Zephyr lattice.

  • t (int) – Tile parameter for the Zephyr lattice.

  • create_using (Graph, optional (default None)) – If provided, this graph is cleared of nodes and edges and filled with the new graph. Usually used to set the type of the graph.

  • node_list (iterable (optional, default None)) – Iterable of nodes in the graph. If not specified, calculated from (m, t) and coordinates. The nodes should typically be compatible with the requested lattice shape parameters and coordinate system, incompatible nodes are accepted unless you set check_node_list=True. If not specified, all \(4 t m (2 m + 1)\) nodes compatible with the topology description are included.

  • edge_list (iterable (optional, default None)) – Iterable of edges in the graph. Edges must be 2-tuples of the nodes specified in node_list, or calculated from (m, t) and coordinates per the topology description below; incompatible edges are ignored unless you set check_edge_list=True. If not specified, all edges compatible with the node_list and topology description are included.

  • data (bool, optional (default True)) – If True, adds to each node an attribute with a format that depends on the coordinates parameter: a 5-tuple 'zephyr_index' if coordinates=False and an integer 'linear_index' if coordinates is True.

  • coordinates (bool, optional (default False)) – If True, node labels are 5-tuple Zephyr indices.

  • check_node_list (bool (optional, default False)) – If True, the node_list elements are checked for compatibility with the graph topology and node labeling conventions, and an error is thrown if any node is incompatible or duplicates exist. In other words, node_lists must specify a subgraph of the default (full yield) graph described below. An exception is allowed if check_edge_list=False, any node in edge_list will also be treated as valid.

  • check_edge_list (bool (optional, default False)) – If True, edge_list elements are checked for compatibility with the graph topology and node labeling conventions, and an error is thrown if any edge is incompatible or duplicates exist. In other words, edge_list must specify a subgraph of the default (full yield) graph described below.

Returns:

G – A Zephyr lattice for grid parameter m and tile parameter t.

Return type:

NetworkX Graph

The maximum degree of this graph is \(4t+4\). The number of nodes is given by

  • zephyr_graph(m, t): \(4tm(2m+1)\)

The number of edges depends on parameter settings,

  • zephyr_graph(1, t): \(2t(8t+3)\)

  • zephyr_graph(m, t): \(2t((8t+8)m^2-2m-3)\) if m > 1

A Zephyr lattice is a graph minor of a lattice similar to Chimera, where unit tiles have odd couplers similar to Pegasus graphs. In its most general definition, prelattice \(Q(2m+1)\) contains nodes of the form

  • vertical nodes: \((i, j, 0, k)\) with \(0 <= k < 2t\)

  • horizontal nodes: \((i, j, 1, k)\) with \(0 <= k < 2t\)

for \(0 <= i < 2m+1\) and \(0 <= j < 2m+1\), and edges of the form

  • external: \((i, j, u, k)\) ~ \((i+u, j+1-u, u, k)\)

  • internal: \((i, j, 0, k)\) ~ \((i, j, 1, h)\)

  • odd: \((i, j, u, 2k)\) ~ \((i, j, u, 2k+1)\)

The minor—a Zephyr lattice—is constructed by contracting pairs of external edges:

I(0, w, k, j, z) = [(2*z+j, w, 0, 2*k+j), (2*z+1+j, w, 0, 2*k+j)]
I(1, w, k, j, z) = [(w, 2*z+j, 1, 2*k+j), (w, 2*z+1+j, 1, 2*k+j)]

and deleting the prelattice nodes of any pair not fully contained in \(Q(2m+1)\).

The Zephyr index of a node in a Zephyr lattice, \((u, w, k, j, z)\), can be interpreted as:

  • \(u\): qubit orientation (0 = vertical, 1 = horizontal)

  • \(w\): orthogonal major offset; \(0 <= w < 2m+1\)

  • \(k\): orthogonal secondary offset; \(0 <= k < t\)

  • \(j\): orthogonal minor offset; \(0 <= j < 2\)

  • \(z\): parallel offset; \(0 <= z < m\)

Edges in the minor have the form

  • external: \((u, w, k, j, z)\) ~ \((u, w, k, j, z+1)\)

  • odd: \((u, w, 2k, z)\) ~ \((u, w, 2k+1, z-a)\)

  • internal: \((0, 2w+1-a, k, j, z-jb)\) ~ \((1, 2z+1-b, h, i, w-ia)\)

for \(0 <= a < 2\) and \(0 <= b < 2\), where internal edges only exist when

  1. \(0 <= 2w+1-a < 2m+1\),

  2. \(0 <= 2z+1-a < 2m+1\),

  3. \(0 <= z-jb < m\), and

  4. \(0 <= w-ia < m\).

Linear indices are computed from Zephyr indices by the formula:

q = (((u * (2 * m + 1) + w) * t + k) * 2 + j) * m + z

Examples

>>> G = dnx.zephyr_graph(2)
>>> G.nodes(data=True)[(0, 0, 0, 0, 0)]    
{'linear_index': 0}

References

[BRK]

Boothby, Raymond, King, Zephyr Topology of D-Wave Quantum Processors, October 2021. https://dwavesys.com/media/fawfas04/14-1056a-a_zephyr_topology_of_d-wave_quantum_processors.pdf