Skip to content
Hybrid Asynchronous Decomposition Sampler prototype framework.
Branch: master
Clone or download
randomir Merge pull request #145 from randomir/master
Create `stoppable` decorator
Latest commit e8328aa May 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Un-ignore doctest results in CI Dec 5, 2018
docs Wrap to 80 cols, reformat to breathe; mostly docs May 13, 2019
examples Update examples to behave as before endomorphic was removed May 13, 2019
hybrid Test stoppable(): sanity checks May 14, 2019
problems Sanitize qbsolv problem names: lex order matches logical Sep 1, 2018
scripts
tests Test stoppable(): sanity checks May 14, 2019
.appveyor.yml Appveyor: explicit pip cache location Dec 4, 2018
.coveragerc Fix coverage config Nov 28, 2018
.gitignore gitignore html coverage output Mar 15, 2019
CONTRIBUTING.rst Add leap Nov 5, 2018
LICENSE Reformat LICENSE Oct 3, 2018
README.rst Update examples to behave as before endomorphic was removed May 13, 2019
perf.py Use consistent 'size' argument in all decomposers Jan 22, 2019
requirements.txt Merge branch 'master' into bugfix/parallel-sa-block-each-other-issue-127 Apr 29, 2019
setup.cfg Include license in wheel Dec 1, 2018
setup.py Merge branch 'master' into bugfix/parallel-sa-block-each-other-issue-127 Apr 29, 2019

README.rst

Last version on PyPI Linux/Mac build status Windows build status Documentation Status

D-Wave Hybrid

A general, minimal Python framework for building hybrid asynchronous decomposition samplers for quadratic unconstrained binary optimization (QUBO) problems.

dwave-hybrid facilitates three aspects of solution development:

  • Hybrid approaches to combining quantum and classical compute resources
  • Evaluating a portfolio of algorithmic components and problem-decomposition strategies
  • Experimenting with workflow structures and parameters to obtain the best application results

The framework enables rapid development and insight into expected performance of productized versions of its experimental prototypes.

Your optimized algorithmic components and other contributions to this project are welcome!

Installation or Building

Install from a package on PyPI:

pip install dwave-hybrid

or from source:

git clone https://github.com/dwavesystems/dwave-hybrid.git
cd dwave-hybrid
pip install -r requirements.txt
python setup.py install

Example

import dimod
import hybrid

# Construct a problem
bqm = dimod.BinaryQuadraticModel({}, {'ab': 1, 'bc': -1, 'ca': 1}, 0, dimod.SPIN)

# Define the workflow
iteration = hybrid.RacingBranches(
    hybrid.Identity(),
    hybrid.InterruptableTabuSampler(),
    hybrid.EnergyImpactDecomposer(size=2)
    | hybrid.QPUSubproblemAutoEmbeddingSampler()
    | hybrid.SplatComposer()
) | hybrid.ArgMin()
workflow = hybrid.LoopUntilNoImprovement(iteration, convergence=3)

# Solve the problem
init_state = hybrid.State.from_problem(bqm)
final_state = workflow.run(init_state).result()

# Print results
print("Solution: sample={.samples.first}".format(final_state))

License

Released under the Apache License 2.0. See LICENSE file.

You can’t perform that action at this time.