GithubHelp home page GithubHelp logo

00mjk / dwave-hybrid Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dwavesystems/dwave-hybrid

0.0 0.0 0.0 21.04 MB

Hybrid Asynchronous Decomposition Sampler prototype framework.

Home Page: https://docs.ocean.dwavesys.com/projects/hybrid/en/stable/

License: Apache License 2.0

Python 100.00%

dwave-hybrid's Introduction

Last version on PyPI Linux/Mac build status Windows build status Code coverage Documentation status PyPI - Python Version

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
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))

License

Released under the Apache License 2.0. See LICENSE file.

dwave-hybrid's People

Contributors

arcondello avatar hhtong avatar joelpasvolsky avatar randomir avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.