dwave.system.samplers.LeapHybridSampler.sample#

LeapHybridSampler.sample(bqm, time_limit=None, **kwargs)[source]#

Sample from the specified binary quadratic model.

Parameters:
  • bqm (BinaryQuadraticModel) – Binary quadratic model.

  • time_limit (int) –

    Maximum run time, in seconds, to allow the solver to work on the problem. Must be at least the minimum required for the number of problem variables, which is calculated and set by default.

    min_time_limit() calculates (and describes) the minimum time for your problem.

  • **kwargs – Optional keyword arguments for the solver, specified in parameters.

Returns:

Sample set constructed from a (non-blocking) Future-like object.

Return type:

SampleSet

Examples

This example samples a randomly generated binary quadratic model with 10 variables and 15 interactions.

>>> from dimod.generators import gnm_random_bqm
>>> from dwave.system import LeapHybridSampler
...
>>> bqm = gnm_random_bqm(10, 15, 'SPIN')
>>> with LeapHybridSampler() as sampler:    
...     sampleset = sampler.sample(bqm)