amplify.client.ToshibaClient
- class ToshibaClient
A class for using the Toshiba client in Fixstars Amplify SDK.
- __init__(self: amplify.client.ToshibaClient, token: str = '', solver: str = '', url: str = '', proxy: str = '') None
Methods
__init__
(self[, token, solver, url, proxy])solve
(*args, **kwargs)Solves a given polynomial or matrix model.
Attributes
The maximum number of available variables.
The parameters of the Toshiba SBM client in Fixstars Amplify SDK.
Set or get the address of proxy server.
Specifies the type of SBM solver.
Set or get the API token of the SBM instance.
URL address of the SBM instance.
Get the API version string of the Toshiba SBM/SQBM+.
Set or get the file path to save request data.
Set or get the file path to save request data.
- property parameters
The parameters of the Toshiba SBM client in Fixstars Amplify SDK.
- Type:
- solve(*args, **kwargs)
Solves a given polynomial or matrix model.
Overloads::
- solve(poly)
- solve(matrix, constant)
- パラメータ:
poly (
BinaryPoly
,BinaryIntPoly
,IsingPoly
orIsingIntPoly
) --Input polynomial model
matrix (
BinaryMatrix
,BinaryIntMatrix
,IsingMatrix
orIsingIntMatrix
) --Input matrix model
constant (
int
orfloat
, optional) --A constant value to be added to the above matrix. The type is set in accordance with the coefficients of the matrix.
- 戻り値:
A result class that provides information about execution.
- 戻り値の型:
Example
from amplify import BinarySymbolGenerator from amplify.client import ToshibaClient gen = BinarySymbolGenerator() q = gen.array(3) f = 2 * q[0] * q[1] - q[0] - q[2] + 1 client = ToshibaClient() client.url = "http://xx.xxx.xxx.xx:xxxx/" client.parameters.timeout = 1 # timeout 1 second result = client.solve(f)
>>> f 2 q_0 q_1 - q_0 - q_2 + 1 >>> [f"energy = {s.energy}, q = {q.decode(s.values)}" for s in result] ['energy = -1.0, q = [1. 0. 1.]']
- property solver
Specifies the type of SBM solver. Can be selected from
"ising"
,"autoising"
,"tsp"
,"qap"
, and"shift"
. Set to"ising"
by default.- Type:
- property write_request_data
Set or get the file path to save request data. The default value is an empty string, so saving is disabled.
- Type: