DWaveSampler.sample_qubo(Q, **kwargs)[source]

Sample from the specified QUBO.

  • Q (dict) – Coefficients of a quadratic unconstrained binary optimization (QUBO) model.
  • **kwargs – Optional keyword arguments for the sampling method, specified per solver in DWaveSampler.parameters. D-Wave System Documentation’s solver guide describes the parameters and properties supported on the D-Wave system.

A dimod SampleSet object. In it this sampler also provides timing information in the info field as described in the D-Wave System Documentation’s timing guide.

Return type:



This example submits a two-variable QUBO mapped directly to qubits 0 and 4 on a D-Wave system.

>>> from dwave.system.samplers import DWaveSampler
>>> sampler = DWaveSampler()
>>> Q = {(0, 0): -1, (4, 4): -1, (0, 4): 2}
>>> sampleset = sampler.sample_qubo(Q)
>>> for sample in sampleset.samples():    # doctest: +SKIP
...    print(sample)
{0: 0, 4: 1}

See Ocean Glossary for explanations of technical terms in descriptions of Ocean tools.