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
Release history Release notifications | RSS feed
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.0.tar.gz
(29.0 kB
view hashes)
Built Distribution
Close
Hashes for dwave_hybrid-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f063b71fec4ca0a4d4bfa893a4ca415e1f15ecabbeabc9d147809c914c869a5 |
|
MD5 | 2aa095b4a5148d7a35767c99f5baaa3b |
|
BLAKE2b-256 | c8c79934dc13b92f606a1fb28ebd80e896983a325255b73d93e7ec6dcea4e063 |