FujitsuDA4ClientΒΆ
- class FujitsuDA4ClientΒΆ
Bases:
BaseClientClient for the Fujitsu Digital Annealer DA4 solver. It takes a job asynchronously, so the client polls the service until the job ends.
Methods
async_solve
Send the objective function and the constraints to the solver.
Attributes
Degrees of the polynomial that the solver accepts.
Parameters that the client sends with every request.
URL of the proxy that the client goes through, or
Nonefor no proxy.API token of the user.
URL of the service that the client sends to.
Version of the API that the client speaks.
Path of the file that receives a copy of the request, or
Noneto write none.Path of the file that receives a copy of the response, or
Noneto write none.- class JobStatusΒΆ
Bases:
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)
- 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)ΒΆ
- property job_idΒΆ
- property job_statusΒΆ
- property start_timeΒΆ
- class ParametersΒΆ
Parameters that the client sends with every request.
- __init__(*args, **kwargs)ΒΆ
- 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)ΒΆ
- property energyΒΆ
- property penalty_energyΒΆ
- property timeΒΆ
- class QuboSolutionΒΆ
- __init__(*args, **kwargs)ΒΆ
- property configurationΒΆ
- property energyΒΆ
- property frequencyΒΆ
- property penalty_energyΒΆ
- class QuboSolutionListΒΆ
- __init__(*args, **kwargs)ΒΆ
- property progressΒΆ
- property result_statusΒΆ
- property solutionsΒΆ
- property timingΒΆ
- class ResultΒΆ
Raw response that the solver returned.
- __init__(*args, **kwargs)ΒΆ
- property messageΒΆ
- property qubo_solutionΒΆ
- property statusΒΆ
- class SolverTimingΒΆ
- __init__(*args, **kwargs)ΒΆ
- 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
- 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:
- get_jobs(self) list[JobStatusInfo]ΒΆ
- Return type:
- health_check(self) CommonError | NoneΒΆ
- Return type:
CommonError | None
- solve(
- self,
- objective: Poly | Matrix,
- dry_run: Literal[False] = False,
- retry_after_delete: bool = True,
- delete_after_solve: bool = True,
- solve(
- self,
- constraint: Constraint | ConstraintList,
- dry_run: Literal[False] = False,
- retry_after_delete: bool = True,
- delete_after_solve: bool = True,
- solve(
- self,
- objective: Poly | Matrix,
- constraint: Constraint | ConstraintList,
- dry_run: Literal[False] = False,
- retry_after_delete: bool = True,
- delete_after_solve: bool = True,
- solve(
- self,
- objective: Poly | Matrix,
- dry_run: Literal[True],
- retry_after_delete: bool = True,
- delete_after_solve: bool = True,
- solve(
- self,
- constraint: Constraint | ConstraintList,
- dry_run: Literal[True],
- retry_after_delete: bool = True,
- delete_after_solve: bool = True,
- solve(
- self,
- objective: Poly | Matrix,
- constraint: Constraint | ConstraintList,
- dry_run: Literal[True],
- retry_after_delete: bool = True,
- delete_after_solve: bool = True,
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 returnNone. Defaults toFalse.retry_after_delete (bool): When
True, delete a job that already finished and send the request again after the service refuses a new job. WhenFalse, raise the error of the service instead. Defaults toTrue.delete_after_solve (bool): When
True, delete the job from the service after the client reads the answer. Defaults toTrue.
- 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 returnNone. Defaults toFalse.retry_after_delete (bool): When
True, delete a job that already finished and send the request again after the service refuses a new job. WhenFalse, raise the error of the service instead. Defaults toTrue.delete_after_solve (bool): When
True, delete the job from the service after the client reads the answer. Defaults toTrue.
- 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 returnNone. Defaults toFalse.retry_after_delete (bool): When
True, delete a job that already finished and send the request again after the service refuses a new job. WhenFalse, raise the error of the service instead. Defaults toTrue.delete_after_solve (bool): When
True, delete the job from the service after the client reads the answer. Defaults toTrue.
- 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 returnNone.retry_after_delete (bool): When
True, delete a job that already finished and send the request again after the service refuses a new job. WhenFalse, raise the error of the service instead. Defaults toTrue.delete_after_solve (bool): When
True, delete the job from the service after the client reads the answer. Defaults toTrue.
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 returnNone.retry_after_delete (bool): When
True, delete a job that already finished and send the request again after the service refuses a new job. WhenFalse, raise the error of the service instead. Defaults toTrue.delete_after_solve (bool): When
True, delete the job from the service after the client reads the answer. Defaults toTrue.
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 returnNone.retry_after_delete (bool): When
True, delete a job that already finished and send the request again after the service refuses a new job. WhenFalse, raise the error of the service instead. Defaults toTrue.delete_after_solve (bool): When
True, delete the job from the service after the client reads the answer. Defaults toTrue.
- property acceptable_degreesΒΆ
Degrees of the polynomial that the solver accepts.
solve()reads it to decide the conversion of the model.- Return type:
- property parametersΒΆ
Parameters that the client sends with every request.
- Return type:
- property proxyΒΆ
URL of the proxy that the client goes through, or
Nonefor no proxy.- Return type:
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().- Return type:
- property type_idΒΆ
- property versionΒΆ
Version of the API that the client speaks.
The client holds this text, so reading it sends no request.
- Return type: