dwave.system.samplers.LeapHybridCQMSampler.min_time_limit#

LeapHybridCQMSampler.min_time_limit(cqm: ConstrainedQuadraticModel) float[source]#

Return the minimum time_limit, in seconds, accepted for the given problem.

This minimum runtime is always at least the minimum specified by the CQM solver’s minimum_time_limit_s property. As the size and complexity of the CQM increases, the minimum runtime may increase. This method calculates, for the given CQM, the minimum runtime as a function of its number of variables, constraints, and biases, weighted by solver properties such as num_variables_multiplier and others described in the CQM Solver Properties section. See the code for the calculation.

Parameters:

cqm (ConstrainedQuadraticModel) – A constrained quadratic model.

Examples

This example generates a small CQM that requires only the minimum runtime of the minimum_time_limit_s property and a more complex CQM that requires a larger minimum time_limit.

>>> from dimod.generators import bin_packing
>>> from dwave.system import LeapHybridCQMSampler
...
>>> cqm = bin_packing([5]*5, 10)
>>> sampler.min_time_limit(cqm) > sampler.properties["minimum_time_limit_s"]  
False
>>> cqm = bin_packing([5]*5, 10)
>>> sampler.min_time_limit(cqm) > sampler.properties["minimum_time_limit_s"]  
True