ToshibaSQBM2Client

class ToshibaSQBM2Client

ベースクラス: BaseClient

Client for TOSHIBA SQBM+, a solver that runs the Simulated Bifurcation Machine algorithm.

Methods

__init__

health_check

solve

Send the objective function and the constraints to the solver.

Attributes

acceptable_degrees

Degrees of the polynomial that the solver accepts.

compression

Whether the client compresses the body of the request.

objective_format

Format of the objective function in the request.

parameters

Parameters that the client sends with every request.

proxy

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

solver

token

API token of the user.

url

URL of the service that the client sends to.

version

Version of the service.

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 Parameters

Parameters that the client sends with every request.

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

str

__str__(self) str
戻り値の型:

str

property C
property HMCsteps
property HMCweight
property PD3Orate
property algo
property algos
property blocks
property detail_level
property detail_log
property dt
property loops
property maxout
property maxwait
property multishot
property phi
property steps
property target
property timeout
class Result

ベースクラス: Solution

Raw response that the solver returned.

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

str

__str__(self) str
戻り値の型:

str

property count
property id
property message
property others
property param
property result
property runs
property time
property value
property wait
class Solution
__init__(*args, **kwargs)
__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

property count
property param
property result
property value
class Solver

ベースクラス: 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

Pubo = 2
Qplib = 1
Qubo = 0
__members__ = mappingproxy({'Qubo': ToshibaSQBM2ClientSolver.Qubo, 'Qplib': ToshibaSQBM2ClientSolver.Qplib, 'Pubo': ToshibaSQBM2ClientSolver.Pubo})
__name__ = 'Solver'
__nb_enum__ = <capsule object NULL>
__qualname__ = 'ToshibaSQBM2Client.Solver'
__init__(self) None
__init__(self, token: str = '', url: str = '', proxy: str | None = None) None
パラメータ:
  • token (str) -- Defaults to ''.

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

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

__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

health_check(self) bool
戻り値の型:

bool

solve(
self,
objective: Poly | Matrix,
dry_run: Literal[False] = False,
) Result
solve(
self,
constraint: Constraint | ConstraintList,
dry_run: Literal[False] = False,
) Result
solve(
self,
objective: Poly | Matrix,
constraint: Constraint | ConstraintList,
dry_run: Literal[False] = False,
) Result
solve(self, objective: Poly | Matrix, dry_run: Literal[True]) None
solve(self, constraint: Constraint | ConstraintList, dry_run: Literal[True]) None
solve(
self,
objective: Poly | Matrix,
constraint: Constraint | ConstraintList,
dry_run: Literal[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.

Returns:

amplify.ToshibaSQBM2Client.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.

Returns:

amplify.ToshibaSQBM2Client.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.

Returns:

amplify.ToshibaSQBM2Client.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.

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.

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.

property acceptable_degrees

Degrees of the polynomial that the solver accepts.

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

戻り値の型:

AcceptableDegrees

property compression

Whether the client compresses the body of the request.

Compression costs CPU time and it makes the request smaller.

戻り値の型:

bool

property objective_format

Format of the objective function in the request.

See ObjectiveFormat. The answer does not depend on this choice.

戻り値の型:

ObjectiveFormat

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 solver
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 url

URL of the service that the client sends to.

戻り値の型:

str

property version

Version of the service.

Reading this property sends a request to the service.

戻り値の型:

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