DQM Solver Parameters#
This section describes the properties of quantum-classical hybrid
discrete quadratic model solvers such as the Leap
service’s hybrid_discrete_quadratic_model_version1
. For the parameters
you can configure, see the DQM Solver Parameters section.
dqm#
Ocean software’s dimod.DiscreteQuadraticModel
class contains linear and
quadratic biases for problems formulated as
discrete binary models as well as additional
information such as variable labels.
Relevant Properties#
maximum_number_of_variables defines the maximum number of problem variables.
maximum_number_of_biases defines the maximum number of problem biases.
minimum_time_limit and maximum_time_limit_hrs define the runtime duration for hybrid solvers.
Example#
This example submits a small, illustrative problem—a game of
rock-paper-scissors—to Ocean software’s
LeapHybridDQMSampler
.
>>> import dimod
>>> from dwave.system import LeapHybridDQMSampler
...
>>> cases = ["rock", "paper", "scissors"]
>>> win = {"rock": "scissors", "paper": "rock", "scissors": "paper"}
...
>>> dqm = dimod.DiscreteQuadraticModel()
>>> dqm.add_variable(3, label='my_hand')
>>> dqm.add_variable(3, label='their_hand')
>>> for my_idx, my_case in enumerate(cases):
... for their_idx, their_case in enumerate(cases):
... if win[my_case] == their_case:
... dqm.set_quadratic('my_hand', 'their_hand',
... {(my_idx, their_idx): -1})
... if win[their_case] == my_case:
... dqm.set_quadratic('my_hand', 'their_hand',
... {(my_idx, their_idx): 1})
...
>>> dqm_sampler = LeapHybridDQMSampler()
>>> sampleset = dqm_sampler.sample_dqm(
... dqm,
... time_limit=10,
... label="Rock-paper-scissors DQM example")
label#
Problem label you can optionally tag submissions with. You can set as a label a non-empty string of up to 1024 Windows-1252 characters that has meaning to you or is generated by your application, which can help you identify your problem submission. You can see this label on the Leap service’s dashboard and in solutions returned from SAPI.
Example#
The example in the dqm section above sets the label property.

Fig. 24 Problem labels on the dashboard.#
time_limit#
Specifies the maximum runtime, in seconds, the solver is allowed to work on the given problem. Can be a float or integer.
Default value is problem dependent.
Relevant Properties#
minimum_time_limit defines the range of supported values for a given DQM.
Example#
The example in the dqm section above sets the time_limit property.