LightSolver
LightSolver's laser-based processing unit (LPU) LaserMind is a quantum-inspired solver.
Solvers
Solver | Models |
---|---|
lightsolver.lasermind | BinaryQuadraticModel |
Binary Quadratic Model
The total number of variables must be between 10-10000
import strangeworks as sw
from strangeworks_optimization import StrangeworksOptimizer
from strangeworks_optimization_models.parameter_models import LightSolverParameterModel
from dimod import BinaryQuadraticModel
sw.authenticate(api_key)
linear = {"1": -2, "2": -2, "3": -3, "4": -3, "5": -2, "6": -2, "7": -2, "8": -3, "9": -3, "10": -2}
quadratic = {
("1", "2"): 2,
("1", "3"): 2,
("2", "4"): 2,
("3", "4"): 2,
("3", "5"): 2,
("4", "5"): 2,
("6", "2"): 2,
("6", "3"): 2,
("7", "4"): 2,
("8", "4"): 2,
("9", "5"): 2,
("10", "5"): 2,
("7", "7"): 2,
("6", "8"): 2,
("7", "9"): 2,
("8", "9"): 2,
("8", "10"): 2,
}
model = BinaryQuadraticModel(linear, quadratic, "BINARY")
solver = "lightsolver.lasermind"
options = LightSolverParameterModel(timeout=2)
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)}")
LightSolverParameterModel
Parameter | Type | Default | Description |
---|---|---|---|
timeout | float | 10 | The running timeout in seconds for the algorithm. Must be in the range 0.001 - 60. |