Hybrid Asynchronous Decomposition Solver Framework
Project description
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
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
Built Distribution
Hashes for dwave_hybrid-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 542e594eb87e4123d2b1ca78c98e0a33b55fdca8ad3188416959da579852f5d4 |
|
MD5 | 7771c646b421a3f9e49eeca611b9f163 |
|
BLAKE2b-256 | 408e54f5e1e15ebe77d92a9813e37b47decd3a4ee745decf699aed004547803a |