dwave_networkx.generators.find_chimera_indices¶
-
find_chimera_indices(G)[source]¶ Tries to determine the Chimera indices of the nodes in G.
See chimera_graph for a definition of a Chimera graph and Chimera indices.
Only works for single-tile Chimera graphs.
Parameters: G (a NetworkX graph.) – Returns: chimera_indices – A dict of the form {node: (i, j, u, k), …} where (i, j, u, k) is a 4-tuple of integer Chimera indices. Return type: dict Examples
>>> G = dnx.chimera_graph(1, 1, 4) >>> chimera_indices = dnx.find_chimera_indices(G)
>>> G = nx.Graph() >>> G.add_edges_from([(0, 2), (1, 2), (1, 3), (0, 3)]) >>> chimera_indices = dnx.find_chimera_indices(G) >>> nx.set_node_attributes(G, 'chimera_index', chimera_indices)