TilingComposite

class TilingComposite(sampler, sub_m, sub_n, t=4)[source]

Composite to tile a small problem across a Chimera-structured sampler. A problem that can fit on a small Chimera graph can be replicated across a larger Chimera graph to get samples from multiple areas of the system in one call. For example, a 2x2 Chimera lattice could be tiled 64 times (8x8) on a fully-yielded D-WAVE 2000Q system (16x16).

Parameters:
  • sampler (dimod.TemplateSampler) – A structured dimod sampler to be wrapped.
  • sub_m (int) – The number of rows in the sub Chimera lattice.
  • sub_n (int) – The number of columns in the sub Chimera lattice.
  • t (int) – The size of the shore within each Chimera cell.
structure

tuple

A named 3-tuple with the following properties/values:

nodelist (list): The nodes available to the sampler.

edgelist (list[(node, node)]): The edges available to the sampler.

adjacency (dict): Encodes the edges of the sampler in nested dicts. The keys of adjacency are the nodes of the sampler and the values are neighbor-dicts.

embeddings

list – A list of dictionaries mapping from the sub Chimera lattice to the structured sampler of the form {v: {s, …}, …} where v is a variable in the sub Chimera lattice and s is a variable in the system.

sample_ising(h, J, **kwargs)[source]

Sample from the sub Chimera lattice.

Parameters:
  • h (list/dict) – Linear terms of the model.
  • J (dict of (int, int) – float): Quadratic terms of the model.
  • **kwargs – Parameters for the sampling method, specified per solver.
Returns:

dimod.SpinResponse

draw_tiling(sampler, t=4)[source]

Draw Chimera graph of sampler with colored tiles.

Parameters:
  • sampler (dwave_micro_client_dimod.TilingComposite) – A tiled dimod sampler to be drawn.
  • t (int) – The size of the shore within each Chimera cell.

Uses dwave_networkx.draw_chimera (see draw_chimera). Linear biases are overloaded to color the graph according to which tile each Chimera cell belongs to.