Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
from sol_reader import parse_sol_to_ordered_dict
from dat_reader import read_qoblib_dat_file
from model import create_problem
from ommx_quantum_benchmarks.qoblib.definitions import (
QOBLIB_AUTHORS,
QOBLIB_AUTHORS_STR,
LICENSE,
)


def batch_process_files(
Expand Down Expand Up @@ -120,10 +125,23 @@ def batch_process_files(
if os.path.exists(output_filename):
os.remove(output_filename)

# Add annotations to the instance.
ommx_instance.title = base_name
ommx_instance.license = LICENSE
ommx_instance.dataset = "Market Split Problem"
ommx_instance.authors = QOBLIB_AUTHORS
ommx_instance.num_variables = len(ommx_instance.decision_variables)
ommx_instance.num_constraints = len(ommx_instance.constraints)
ommx_instance.annotations["org.ommx.qoblib.url"] = (
"https://git.zib.de/qopt/qoblib-quantum-optimization-benchmarking-library/-/tree/main/01-marketsplit?ref_type=heads"
)

# Create OMMX Artifact
builder = ArtifactBuilder.new_archive_unnamed(output_filename)
builder.add_instance(ommx_instance)
instance_desc = builder.add_instance(ommx_instance)
if solution is not None:
solution.instance = instance_desc.digest
solution.annotations["org.ommx.qoblib.authors"] = QOBLIB_AUTHORS_STR
builder.add_solution(solution)
builder.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
from sol_reader import parse_sol_to_ordered_dict
from dat_reader import read_qoblib_dat_file
from model import create_problem
from ommx_quantum_benchmarks.qoblib.definitions import (
QOBLIB_AUTHORS,
QOBLIB_AUTHORS_STR,
LICENSE,
)


def batch_process_files(
Expand Down Expand Up @@ -120,10 +125,23 @@ def batch_process_files(
if os.path.exists(output_filename):
os.remove(output_filename)

# Add annotations to the instance.
ommx_instance.title = base_name
ommx_instance.license = LICENSE
ommx_instance.dataset = "Market Split Problem"
ommx_instance.authors = QOBLIB_AUTHORS
ommx_instance.num_variables = len(ommx_instance.decision_variables)
ommx_instance.num_constraints = len(ommx_instance.constraints)
ommx_instance.annotations["org.ommx.qoblib.url"] = (
"https://git.zib.de/qopt/qoblib-quantum-optimization-benchmarking-library/-/tree/main/01-marketsplit?ref_type=heads"
)

# Create OMMX Artifact
builder = ArtifactBuilder.new_archive_unnamed(output_filename)
builder.add_instance(ommx_instance)
instance_desc = builder.add_instance(ommx_instance)
if solution is not None:
solution.instance = instance_desc.digest
solution.annotations["org.ommx.qoblib.authors"] = QOBLIB_AUTHORS_STR
builder.add_solution(solution)
builder.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
from sol_reader import parse_sol_file
from model import create_problem
from solve_c_from_x import solve_c
from ommx_quantum_benchmarks.qoblib.definitions import (
QOBLIB_AUTHORS,
QOBLIB_AUTHORS_STR,
LICENSE,
)


def create_instance(n):
Expand Down Expand Up @@ -108,42 +113,11 @@ def batch_process_files(
if os.path.exists(output_filename):
os.remove(output_filename)

# Create QOBLIB authors.
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",
]
qoblib_authors_str = ", ".join(qoblib_authors)
# Add annotations to the instance.
ommx_instance.title = base_name
ommx_instance.license = "CC BY 4.0"
ommx_instance.license = LICENSE
ommx_instance.dataset = "Low Autocorrelation Binary Sequences (LABS)"
ommx_instance.authors = qoblib_authors
ommx_instance.authors = QOBLIB_AUTHORS
ommx_instance.num_variables = len(ommx_instance.decision_variables)
ommx_instance.num_constraints = len(ommx_instance.constraints)
ommx_instance.annotations["org.ommx.qoblib.url"] = (
Expand All @@ -155,7 +129,7 @@ def batch_process_files(
# Add solution if available.
if solution is not None:
solution.instance = instance_desc.digest
solution.annotations["org.ommx.qoblib.authors"] = qoblib_authors_str
solution.annotations["org.ommx.qoblib.authors"] = QOBLIB_AUTHORS_STR
builder.add_solution(solution)
builder.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
from ommx.artifact import ArtifactBuilder
from sol_reader import parse_sol_file
from model import create_problem
from ommx_quantum_benchmarks.qoblib.definitions import (
QOBLIB_AUTHORS,
QOBLIB_AUTHORS_STR,
LICENSE,
)


def create_instance(n):
Expand Down Expand Up @@ -112,42 +117,11 @@ def batch_process_files(
if os.path.exists(output_filename):
os.remove(output_filename)

# Create QOBLIB authors.
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",
]
qoblib_authors_str = ", ".join(qoblib_authors)
# Add annotations to the instance.
ommx_instance.title = base_name
ommx_instance.license = "CC BY 4.0"
ommx_instance.license = LICENSE
ommx_instance.dataset = "Low Autocorrelation Binary Sequences (LABS)"
ommx_instance.authors = qoblib_authors
ommx_instance.authors = QOBLIB_AUTHORS
ommx_instance.num_variables = len(ommx_instance.decision_variables)
ommx_instance.num_constraints = len(ommx_instance.constraints)
ommx_instance.annotations["org.ommx.qoblib.url"] = (
Expand All @@ -159,7 +133,7 @@ def batch_process_files(
# Add solution if available.
if solution is not None:
solution.instance = instance_desc.digest
solution.annotations["org.ommx.qoblib.authors"] = qoblib_authors_str
solution.annotations["org.ommx.qoblib.authors"] = QOBLIB_AUTHORS_STR
builder.add_solution(solution)
builder.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
from models import create_problem
from dat_reader import load_and_process_all
from sol_reader import parse_sol_file
from ommx_quantum_benchmarks.qoblib.definitions import (
QOBLIB_AUTHORS,
QOBLIB_AUTHORS_STR,
LICENSE,
)


def infer_name_func_from_subdir(sol_subdir: str):
Expand Down Expand Up @@ -125,42 +130,11 @@ def batch_process_from_qbench_json(
if os.path.exists(output_filename):
os.remove(output_filename)

# Create QOBLIB authors.
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",
]
qoblib_authors_str = ", ".join(qoblib_authors)
# Add annotations to the instance.
ommx_instance.title = base_name
ommx_instance.license = "CC BY 4.0"
ommx_instance.license = LICENSE
ommx_instance.dataset = "Minimum Birkhoff Decomposition"
ommx_instance.authors = qoblib_authors
ommx_instance.authors = QOBLIB_AUTHORS
ommx_instance.num_variables = len(ommx_instance.decision_variables)
ommx_instance.num_constraints = len(ommx_instance.constraints)
ommx_instance.annotations["org.ommx.qoblib.url"] = (
Expand All @@ -170,7 +144,7 @@ def batch_process_from_qbench_json(
instance_desc = builder.add_instance(ommx_instance)
if solution is not None:
solution.instance = instance_desc.digest
solution.annotations["org.ommx.qoblib.authors"] = qoblib_authors_str
solution.annotations["org.ommx.qoblib.authors"] = QOBLIB_AUTHORS_STR
builder.add_solution(solution)
builder.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
parse_steiner_sol_file,
read_steiner_solution_file_as_jijmodeling_format,
)
from ommx_quantum_benchmarks.qoblib.definitions import (
QOBLIB_AUTHORS,
QOBLIB_AUTHORS_STR,
LICENSE,
)

# Global optimization: reuse timestamp for better performance
_CREATION_TIME = datetime.now(tzlocal())
Expand Down Expand Up @@ -341,42 +346,11 @@ def process_single_instance(
if solution is None:
solution = result["ommx_solution"]

# Create QOBLIB authors.
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",
]
qoblib_authors_str = ", ".join(qoblib_authors)
# Add annotations to the instance.
ommx_instance.title = instance_name
ommx_instance.license = "CC BY 4.0"
ommx_instance.license = LICENSE
ommx_instance.dataset = "Steiner Tree Packing Problem"
ommx_instance.authors = qoblib_authors
ommx_instance.authors = QOBLIB_AUTHORS
ommx_instance.num_variables = len(ommx_instance.decision_variables)
ommx_instance.num_constraints = len(ommx_instance.constraints)
ommx_instance.annotations["org.ommx.qoblib.url"] = (
Expand All @@ -396,7 +370,7 @@ def process_single_instance(
instance_desc = builder.add_instance(ommx_instance)
if solution is not None:
solution.instance = instance_desc.digest
solution.annotations["org.ommx.qoblib.authors"] = qoblib_authors_str
solution.annotations["org.ommx.qoblib.authors"] = QOBLIB_AUTHORS_STR
builder.add_solution(solution)
builder.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
from model import build_mis_problem
from dat_reader import read_dimacs_gph
from sol_reader import parse_sol_file
from ommx_quantum_benchmarks.qoblib.definitions import (
QOBLIB_AUTHORS,
QOBLIB_AUTHORS_STR,
LICENSE,
)


def _pick_solution_file(sol_dir: str, base: str) -> str | None:
Expand Down Expand Up @@ -84,9 +89,22 @@ def batch_process(
if os.path.exists(out_path):
os.remove(out_path)

# Add annotations to the instance.
ommx_instance.title = base
ommx_instance.license = LICENSE
ommx_instance.dataset = "Maximum Independent Set Problem"
ommx_instance.authors = QOBLIB_AUTHORS
ommx_instance.num_variables = len(ommx_instance.decision_variables)
ommx_instance.num_constraints = len(ommx_instance.constraints)
ommx_instance.annotations["org.ommx.qoblib.url"] = (
"https://git.zib.de/qopt/qoblib-quantum-optimization-benchmarking-library/-/tree/main/07-independentset?ref_type=heads"
)

builder = ArtifactBuilder.new_archive_unnamed(out_path)
builder.add_instance(ommx_instance)
instance_desc = builder.add_instance(ommx_instance)
if solution is not None:
solution.instance = instance_desc.digest
solution.annotations["org.ommx.qoblib.authors"] = QOBLIB_AUTHORS_STR
builder.add_solution(solution)
builder.build()

Expand Down
Loading