--- sd_hide_title: true hide-toc: true --- # TOSHIBA (clients-ToshibaSQBM2Client)= ## SQBM+ v2.0.3 SQBM+ is a [TOSHIBA](https://www.global.toshiba/jp/products-solutions/ai-iot/sbm.html)-developed quantum-inspired optimization solution with a simulated bifurcation machine at its core. ```{tip} Available as a paid option on AWS Marketplace or Fixstars Amplify. ``` ```{tip} The available solvers and variable types vary depending on the version of the SQBM+ server. You can check the version from {py:attr}`~amplify.ToshibaSQBM2Client.version` property of this client. ``` :**Solver specification**: ```{list-table} :width: 100% :widths: 2 3 * - Client class - {py:class}`amplify.ToshibaSQBM2Client` * - [Execution parameters](amplify.ToshibaSQBM2Client.parameters) - {py:class}`amplify.ToshibaSQBM2Client.Parameters` * - [Execution result](amplify.Result.client_result) - {py:class}`amplify.ToshibaSQBM2Client.Result` * - [Execution time](amplify.Result.execution_time) - {py:attr}`amplify.ToshibaSQBM2Client.Result.time` * - API method - REST API (HDF5/JSON) * - API reference - [{bdg-info}`📖 User Guide (v2.0.3)`](/../_static/User_Manual-SQBM+_for_On-premises.pdf) ``` * When {py:class}`~amplify.ToshibaSQBM2Client.Solver.Qubo` is set in the {py:class}`~amplify.ToshibaSQBM2Client.solver` property (default): ```{csv-table} :header-rows: 1 :stub-columns: 1 :width: 100% :widths: 1 1 1 1 1 ,Binary variable,Ising variable,Integer variable,Real variable Objective function,2nd,\-,\-,\- Equality constraint,\-,\-,\-,\- Inequality constraint,\-,\-,\-,\- ``` * When {py:class}`~amplify.ToshibaSQBM2Client.Solver.Qplib` is set in the {py:class}`~amplify.ToshibaSQBM2Client.solver` property: ```{csv-table} :header-rows: 1 :stub-columns: 1 :width: 100% :widths: 1 1 1 1 1 ,Binary variable,Ising variable,Integer variable,Real variable Objective function,2nd,\-,\-,2nd Equality constraint,1st,\-,\-,1st Inequality constraint,1st,\-,\-,1st ``` * When {py:class}`~amplify.ToshibaSQBM2Client.Solver.Pubo` is set in the {py:class}`~amplify.ToshibaSQBM2Client.solver` property: ```{csv-table} :header-rows: 1 :stub-columns: 1 :width: 100% :widths: 1 1 1 1 1 ,Binary variable,Ising variable,Integer variable,Real variable Objective function,4th,\-,\-,4th Equality constraint,\-,\-,\-,\- Inequality constraint,\-,\-,\-,\- ``` :**Client class**: In addition to [the common interface](#client-common-interface), the client class has the following attributes and a method. ```{list-table} :width: 100% :header-rows: 1 :widths: 1 1 3 * - Attribute - Data type - Details * - {py:attr}`~amplify.ToshibaSQBM2Client.solver` - {py:class}`~amplify.ToshibaSQBM2Client.Solver` | {py:class}`str` - Specify the solver to use from {py:class}`~amplify.ToshibaSQBM2Client.Solver.Qubo` (default) and {py:class}`~amplify.ToshibaSQBM2Client.Solver.Qplib`. * - {py:attr}`~amplify.ToshibaSQBM2Client.compression` - {py:class}`bool` - Compress the request data before sending. The default value is {py:obj}`True`; setting to {py:obj}`False` will reduce the compression time of the request data, but may increase the communication time. ``` ```{list-table} :width: 100% :header-rows: 1 :widths: 1 1 3 * - Method - Return type - Details * - {py:meth}`~amplify.ToshibaSQBM2Client.health_check` - {py:class}`bool` - Query the health check API to verify that the solver is working properly. ``` :**Configuration example**: ```{testcode} from amplify import ToshibaSQBM2Client from datetime import timedelta client = ToshibaSQBM2Client() # Set API token # (Not required if using AWS version) client.token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # Set URL (required if using AWS version) # client.url = "http://xxx.xxx.xxx.xxx:8000/" # Specify a solver # (Qubo, Qplib, or Pubo) client.solver = "Qplib" # Set execution time to 1 second client.parameters.timeout = timedelta(milliseconds=1000) ``` :**Execution example**: ```python from amplify import Model, VariableGenerator, solve # Create decision variables and the objective function g = VariableGenerator() q = g.array("Binary", 2) f = q[0] * q[1] + q[0] - q[1] + 1 # Create a model model = Model(f) # Run the solver result = solve(model, client) ``` To perform health check API: ```python >>> client.health_check() True ``` To obtain the solver version: ```python >>> client.version '2.0.3' ```