dwave_networkx.zephyr_graph¶
- zephyr_graph(m, t=4, create_using=None, node_list=None, edge_list=None, data=True, coordinates=False)[source]¶
Creates a Zephyr graph with grid parameter
m
and tile parametert
.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 None, calculated from
m
. Note that this list is used to remove nodes, so only specified nodes that belong to the base node set (described in thecoordinates
parameter) are added.edge_list (iterable, optional (default None)) – Iterable of edges in the graph. If None, edges are generated as described below. The nodes in each edge must be labeled according to the
coordinates
parameter.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'
ifcoordinates
is False and an integer'linear_index'
ifcoordinates
is True.coordinates (bool, optional (default False)) – If True, node labels are 5-tuple Zephyr indices.
- Returns
G – A Zephyr lattice for grid parameter
m
and tile parametert
.- 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
\(0 <= 2w+1-a < 2m+1\),
\(0 <= 2z+1-a < 2m+1\),
\(0 <= z-jb < m\), and
\(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