dwave.graphs.algorithms.coloring.zephyr_four_color#

zephyr_four_color(q: tuple[int, int, int, int, int], scheme: Literal[0, 1] = 0) int[source]#

Returns a node color sufficient for four coloring a Zephyr graph.

Parameters:
  • q – Qubit label in standard coordinate format: (u, w, k, j, z).

  • scheme – Pattern selector. Two patterns not related by automorphism are supported.

Returns:

A color in {0, 1, 2, 3}.

Example

A mapping of every qubit in a Zephyr[m, t] graph to one of four colors.

>>> m = 2
>>> G = dwave.graphs.zephyr_graph(m, coordinates=True)
>>> colors = {q: dwave.graphs.zephyr_four_color(q) for q in G.nodes()}