exa.core.util.topology.get_naive_coloring

exa.core.util.topology.get_naive_coloring#

get_naive_coloring(components)#

Get a naive coloring out of given component lists.

Going in order, find a set of tuples of qubits which does not overlap on any qubit. Remove these tuples, and repeat, obtaining effectively an edge coloring of a hypergraph. Solving this problem optimally is NP-complete.

Returns:

Coloring for parallel experiments, compatible with the COLORED_GROUPS mode.

Parameters:

components (list[tuple[str, ...]])

Return type:

list[list[tuple[str, …]]]