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)Solves a given polynomial or matrix model.
Attributes
The maximum number of available variables.
The parameters of the Hitachi CMOS client.
Set or get the address of proxy server.
Set or get the API token.
Set or get the API URL for Hitachi CMOS client.
Get the API version string of the Hitachi CMOS annealing machine.
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 Hitachi CMOS client.
- 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 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 url
Set or get the API URL for Hitachi CMOS client. Set to https://annealing-cloud.com/api/v2/ 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: