Skip to main content

Hybrid Asynchronous Decomposition Solver Framework

Project description

Latest version on PyPI Linux/MacOS/Windows build status Code coverage Supported Python versions

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.

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.6.15.tar.gz (96.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.6.15-py3-none-any.whl (78.5 kB view details)

Uploaded Python 3

File details

Details for the file dwave_hybrid-0.6.15.tar.gz.

File metadata

  • Download URL: dwave_hybrid-0.6.15.tar.gz
  • Upload date:
  • Size: 96.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for dwave_hybrid-0.6.15.tar.gz
Algorithm Hash digest
SHA256 c834d4440fc5444a57bad55cef102a0a90892aca2b76dacd5c9152f387d81f74
MD5 fdf49e0144e40043958ea5ac69a9a02a
BLAKE2b-256 a615dc1dab29e0de602fc9459d0a1e6e93aa8905f16589d239eed689290de656

See more details on using hashes here.

File details

Details for the file dwave_hybrid-0.6.15-py3-none-any.whl.

File metadata

  • Download URL: dwave_hybrid-0.6.15-py3-none-any.whl
  • Upload date:
  • Size: 78.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for dwave_hybrid-0.6.15-py3-none-any.whl
Algorithm Hash digest
SHA256 a3cb71624e578d312e831b54c908333a966f482951d0294cb7915be43b283117
MD5 3e42e7fd7a8cfada24b7a4853566c0f2
BLAKE2b-256 6c54977a276542c3f9f196d623bd9f3b13840b6001ed4679211d0c9eb2af62fe

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