hybrid.utils.chimera_tiles#
- chimera_tiles(bqm, m, n, t)[source]#
Map a binary quadratic model to a set of Chimera tiles.
A Chimera lattice is an m-by-n grid of Chimera tiles, where each tile is a bipartite graph with shores of size t.
- Parameters:
bqm (
BinaryQuadraticModel
) – Binary quadratic model (BQM).m (int) – Rows.
n (int) – Columns.
t (int) – Size of shore.
- Returns:
Map as a dict where keys are tile coordinates (row, column, aisle) and values are partial embeddings of part of the BQM to a Chimera tile. Embeddings are those that would be generated by dwave_networkx’s chimera_graph() function.
- Return type:
Examples
This example maps a 1-by-2 Chimera-derived BQM to 2 side-by-side tiles.
>>> import dwave_networkx as dnx >>> import dimod >>> G = dnx.chimera_graph(1, 2) # Create a Chimera-based BQM >>> bqm = dimod.BinaryQuadraticModel({}, {edge: edge[0] for edge in G.edges}, 0, 'BINARY') >>> chimera_tiles(bqm, 1, 1, 4) {(0, 0, 0): {0: [0], 1: [1], 2: [2], 3: [3], 4: [4], 5: [5], 6: [6], 7: [7]}, (0, 1, 0): {8: [0], 9: [1], 10: [2], 11: [3], 12: [4], 13: [5], 14: [6], 15: [7]}}