Quantagonia
Quantagonia offers a Hybrid Quantum Platform for solving complex computational problems.
Solvers
Model | Backend |
---|---|
BinaryQuadraticModel | quantagonia.qubo |
MPSFile | quantagonia.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"
so = StrangeworksOptimizer(
model=model,
solver=solver,
options=options)
sw_job = so.run()
print(f"Job slug: {sw_job.slug}")
print(f"Job status: {so.status(sw_job.slug)}")
results = so.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"
so = StrangeworksOptimizer(
model=model,
solver=solver,
options=options)
sw_job = so.run()
print(f"Job slug: {sw_job.slug}")
print(f"Job status: {so.status(sw_job.slug)}")
results = so.results(sw_job.slug)
QuantagoniaParameterModel
Parameter | Type | Description | Default | Values |
---|---|---|---|---|
sense | string | Determines the optimization direction of the problem, either maximizing or minimizing the objective function. | MINIMIZE | MAXIMIZE , MINIMIZE |
timelimit | float | Sets the maximum time, in seconds, that the solver should spend on the problem before terminating. | 86400 | - |
relative_gap | float | Specifies the stopping criterion based on the relative gap between the best found solution and the bound. | 0.0001 | - |
absolute_gap | float | Sets 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_only | bool | (Only for QUBO) If set to true, the solver will only use heuristic methods to find a solution, potentially faster but possibly less optimal. | False | True , False |
For further details on these parameters and more in-depth explanations, you can consult the Quantagonia documentation directly at Quantagonia's API Documentation.