Skip to main content

Hybrid Asynchronous Decomposition Solver Framework

Project description

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
from hybrid.samplers import (
    QPUSubproblemAutoEmbeddingSampler, InterruptableTabuSampler)
from hybrid.decomposers import EnergyImpactDecomposer
from hybrid.composers import SplatComposer
from hybrid.core import State
from hybrid.flow import RacingBranches, ArgMin, Loop
from hybrid.utils import min_sample

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

# Define the solver
iteration = RacingBranches(
    InterruptableTabuSampler(),
    EnergyImpactDecomposer(max_size=2)
    | QPUSubproblemAutoEmbeddingSampler()
    | SplatComposer()
) | ArgMin()
main = Loop(iteration, max_iter=10, convergence=3)

# Solve the problem
init_state = State.from_sample(min_sample(bqm), bqm)
solution = main.run(init_state).result()

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

License

Released under the Apache License 2.0. See LICENSE file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dwave-hybrid-0.1.1.tar.gz (33.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dwave_hybrid-0.1.1-py2.py3-none-any.whl (53.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file dwave-hybrid-0.1.1.tar.gz.

File metadata

  • Download URL: dwave-hybrid-0.1.1.tar.gz
  • Upload date:
  • Size: 33.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for dwave-hybrid-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1339b14d7c56e18f8db88f1268a11a6d1fea33bf27360fa47cd1841c8260a618
MD5 763cc92edbbff24fc9ff32760b6ee4d5
BLAKE2b-256 553bef39637518228f85c4c0002f82b43e371d1508a8c9b5884296ad803440bc

See more details on using hashes here.

File details

Details for the file dwave_hybrid-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: dwave_hybrid-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 53.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for dwave_hybrid-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 86a559b4224d6c8e17610d55391646f33bb179a055f445bab869ed9ff0d7f007
MD5 d11021e32620ce580235ab6efe213f70
BLAKE2b-256 acb9c7519c55fa9a66f1f9ada70ff707105e4a807fce7b02e9e8612970a3df48

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page