dwave.system.composites.TilingComposite.sample¶
- TilingComposite.sample(bqm, **kwargs)[source]¶
Sample from the specified binary quadratic model.
- Parameters
bqm (
dimod.BinaryQuadraticModel
) – Binary quadratic model to be sampled from.**kwargs – Optional keyword arguments for the sampling method, specified per solver.
- Returns
Examples
This example submits a simple Ising problem of just two variables on a D-Wave system. Because the problem fits in a single Chimera unit cell, it is tiled across the solver’s entire Chimera graph, resulting in multiple samples (the exact number depends on the working Chimera graph of the D-Wave system).
>>> from dwave.system import DWaveSampler, EmbeddingComposite >>> from dwave.system import TilingComposite ... >>> qpu_2000q = DWaveSampler(solver={'topology__type': 'chimera'}) >>> sampler = EmbeddingComposite(TilingComposite(qpu_2000q, 1, 1, 4)) >>> response = sampler.sample_ising({},{('a', 'b'): 1}) >>> len(response) 246
See Ocean Glossary for explanations of technical terms in descriptions of Ocean tools.