Coordinates Conversion¶
-
class
chimera_coordinates
(m, n=None, t=None)[source]¶ Provides coordinate converters for the chimera indexing scheme.
Parameters: Examples
Convert between Chimera coordinates and linear indices directly
>>> coords = dnx.chimera_coordinates(16, 16, 4) >>> coords.chimera_to_linear((0, 2, 0, 1)) 17 >>> coords.linear_to_chimera(17) (0, 2, 0, 1)
Construct a new graph with the coordinate labels
>>> C16 = dnx.chimera_graph(16) >>> coords = dnx.chimera_coordinates(16) >>> G = nx.Graph() >>> G.add_nodes_from(coords.iter_linear_to_chimera(C16.nodes)) >>> G.add_edges_from(coords.iter_linear_to_chimera_pairs(C16.edges))
See also
chimera_graph()
- Describes the various conventions.
-
class
pegasus_coordinates
(m)[source]¶ Provides coordinate converters for the Pegasus indexing schemes.
Parameters: m (int) – Size parameter for the Pegasus lattice. See also
pegasus_graph()
- Describes the various coordinate conventions.