FujitsuDA3cClient

class FujitsuDA3cClient

ベースクラス: FujitsuDA4Client

Client for the Fujitsu Digital Annealer DA3c solver. It has the same interface as FujitsuDA4Client and it reaches another endpoint.

Methods

__init__

async_solve

async_solve

cancel_job

delete_job_result

get_job_result

get_jobs

health_check

solve

Send the objective function and the constraints to the solver.

Attributes

acceptable_degrees

Degrees of the polynomial that the solver accepts.

parameters

Parameters that the client sends with every request.

proxy

URL of the proxy that the client goes through, or None for no proxy.

set_inequalities

set_one_way_one_hot_groups

set_penalty_binary_polynomial

set_two_way_one_hot_groups

token

API token of the user.

type_id

url

URL of the service that the client sends to.

version

Version of the API that the client speaks.

write_request_data

Path of the file that receives a copy of the request, or None to write none.

write_response_data

Path of the file that receives a copy of the response, or None to write none.

class CommonError
__init__(*args, **kwargs)
__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

property code
property message
property title
class JobStatus

ベースクラス: Enum

classmethod __contains__(value)

Return True if value is in cls.

value is in cls if: 1) value is a member of cls, or 2) value is the value of one of the cls's members. 3) value is a pseudo-member (flags)

classmethod __getitem__(name)

Return the member matching name.

classmethod __iter__()

Return members in definition order.

classmethod __len__()

Return the number of members (no aliases)

__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

Canceled = 3
Deleted = 5
Done = 0
Error = 4
Running = 1
Waiting = 2
__members__ = mappingproxy({'Done': FujitsuDA4ClientJobStatusEnum.Done, 'Running': FujitsuDA4ClientJobStatusEnum.Running, 'Waiting': FujitsuDA4ClientJobStatusEnum.Waiting, 'Canceled': FujitsuDA4ClientJobStatusEnum.Canceled, 'Error': FujitsuDA4ClientJobStatusEnum.Error, 'Deleted': FujitsuDA4ClientJobStatusEnum.Deleted})
__name__ = 'JobStatus'
__nb_enum__ = <capsule object NULL>
__qualname__ = 'FujitsuDA4Client.JobStatus'
class JobStatusInfo
__init__(*args, **kwargs)
__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

property job_id
property job_status
property start_time
class Parameters

Parameters that the client sends with every request.

__init__(*args, **kwargs)
__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

property gs_cutoff
property gs_level
property internal_penalty
property max_penalty_coef
property num_group
property num_output_solution
property num_run
property one_hot_cutoff
property one_hot_level
property penalty_auto_mode
property penalty_coef
property penalty_inc_rate
property target_energy
property time_limit_sec
class Progress
__init__(*args, **kwargs)
__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

property energy
property penalty_energy
property time
QuboResponse

Result の別名です。

class QuboSolution
__init__(*args, **kwargs)
__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

property configuration
property energy
property frequency
property penalty_energy
class QuboSolutionList
__init__(*args, **kwargs)
__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

property progress
property result_status
property solutions
property timing
class Result

Raw response that the solver returned.

__init__(*args, **kwargs)
__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

property message
property qubo_solution
property status
class SolverTiming
__init__(*args, **kwargs)
__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

property solve_time
property total_elapsed_time
__init__(self) None
__init__(self, token: str = '', type_id: str | None = None, url: str = '', proxy: str | None = None) None
パラメータ:
  • token (str) -- Defaults to ''.

  • type_id (str | None) -- Defaults to None.

  • url (str) -- Defaults to ''.

  • proxy (str | None) -- Defaults to None.

__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

async_solve(self, objective: Poly) str
async_solve(self, constraint: Constraint | ConstraintList) str
async_solve(self, objective: Poly, constraint: Constraint | ConstraintList) str

async_solve

Overload 1.

Args:
  • objective (amplify.Poly)

Returns:

str:

Overload 2.

Args:
  • constraint (amplify.Constraint | amplify.ConstraintList)

Returns:

str:

Overload 3.

Args:
  • objective (amplify.Poly)

  • constraint (amplify.Constraint | amplify.ConstraintList)

Returns:

str:

cancel_job(self, job_id: str) JobStatus
パラメータ:

job_id (str)

戻り値の型:

JobStatus

delete_job_result(self, job_id: str) Result
パラメータ:

job_id (str)

戻り値の型:

Result

get_job_result(self, job_id: str) Result
パラメータ:

job_id (str)

戻り値の型:

Result

get_jobs(self) list[JobStatusInfo]
戻り値の型:

list[JobStatusInfo]

health_check(self) CommonError | None
戻り値の型:

CommonError | None

