Skip to main content

Fujitsu

The Fujitsu Digital Annealer 🔗 provides an alternative to quantum computing technology

Solver​

ModelSolvers
Quadratic Unconstrained Binary Optimization (QUBO)fujitsu.DA3

Quadratic Unconstrained Binary Optimization (QUBO)​

The Fujitsu solver can be used to solve QUBO problems written as a binary quadratic model (BQM).

import strangeworks as sw
from strangeworks_optimization import StrangeworksOptimizer
from strangeworks_optimization_models.parameter_models import (
FujitsuParameterModel
)
from dimod import BinaryQuadraticModel

sw.authenticate(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 = FujitsuParameterModel(
time_limit_sec=1, penalty_coef=10000
)

solver = "fujitsu.DA3"

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)

Fujitsu Model​

Fujitsu API Reference 🔗

import strangeworks as sw
from strangeworks_optimization import StrangeworksOptimizer
from strangeworks_optimization_models.parameter_models import (
FujitsuParameterModel
)
from strangeworks_optimization_models.problem_models import FujitsuModelList

sw.authenticate(api_key)

model = FujitsuModelList(
binary_polynomial={
"terms": [
{"coefficient": 2, "polynomials": [1, 2]},
{"coefficient": -4, "polynomials": [2, 4]},
{"coefficient": -3, "polynomials": []},
]
}
)

options = FujitsuParameterModel(
time_limit_sec=1, penalty_coef=10000
)

solver = "fujitsu.DA3"

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)

Convert from QUBO​

For larger models it is advisable to first convert the BinaryQuadraticModel to a FujitsuModelList locally before submitting.

import strangeworks as sw
from strangeworks_optimization import StrangeworksOptimizer
from strangeworks_optimization_models.problem_models import FujitsuModelList
from strangeworks_optimization_models.converter_models import StrangeworksConverterFactory

sw.authenticate(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", offset=1.4)
strangeworks_converter = StrangeworksConverterFactory.from_model(model, FujitsuModelList)

fujitsu_model = strangeworks_converter.convert()

optimizer = StrangeworksOptimizer(model=fujitsu_model, solver="fujitsu.DA3")
optimizer.run()

Parameters​

from strangeworks_optimization_models.parameter_models import FujitsuParameterModel

options = FujitsuParameterModel(
.....
)

Solvers

  • fujitsu.DA3
ParameterDescriptionTypeDefaultRange
time_limit_secMaximum running time of DA in secondsint101 to 3600
target_energyThreshold energy for fast exitfloatdisabled-
num_runThe number of parallel attempts of each groupint11 to 16
num_output_solutionThe number of output solutions of each groupint51 to 1024
gs_levelLevel of the global searchint50 to 100
gs_cutoffGlobal search cutoff levelint80000 to 1000000
one_hot_levelLevel of the 1hot constraint searchint30 to 100
one_hot_cutoffLevel of the convergence for 1hot constraint searchint1000 to 1000000
internal_penaltyMode of 1hot constraint internal generationint00 or 1
penalty_auto_modeCoefficient adjustment modeint10 to 10000
penalty_coefCoefficient of the constraint termint11 to 9223372036854775807
penalty_inc_rateParameters for automatic adjustment of constraint termsint150100 to 200
max_penalty_coefMaximum constraint term coefficientint00 to 9223372036854775807
guidance_configInitial value of each variabledict--
fixed_configFixed value of each variabledict--
one_way_one_hot_groupsNumber of variables in each group of one-way one-hot constraintsdict--
two_way_one_hot_groupsNumber of variables in each group of two-way one-hot constraintsdict--