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.
Metadata
Release files for ommx-qiskit-opt-mapper-adapter 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ommx_qiskit_opt_mapper_adapter-0.1.0.tar.gz | 183.3 kB | With provenance | Details for ommx_qiskit_opt_mapper_adapter-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ommx_qiskit_opt_mapper_adapter-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for ommx_qiskit_opt_mapper_adapter-0.1.0-py3-none-any.whl |
Total release size: 197.2 kB
Release files / ommx_qiskit_opt_mapper_adapter-0.1.0.tar.gz
| Download URL | ommx_qiskit_opt_mapper_adapter-0.1.0.tar.gz |
|---|---|
| Size | 183.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c5a12be41703e19389bae128a8d82ed9dc9a2002bab72348292cbab8ee6ef25f
|
|
BLAKE2b-256 checksum How to use checksums |
893974303dfdab5cc538e2f22fbf08f3d5c9dd3ecaacd876a1d9e7b73aec3685
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.
Transparency logRelease files / ommx_qiskit_opt_mapper_adapter-0.1.0-py3-none-any.whl
| Download URL | ommx_qiskit_opt_mapper_adapter-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e47840feebaf810d03e29692a1b423d69b99631170f47a84586aca4fc1a9909a
|
|
BLAKE2b-256 checksum How to use checksums |
3f5519c9b119eafebbaf46124da72bf45b39dd92cc1804bdaeb2b5e4f705349f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.
Transparency logSecurity for ommx-qiskit-opt-mapper-adapter 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ommx_qiskit_opt_mapper_adapter-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.