solve(
self,
objective: Poly | Matrix,
dry_run: Literal[False] = False,
retry_after_delete: bool = True,
delete_after_solve: bool = True,
) Result
solve(
self,
constraint: Constraint | ConstraintList,
dry_run: Literal[False] = False,
retry_after_delete: bool = True,
delete_after_solve: bool = True,
) Result
solve(
self,
objective: Poly | Matrix,
constraint: Constraint | ConstraintList,
dry_run: Literal[False] = False,
retry_after_delete: bool = True,
delete_after_solve: bool = True,
) Result
solve(
self,
objective: Poly | Matrix,
dry_run: Literal[True],
retry_after_delete: bool = True,
delete_after_solve: bool = True,
) None
solve(
self,
constraint: Constraint | ConstraintList,
dry_run: Literal[True],
retry_after_delete: bool = True,
delete_after_solve: bool = True,
) None
solve(
self,
objective: Poly | Matrix,
constraint: Constraint | ConstraintList,
dry_run: Literal[True],
retry_after_delete: bool = True,
delete_after_solve: bool = True,
) None

Send the objective function and the constraints to the solver.

This method takes the polynomial that the solver accepts, so it runs no conversion of the model. Use solve() to solve a model that needs a conversion. It returns the raw response of the solver.

Overload 1.

Args:
  • objective (amplify.Poly | amplify.Matrix): The objective function that the solver minimizes.

  • dry_run (typing.Literal[False]): When True, ask the service to check the request, and return None. Defaults to False.

  • retry_after_delete (bool): When True, delete a job that already finished and send the request again after the service refuses a new job. When False, raise the error of the service instead. Defaults to True.

  • delete_after_solve (bool): When True, delete the job from the service after the client reads the answer. Defaults to True.

Returns:

amplify.FujitsuDA4Client.Result:

Overload 2.

Args:
  • constraint (amplify.Constraint | amplify.ConstraintList): The constraints that the solution must satisfy.

  • dry_run (typing.Literal[False]): When True, ask the service to check the request, and return None. Defaults to False.

  • retry_after_delete (bool): When True, delete a job that already finished and send the request again after the service refuses a new job. When False, raise the error of the service instead. Defaults to True.

  • delete_after_solve (bool): When True, delete the job from the service after the client reads the answer. Defaults to True.

Returns:

amplify.FujitsuDA4Client.Result:

Overload 3.

Args:
  • objective (amplify.Poly | amplify.Matrix): The objective function that the solver minimizes.

  • constraint (amplify.Constraint | amplify.ConstraintList): The constraints that the solution must satisfy.

  • dry_run (typing.Literal[False]): When True, ask the service to check the request, and return None. Defaults to False.

  • retry_after_delete (bool): When True, delete a job that already finished and send the request again after the service refuses a new job. When False, raise the error of the service instead. Defaults to True.

  • delete_after_solve (bool): When True, delete the job from the service after the client reads the answer. Defaults to True.

Returns:

amplify.FujitsuDA4Client.Result:

Overload 4.

Args:
  • objective (amplify.Poly | amplify.Matrix): The objective function that the solver minimizes.

  • dry_run (typing.Literal[True]): When True, ask the service to check the request, and return None.

  • retry_after_delete (bool): When True, delete a job that already finished and send the request again after the service refuses a new job. When False, raise the error of the service instead. Defaults to True.

  • delete_after_solve (bool): When True, delete the job from the service after the client reads the answer. Defaults to True.

Overload 5.

Args:
  • constraint (amplify.Constraint | amplify.ConstraintList): The constraints that the solution must satisfy.

  • dry_run (typing.Literal[True]): When True, ask the service to check the request, and return None.

  • retry_after_delete (bool): When True, delete a job that already finished and send the request again after the service refuses a new job. When False, raise the error of the service instead. Defaults to True.

  • delete_after_solve (bool): When True, delete the job from the service after the client reads the answer. Defaults to True.

Overload 6.

Args:
  • objective (amplify.Poly | amplify.Matrix): The objective function that the solver minimizes.

  • constraint (amplify.Constraint | amplify.ConstraintList): The constraints that the solution must satisfy.

  • dry_run (typing.Literal[True]): When True, ask the service to check the request, and return None.

  • retry_after_delete (bool): When True, delete a job that already finished and send the request again after the service refuses a new job. When False, raise the error of the service instead. Defaults to True.

  • delete_after_solve (bool): When True, delete the job from the service after the client reads the answer. Defaults to True.

property acceptable_degrees

Degrees of the polynomial that the solver accepts.

solve() reads it to decide the conversion of the model.

戻り値の型:

AcceptableDegrees

property parameters

Parameters that the client sends with every request.

戻り値の型:

Parameters

property proxy

URL of the proxy that the client goes through, or None for no proxy.

戻り値の型:

str | None

property set_inequalities
property set_one_way_one_hot_groups
property set_penalty_binary_polynomial
property set_two_way_one_hot_groups
property token

API token of the user.

The client needs it for every request. Its text never appears in the output of repr().

戻り値の型:

str

property type_id
property url

URL of the service that the client sends to.

戻り値の型:

str

property version

Version of the API that the client speaks.

The client holds this text, so reading it sends no request.

戻り値の型:

str

property write_request_data

Path of the file that receives a copy of the request, or None to write none.

Use it to inspect what the client sends.

戻り値の型:

Path | None

property write_response_data

Path of the file that receives a copy of the response, or None to write none.

戻り値の型:

Path | None