Result

class Result

Container of optimization solutions and conversion/runtime metadata.

Methods

__init__

sort

Sort solutions by feasibility and objective value.

Attributes

best

Best solution in the result set.

client_result

Solver/client result.

embedding

Graph embedding information.

execution_time

The time the solver used to solve the problem.

filter_solution

Whether to filter out infeasible solutions.

intermediate

Model conversion information.

num_solves

Number of solve executions aggregated.

response_time

The time between sending the request and receiving the response from the solver.

solutions

View of all solutions.

split

Split view for each independent solve.

total_time

Total time including conversion and solve.

class GraphConversion

Graph embedding conversion details used during solving.

class ChainBreakFractions

List-like view of chain break fractions.

class Iterator
__init__(*args, **kwargs)
__iter__(self) Iterator
戻り値の型:

Iterator

__next__(self) float
戻り値の型:

float

__bool__(self) bool
戻り値の型:

bool

__getitem__(self, key: int) float

Return the element at the index.

A negative index counts from the end, as in a Python list.

パラメータ:

key (int) -- The index of the element.

戻り値の型:

float

例外:

IndexError -- The index is out of range.

__init__(*args, **kwargs)
__iter__(self) Iterator
戻り値の型:

Iterator

__len__(self) int
戻り値の型:

int

__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

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

str

__str__(self) str
戻り値の型:

str

property chain_break_fractions

Chain break fraction for each solve.

戻り値の型:

ChainBreakFractions

property chains

Embedding chains for each logical variable.

戻り値の型:

list[ndarray[dtype=uint32, writable=False]]

property dst_graph

Destination (physical) graph used for embedding.

戻り値の型:

Graph

property num_variables

Number of physical variables used after embedding.

戻り値の型:

int

property poly

Embedded polynomial.

戻り値の型:

Poly

property src_graph

Source (input polynomial) graph for embedding.

戻り値の型:

list[tuple[int, int]]

property values_list

Physical variable assignments for each solve.

戻り値の型:

ValuesList

class ModelConversion

Model conversion details used during solving.

class IntermediateMapping

Mapping between original and intermediate variables during model conversion.

class ItemsView

View of key-value pairs in IntermediateMapping.

__bool__(self) bool
戻り値の型:

bool

__init__(*args, **kwargs)
__iter__(self) ItemsView
戻り値の型:

ItemsView

__len__(self) int
戻り値の型:

int

__next__(self) tuple[Poly, Poly]
戻り値の型:

tuple[Poly, Poly]

__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

class KeysView

View of keys in IntermediateMapping.

__bool__(self) bool
戻り値の型:

bool

__contains__(self, arg: Poly, /) bool
__contains__(self, arg: object, /) bool

__contains__

Overload 1.

Args:
  • arg (amplify.Poly)

Returns:

bool:

Overload 2.

Args:
  • arg (object)

Returns:

bool:

__init__(*args, **kwargs)
__iter__(self) KeysView
戻り値の型:

KeysView

__len__(self) int
戻り値の型:

int

__next__(self) Poly
戻り値の型:

Poly

__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

class ValuesView

View of values in IntermediateMapping.

__bool__(self) bool
戻り値の型:

bool

__init__(*args, **kwargs)
__iter__(self) ValuesView
戻り値の型:

ValuesView

__len__(self) int
戻り値の型:

int

__next__(self) Poly
戻り値の型:

Poly

__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

__bool__(self) bool
戻り値の型:

bool

__contains__(self, arg: Poly, /) bool
__contains__(self, arg: object, /) bool

__contains__

Overload 1.

Args:
  • arg (amplify.Poly)

Returns:

bool:

Overload 2.

Args:
  • arg (object)

Returns:

bool:

__getitem__(self, arg: Poly, /) Poly

Return the intermediate expression of the input variable.

パラメータ:

arg (Poly) -- The input variable to look up. It has to be a polynomial of one variable.

戻り値:

The expression in the intermediate variables that replaced the input variable.

戻り値の型:

Poly

例外:

KeyError -- The mapping holds no entry for the variable.

__init__(*args, **kwargs)
__iter__(self) KeysView
戻り値の型:

KeysView

__len__(self) int
戻り値の型:

int

__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

items(self) ItemsView
戻り値の型:

ItemsView

keys(self) KeysView
戻り値の型:

KeysView

values(self) ValuesView
戻り値の型:

ValuesView

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

str

__str__(self) str
戻り値の型:

str

property mapping

