amplify.client.FujitsuDA3SolverClient
- class FujitsuDA3SolverClient
A client class for using FujitsuDA3Solver.
- __init__(self: amplify.client.FujitsuDA3SolverClient, 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 number of available variables in Fujitsu Digital Annealer V3, which is 100000.
The parameters of
FujitsuDA3SolverClient
.The address of a proxy server.
When set to
True
,Inequalities
is used to handle a problem with linear inequality constraints.When set to
True
,one_way_one_hot_groups
is set if the model has one-hot constraints.When set to
True
,PenaltyBinaryPolynomial
is used to handle a problem with constraints.When set to
True
,two_way_one_hot_groups
is set if the model has two-way one-hot constraints.Authentication token for Fujitsu Digital Annealer V3.
The endpoint url for Fujitsu Digital Annealer V3.
Get the API version string of the Fujitsu Digital Annealer.
Set or get the file path to save request data.
Set or get the file path to save request data.
- property num_bits
The number of available variables in Fujitsu Digital Annealer V3, which is 100000.
- property parameters
The parameters of
FujitsuDA3SolverClient
.
- property proxy
The address of a proxy server. The address of proxy server can be set or read from this attribute.
- Type:
- property set_inequalities
When set to
True
,Inequalities
is used to handle a problem with linear inequality constraints. If set toFalse
, constraint terms are converted to a penalty function and added to the input polynomial model or thePenaltyBinaryPolynomial
. The default value is set toFalse
.- Type:
- property set_one_way_one_hot_groups
When set to
True
,one_way_one_hot_groups
is set if the model has one-hot constraints. The default value is set toFalse
.- Type:
- property set_penalty_binary_polynomial
When set to
True
,PenaltyBinaryPolynomial
is used to handle a problem with constraints. If set toFalse
, constraint terms are converted to a penalty function and added to the input polynomial model. The default value is set toFalse
.- Type:
- property set_two_way_one_hot_groups
When set to
True
,two_way_one_hot_groups
is set if the model has two-way one-hot constraints. The default value is set toFalse
.- 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.
- 戻り値:
The result class of FujitsuDA3Solver client is returned.
- 戻り値の型:
Example
from amplify import BinarySymbolGenerator from amplify.client import FujitsuDA3SolverClient gen = BinarySymbolGenerator() q = gen.array(4) f = 2 * q[0] * q[1] - q[2] * q[3] + 1 client = FujitsuDA3SolverClient() client.token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" client.parameters.time_limit_sec = 1 result = client.solve(f)
>>> f 2 q_0 q_1 - q_2 q_3 + 1 >>> [f"energy = {s.energy}, q = {q.decode(s.values)}" for s in result] ['energy = 0.0, q = [1. 0. 1. 1.]', 'energy = 0.0, q = [0. 1. 1. 1.]', 'energy = 0.0, q = [0. 0. 1. 1.]', 'energy = 1.0, q = [0. 0. 0. 0.]']
- 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: