Sampling with Hybrid Solvers#
The quantum-classical hybrid solvers in the Leap service are intended to solve arbitrary application problems formulated as a nonlinear model or quadratic model[1].
These solvers, which implement state-of-the-art classical algorithms together with intelligent allocation of the quantum computer to parts of the problem where it benefits most, are designed to accommodate even very large problems. Hybrid solvers enable you to benefit from D‑Wave’s deep investment in researching, developing, optimizing, and maintaining hybrid algorithms.
Using the Stride™ hybrid solver.
Other hybrid samplers.
D-Wave also provides a Python framework for building a variety of flexible hybrid workflows. The dwave-hybrid Development Framework section describes this framework.
Solver Timing#
The table below lists the timing information returned from quantum-classical hybrid solvers in the Leap service.
Field |
Meaning |
|---|---|
run_time |
Time, in microseconds, the hybrid solver spent working on the problem. |
charge_time |
Time, in microseconds, charged to the account.[2] |
qpu_access_time |
QPU time, in microseconds, used by the hybrid solver.[3] |
charge_time and run_time may differ due to the time granularity of the solver. For example, if a hybrid solver has a time granularity of 0.5 sec and your submission specifies 4.7 sec, run_time might be 5 sec and charge_time 4.5 sec.
qpu_access_time might be zero for submissions with short run_time. Because the QPU is a shared, remote resource, the first set of samples from the QPU might not be received before a short explicitly-specified or default time_limit is reached. In such cases, the hybrid solver respects the time limitation and returns without the QPU having a chance to contribute to the solution. On the large, complex problems for which hybrid solvers are intended, this is unlikely to occur.
You can access this information in the returned
Future object from the hybrid nonlinear solver
(or via the dimod SampleSet class for other
hybrid solvers), as in the example below.
>>> from dwave.optimization.generators import bin_packing
>>> from dwave.system import LeapHybridNLSampler
...
>>> model = bin_packing([3, 5, 1, 3], 7)
>>> with LeapHybridNLSampler() as sampler:
... results = sampler.sample(
... model,
... label='SDK Examples - Knapsack')
>>> results.result().info["timing"]
{'qpu_access_time': 319883, 'charge_time': 5000000, 'run_time': 5026351}
Solver Usage Charges#
D‑Wave charges you for time that solvers run your problems,
with rates depending on QPU usage. You can see the rate at which
your account’s quota is consumed for a particular solver in the solver’s
property_quota_rate property; for example,
quota_conversion_rate for the nonlinear solver.
You can see the time you are charged for in the responses returned for your
submitted problems. The relevant field in the response is 'charge_time'.
The example in the Solver Timing section shows
'charge_time': 5000000' in the returned response, meaning five seconds
are being charged.
Instantiating the needed compute resources for your problem can introduce a delay before the problem is processed. This delay tends to be small compared to the overall solution time for large problems. The charge_time does not include this delay.