OMMX Qiskit Opt Mapper Adapter
Bidirectional, semantics-preserving translation between OMMX and Qiskit Addon Opt Mapper.
Installation
Published releases can be installed with:
pip install ommx-qiskit-opt-mapper-adapter
This adapter targets OMMX 2 exclusively and requires ommx>=2.6.1,<3.0.0.
It supports the published Opt Mapper 0.1 release series and requires
qiskit-addon-opt-mapper>=0.1.0,<0.2.0.
This is an independent adapter maintained by Jij Inc. It is not an official Qiskit project.
Usage
from qiskit_addon_opt_mapper import OptimizationProblem
from ommx_qiskit_opt_mapper_adapter import from_ommx, to_ommx
problem = OptimizationProblem("example")
problem.binary_var("x")
problem.integer_var(0, 5, "y")
problem.maximize(constant=1, linear={"x": 2}, quadratic={("x", "y"): 1})
problem.linear_constraint({"x": 1, "y": 1}, "<=", 4, "capacity")
instance = to_ommx(problem)
restored_problem = from_ommx(instance)
You can also use the namespace-style facade:
from ommx_qiskit_opt_mapper_adapter import OMMXQiskitOptMapperAdapter
restored_problem = OMMXQiskitOptMapperAdapter.from_ommx(instance)
Supported model features
| Feature | OMMX → Opt Mapper | Opt Mapper → OMMX |
|---|---|---|
| Binary variables | Yes | Yes |
| Integer variables and representable bounds | Yes | Yes |
| Continuous variables and representable bounds | Yes | Yes |
| Native unbounded variables | Yes | Yes |
| Minimize / maximize | Yes | Yes |
| Polynomial objective of any order | Yes | Yes |
| Polynomial equality / inequality constraints | Yes | Yes |
| Arbitrary OMMX variable / constraint IDs | Preserved | Restored |
| Names, subscripts, parameters, descriptions | Preserved as metadata | Restored |
| Spin variables | N/A | Explicit error |
| Semi-integer / semi-continuous variables | Explicit error | N/A |
The adapter never silently approximates an unsupported domain or constraint. See
the design notes
for normalization and metadata details.
Finite OMMX bounds whose absolute value is at least 1e20 are rejected because Opt Mapper
reserves that range as its representation of infinity.
Development
See CONTRIBUTING.md for the contribution workflow and SECURITY.md for private vulnerability reporting.
uv sync --group dev
uv run pytest --cov
uv run mypy src
uv run ruff check .
uv run ruff format --check .
License
Apache License 2.0.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ommx_qiskit_opt_mapper_adapter-0.1.0.tar.gz.
File metadata
- Download URL: ommx_qiskit_opt_mapper_adapter-0.1.0.tar.gz
- Upload date:
- Size: 183.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5a12be41703e19389bae128a8d82ed9dc9a2002bab72348292cbab8ee6ef25f
|
|
| MD5 |
a47a86906a0e0ce2229ddbe30e9e6bb3
|
|
| BLAKE2b-256 |
893974303dfdab5cc538e2f22fbf08f3d5c9dd3ecaacd876a1d9e7b73aec3685
|
Provenance
The following attestation bundles were made for ommx_qiskit_opt_mapper_adapter-0.1.0.tar.gz:
Publisher:
publish.yml on Jij-Inc/ommx-qiskit-opt-mapper-adapter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ommx_qiskit_opt_mapper_adapter-0.1.0.tar.gz -
Subject digest:
c5a12be41703e19389bae128a8d82ed9dc9a2002bab72348292cbab8ee6ef25f - Sigstore transparency entry: 2745120053
- Sigstore integration time:
-
Permalink:
Jij-Inc/ommx-qiskit-opt-mapper-adapter@01ccaa41764500bcef933a95cf6f6b96d9720fe2 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Jij-Inc
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@01ccaa41764500bcef933a95cf6f6b96d9720fe2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ommx_qiskit_opt_mapper_adapter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ommx_qiskit_opt_mapper_adapter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e47840feebaf810d03e29692a1b423d69b99631170f47a84586aca4fc1a9909a
|
|
| MD5 |
2251acab6272c861562c0f922c716a54
|
|
| BLAKE2b-256 |
3f5519c9b119eafebbaf46124da72bf45b39dd92cc1804bdaeb2b5e4f705349f
|
Provenance
The following attestation bundles were made for ommx_qiskit_opt_mapper_adapter-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Jij-Inc/ommx-qiskit-opt-mapper-adapter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ommx_qiskit_opt_mapper_adapter-0.1.0-py3-none-any.whl -
Subject digest:
e47840feebaf810d03e29692a1b423d69b99631170f47a84586aca4fc1a9909a - Sigstore transparency entry: 2745120062
- Sigstore integration time:
-
Permalink:
Jij-Inc/ommx-qiskit-opt-mapper-adapter@01ccaa41764500bcef933a95cf6f6b96d9720fe2 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Jij-Inc
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@01ccaa41764500bcef933a95cf6f6b96d9720fe2 -
Trigger Event:
release
-
Statement type: