amplify.client.FixstarsClient

class FixstarsClient

ベースクラス: pybind11_builtins.pybind11_object

A class for using Fixstars Amplify Annealing Engine client.

__init__(self: amplify.client.FixstarsClient, token: str = '', url: str = '', proxy: str = '')None

Methods

__init__(self, token, url, proxy)

solve(*args, **kwargs)

Overloaded function.

Attributes

compression

Specifies whether to compress the transmitted data.

num_bits

The maximum number of available variables.

parameters

Obtains the parameter class of FixstarsClient.

proxy

Set or get the address of proxy server.

token

Set or get the API token.

url

Set or get the API URL for Fixstars Amplify Annealing Engine client.

version

The version of Fixstars Amplify Annealing Engine client.

property compression

Specifies whether to compress the transmitted data. Assumed True if no value is set.

Type

bool

property num_bits

The maximum number of available variables.

Type

int

property parameters

Obtains the parameter class of FixstarsClient.

Type

FixstarsClientParameters

property proxy

Set or get the address of proxy server.

Type

str

solve(*args, **kwargs)

Overloaded function.

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

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

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

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

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

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

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

  8. solve(self: amplify.client.FixstarsClient, matrix: amplify.IsingIntMatrix, constant: int = 0) -> qubo::client::ClientResult<qubo::client::FixstarsGAClient, 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 FixstarsClient

gen = BinarySymbolGenerator()
q = gen.array(3)
f = 2 * q[0] * q[1] - q[0] - q[2] + 1  # BinaryPoly type input model

client = FixstarsClient()
client.token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
client.parameters.timeout = 1000  # 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 token

Set or get the API token.

Type

str

property url

Set or get the API URL for Fixstars Amplify Annealing Engine client. Set to https://optigan.fixstars.com by default.

Type

str

property version

The version of Fixstars Amplify Annealing Engine client.

Type

str