Skip to main content

Quantagonia

Quantagonia offers a Hybrid Quantum Platform for solving complex computational problems.

Solvers

ModelBackend
BinaryQuadraticModelquantagonia.qubo
MPSFilequantagonia.mps

Binary Quadratic Model

import strangeworks as sw
from strangeworks_optimization import StrangeworksOptimizer
from strangeworks_optimization_models.parameter_models import QuantagoniaParameterModel
from dimod import BinaryQuadraticModel

sw.authenticate('your-api-key')

linear = {1: -2, 2: -2, 3: -3, 4: -3, 5: -2}
quadratic = {(1, 2): 2, (1, 3): 2, (2, 4): 2, (3, 4): 2, (3, 5): 2, (4, 5): 2}
model = BinaryQuadraticModel(linear, quadratic, "BINARY")

options = QuantagoniaParameterModel(sense="MINIMIZE")

solver = "quantagonia.qubo"

optimizer = StrangeworksOptimizer(model=model, solver=solver, options=options)
sw_job = optimizer.run()

print(f"Job slug: {sw_job.slug}")
print(f"Job status: {optimizer.status(sw_job.slug)}")

results = optimizer.results(sw_job.slug)

Mathematical Programming System

import strangeworks as sw
from strangeworks_optimization import StrangeworksOptimizer
from strangeworks_optimization_models.problem_models import MPSFile
from strangeworks_optimization_models.parameter_models import QuantagoniaParameterModel
from dimod import BinaryQuadraticModel

sw.authenticate('your-api-key')

file = "example.mps"
model = MPSFile.read_file(file)

options = QuantagoniaParameterModel(sense="MINIMIZE")

solver = "quantagonia.mps"

optimizer = StrangeworksOptimizer(model=model, solver=solver, options=options)
sw_job = optimizer.run()

print(f"Job slug: {sw_job.slug}")
print(f"Job status: {optimizer.status(sw_job.slug)}")

results = optimizer.results(sw_job.slug)

QuantagoniaParameterModel

ParameterTypeDescriptionDefaultValues
sensestringDetermines the optimization direction of the problem, either maximizing or minimizing the objective function.MINIMIZEMAXIMIZE, MINIMIZE
timelimitfloatSets the maximum time, in seconds, that the solver should spend on the problem before terminating.86400-
relative_gapfloatSpecifies the stopping criterion based on the relative gap between the best found solution and the bound.0.0001-
absolute_gapfloatSets the absolute gap tolerance, which is the acceptable difference between the best solution's objective value and the solver's bound for concluding optimization.0.000000001-
heuristics_onlybool(Only for QUBO) If set to true, the solver will only use heuristic methods to find a solution, potentially faster but possibly less optimal.FalseTrue, False

For further details on these parameters and more in-depth explanations, you can consult the Quantagonia documentation directly at Quantagonia's API Documentation.