Composites

The dwave-greedy package currently includes just one composite, SteepestDescentComposite.

SteepestDescentComposite

Class

class SteepestDescentComposite(child_sampler)[source]

Runs greedy local optimization (steepest descent) on input problem, seeded with samples from the sampler.

Parameters

child_sampler (dimod.Sampler) – A dimod sampler, such as a DWaveSampler.

Examples

>>> from dwave.system import DWaveSampler
>>> from greedy import SteepestDescentComposite
...
>>> sampler = SteepestDescentComposite(DWaveSampler())
>>> h = {0: -1, 4: 2}
>>> J = {(0, 4): 1.5}
>>> sampleset = sampler.sample_ising(h, J)
>>> sampleset.first.energy
-4.5

Attributes

SteepestDescentComposite.properties

Properties in the form of a dict.

SteepestDescentComposite.parameters

Parameters in the form of a dict.

Methods

SteepestDescentComposite.sample(bqm, ...)

Sample from the provided binary quadratic model.

SteepestDescentComposite.sample_ising(h, J, ...)

Sample from an Ising model using the implemented sample method.

SteepestDescentComposite.sample_qubo(Q, ...)

Sample from a QUBO using the implemented sample method.