Toshiba
SQBM+ π is an optimization solution derived from the Simulated Bifurcation Machine, a combinatorial optimization solver built on the Simulated Bifurcation Algorithm developed by Toshiba Corporation.
Latest Versionβ
The latest version of the Toshiba optimization solution is 2.1.0.
Solversβ
Quadratic Unconstrained Binary Optimization (QUBO)β
import strangeworks as sw
from strangeworks_optimization import StrangeworksOptimizer
from strangeworks_optimization_models.parameter_models import ToshibaParameterModel
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 = ToshibaParameterModel(algo=0, maxout=100, loops=10)
solver = "toshiba.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)
Polynomial Unconstrained Binary Optimization (PUBO)β
QPLIB files can also be used to encode PUBO problems. PUBO stands for Polynomial Unconstrained Binary Optimization.
import strangeworks as sw
from strangeworks_optimization import StrangeworksOptimizer
from strangeworks_optimization_models.parameter_models import ToshibaParameterModel
from strangeworks_optimization_models.problem_models import QplibFile
sw.authenticate(api_key)
options = ToshibaParameterModel(algo=0, maxout=100, loops=10)
solver = "toshiba.pubo"
model = QplibFile.read_file("path/to/qplib/file.qplib")
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)
Matrix Marketβ
Matrix Market is a NIST-sponsored repository of test matrices for use in numerical algorithms.
You can download Matrix Market files from the Matrix Market website.
import strangeworks as sw
from strangeworks_optimization import StrangeworksOptimizer
from strangeworks_optimization_models.parameter_models import ToshibaParameterModel
from strangeworks_optimization_models.problem_models import MatrixMarket
sw.authenticate(api_key)
options = ToshibaParameterModel(algo=0, maxout=100, loops=10)
solver = "toshiba.qubo"
model = MatrixMarket.read_file("path/to/matrixmarket/file.txt")
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)
QPLIBβ
The QPLIB solver uses a specialized format that differs from the standard QPLIB specification. Standard QPLIB files from the ZIB collection may not be compatible with Toshiba's implementation.
import strangeworks as sw
from strangeworks_optimization import StrangeworksOptimizer
from strangeworks_optimization_models.parameter_models import ToshibaParameterModel
from strangeworks_optimization_models.problem_models import QplibFile
sw.authenticate(api_key)
options = ToshibaParameterModel(algo=0, maxout=100, loops=10)
solver = "toshiba.qplib"
model = QplibFile.read_file("path/to/qplib/file.qplib")
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)
Parametersβ
from strangeworks_optimization_models.parameter_models import ToshibaParameterModel
options = ToshibaParameterModel(.....)
The ToshibaParameterModel is designed to configure the parameters for the SQBM+. For detailed information on each parameter and how to set them up for your specific optimization problems, please refer to the official User Manual for SQBM+ AWS AMI v2.0.1.
| Parameter | Type | Default | Description |
|---|---|---|---|
| steps | int | 0 | Specify 'steps' as described in the Computation structure of the SQBM+ computation API. The value 0 (zero) means auto step specification, where the SQBM+ computation API automatically changes the number of 'steps' each time it finds a solution. Specify an integer between 0 and 100,000,000. |
| loops | int | 0 | Specify 'loops' as described in the Computation structure of the SQBM+ computation API. If 0 (zero) is specified, 'loops' is set to 100,000,000. Specify an integer between 0 and 100,000,000. |
| timeout | int | 10 seconds | Specify the maximum computation time (timeout) in seconds. The default value can be modified using the system configuration file. |
| maxwait | int | 60 seconds | Specify the maximum waiting time in seconds for each computation request. A computation request accepted by the API server waits in a queue for the preceding requests to be completed. If the specified maximum waiting time elapses during this wait, the computation request ends with a timeout error. Specify a value greater than 0 and less than or equal to 100,000. The default value can be modified using the system configuration file. |
| target | float | unspecified | If the parameter 'target' is specified, computation will stop when the evaluation value of the objective function reaches 'target'. If 0 (zero) is specified for 'loops', solving will be repeated either until the objective function reaches the value specified in 'target' or until a timeout occurs. |
| maxout | int | 1 | Specify the upper limit of the number of solutions to be outputted. Until the limit specified by 'maxout' is reached, the SQBM+ computation API outputs the obtained solutions in descending order of the value of the objective function. Specify an integer equal to or greater than one. |
| algo | int | Specifies the algorithm to be used. | |
| dt | float | Specifies the time per step. | |
| C | float | Corresponds to the constant ΞΎ0, appearing in the paper by Goto, Tatsumura, & Dixon (2019, p. 2), which is the theoretical basis of SQBM+. | |
| blocks | int | Specify the number of blocks of GPUs used to find a solution. If 0 (zero) is specified, the value of 'blocks' will be auto-adjusted. Specify an integer between 0 and 40. | |
| multishot | int | 0 | When you specify multishot, SQBM+ will get multiple solutions, which start from different initial decision variable values but other parameters are the same. The number of solutions is the multishot number. Default value is 0, which automatically decides multishot from problem size. If multishot > 1, SQBM+ will have less overhead. Specify an integer between 0 and 10. |
QPLIB Parametersβ
from strangeworks_optimization_models.parameter_models import ToshibaParameterModel
options = ToshibaParameterModel(.....)
| Parameter | Type | Description |
|---|---|---|
| PD3Orate | int | Parameter that determines the number of PD3O algorithm execution steps. SQBM+ searches for solutions using the SB algorithm, but if PD3Orate is set to anything other than 0, it also searches for solutions using another algorithm (called the PD3O algorithm). For the steps of the SB algorithm, the PD3O algorithm performs PD3Orate*steps times to update decision variables. |
| phi | float | Parameters that determine the behavior of the PD3O algorithm. Specify a real number between 0 and 1. If it is close to 0, it behaves like the SB algorithm. If it is close to 1, it narrows the search range of solutions, but it may find a better solution than the SB algorithm. |