Solve with SCIP using OMMX#
In this tutorial, we will see how this dataset can be seemlessly used with SCIP (ommx-pyscipopt-adapter), which is not a quantum algorithm. However, one of beautiful points of OMMX format is actually that we can seemlessly employ algorithms either quantum or classical.
# Install ommx-pyscipopt-adapter as needed.
# !pip install "ommx-pyscipopt-adapter"
import ommx_pyscipopt_adapter
from ommx_quantum_benchmarks.qoblib import Labs
Loading Data#
First, we load one data using this library. As a representative example, we will employ Labs dataset, "labs003" instance of "quadratic_unconstrained" model. Feel free to change the instance, model or dataset. See qoblib page for available instances.
# See the available models and instances.
dataset = Labs()
for model_name, instance_names in dataset.available_instances.items():
print(f"Model: {model_name}")
for instance_name in instance_names[:5]: # Show only first 5 instances
print(f" Instance: {instance_name}")
Model: integer
Instance: labs002
Instance: labs003
Instance: labs004
Instance: labs005
Instance: labs006
Model: quadratic_unconstrained
Instance: labs002
Instance: labs003
Instance: labs004
Instance: labs005
Instance: labs006
# Load a specific instance.
model_name = "quadratic_unconstrained"
instance_name = "labs003"
(instance, solution) = dataset(model_name, instance_name)
print(f"Instance: {instance}")
print(f"Given Solution: {solution}")
[2026-06-16 08:14:22] π Starting experiment 'qoblib_v2'
[2026-06-16 08:14:22] ββ π Environment: OS: Linux 6.17.0-1018-azure, CPU: AMD EPYC 9V74 80-Core Processor (4 cores), Memory: 15.6 GB, Python: 3.11.15
[2026-06-16 08:14:22] ββ π Environment Information
[2026-06-16 08:14:22] ββ OS: Linux 6.17.0-1018-azure
[2026-06-16 08:14:22] ββ Platform: Linux-6.17.0-1018-azure-x86_64-with-glibc2.39
[2026-06-16 08:14:22] ββ CPU: AMD EPYC 9V74 80-Core Processor (4 cores)
[2026-06-16 08:14:22] ββ Memory: 15.6 GB
[2026-06-16 08:14:22] ββ Architecture: x86_64
[2026-06-16 08:14:22] ββ Python: 3.11.15
[2026-06-16 08:14:22] ββ Virtual Environment: /home/runner/work/OmmxQuantumBenchmarks/OmmxQuantumBenchmarks/.venv
[2026-06-16 08:14:22] ββ Key Package Versions:
Instance: Instance(raw=<builtins.Instance object at 0x7f3573a4ec30>, annotations={'org.ommx.v1.instance.dataset': 'Low Autocorrelation Binary Sequences (LABS)', 'org.ommx.v1.instance.license': 'CC BY 4.0', 'org.ommx.v1.instance.authors': 'Thorsten Koch,David E. Bernal Neira,Ying Chen,Giorgio Cortiana,Daniel J. Egger,Raoul Heese,Narendra N. Hegade,Alejandro Gomez Cadavid,Rhea Huang,Toshinari Itoko,Thomas Kleinert,Pedro Maciel Xavier,Naeimeh Mohseni,Jhon A. Montanez-Barrera,Koji Nakano,Giacomo Nannicini,Corey OβMeara,Justin Pauckert,Manuel Proissl,Anurag Ramesh,Maximilian Schicker,Noriaki Shimada,Mitsuharu Takeori,Victor Valls,David Van Bulck,Stefan Woerner,Christa Zoufal', 'org.ommx.v1.instance.constraints': '0', 'org.ommx.qoblib.url': 'https://git.zib.de/qopt/qoblib-quantum-optimization-benchmarking-library/-/tree/main/02-labs?ref_type=heads', 'org.minto.space': 'experiment', 'org.ommx.v1.instance.title': 'labs003', 'org.ommx.v1.instance.variables': '9', 'org.minto.name': 'labs003', 'org.minto.storage': 'instances'})
Given Solution: Solution(raw=<builtins.Solution object at 0x7f35738a4870>, annotations={'org.ommx.qoblib.authors': 'Thorsten Koch, David E. Bernal Neira, Ying Chen, Giorgio Cortiana, Daniel J. Egger, Raoul Heese, Narendra N. Hegade, Alejandro Gomez Cadavid, Rhea Huang, Toshinari Itoko, Thomas Kleinert, Pedro Maciel Xavier, Naeimeh Mohseni, Jhon A. Montanez-Barrera, Koji Nakano, Giacomo Nannicini, Corey OβMeara, Justin Pauckert, Manuel Proissl, Anurag Ramesh, Maximilian Schicker, Noriaki Shimada, Mitsuharu Takeori, Victor Valls, David Van Bulck, Stefan Woerner, Christa Zoufal', 'org.minto.space': 'run', 'org.minto.name': 'labs003', 'org.minto.storage': 'solutions', 'org.ommx.v1.solution.instance': 'sha256:11da1b5ffe097d37e5e16ab3710eb2da0cb565f8980123e7e36912e2fda32192', 'org.minto.run_id': '0'})
Solving using SCIP#
# Solve with SCIP.
obtained_solution = ommx_pyscipopt_adapter.OMMXPySCIPOptAdapter.solve(instance)
# Compare the results.
print(f"Given solution: {solution.objective=}, {obtained_solution.feasible=}")
print(f"Obtained solution: {obtained_solution.objective=}, {obtained_solution.feasible=}")
Given solution: solution.objective=1.0, obtained_solution.feasible=True
Obtained solution: obtained_solution.objective=1.0, obtained_solution.feasible=True