amplify.client.HitachiClient

class HitachiClient

A class for using Hitachi CMOS client.

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

Methods

__init__(self, token, url, proxy)

solve(*args, **kwargs)

Overloaded function.

Attributes

num_bits

The maximum number of available variables.

parameters

The parameters of the Hitachi CMOS client.

proxy

Set or get the address of proxy server.

token

Set or get the API token.

url

Set or get the API URL for Hitachi CMOS client.

version

The version of Fixstars Amplify Annealing Engine client.

property num_bits

The maximum number of available variables.

Type

int

property parameters

The parameters of the Hitachi CMOS client.

Type

HitachiClientParameters

property proxy

Set or get the address of proxy server.

Type

str

solve(*args, **kwargs)

Overloaded function.

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

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

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

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

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

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

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

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

Solves a given polynomial or matrix model.

Overloads

  1. solve(poly)
  2. solve(matrix, constant)
Parameters
Returns

A result class that provides information about execution.

Return type

FixstarClientResult

Example

from amplify import BinaryPoly, gen_symbols, Solver
from amplify.client import HitachiClient

gen = BinarySymbolGenerator()
q = gen.array(512, 512)
f = -2 * q[0][0] * q[1][1] - q[0][0] - q[1][1] + 1

client = HitachiClient()
client.token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
client.parameters.temperature_num_steps = 10
client.parameters.temperature_step_length = 100
client.parameters.temperature_initial = 100.0
client.parameters.temperature_target = 0.02

result = client.solve(f)
>>> f
- 2 q_0 q_513 - q_0 - q_513 + 1
>>> [f"energy = {s.energy}, q[0][0] = {s.values[0]}, q[1][1] = {s.values[513]}" for s in result]
['energy = -3.0, q[0][0] = 1, q[1][1] = 1']
property token

Set or get the API token.

Type

str

property url

Set or get the API URL for Hitachi CMOS client. Set to https://annealing-cloud.com/api/v2/ by default.

Type

str

property version

The version of Fixstars Amplify Annealing Engine client.

Type

str