Skip to content

Jij-Inc/ommx-dwave-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ommx-dwave-adapter

Provides an adapter to translate between OMMX and D-Wave samplers.

Currently only implements an adapter to LeapHybridCQMSampler.

Usage

ommx-dwave-adapter can be installed from PyPI as follows:

pip install ommx-dwave-adapter

An example usage of the LeapHybridCQMSampler through this adapter:

from ommx_dwave_adapter import OMMXLeapHybridCQMAdapter
from ommx.v1 import Instance, DecisionVariable

x1 = DecisionVariable.integer(1, lower=0, upper=5)
ommx_instance = Instance.from_components(
    decision_variables=[x1],
    objective=x1,
    constraints=[],
    sense=Instance.MINIMIZE,
)

# Create `ommx.v1.SampleSet` through `diwave.system.LeapHybridCQMSampler`
# Your Leap token can be set through configuration file, environment variable,
# or passed with a `token` parameter.
ommx_sampleset = OMMLeapHybridCQMAdapter.sample(ommx_instance)

print(ommx_sampleset)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages