dwave.embedding.chimera.find_grid_embedding¶
- find_grid_embedding(dim, m, n=None, t=4)[source]¶
Find an embedding for a grid in a Chimera graph.
Given grid dimensions and a target Chimera graph size, attempts to find an embedding.
- Parameters
- Returns
An embedding mapping a grid to the Chimera lattice.
- Return type
Examples
This example finds an embedding for a 2x3 grid in a 12x12 lattice of Chimera unit cells.
>>> from dwave.embedding.chimera import find_grid_embedding ... >>> embedding = find_grid_embedding([2, 3], m=12, n=12, t=4) >>> embedding {(0, 0): [0, 4], (0, 1): [8, 12], (0, 2): [16, 20], (1, 0): [96, 100], (1, 1): [104, 108], (1, 2): [112, 116]}