dwave-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 in development mode:
git clone https://github.com/dwavesystems/dwave-hybrid.git cd dwave-hybrid pip install -e .
Testing
Install test requirements and run unittest:
pip install -r tests/requirements.txt python -m unittest
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.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))
Documentation
Documentation for latest stable release included in Ocean is available here.
License
Released under the Apache License 2.0. See LICENSE file.
Contributing
Ocean’s contributing guide has guidelines for contributing to Ocean packages.
Release files for dwave-hybrid 0.6.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dwave_hybrid-0.6.16.tar.gz | 96.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dwave_hybrid-0.6.16-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 174.5 kB
Release files / dwave_hybrid-0.6.16.tar.gz
| Download URL | dwave_hybrid-0.6.16.tar.gz |
|---|---|
| Size | 96.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e41f637920905128b0fe4b7b2f0de6d12f921933cd31b9ae611289352d6b9f0
|
|
BLAKE2b-256 checksum How to use checksums |
eb869f05639fb1301999071d4efad127ef9ffb9f7d137d68f5d24b961e962f89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / dwave_hybrid-0.6.16-py3-none-any.whl
| Download URL | dwave_hybrid-0.6.16-py3-none-any.whl |
|---|---|
| Size | 78.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d327bec5a2d13ac953b599c9bdf78520d8c400c93310a7c8e897818d7a68003b
|
|
BLAKE2b-256 checksum How to use checksums |
3582ec7765cafe0dcbb57788c8f0b90d68eb39f8a8b1b9999215d457190f59ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|