amplify.client.ToshibaClient

class ToshibaClient

ベースクラス: pybind11_builtins.pybind11_object

A class for using the Toshiba client in Fixstars Amplify SDK.

__init__(self: amplify.client.ToshibaClient, solver: str = '', url: str = '', proxy: str = '')None

Methods

__init__(self, solver, url, proxy)

solve(*args, **kwargs)

Overloaded function.

Attributes

num_bits

The maximum number of available variables.

parameters

The parameters of the Toshiba SBM client in Fixstars Amplify SDK.

proxy

Set or get the address of proxy server.

solver

Specifies the type of SBM solver.

url

URL address of the SBM instance.

version

The version of the Toshiba SBM client in Fixstars Amplify SDK.

property num_bits

The maximum number of available variables.

Type

int

property parameters

The parameters of the Toshiba SBM client in Fixstars Amplify SDK.

Type

ToshibaClientParameters

property proxy

Set or get the address of proxy server.

Type

str

solve(*args, **kwargs)

Overloaded function.

  1. solve(self: amplify.client.ToshibaClient, arg0: amplify.BinaryPoly) -> qubo::client::ClientResult<qubo::client::ToshibaSbmClient, decltype(nullptr)>

  2. solve(self: amplify.client.ToshibaClient, arg0: amplify.BinaryIntPoly) -> qubo::client::ClientResult<qubo::client::ToshibaSbmClient, decltype(nullptr)>

  3. solve(self: amplify.client.ToshibaClient, arg0: amplify.IsingPoly) -> qubo::client::ClientResult<qubo::client::ToshibaSbmClient, decltype(nullptr)>

  4. solve(self: amplify.client.ToshibaClient, arg0: amplify.IsingIntPoly) -> qubo::client::ClientResult<qubo::client::ToshibaSbmClient, decltype(nullptr)>

  5. solve(self: amplify.client.ToshibaClient, matrix: amplify.BinaryMatrix, constant: float = 0.0) -> qubo::client::ClientResult<qubo::client::ToshibaSbmClient, decltype(nullptr)>

  6. solve(self: amplify.client.ToshibaClient, matrix: amplify.BinaryIntMatrix, constant: int = 0) -> qubo::client::ClientResult<qubo::client::ToshibaSbmClient, decltype(nullptr)>

  7. solve(self: amplify.client.ToshibaClient, matrix: amplify.IsingMatrix, constant: float = 0.0) -> qubo::client::ClientResult<qubo::client::ToshibaSbmClient, decltype(nullptr)>

  8. solve(self: amplify.client.ToshibaClient, matrix: amplify.IsingIntMatrix, constant: int = 0) -> qubo::client::ClientResult<qubo::client::ToshibaSbmClient, decltype(nullptr)>

Solves a given polynomial or matrix model.

Overloads

  1. solve(poly)
  2. solve(matrix, constant)
パラメータ
戻り値

A result class that provides information about execution.

戻り値の型

FixstarClientResult

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.]']
  1. solve(self: amplify.client.ToshibaClient, arg0: qubo::client::toshiba::TSPData) -> qubo::client::ClientResult<qubo::client::ToshibaSbmClient, decltype(nullptr)>

  2. solve(self: amplify.client.ToshibaClient, arg0: qubo::client::toshiba::QAPData) -> qubo::client::ClientResult<qubo::client::ToshibaSbmClient, decltype(nullptr)>

  3. solve(self: amplify.client.ToshibaClient, arg0: qubo::client::toshiba::ShiftData) -> qubo::client::ClientResult<qubo::client::ToshibaSbmClient, decltype(nullptr)>

property solver

Specifies the type of SBM solver. Can be selected from "ising", "autoising", "tsp", "qap", and "shift". Set to "ising" by default.

Type

str

property url

URL address of the SBM instance.

Type

str

property version

The version of the Toshiba SBM client in Fixstars Amplify SDK.

Type

str