Skip to content

Optimization and QUBO

dwave_sapi_dimod

Maintained by dwavesystems

sample_qubo and sample_ising work only for problems that fit directly onto the solver's structure

PythonApache-2.0Archive
dwave_sapi_dimod illustration

Resource snapshot

Category

Optimization and QUBO

Stars

9

Last pushed

Feb 21, 2018Updated 8y ago

Open issues

0

What it is

dwave_sapi_dimod is maintained by dwavesystems and sits in the Optimization and QUBO lane of the open-source quantum map.

sample_qubo and sample_ising work only for problems that fit directly onto the solver's structure It commonly appears alongside dwavesystems-dimod in example workflows.

Last verified by Qtangl generator on May 27, 2026

Who it's for

Teams exploring routing, scheduling, allocation, and other combinatorial problems that can be modeled as optimization workloads.

What you can build or learn

  • Understand how this project models constrained optimization problems.
  • Compare QUBO, QAOA, and hybrid optimization workflows against classical baselines.
  • Identify pieces that could inform a practical planning stack like Qtangl.

Plays well with

License

Apache-2.0

SPDX identifier detected from the repository metadata or license files.

Repository README

Preview from the project README.

Rendered as Markdown inside a scrollable preview. Long READMEs stay contained; expand or open on GitHub for the full document.

~200 words · about 1 min readOpen on GitHub

D-Wave SAPI dimod

A dimod wrapper for SAPI.

Installation

For python 2

python setup.py install

Examples

Loading the module

>>> import dwave_sapi_dimod as sapi

Initializing a remote solver

>>> url = "http://myURL"
>>> token = "myToken001"
>>> solver_name = "solver_name"
>>> solver = sapi.SAPISampler(solver_name, url, token)

Initializing a local solver.

>>> solver_name = 'c4-sw_optimize'
>>> solver = sapi.SAPILocalSampler(solver_name)

sample_qubo and sample_ising work only for problems that fit directly onto the solver's structure

>>> h = {0: -.1, 4: .1}
>>> J = {(0, 4): -1}
>>> response = solver.sample_ising(h, J)
>>> list(response.samples())
[{0: -1, 4: -1}, {0: 1, 4: 1}, {0: 1, 4: -1}, {0: -1, 4: 1}]
>>> list(response.energies())
[-1.0, -1.0, 0.8, 1.2]

For solving arbitrary problems, you need to apply the EmbeddingComposite layer.

>>> solver = sapi.EmbeddingComposite(sapi.SAPILocalSampler(solver_name))
>>> h = {0: -.1, 1: .1}
>>> J = {(0, 1): -1}
>>> response = solver.sample_ising(h, J)
>>> list(response.samples())
[{0: -1, 1: -1}, {0: 1, 1: 1}, {0: 1, 1: -1}, {0: -1, 1: 1}]
>>> list(response.energies())
[-1.0, -1.0, 0.8, 1.2]

See dimod documentation for full description of the response object.

License

See LICENSE.txt

Read on GitHub

Activity

Latest release

—

Watchers

3

Python support

—

Learn digest

Get monthly updates when library entries change.

Monthly digest: new library entries, updated flagships, and one editorial pick.

Related resources

Keep exploring nearby tools.

cda-tum

mqt-qmap

MQT QMAP - A tool for Quantum Circuit Mapping written in C++

C++MITFlagshipQtangl relevant

138 stars · Updated 3mo ago

entropicalabs

openqaoa

Multi-backend SDK for quantum optimisation

PythonMITFlagshipQtangl relevant

139 stars · Updated 2y ago

dwavesystems

penaltymodel

Utilities and interfaces for using penalty models.

PythonApache-2.0Archive

19 stars · Updated 1y ago

Qiskit

qiskit-optimization

Quantum Optimization

PythonApache-2.0FlagshipQtangl relevant

281 stars · Updated 5mo ago

jtiosue

qubovert

The one-stop package for formulating, simulating, and solving problems in boolean and spin form

PythonApache-2.0FlagshipQtangl relevant

41 stars · Updated 4mo ago

goodchemistryco

Tangelo

A python package for exploring end-to-end chemistry workflows on quantum computers and simulators.

PythonApache-2.0Qtangl relevant

137 stars · Updated 8mo ago