Mapping from input variables to intermediate expressions.

戻り値の型:

IntermediateMapping

property model

Intermediate model.

戻り値の型:

Model

property num_variables

Number of variables in the intermediate model.

戻り値の型:

int

property values_list

Intermediate variable assignments for each solve.

戻り値の型:

ValuesList

class Solution

Single solution entry in Result.

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

str

__str__(self) str
戻り値の型:

str

property feasible

Whether all constraints are satisfied.

戻り値の型:

bool

property objective

Objective function value.

戻り値の型:

float

property time

Time at which the solver found this solution.

戻り値の型:

timedelta

property values

Variable assignments of the solution.

戻り値の型:

Values

class SolutionList

List-like view of solutions.

class Iterator
__init__(*args, **kwargs)
__iter__(self) Iterator
戻り値の型:

Iterator

__next__(self) Solution
戻り値の型:

Solution

__bool__(self) bool
戻り値の型:

bool

__getitem__(self, key: int) Solution

Return the element at the index.

A negative index counts from the end, as in a Python list.

パラメータ:

key (int) -- The index of the element.

戻り値の型:

Solution

例外:

IndexError -- The index is out of range.

__init__(*args, **kwargs)
__iter__(self) Iterator
戻り値の型:

Iterator

__len__(self) int
戻り値の型:

int

__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

class SplitView

List-of-list-like view of solutions that splits solutions by independent solves.

__bool__(self) bool
戻り値の型:

bool

__getitem__(self, key: int) Result

Return the element at the index.

A negative index counts from the end, as in a Python list.

パラメータ:

key (int) -- The index of the element.

戻り値の型:

Result

例外:

IndexError -- The index is out of range.

__init__(*args, **kwargs)
__iter__(self) SplitView
戻り値の型:

SplitView

__len__(self) int
戻り値の型:

int

__next__(self) Result
戻り値の型:

Result

__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

class ValuesList

List-like view of value mappings for solutions.

class Iterator
__init__(*args, **kwargs)
__iter__(self) Iterator
戻り値の型:

Iterator

__next__(self) Values
戻り値の型:

Values

__bool__(self) bool
戻り値の型:

bool

__getitem__(self, key: int) Values

Return the element at the index.

A negative index counts from the end, as in a Python list.

パラメータ:

key (int) -- The index of the element.

戻り値の型:

Values

例外:

IndexError -- The index is out of range.

__init__(*args, **kwargs)
__iter__(self) Iterator
戻り値の型:

Iterator

__len__(self) int
戻り値の型:

int

__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

__getitem__(self, key: int) Solution

Return the element at the index.

A negative index counts from the end, as in a Python list.

パラメータ:

key (int) -- The index of the element.

戻り値の型:

Solution

例外:

IndexError -- The index is out of range.

__init__(*args, **kwargs)
__iter__(self) Iterator
戻り値の型:

Iterator

__len__(self) int
戻り値の型:

int

__repr__(self) str
戻り値の型:

str

__str__(self) str
戻り値の型:

str

sort(self) None

Sort solutions by feasibility and objective value.

__nb_signature__ = 'class Result(typing.Generic[_BaseClient_co])'
property best

Best solution in the result set.

The best solution is the feasible solution with the smallest objective value. When filter_solution is True, the result holds only the feasible solutions, so this property raises as soon as the result is empty.

戻り値:

The solution that has the smallest objective value among the feasible solutions.

戻り値の型:

Solution

例外:

RuntimeError -- The result holds no solution, or it holds no feasible solution.

property client_result

Solver/client result.

The raw response of the machine. Its type depends on the client that solved the model. It is None when the solve kept no client result, as after a conversion only run.

戻り値の型:

Result | Result | SampleSet | SampleSet | SampleSet | Result | Result | Result | Result | object | None

property embedding

Graph embedding information.

戻り値の型:

GraphConversion | None

property execution_time

The time the solver used to solve the problem.

戻り値の型:

timedelta

property filter_solution

Whether to filter out infeasible solutions.

戻り値の型:

bool

property intermediate

Model conversion information.

戻り値の型:

ModelConversion

property num_solves

Number of solve executions aggregated.

戻り値の型:

int

property response_time

The time between sending the request and receiving the response from the solver.

戻り値の型:

timedelta

property solutions

View of all solutions.

戻り値の型:

SolutionList

property split

Split view for each independent solve.

戻り値の型:

SplitView

property total_time

Total time including conversion and solve.

戻り値の型:

timedelta