An adapter for the Digital Annealer V4 from/to OMMX.
Project description
ommx-da4-adapter
This package provides an adapter for Fujitsu Digital Annealer(DA4) from OMMX. It allows you to solve optimization problems defined in OMMX format using DA4's powerful solver.
Installation
The ommx-da4-adapter can be installed from PyPI as follows:
pip install ommx-da4-adapter
Usage
Here's a simple example of how to use the adapter directly:
from ommx.v1 import Instance, DecisionVariable
from ommx_da4_adapter import OMMXDA4Adapter
x_0 = DecisionVariable.binary(id=0, name="x_0")
x_1 = DecisionVariable.binary(id=1, name="x_1")
ommx_instance = Instance.from_components(
decision_variables=[x_0, x_1],
objective=x_0 * x_1 + x_0 - x_1 + 1,
constraints=[x_0 + x_1 == 1],
sense=Instance.MINIMIZE,
)
ommx_sampleset = OMMXDA4Adapter.sample(
ommx_instance=ommx_instance,
token="*** your da4 api token ***",
url="*** da4 url ***",
)
You can also use the adapter and client separately:
from ommx_da4_adapter import OMMXDA4Adapter, DA4Client
# Assuming ommx_instance is already defined as above
adapter = OMMXDA4Adapter(ommx_instance)
qubo_request = adapter.sampler_input
client = DA4Client(
token="*** your da4 api token ***",
url="*** da4 url ***",
)
qubo_response = client.sample(qubo_request=qubo_request)
ommx_sampleset = adapter.decode_to_sampleset(qubo_response)
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
ommx_da4_adapter-0.1.1.tar.gz
(26.7 kB
view details)
File details
Details for the file ommx_da4_adapter-0.1.1.tar.gz.
File metadata
- Download URL: ommx_da4_adapter-0.1.1.tar.gz
- Upload date:
- Size: 26.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2123a94706f8e36d46bc210b5747b1f130df47f275f6de5dd552ff68e273dee
|
|
| MD5 |
c354f9da6b449b55e0d3bd3d7a7497b8
|
|
| BLAKE2b-256 |
12cc902919da52eafaafc68fddbccd0385ccb290d4c599ef0c978dc62be630bb
|
Provenance
The following attestation bundles were made for ommx_da4_adapter-0.1.1.tar.gz:
Publisher:
release.yaml on Jij-Inc/ommx-da4-adapter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ommx_da4_adapter-0.1.1.tar.gz -
Subject digest:
a2123a94706f8e36d46bc210b5747b1f130df47f275f6de5dd552ff68e273dee - Sigstore transparency entry: 329289922
- Sigstore integration time:
-
Permalink:
Jij-Inc/ommx-da4-adapter@93ce5c1196382f190a74546fb3aa2855532a775b -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Jij-Inc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@93ce5c1196382f190a74546fb3aa2855532a775b -
Trigger Event:
push
-
Statement type: