Enables the formulation of nonlinear models for industrial optimization problems using D-Wave quantum and hybrid solvers. Current version 0.6.12, released approximately monthly.
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Package uses dot notation, not underscore.
from dwave.optimization import Model
Sampler is in dwave-system, not in dwave-optimization.
from dwave.system import DWaveSampler
from dwave.optimization import Symbol
Basic nonlinear model creation and sampling via D-Wave hybrid solver.
from dwave.optimization import Model
import os
# Create a model with a symbol
model = Model()
x = model.integer(0, 10, num=3)
model.minimize(sum(x))
# Submit to a solver (requires Leap API token)
token = os.environ.get('DWAVE_API_TOKEN', '')
if token:
from dwave.system import DWaveSampler
sampler = DWaveSampler(token=token)
sampleset = sampler.sample(model)
print(sampleset.first)
else:
print('DWAVE_API_TOKEN not set; install dwave-neal for local sampling from dimod')
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.
Agent activity
0 hits · last 30 days
No traffic data recorded yet.