Leap Service’s Hybrid Solvers#

This section introduces the Leap service’s quantum-classical hybrid solvers and provides references to usage information.

Note

Not all accounts have access to this type of solver.

Supported Solvers#

The quantum-classical hybrid solvers in the Leap service are intended to solve arbitrary application problems formulated as a quadratic model or nonlinear 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.

The generally available hybrid solvers depend on your account in the Leap service. Check your dashboard to see which hybrid solvers are available to you.

Generally available hybrid solvers currently supported include:

  • Hybrid nonlinear-program solver (e.g., hybrid_nonlinear_program_version1)

    Nonlinear models typically represent general optimization problems with an objective function and/or one or more constraints over integer and/or binary variables; the model supports constraints natively.

    This model is especially suited for use with decision variables that represent a common logic, such as subsets of choices or permutations of ordering. For example, in a traveling salesperson problem permutations of the variables representing cities can signify the order of the route being optimized and in a knapsack problem the variables representing items can be divided into subsets of packed and not packed.

    These solvers accept arbitrarily structured problems formulated as nonlinear models, with any constraints represented natively.

  • Hybrid CQM solver (e.g., hybrid_constrained_quadratic_model_version1)

    Constrained quadratic models (CQM) are typically used for applications that optimize problems that might include binary-valued variables (both \(0/1\)-valued variables and \(-1/1\)-valued variables), integer-valued variables, and real variables (also known as continuous variables); the model supports constraints natively.

    These solvers accept arbitrarily structured problems formulated as CQMs, with any constraints represented natively.

  • Hybrid BQM solver (e.g., hybrid_binary_quadratic_model_version2)

    Binary quadratic models (BQM) are unconstrained and typically represent problems of decisions that could either be true (or yes) or false (no); for example, should an antenna transmit, or did a network node fail? The model uses \(0/1\)-valued variables and \(-1/1\)-valued variables; constraints are typically represented as penalty models.

    These solvers accept arbitrarily structured, unconstrained problems formulated as BQMs, with any constraints typically represented through penalty models.

  • Hybrid DQM solver (e.g., hybrid_discrete_quadratic_model_version1)

    Discrete quadratic models (DQM) are unconstrained and typically represent problems with several distinct options; for example, which shift should employee X work, or should the state on a map be colored red, blue, green, or yellow? The model uses variables that can represent a set of values such as {red, green, blue, yellow} or {3.2, 67}; constraints are typically represented as penalty models.

    These solvers accept arbitrarily structured, unconstrained problems formulated as DQMs, with any constraints typically represented through penalty models.

Contact D-Wave at sales@dwavesys.com if your application requires scale or performance that exceeds the currently advertised capabilities of the generally available hybrid solvers.

Solver Properties and Parameters#

The following table provides links to documentation for the properties and parameters of the hybrid solvers in the Leap service.

Table 1 Hybrid Solver Properties and Parameters#

Solver for Model

Properties

Parameters

Nonlinear models

Nonlinear Solver Properties

Nonlinear Solver Parameters

Constrained quadratic models

CQM Solver Properties

CQM Solver Parameters

Constrained quadratic models

BQM Solver Properties

BQM Solver Parameters

Nonlinear models

DQM Solver Properties

DQM Solver Parameters

Solver Timing#

The table below lists the timing information returned from quantum-classical hybrid solvers in the Leap service.

Table 2 Timing Information from Hybrid Solvers#

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]

You can access this information via the dimod SampleSet class, as in the example below.

>>> import dimod
>>> from dwave.system import LeapHybridSampler
...
>>> sampler = LeapHybridSampler(solver={'category': 'hybrid'})  
>>> bqm = dimod.generators.ran_r(1, 300)
>>> sampleset = sampler.sample(bqm)     
>>> sampleset.info     
{'qpu_access_time': 41990, 'charge_time': 2991424, 'run_time': 2991424}

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': 2991424' in the returned response, meaning almost 3 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.

Usage Examples#

Use a hybrid solver as you would any Ocean SDK sampler. For example, given a 1000-variable problem formulated as a quadratic unconstrained binary optimization (QUBO) model, \(Q\), you can submit it for solution to a hybrid BQM solver as follows:

from dwave.system import LeapHybridSampler

# Select a solver
sampler = LeapHybridSampler()

# Submit for solution
answer = sampler.sample_qubo(Q)

You can find more usage examples here: