Skip to main content

Hybrid Asynchronous Decomposition Solver Framework

Project description

A general, minimal Python framework for building hybrid asynchronous decomposition samplers for quadratic unconstrained binary optimization (QUBO) problems. It facilitates experimentation with structures and parameters for tailoring a decomposition solver to a problem.

The framework enables rapid development and insight into expected performance of productized versions of its experimental prototypes. It does not provide real-time performance.

Installation or Building

Package not yet available on PyPI. Install in developer (edit) mode:

pip install -e git+https://github.com/dwavesystems/dwave-hybrid.git#egg=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, ArgMinFold, SimpleIterator
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()
) | ArgMinFold()
main = SimpleIterator(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))

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.0.3.tar.gz (29.0 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.0.3-py2.py3-none-any.whl (48.2 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: dwave-hybrid-0.0.3.tar.gz
  • Upload date:
  • Size: 29.0 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.0.3.tar.gz
Algorithm Hash digest
SHA256 14f7e5fb304941e5a94c3009b5a2af64fd3e22aea573bf50e0f89b2a5cce2ece
MD5 8e4894b65a738048806ddbda193f3b8f
BLAKE2b-256 7928a0d6aa94df169416da3c1e2a5393d239b2247c6a7124acd8eb2e73ffe309

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dwave_hybrid-0.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 48.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.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 234a611dd69797b69f774f5a010ae069c44b0a820b851a5c1c421b07b7a36668
MD5 f9f2990effd073161ebb6c2c2c566e47
BLAKE2b-256 323a845ecdf59cfb97ea77aad1f566de2e5166adeded4825b721c5a7a73f0d71

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